// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x101150, %rsp         # imm = 0x101150
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x1020(%rbp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x20c0
leaq -0x101020(%rbp), %rdi
xorl %esi, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x20c0
leaq 0x5d2d(%rip), %rdi      # 0x93c0
callq 0x2090
cmpq $0x0, %rax
jne 0x3732
leaq 0x1d13(%rip), %rdi      # 0x53bc
callq 0x2030
movq %rax, -0x101028(%rbp)
cmpq $0x0, %rax
je 0x36d8
movq -0x101028(%rbp), %rdi
callq 0x2150
movq %rax, %rsi
leaq 0x5cef(%rip), %rdi      # 0x93c0
callq 0x3db0
jmp 0x3730
leaq 0x1ce5(%rip), %rdi      # 0x53c4
callq 0x3e40
movq %rax, -0x101050(%rbp)
movq %rdx, -0x101048(%rbp)
movq -0x101050(%rbp), %rax
movq %rax, -0x101040(%rbp)
movq -0x101040(%rbp), %rax
movq %rax, -0x1010c0(%rbp)
movq -0x101040(%rbp), %rdi
callq 0x2090
movq -0x1010c0(%rbp), %rsi
movq %rax, %rdx
leaq 0x5c95(%rip), %rdi      # 0x93c0
callq 0x2060
jmp 0x3732
leaq 0x6c97(%rip), %rdi      # 0xa3d0
callq 0x2090
cmpq $0x0, %rax
jne 0x37d8
leaq 0x1c84(%rip), %rdi      # 0x53d3
callq 0x2030
movq %rax, -0x101038(%rbp)
cmpq $0x0, %rax
je 0x377e
movq -0x101038(%rbp), %rdi
callq 0x2150
movq %rax, %rsi
leaq 0x6c59(%rip), %rdi      # 0xa3d0
callq 0x3db0
jmp 0x37d6
leaq 0x1c3f(%rip), %rdi      # 0x53c4
callq 0x3e40
movq %rax, -0x101068(%rbp)
movq %rdx, -0x101060(%rbp)
movq -0x101060(%rbp), %rax
movq %rax, -0x101058(%rbp)
movq -0x101058(%rbp), %rax
movq %rax, -0x1010c8(%rbp)
movq -0x101058(%rbp), %rdi
callq 0x2090
movq -0x1010c8(%rbp), %rsi
movq %rax, %rdx
leaq 0x6bff(%rip), %rdi      # 0xa3d0
callq 0x2060
jmp 0x37d8
leaq -0x101020(%rbp), %rdi
leaq 0x23ae(%rip), %rsi      # 0x5b94
leaq 0x4b73(%rip), %rdx      # 0x8360
movb $0x0, %al
callq 0x21c0
cmpl $0x1, 0x5bb5(%rip)      # 0x93b0
jne 0x38a0
leaq 0x5bb8(%rip), %rdi      # 0x93c0
callq 0x3ec0
movq %rax, %rsi
leaq -0x101090(%rbp), %rdi
callq 0x3f70
movq -0x101080(%rbp), %rdi
callq 0x21e0
movq %rax, -0x101030(%rbp)
leaq -0x101020(%rbp), %rax
movq %rax, -0x1010e0(%rbp)
leaq -0x101020(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x1010e0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x1010d8(%rbp)
leaq 0x5b5c(%rip), %rdi      # 0x93c0
callq 0x3ec0
movq %rax, -0x1010d0(%rbp)
movq -0x101030(%rbp), %rdi
callq 0x4040
movq -0x1010d8(%rbp), %rdi
movq -0x1010d0(%rbp), %rdx
movq %rax, %rcx
leaq 0x230c(%rip), %rsi      # 0x5ba0
movb $0x0, %al
callq 0x21c0
jmp 0x3ab6
cmpl $0x1, 0x6b21(%rip)      # 0xa3c8
jne 0x3900
leaq -0x101020(%rbp), %rax
movq %rax, -0x1010f0(%rbp)
leaq -0x101020(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x1010f0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x1010e8(%rbp)
leaq 0x6af2(%rip), %rdi      # 0xa3d0
callq 0x4040
movq -0x1010e8(%rbp), %rdi
movq %rax, %rdx
leaq 0x22b7(%rip), %rsi      # 0x5bab
movb $0x0, %al
callq 0x21c0
jmp 0x3ab6
cmpq $0x0, 0x5aa0(%rip)      # 0x93a8
je 0x39d7
leaq -0x101020(%rbp), %rax
movq %rax, -0x1010f8(%rbp)
leaq -0x101020(%rbp), %rdi
callq 0x2090
movq -0x1010f8(%rbp), %rdi
addq %rax, %rdi
movq 0x5a6f(%rip), %rdx      # 0x93a8
leaq 0x2254(%rip), %rsi      # 0x5b94
movb $0x0, %al
callq 0x21c0
movq 0x5a5a(%rip), %rdi      # 0x93a8
callq 0x47e0
cmpl $0x1, %eax
jne 0x39d5
movq 0x5a49(%rip), %rsi      # 0x93a8
leaq -0x1010b8(%rbp), %rdi
callq 0x3f70
movq -0x1010a8(%rbp), %rdi
callq 0x21e0
movq %rax, -0x101030(%rbp)
leaq -0x101020(%rbp), %rax
movq %rax, -0x101108(%rbp)
leaq -0x101020(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x101108(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x101100(%rbp)
movq -0x101030(%rbp), %rdi
callq 0x4040
movq -0x101100(%rbp), %rdi
movq %rax, %rdx
leaq 0x21e2(%rip), %rsi      # 0x5bab
movb $0x0, %al
callq 0x21c0
jmp 0x3ab6
jmp 0x39d7
cmpq $0x0, 0x69e1(%rip)      # 0xa3c0
je 0x3a1a
leaq -0x101020(%rbp), %rax
movq %rax, -0x101110(%rbp)
leaq -0x101020(%rbp), %rdi
callq 0x2090
movq -0x101110(%rbp), %rdi
addq %rax, %rdi
movq 0x69b4(%rip), %rdx      # 0xa3c0
leaq 0x2198(%rip), %rsi      # 0x5bab
movb $0x0, %al
callq 0x21c0
cmpl $0x0, 0x598f(%rip)      # 0x93b0
jne 0x3ab4
cmpl $0x0, 0x699a(%rip)      # 0xa3c8
jne 0x3ab4
cmpq $0x0, 0x6984(%rip)      # 0xa3c0
jne 0x3ab4
cmpq $0x0, 0x5962(%rip)      # 0x93a8
jne 0x3ab4
leaq -0x101020(%rbp), %rax
movq %rax, -0x101128(%rbp)
leaq -0x101020(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x101128(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x101120(%rbp)
leaq 0x5943(%rip), %rdi      # 0x93c0
callq 0x3ec0
movq %rax, -0x101118(%rbp)
leaq 0x6940(%rip), %rdi      # 0xa3d0
callq 0x4040
movq -0x101120(%rbp), %rdi
movq -0x101118(%rbp), %rdx
movq %rax, %rcx
leaq 0x20f3(%rip), %rsi      # 0x5ba0
movb $0x0, %al
callq 0x21c0
jmp 0x3ab6
leaq -0x1020(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x101020(%rbp), %rdx
callq 0x4840
cmpl $0x0, %eax
jne 0x3b9b
cmpl $0x1, 0x78f3(%rip)      # 0xb3d0
jne 0x3b2c
leaq -0x1020(%rbp), %rdi
movl $0x1, %esi
callq 0x2170
cmpl $0x0, %eax
jne 0x3b20
movq 0x44cc(%rip), %rax      # 0x7fc8
movq (%rax), %rdi
leaq -0x1020(%rbp), %rdx
leaq 0x18e0(%rip), %rsi      # 0x53ed
movb $0x0, %al
callq 0x2120
movl $0x0, -0x4(%rbp)
jmp 0x3be9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3be9
leaq -0x1020(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x4980
cmpl $0x0, %eax
je 0x3b97
movq 0x44ad(%rip), %rax      # 0x7ff8
movq (%rax), %rax
movq %rax, -0x101138(%rbp)
leaq -0x1020(%rbp), %rax
movq %rax, -0x101130(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x21f0
movq -0x101138(%rbp), %rdi
movq -0x101130(%rbp), %rdx
movq %rax, %rcx
leaq 0x202f(%rip), %rsi      # 0x5bb6
movb $0x0, %al
callq 0x2120
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3be9
jmp 0x3b99
jmp 0x3b9b
movq 0x4456(%rip), %rax      # 0x7ff8
movq (%rax), %rax
movq %rax, -0x101148(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x101140(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x21f0
movq -0x101148(%rbp), %rdi
movq -0x101140(%rbp), %rdx
movq %rax, %rcx
leaq 0x1fff(%rip), %rsi      # 0x5bda
movb $0x0, %al
callq 0x2120
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x101150, %rsp         # imm = 0x101150
popq %rbp
retq
nopw %cs:(%rax,%rax)