```\nassembly {\n    // store selector of destination function\n    let freeMemPtr := 0\n    if gt(customEgressSelector, 0) {\n        mstore(0x0, customEgressSelector)\n        freeMemPtr := add(freeMemPtr, 4)\n    }\n\n    // adjust the calldata offset, if we should ignore the selector\n    let calldataOffset := 0\n    if gt(ignoreIngressSelector, 0) {\n        calldataOffset := 4\n    }\n\n    // copy calldata to memory\n    calldatacopy(\n        freeMemPtr,\n        calldataOffset,\n        calldatasize()\n    )\n```\n