// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: request_command
static int request_command(const char *name, int argc, char *argv[])
{
	char cmd[PATH_MAX] = { 0 };
	char search_string[PATH_MAX * 256] = { 0 };
	char *sdk_env, *toolch_name, *toolchain_env;

	/*
	 * If xcrun was called in a multicall state, we still want to specify current_sdk for SDKROOT and
	 * current_toolchain for PATH.
	 */
	if (strlen(current_sdk) == 0) {
		if ((sdk_env = getenv("SDKROOT")) != NULL) {
			stripext(current_sdk, basename(sdk_env));
		} else {
			const char *sdk_info = get_default_info(XCRUN_DEFAULT_CFG).sdk;
			strncpy(current_sdk, sdk_info, strlen(sdk_info));
		}
	}

	if (strlen(current_toolchain) == 0) {
		if ((toolchain_env = getenv("TOOLCHAINS")) != NULL) {
			stripext(current_toolchain, basename(toolchain_env));
		} else {
			const char *toolch_info = get_default_info(XCRUN_DEFAULT_CFG).toolchain;
			strncpy(current_toolchain, toolch_info, strlen(toolch_info));
		}
	}

	/* No matter the circumstance, search the developer dir. */
	sprintf(search_string, "%s/usr/bin:", developer_dir);

	/* If we explicitly specified an sdk, search the sdk and it's associated toolchain. */
	if (explicit_sdk_mode == 1) {
		toolch_name = strdup(get_sdk_info(get_sdk_path(current_sdk)).toolchain);
		sprintf((search_string + strlen(search_string)), "%s/usr/bin:%s/usr/bin", get_sdk_path(current_sdk), get_toolchain_path(toolch_name));
		goto do_search;
	}

	/* If we explicitly specified a toolchain, only search the toolchain. */
	if (explicit_toolchain_mode == 1) {
		sprintf((search_string + strlen(search_string)), "%s/usr/bin", get_toolchain_path(current_toolchain));
		goto do_search;
	}

	/* If we explicitly specified an SDK, append it to the search string. */
	if (alternate_sdk_path != NULL) {
		sprintf((search_string + strlen(search_string)), "%s/usr/bin:", alternate_sdk_path);
		/* We also want to append an associated toolchain if this is really an SDK folder. */
		if (test_sdk_authenticity(alternate_sdk_path) == 1) {
			toolch_name = strdup(get_sdk_info(alternate_sdk_path).toolchain);
			sprintf((search_string + strlen(search_string)), "%s/usr/bin", get_toolchain_path(toolch_name));
			/* We now have a toolchain, so skip to search. */
			goto do_search;
		}
	}

	/* If we explicitly specified a toolchain, append it to the search string. */
	if (alternate_toolchain_path != NULL)
		sprintf((search_string + strlen(search_string)), "%s/usr/bin", alternate_toolchain_path);

	/* By default, we search our developer dir, our default sdk, and our default toolchain only. */
	if (explicit_sdk_mode == 0 && explicit_toolchain_mode == 0 && alternate_toolchain_path == NULL && alternate_sdk_path == NULL)
		sprintf((search_string + strlen(search_string)), "%s/usr/bin:%s/usr/bin", get_sdk_path(current_sdk), get_toolchain_path(current_toolchain));

	/* Search each path entry in search_string until we find our program. */
do_search:
	if (search_command(cmd, name, search_string) == 0) {
		if (finding_mode == 1) {
			if (access(cmd, (F_OK | X_OK)) == 0) {
				fprintf(stdout, "%s\n", cmd);
				return 0;
			} else {
				return -1;
			}
		} else {
			if (call_command(cmd, argc, argv) != 0) {
				fprintf(stderr, "xcrun: error: can't exec \'%s\' (%s)\n", cmd, strerror(errno));
				return -1;
			}
		}
	}

	/* We have searched everywhere, but we haven't found our program. State why. */
	fprintf(stderr, "xcrun: error: can't stat \'%s\' (%s)\n", name, strerror(errno));

	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1020a8, %rsp         # imm = 0x1020A8
movq %rdx, %r15
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
leaq 0x10a0(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20d0
leaq 0x20a0(%rsp), %rdi
movl $0x100000, %edx         # imm = 0x100000
xorl %esi, %esi
callq 0x20d0
cmpb $0x0, 0x6140(%rip)      # 0x93b0
jne 0x32be
leaq 0x213e(%rip), %rdi      # 0x53b7
callq 0x2030
testq %rax, %rax
je 0x329c
movq %rax, %rdi
callq 0x2160
leaq 0x611e(%rip), %rdi      # 0x93b0
movq %rax, %rsi
callq 0x3a71
jmp 0x32be
callq 0x3aaf
movq %rax, %r14
movq %rax, %rdi
callq 0x20a0
leaq 0x60fd(%rip), %rdi      # 0x93b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x2060
cmpb $0x0, 0x70fb(%rip)      # 0xa3c0
jne 0x3313
leaq 0x2100(%rip), %rdi      # 0x53ce
callq 0x2030
testq %rax, %rax
je 0x32f1
movq %rax, %rdi
callq 0x2160
leaq 0x70d9(%rip), %rdi      # 0xa3c0
movq %rax, %rsi
callq 0x3a71
jmp 0x3313
callq 0x3aaf
movq %rdx, %r14
movq %rdx, %rdi
callq 0x20a0
leaq 0x70b8(%rip), %rdi      # 0xa3c0
movq %r14, %rsi
movq %rax, %rdx
callq 0x2060
leaq 0x282f(%rip), %rsi      # 0x5b49
leaq 0x502f(%rip), %rdx      # 0x8350
leaq 0x20a0(%rsp), %rdi
xorl %eax, %eax
callq 0x21d0
cmpb $0x1, 0x6069(%rip)      # 0x93a0
movq %r15, 0x10(%rsp)
jne 0x33a3
callq 0x3ae4
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b30
movq 0x10(%r14), %rdi
callq 0x2200
movq %rax, %r14
leaq 0x20a0(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r15
addq $0x20a0, %r15           # imm = 0x20A0
callq 0x3ae4
movq %rax, %r12
movq %r14, %rdi
callq 0x3b94
leaq 0x27c7(%rip), %rsi      # 0x5b55
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x21d0
jmp 0x349f
cmpb $0x1, 0x700e(%rip)      # 0xa3b8
jne 0x33df
leaq 0x20a0(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r14
addq $0x20a0, %r14           # imm = 0x20A0
leaq 0x6ff5(%rip), %rdi      # 0xa3c0
callq 0x3b94
leaq 0x2789(%rip), %rsi      # 0x5b60
movq %r14, %rdi
jmp 0x3495
movq 0x5fb2(%rip), %r14      # 0x9398
testq %r14, %r14
je 0x35de
leaq 0x20a0(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %rdi
addq $0x20a0, %rdi           # imm = 0x20A0
leaq 0x273b(%rip), %rsi      # 0x5b49
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0x5f79(%rip), %rdx      # 0x9398
leaq 0x25e0(%rip), %rsi      # 0x5a06
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
cmpl $-0x1, %eax
je 0x35de
movq 0x5f46(%rip), %rsi      # 0x9398
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x3b30
movq 0x10(%r14), %rdi
callq 0x2200
movq %rax, %r14
leaq 0x20a0(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r15
addq $0x20a0, %r15           # imm = 0x20A0
movq %r14, %rdi
callq 0x3b94
leaq 0x26ce(%rip), %rsi      # 0x5b60
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0xa0(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20d0
leaq 0x2699(%rip), %rsi      # 0x5b53
leaq 0x20a0(%rsp), %rdi
callq 0x21a0
testq %rax, %rax
je 0x3951
movq %rax, %r14
leaq 0x26d9(%rip), %r15      # 0x5bb3
leaq 0x270c(%rip), %r12      # 0x5bed
leaq 0xa0(%rsp), %r13
leaq 0x2663(%rip), %rbp      # 0x5b53
movq 0x4ac9(%rip), %rax      # 0x7fc0
movq (%rax), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3981
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x21d0
movq %r13, %rdi
movl $0x1, %esi
callq 0x2180
testl %eax, %eax
je 0x3554
movl $0x1000, %edx           # imm = 0x1000
movq %r13, %rdi
xorl %esi, %esi
callq 0x20d0
xorl %edi, %edi
movq %rbp, %rsi
callq 0x21a0
movq %rax, %r14
testq %rax, %rax
jne 0x34f0
jmp 0x3951
movq 0x4a65(%rip), %r15      # 0x7fc0
movq (%r15), %rdi
leaq 0x268e(%rip), %rsi      # 0x5bf3
leaq 0xa0(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x3981
movq %r14, %rdi
callq 0x20a0
leaq 0x10a0(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2060
cmpb $0x1, 0x7e27(%rip)      # 0xb3c0
jne 0x3690
leaq 0x10a0(%rsp), %rdi
movl $0x1, %esi
callq 0x2180
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x395e
movq (%r15), %rdi
leaq 0x1e20(%rip), %rsi      # 0x53e8
xorl %ebx, %ebx
leaq 0x10a0(%rsp), %rdx
xorl %eax, %eax
callq 0x2130
jmp 0x395e
movq 0x6dcb(%rip), %r14      # 0xa3b0
testq %r14, %r14
je 0x3620
leaq 0x20a0(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %rdi
addq $0x20a0, %rdi           # imm = 0x20A0
leaq 0x2557(%rip), %rsi      # 0x5b60
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
cmpq $0x0, 0x6d95(%rip)      # 0xa3b0
sete %al
jmp 0x3622
movb $0x1, %al
cmpb $0x0, 0x5d77(%rip)      # 0x93a0
jne 0x349f
testb $0x1, 0x6d82(%rip)      # 0xa3b8
jne 0x349f
testb %al, %al
je 0x349f
cmpq $0x0, 0x5d4c(%rip)      # 0x9398
jne 0x349f
leaq 0x20a0(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r14
addq $0x20a0, %r14           # imm = 0x20A0
callq 0x3ae4
movq %rax, %r15
leaq 0x6d47(%rip), %rdi      # 0xa3c0
callq 0x3b94
leaq 0x24d0(%rip), %rsi      # 0x5b55
movq %r14, %rdi
movq %r15, %rdx
jmp 0x3394
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, %r13
movq %rax, 0xa0(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, %rbp
movq %rax, 0xa8(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, %r15
movq %rax, 0xb0(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, 0x20(%rsp)
movq %rax, 0xb8(%rsp)
movl $0xff, %edi
movl $0x1, %esi
callq 0x2110
movq %rax, 0x18(%rsp)
movq %rax, 0xc0(%rsp)
movl $0xff, %edi
movl $0x1, %esi
callq 0x2110
movq %rax, (%rsp)
movq %rax, 0xc8(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, %r12
movq %rax, 0xd0(%rsp)
callq 0x3ae4
leaq 0x24c3(%rip), %rsi      # 0x5c25
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0x6c4a(%rip), %r14      # 0xa3c0
movq %r14, %rdi
callq 0x3b94
movq %rax, %r13
leaq 0x24c6(%rip), %rdi      # 0x5c4e
callq 0x2030
leaq 0x249c(%rip), %rsi      # 0x5c30
leaq 0x4bb5(%rip), %rdx      # 0x8350
movq %rbp, %rdi
movq %rdx, %rbp
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x21d0
movq %r14, %rdi
callq 0x3b94
leaq 0x2496(%rip), %rsi      # 0x5c53
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0x19d0(%rip), %rdi      # 0x51a1
callq 0x2030
leaq 0x2491(%rip), %rsi      # 0x5c6e
movq 0x20(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0x2483(%rip), %rsi      # 0x5c76
movq %r12, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x21d0
callq 0x3c52
testq %rax, %rax
jne 0x3811
callq 0x2419
jmp 0x3827
leaq 0x246f(%rip), %rsi      # 0x5c87
movq 0x18(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0x10(%rsp), %r13
leaq 0x24af(%rip), %rdi      # 0x5ce2
callq 0x2030
testq %rax, %rax
movq 0x477e(%rip), %rbp      # 0x7fc0
jne 0x38b7
leaq 0x24d0(%rip), %rdi      # 0x5d1b
callq 0x2030
testq %rax, %rax
jne 0x38a5
callq 0x3ae4
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b30
movq 0x20(%r14), %rdi
callq 0x2200
testq %rax, %rax
jne 0x389c
movq 0x4771(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x24c7(%rip), %rsi      # 0x5d50
leaq 0x5b20(%rip), %rdx      # 0x93b0
xorl %eax, %eax
callq 0x2130
jmp 0x3972
cmpb $0x1, 0x7b25(%rip)      # 0xb3c8
jne 0x38ae
leaq 0x2488(%rip), %rsi      # 0x5d34
jmp 0x38be
cmpb $0x1, 0x7b0f(%rip)      # 0xb3c4
jne 0x38cc
leaq 0x243f(%rip), %rsi      # 0x5cfd
movq (%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
cmpb $0x1, 0x5a7d(%rip)      # 0x9350
jne 0x3935
movq (%rbp), %rdi
leaq 0x24bc(%rip), %rsi      # 0x5d9c
leaq 0x10a0(%rsp), %rdx
xorl %eax, %eax
callq 0x3fe6
movl 0xc(%rsp), %eax
cmpl $0x2, %eax
jl 0x3923
movl %eax, %r15d
movl $0x1, %r12d
leaq 0x24b8(%rip), %r14      # 0x5dc0
movq (%rbp), %rdi
movq (%r13,%r12,8), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x3fe6
incq %r12
cmpq %r12, %r15
jne 0x3908
movq (%rbp), %rdi
leaq 0x2496(%rip), %rsi      # 0x5dc4
xorl %eax, %eax
callq 0x3fe6
leaq 0x10a0(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
movq %r13, %rsi
callq 0x2100
testl %eax, %eax
jne 0x3972
movq %rbx, %rdi
callq 0x247a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x1020a8, %rsp         # imm = 0x1020A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10a0(%rsp), %rdi
callq 0x243e
jmp 0x3959