// File: /workspace/github_c_makefile_star2_O2/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 $0x1158, %rsp           # imm = 0x1158
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x150(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x10a0
cmpl $0x1, %ebp
jle 0x16b1
leaq 0x2a9a(%rip), %rsi      # 0x3d40
leaq 0xb0(%rsp), %r12
movl $0xa0, %edx
movq %r12, %rdi
callq 0x1100
pushq $-0x1
popq %rax
leaq 0xd5e(%rip), %r13       # 0x2023
pushq $0x1
popq %r15
movl %eax, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
movq %rbx, 0x18(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x10b0
cmpl $0x70, %eax
jne 0x144b
leaq 0xfb8(%rip), %rdi       # 0x22b1
callq 0x1030
testq %rax, %rax
je 0x1329
movq %rax, %r14
movq %rax, %rdi
callq 0x1090
movq %rax, %r15
movslq %r15d, %rdx
leaq 0x150(%rsp), %rdi
movq %r14, %rsi
callq 0x1060
jmp 0x1411
leaq 0xe74(%rip), %rdi       # 0x21a4
callq 0x1030
testq %rax, %rax
je 0x158c
movq %rax, %r14
movq %r13, %rbx
movq %r12, %r13
movq %rax, %rdi
callq 0x1090
leaq 0xc(%rax), %rdi
movq %r15, %rsi
callq 0x10c0
movq %rax, %r12
movq %r14, %rdi
callq 0x1090
movw $0x2f, (%r14,%rax)
movq %r14, %rdi
callq 0x1090
movabsq $0x642e76656463782e, %rcx # imm = 0x642E76656463782E
movq %rcx, (%r14,%rax)
movl $0x746164, 0x7(%r14,%rax) # imm = 0x746164
movq %r12, %rdi
movq %r14, %rsi
callq 0x1130
movq %r12, %rdi
leaq 0xf5e(%rip), %rsi       # 0x22ff
callq 0x1120
testq %rax, %rax
je 0x15ad
movq %rax, %r14
movq %r15, %rbp
movq %rax, %rdi
xorl %esi, %esi
pushq $0x2
popq %rdx
callq 0x1110
movq %r14, %rdi
callq 0x10e0
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
movslq %r15d, %rsi
leaq 0x150(%rsp), %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x1070
movq %rax, %r15
movq %r14, %rdi
callq 0x1080
movq %r12, %rdi
callq 0x1040
movq %r13, %r12
movq %rbx, %r13
movq 0x18(%rsp), %rbx
movl 0xc(%rsp), %ebp
testl %r15d, %r15d
pushq $0x1
popq %r15
jle 0x12d6
movq 0x2bab(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
movl $0x0, 0x8(%rsp)
leaq 0xd63(%rip), %rsi       # 0x219a
leaq 0x150(%rsp), %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x12d6
cmpl $-0x1, %eax
je 0x1693
cmpl $0x73, %eax
jne 0x16a9
movq 0x2b74(%rip), %rax      # 0x3fd8
movq (%rax), %r14
movq %r14, %rdi
callq 0x1090
leaq 0x150(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1060
leaq 0x150(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x10f0
testl %eax, %eax
jne 0x15df
movl 0x38(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x1613
leaq 0xceb(%rip), %rdi       # 0x21a4
callq 0x1030
testq %rax, %rax
je 0x1635
movq %rax, %r14
movq %rax, %rdi
callq 0x1090
leaq 0xc(%rax), %rdi
movq %r15, %rsi
callq 0x10c0
movq %rax, %r12
movq %r14, %rdi
callq 0x1090
movw $0x2f, (%r14,%rax)
movq %r14, %rdi
callq 0x1090
movabsq $0x642e76656463782e, %rcx # imm = 0x642E76656463782E
movq %rcx, (%r14,%rax)
movl $0x746164, 0x7(%r14,%rax) # imm = 0x746164
movq %r12, %rdi
movq %r14, %rsi
callq 0x1130
movq %r12, %rdi
leaq 0xcc4(%rip), %rsi       # 0x21e8
callq 0x1120
testq %rax, %rax
je 0x165d
movq %rax, %r14
movq %r12, 0x10(%rsp)
movq %r15, %r12
leaq 0x150(%rsp), %r15
movq %r15, %rdi
callq 0x1090
movq %r15, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %r12
movq %rax, %rdx
movq %r14, %rcx
callq 0x1150
movq %r14, %rdi
callq 0x1080
movl $0x0, 0x8(%rsp)
movq %r12, %rdi
callq 0x1040
leaq 0xb0(%rsp), %r12
pushq $0x1
popq %r15
jmp 0x12d6
movq 0x2a65(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xd22(%rip), %rdi       # 0x22bf
pushq $0x3f
popq %rsi
movq %r15, %rdx
callq 0x1150
jmp 0x12d6
movq 0x2a44(%rip), %rax      # 0x3ff8
movq (%rax), %r14
callq 0x1050
movl (%rax), %edi
callq 0x1160
xorl %r15d, %r15d
movq %r14, %rdi
leaq 0xd31(%rip), %rsi       # 0x2301
movq %rax, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x13fa
movq 0x2a12(%rip), %rax      # 0x3ff8
movq (%rax), %r14
callq 0x1050
movl (%rax), %edi
callq 0x1160
movq %r14, %rdi
leaq 0xc2a(%rip), %rsi       # 0x2229
leaq 0x150(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10d0
jmp 0x1651
movq 0x29de(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xc42(%rip), %rsi       # 0x2266
leaq 0x150(%rsp), %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x1651
movq 0x29bc(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xb63(%rip), %rdi       # 0x21a9
pushq $0x33
popq %rsi
movq %r15, %rdx
callq 0x1150
pushq $-0x1
popq %rax
movl %eax, 0x8(%rsp)
jmp 0x12d6
movq 0x2994(%rip), %rax      # 0x3ff8
movq (%rax), %r14
callq 0x1050
movl (%rax), %edi
callq 0x1160
movq %r14, %rdi
leaq 0xb6e(%rip), %rsi       # 0x21eb
movq %rax, %rdx
xorl %eax, %eax
callq 0x10d0
pushq $-0x1
popq %rax
movl %eax, 0x8(%rsp)
jmp 0x1573
movl 0x8(%rsp), %eax
addq $0x1158, %rsp           # imm = 0x1158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %eax
je 0x16b6
cmpl $0x68, %eax
callq 0x16dc
movq 0x2913(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
leaq 0xabe(%rip), %rsi       # 0x2185
leaq 0xad0(%rip), %rdx       # 0x219e
xorl %eax, %eax
callq 0x10d0
xorl %edi, %edi
callq 0x1140