public static long getTarget(DyldChainType ptrFormat, long chainValue) {

		if (isBound(ptrFormat, chainValue)) {
			return -1;
		}

		if (isAuthenticated(ptrFormat, chainValue)) {
			switch (ptrFormat) {
				case DYLD_CHAINED_PTR_ARM64E:
				case DYLD_CHAINED_PTR_ARM64E_USERLAND:
				case DYLD_CHAINED_PTR_ARM64E_USERLAND24:
				case DYLD_CHAINED_PTR_ARM64E_KERNEL:
					return chainValue & 0x000000FFFFFFFFL;
				case DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE:
				case DYLD_CHAINED_PTR_64_KERNEL_CACHE:
					return (chainValue & 0x3FFFFFFFL); // 30 bits
				case DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE:
					return (chainValue & 0x3FFFFFFFFL); // 34 bits
				default:
					break;
			}
		}

		return switch (ptrFormat) {
			case DYLD_CHAINED_PTR_ARM64E:
			case DYLD_CHAINED_PTR_ARM64E_USERLAND:
			case DYLD_CHAINED_PTR_ARM64E_USERLAND24:
			case DYLD_CHAINED_PTR_ARM64E_KERNEL:
				long top8Bits = (chainValue >> 43) & 0xFFL;
				long bottom43Bits = chainValue & 0x000007FFFFFFFFFFL;
				// Hack! Top bits don't matter and are a pointer tag
				if (top8Bits == 0x80) {
					top8Bits = 0;
				}
				yield (top8Bits << 56) | bottom43Bits;

			case DYLD_CHAINED_PTR_64:
			case DYLD_CHAINED_PTR_64_OFFSET:
				top8Bits = (chainValue >> 36) & 0xFFL;
				long bottom36Bits = chainValue & 0x00000FFFFFFFFFL;
				// Hack! Top bits don't matter and are a pointer tag
				if (top8Bits == 0x80) {
					top8Bits = 0;
				}
				yield (top8Bits << 56) | bottom36Bits;

			case DYLD_CHAINED_PTR_32:
				yield (chainValue & 0x3FFFFF); // 26 bits

			case DYLD_CHAINED_PTR_32_CACHE:
				yield (chainValue & 0x3FFFFFFF); // 30 bits

			case DYLD_CHAINED_PTR_32_FIRMWARE:
				yield (chainValue & 0x3FFFFF); // 26 bits

			case DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE:
			case DYLD_CHAINED_PTR_64_KERNEL_CACHE:
				yield (chainValue & 0x3FFFFFFF); // 30 bits

			case DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE:
				yield (chainValue & 0x3FFFFFFFFL); // 34 bits

			default:
				yield 0;
		};
	}
@see <a href="https://github.com/apple-oss-distributions/dyld/blob/main/include/mach-o/fixup-chains.h">mach-o/fixup-chains.h</a>
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/dyld/DyldChainedPtr.java