// File: /workspace/github_c_makefile_star2_O1/darwin-on-arm[P]darwin-sdk/xcode_tools/xcode-select/xcode-select.c
// Function: main
int main(int argc, char *argv[])
{
	int ch;
	int status = -1;
	char path[PATH_MAX] = { 0 };

	if (argc < 2)
		usage();

	struct option options[] = {
		{ "help", no_argument, 0, 'h' },
		{ "version", no_argument, 0, 'v' },
		{ "switch", required_argument, 0, 's' },
		{ "print-path", no_argument, 0, 'p' },
		{ NULL, 0, 0, 0 }
	};

	while ((ch = getopt_long_only(argc, argv, "hvs:p", options, NULL)) != (-1)) {
		switch (ch) {
			case 'h':
				usage();
				break;
			case 'v':
				version();
				break;
			case 's':
				strncpy(path, optarg, strlen(optarg));
				status = set_developer_path(path);
				break;
			case 'p':
				if (get_developer_path(path) > 0) {
					fprintf(stdout, "%s\n", path);
					status = 0;
				}
				break;
			case '?':
			default:
				usage();
		}
	}

	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1148, %rsp           # imm = 0x1148
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x140(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x10a0
cmpl $0x1, %ebp
jle 0x174d
leaq 0x294a(%rip), %rsi      # 0x3d40
leaq 0x10(%rsp), %r12
movl $0xa0, %edx
movq %r12, %rdi
callq 0x1100
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
leaq 0x140(%rsp), %r13
movl %ebp, %edi
movq %rbx, %rsi
leaq 0xbff(%rip), %rdx       # 0x2023
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x10b0
cmpl $0x70, %eax
jne 0x1571
leaq 0xe72(%rip), %rdi       # 0x22b1
callq 0x1030
testq %rax, %rax
je 0x146a
movq %rax, %r15
movq %rax, %rdi
callq 0x1090
movq %rax, %r14
movslq %r14d, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1060
jmp 0x1540
leaq 0xd33(%rip), %rdi       # 0x21a4
callq 0x1030
testq %rax, %rax
je 0x1696
movq %rax, %r15
movq %rax, %rdi
callq 0x1090
leaq 0xc(%rax), %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %r12
movq %r15, %rdi
callq 0x1090
movw $0x2f, (%r15,%rax)
movq %r15, %rdi
callq 0x1090
movabsq $0x642e76656463782e, %rcx # imm = 0x642E76656463782E
movq %rcx, (%r15,%rax)
movl $0x746164, 0x7(%r15,%rax) # imm = 0x746164
movq %r12, %rdi
movq %r15, %rsi
callq 0x1130
movq %r12, %rdi
leaq 0xe21(%rip), %rsi       # 0x22ff
callq 0x1120
testq %rax, %rax
je 0x16a3
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1110
movq %r15, %rdi
callq 0x10e0
movq %rax, %r14
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
movslq %r14d, %rsi
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0x1070
movq %rax, %r14
movq %r15, %rdi
callq 0x1080
movq %r12, %rdi
callq 0x1040
leaq 0x10(%rsp), %r12
testl %r14d, %r14d
jle 0x1418
movq 0x2a80(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
movl $0x0, 0xc(%rsp)
leaq 0xc38(%rip), %rsi       # 0x219a
movq %r13, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x1418
cmpl $0x72, %eax
jle 0x16f8
cmpl $0x73, %eax
jne 0x1713
movq 0x2a4e(%rip), %rax      # 0x3fd8
movq (%rax), %r14
movq %r14, %rdi
callq 0x1090
movq %r13, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1060
movq %r13, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x10f0
testl %eax, %eax
jne 0x16b0
movl 0xc8(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x16ba
leaq 0xbc9(%rip), %rdi       # 0x21a4
callq 0x1030
testq %rax, %rax
je 0x16d7
movq %rax, %r15
movq %rax, %rdi
callq 0x1090
leaq 0xc(%rax), %rdi
movl $0x1, %esi
callq 0x10c0
movq %rax, %r12
movq %r15, %rdi
callq 0x1090
movw $0x2f, (%r15,%rax)
movq %r15, %rdi
callq 0x1090
movabsq $0x642e76656463782e, %rcx # imm = 0x642E76656463782E
movq %rcx, (%r15,%rax)
movl $0x746164, 0x7(%r15,%rax) # imm = 0x746164
movq %r12, %rdi
movq %r15, %rsi
callq 0x1130
movq %r12, %rdi
leaq 0xba0(%rip), %rsi       # 0x21e8
callq 0x1120
testq %rax, %rax
je 0x16e9
movq %rax, %r14
movq %r13, %rdi
callq 0x1090
movl $0x1, %esi
movq %r13, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1150
movq %r14, %rdi
callq 0x1080
movl $0x0, 0xc(%rsp)
movq %r12, %rdi
callq 0x1040
leaq 0x10(%rsp), %r12
jmp 0x1418
callq 0x11ad
xorl %r14d, %r14d
jmp 0x1540
callq 0x1180
xorl %r14d, %r14d
jmp 0x1533
movq %r13, %rdi
callq 0x11cf
jmp 0x16dc
movq 0x2937(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xb9b(%rip), %rsi       # 0x2266
movq %r13, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x16dc
callq 0x1238
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1418
callq 0x120b
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1684
cmpl $-0x1, %eax
jne 0x173e
movl 0xc(%rsp), %eax
addq $0x1148, %rsp           # imm = 0x1148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %eax
jne 0x1748
movq 0x28b1(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
leaq 0xa5c(%rip), %rsi       # 0x2185
leaq 0xa6e(%rip), %rdx       # 0x219e
xorl %eax, %eax
callq 0x10d0
xorl %edi, %edi
callq 0x1140
cmpl $0x68, %eax
jne 0x1748
callq 0x125a
callq 0x1281
callq 0x12a8