// File: /workspace/github_c_makefile_star2_O3/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 0x1794
leaq 0x294a(%rip), %rsi      # 0x3d40
leaq 0xa0(%rsp), %r12
movl $0xa0, %edx
movq %r12, %rdi
callq 0x1100
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
leaq 0xc09(%rip), %r13       # 0x2023
movl %ebp, 0xc(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x10b0
cmpl $0x70, %eax
jne 0x1593
leaq 0xe70(%rip), %rdi       # 0x22b1
callq 0x1030
testq %rax, %rax
je 0x1471
movq %rax, %r15
movq %rax, %rdi
callq 0x1090
movq %rax, %r14
movslq %r14d, %rdx
leaq 0x140(%rsp), %rdi
movq %r15, %rsi
callq 0x1060
jmp 0x155d
leaq 0xd2c(%rip), %rdi       # 0x21a4
callq 0x1030
testq %rax, %rax
je 0x16d3
movq %rax, %r15
movq %rbx, %rbp
movq %r13, %rbx
movq %r12, %r13
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 0xe11(%rip), %rsi       # 0x22ff
callq 0x1120
testq %rax, %rax
je 0x16dd
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
leaq 0x140(%rsp), %rdi
movq %r15, %rcx
callq 0x1070
movq %rax, %r14
movq %r15, %rdi
callq 0x1080
movq %r12, %rdi
callq 0x1040
movq %r13, %r12
movq %rbx, %r13
movq %rbp, %rbx
movl 0xc(%rsp), %ebp
testl %r14d, %r14d
jle 0x141e
movq 0x2a63(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
movl $0x0, 0x8(%rsp)
leaq 0xc1b(%rip), %rsi       # 0x219a
leaq 0x140(%rsp), %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x141e
cmpl $0x72, %eax
jle 0x173f
cmpl $0x73, %eax
jne 0x175a
movq 0x2a2c(%rip), %rax      # 0x3fd8
movq (%rax), %r14
movq %r14, %rdi
callq 0x1090
leaq 0x140(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1060
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x10f0
testl %eax, %eax
jne 0x16ea
movl 0x28(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x16f9
leaq 0xba5(%rip), %rdi       # 0x21a4
callq 0x1030
testq %rax, %rax
je 0x171b
movq %rax, %r15
movq %rbx, %rbp
movq %r13, %rbx
movq %r12, %r13
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 0xb73(%rip), %rsi       # 0x21e8
callq 0x1120
testq %rax, %rax
je 0x172d
movq %rax, %r14
leaq 0x140(%rsp), %r15
movq %r15, %rdi
callq 0x1090
movl $0x1, %esi
movq %r15, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1150
movq %r14, %rdi
callq 0x1080
movl $0x0, 0x8(%rsp)
movq %r12, %rdi
callq 0x1040
movq %r13, %r12
movq %rbx, %r13
movq %rbp, %rbx
movl 0xc(%rsp), %ebp
jmp 0x141e
callq 0x11ad
jmp 0x141e
callq 0x1180
xorl %r14d, %r14d
jmp 0x1548
leaq 0x140(%rsp), %rdi
callq 0x11cf
jmp 0x1720
movq 0x28f8(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xb5c(%rip), %rsi       # 0x2266
leaq 0x140(%rsp), %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x1720
callq 0x1238
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
jmp 0x141e
callq 0x120b
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
jmp 0x16b9
cmpl $-0x1, %eax
jne 0x1785
movl 0x8(%rsp), %eax
addq $0x1148, %rsp           # imm = 0x1148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %eax
jne 0x178f
movq 0x286a(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
leaq 0xa15(%rip), %rsi       # 0x2185
leaq 0xa27(%rip), %rdx       # 0x219e
xorl %eax, %eax
callq 0x10d0
xorl %edi, %edi
callq 0x1140
cmpl $0x68, %eax
jne 0x178f
callq 0x125a
callq 0x1281
callq 0x12a8