// File: /workspace/github_c_makefile_star2_O1/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 $0x102098, %rsp         # imm = 0x102098
movq %rdx, %r15
movl %esi, 0x4(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x1090(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20d0
leaq 0x2090(%rsp), %rdi
movl $0x100000, %edx         # imm = 0x100000
xorl %esi, %esi
callq 0x20d0
cmpb $0x0, 0x6134(%rip)      # 0x93b0
jne 0x32ca
leaq 0x2135(%rip), %rdi      # 0x53ba
callq 0x2030
testq %rax, %rax
je 0x32a8
movq %rax, %rdi
callq 0x2160
leaq 0x6112(%rip), %rdi      # 0x93b0
movq %rax, %rsi
callq 0x3a99
jmp 0x32ca
callq 0x3ad7
movq %rax, %r14
movq %rax, %rdi
callq 0x20a0
leaq 0x60f1(%rip), %rdi      # 0x93b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x2060
cmpb $0x0, 0x70ef(%rip)      # 0xa3c0
jne 0x331f
leaq 0x20f7(%rip), %rdi      # 0x53d1
callq 0x2030
testq %rax, %rax
je 0x32fd
movq %rax, %rdi
callq 0x2160
leaq 0x70cd(%rip), %rdi      # 0xa3c0
movq %rax, %rsi
callq 0x3a99
jmp 0x331f
callq 0x3ad7
movq %rdx, %r14
movq %rdx, %rdi
callq 0x20a0
leaq 0x70ac(%rip), %rdi      # 0xa3c0
movq %r14, %rsi
movq %rax, %rdx
callq 0x2060
leaq 0x2826(%rip), %rsi      # 0x5b4c
leaq 0x5023(%rip), %rdx      # 0x8350
leaq 0x2090(%rsp), %rdi
xorl %eax, %eax
callq 0x21d0
cmpb $0x1, 0x605d(%rip)      # 0x93a0
movq %r15, 0x8(%rsp)
jne 0x33af
callq 0x3b0c
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b58
movq 0x10(%r14), %rdi
callq 0x2200
movq %rax, %r14
leaq 0x2090(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r15
addq $0x2090, %r15           # imm = 0x2090
callq 0x3b0c
movq %rax, %r12
movq %r14, %rdi
callq 0x3bbf
leaq 0x27be(%rip), %rsi      # 0x5b58
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x21d0
jmp 0x34ab
cmpb $0x1, 0x7002(%rip)      # 0xa3b8
jne 0x33eb
leaq 0x2090(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r14
addq $0x2090, %r14           # imm = 0x2090
leaq 0x6fe9(%rip), %rdi      # 0xa3c0
callq 0x3bbf
leaq 0x2780(%rip), %rsi      # 0x5b63
movq %r14, %rdi
jmp 0x34a1
movq 0x5fa6(%rip), %r14      # 0x9398
testq %r14, %r14
je 0x35e9
leaq 0x2090(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %rdi
addq $0x2090, %rdi           # imm = 0x2090
leaq 0x2732(%rip), %rsi      # 0x5b4c
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0x5f6d(%rip), %rdx      # 0x9398
leaq 0x25d7(%rip), %rsi      # 0x5a09
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
cmpl $-0x1, %eax
je 0x35e9
movq 0x5f3a(%rip), %rsi      # 0x9398
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x3b58
movq 0x10(%r14), %rdi
callq 0x2200
movq %rax, %r14
leaq 0x2090(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r15
addq $0x2090, %r15           # imm = 0x2090
movq %r14, %rdi
callq 0x3bbf
leaq 0x26c5(%rip), %rsi      # 0x5b63
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0x90(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20d0
leaq 0x2690(%rip), %rsi      # 0x5b56
leaq 0x2090(%rsp), %rdi
callq 0x21a0
testq %rax, %rax
je 0x3977
movq %rax, %r14
movq 0x4ada(%rip), %rbx      # 0x7fc0
leaq 0x2703(%rip), %r12      # 0x5bf0
leaq 0x90(%rsp), %r13
leaq 0x265a(%rip), %rbp      # 0x5b56
movq 0x10(%rsp), %r15
movq (%rbx), %rdi
leaq 0x26ab(%rip), %rsi      # 0x5bb6
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x39a9
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x21d0
movq %r13, %rdi
movl $0x1, %esi
callq 0x2180
testl %eax, %eax
je 0x3562
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 0x3501
jmp 0x3977
movq %rbx, %rbp
movq (%rbx), %rdi
leaq 0x2687(%rip), %rsi      # 0x5bf6
leaq 0x90(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x39a9
movq %r14, %rdi
callq 0x20a0
leaq 0x1090(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2060
cmpb $0x0, 0x7e1d(%rip)      # 0xb3c0
je 0x3692
leaq 0x1090(%rsp), %rdi
movl $0x1, %esi
callq 0x2180
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x3986
movq (%rbp), %rdi
leaq 0x1e18(%rip), %rsi      # 0x53eb
xorl %ebx, %ebx
leaq 0x1090(%rsp), %rdx
xorl %eax, %eax
callq 0x2130
jmp 0x3986
movq 0x6dc0(%rip), %r14      # 0xa3b0
testq %r14, %r14
je 0x361e
leaq 0x2090(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %rdi
addq $0x2090, %rdi           # imm = 0x2090
leaq 0x254f(%rip), %rsi      # 0x5b63
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
cmpb $0x0, 0x5d7b(%rip)      # 0x93a0
jne 0x34ab
testb $0x1, 0x6d86(%rip)      # 0xa3b8
jne 0x34ab
cmpq $0x0, 0x6d70(%rip)      # 0xa3b0
jne 0x34ab
cmpq $0x0, 0x5d4a(%rip)      # 0x9398
jne 0x34ab
leaq 0x2090(%rsp), %rdi
callq 0x20a0
leaq (%rsp,%rax), %r14
addq $0x2090, %r14           # imm = 0x2090
callq 0x3b0c
movq %rax, %r15
leaq 0x6d45(%rip), %rdi      # 0xa3c0
callq 0x3bbf
leaq 0x24d1(%rip), %rsi      # 0x5b58
movq %r14, %rdi
movq %r15, %rdx
jmp 0x33a0
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, %r15
movq %rax, 0x90(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, 0x98(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, 0xa0(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, 0xa8(%rsp)
movl $0xff, %edi
movl $0x1, %esi
callq 0x2110
movq %rax, 0xb0(%rsp)
movl $0xff, %edi
movl $0x1, %esi
callq 0x2110
movq %rax, 0xb8(%rsp)
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, 0xc0(%rsp)
callq 0x3b0c
leaq 0x24c3(%rip), %rsi      # 0x5c28
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0x98(%rsp), %r14
leaq 0x6c3f(%rip), %r12      # 0xa3c0
movq %r12, %rdi
callq 0x3bbf
movq %rax, %r13
leaq 0x24be(%rip), %rdi      # 0x5c51
callq 0x2030
leaq 0x2494(%rip), %rsi      # 0x5c33
leaq 0x4baa(%rip), %r15      # 0x8350
movq %r14, %rdi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x21d0
movq 0xa0(%rsp), %r14
movq %r12, %rdi
callq 0x3bbf
leaq 0x2486(%rip), %rsi      # 0x5c56
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0xa8(%rsp), %r14
leaq 0x19b5(%rip), %rdi      # 0x51a1
callq 0x2030
leaq 0x2479(%rip), %rsi      # 0x5c71
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0xc0(%rsp), %rdi
leaq 0x2465(%rip), %rsi      # 0x5c79
movq %r15, %rdx
xorl %eax, %eax
callq 0x21d0
callq 0x3c7d
testq %rax, %rax
jne 0x382f
callq 0x2419
jmp 0x3848
movq 0xb0(%rsp), %rdi
leaq 0x244c(%rip), %rsi      # 0x5c8a
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
movq 0x8(%rsp), %r13
leaq 0x2491(%rip), %rdi      # 0x5ce5
callq 0x2030
testq %rax, %rax
jne 0x38d9
leaq 0x24b9(%rip), %rdi      # 0x5d1e
callq 0x2030
testq %rax, %rax
jne 0x38bf
callq 0x3b0c
leaq 0x68(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b58
movq 0x20(%r14), %rdi
callq 0x2200
testq %rax, %rax
jne 0x38b6
movq 0x4757(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x24b0(%rip), %rsi      # 0x5d53
leaq 0x5b06(%rip), %rdx      # 0x93b0
xorl %eax, %eax
callq 0x2130
jmp 0x399a
cmpb $0x1, 0x7b0b(%rip)      # 0xb3c8
jne 0x38d0
movq 0xb8(%rsp), %rdi
leaq 0x2469(%rip), %rsi      # 0x5d37
jmp 0x38e8
cmpb $0x1, 0x7aed(%rip)      # 0xb3c4
jne 0x38f2
movq 0xb8(%rsp), %rdi
leaq 0x2418(%rip), %rsi      # 0x5d00
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
cmpb $0x1, 0x5a57(%rip)      # 0x9350
jne 0x395b
movq (%rbp), %rdi
leaq 0x2499(%rip), %rsi      # 0x5d9f
leaq 0x1090(%rsp), %rdx
xorl %eax, %eax
callq 0x4043
movl 0x4(%rsp), %eax
cmpl $0x2, %eax
jl 0x3949
movl %eax, %r15d
movl $0x1, %r12d
leaq 0x2495(%rip), %r14      # 0x5dc3
movq (%rbp), %rdi
movq (%r13,%r12,8), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x4043
incq %r12
cmpq %r12, %r15
jne 0x392e
movq (%rbp), %rdi
leaq 0x2473(%rip), %rsi      # 0x5dc7
xorl %eax, %eax
callq 0x4043
leaq 0x1090(%rsp), %rdi
leaq 0x90(%rsp), %rdx
movq %r13, %rsi
callq 0x2100
testl %eax, %eax
jne 0x399a
movq 0x10(%rsp), %rdi
callq 0x247a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x102098, %rsp         # imm = 0x102098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1090(%rsp), %rdi
callq 0x243e
jmp 0x3981