// File: /workspace/github_c_makefile_star2_O2/michaelforney[P]cproc/driver.c
// Function: main
int
main(int argc, char *argv[])
{
	enum stage last = LINK;
	enum filetype filetype = 0;
	char *arg, *end, *output = NULL, *arch, *qbearch;
	struct array inputs = {0}, *cmd;
	struct input *input;
	size_t i;

	argv0 = progname(argv[0], "cproc");

	arrayaddbuf(&stages[PREPROCESS].cmd, preprocesscmd, sizeof(preprocesscmd));
	arrayaddptr(&stages[COMPILE].cmd, compilecommand(argv[0]));
	arrayaddbuf(&stages[CODEGEN].cmd, codegencmd, sizeof(codegencmd));
	arrayaddbuf(&stages[ASSEMBLE].cmd, assemblecmd, sizeof(assemblecmd));
	arrayaddbuf(&stages[LINK].cmd, linkcmd, sizeof(linkcmd));

	if (hasprefix(target, "x86_64-") || hasprefix(target, "amd64-")) {
		arch = "x86_64-sysv";
		qbearch = "amd64_sysv";
	} else if (hasprefix(target, "aarch64-")) {
		arch = "aarch64";
		qbearch = "arm64";
	} else if (hasprefix(target, "riscv64-")) {
		arch = "riscv64";
		qbearch = "rv64";
	} else {
		fatal("unsupported target '%s'", target);
		return 1;  /* unreachable */
	}
	arrayaddptr(&stages[COMPILE].cmd, "-t");
	arrayaddptr(&stages[COMPILE].cmd, arch);
	arrayaddptr(&stages[CODEGEN].cmd, "-t");
	arrayaddptr(&stages[CODEGEN].cmd, qbearch);

	for (;;) {
		++argv, --argc;
		arg = *argv;
		if (!arg)
			break;
		if (arg[0] != '-' || arg[1] == '\0') {
			input = arrayadd(&inputs, sizeof(*input));
			input->name = arg;
			input->lib = false;
			input->filetype = filetype == NONE && arg[1] ? detectfiletype(arg) : filetype;
			switch (input->filetype) {
			case ASM:    input->stages =                                     1<<ASSEMBLE|1<<LINK; break;
			case ASMPP:  input->stages = 1<<PREPROCESS|                      1<<ASSEMBLE|1<<LINK; break;
			case C:      input->stages = 1<<PREPROCESS|1<<COMPILE|1<<CODEGEN|1<<ASSEMBLE|1<<LINK; break;
			case CHDR:   input->stages = 1<<PREPROCESS                                          ; break;
			case CPPOUT: input->stages =               1<<COMPILE|1<<CODEGEN|1<<ASSEMBLE|1<<LINK; break;
			case QBE:    input->stages =                          1<<CODEGEN|1<<ASSEMBLE|1<<LINK; break;
			case OBJ:    input->stages =                                                 1<<LINK; break;
			default:     usage("reading from standard input requires -x");
			}
			continue;
		}
		/* TODO: use a binary search for these long parameters */
		if (strcmp(arg, "-nostdlib") == 0) {
			flags.nostdlib = true;
		} else if (strcmp(arg, "-nostdinc") == 0) {
			arrayaddptr(&stages[PREPROCESS].cmd, arg);
		} else if (strcmp(arg, "-static") == 0) {
			arrayaddptr(&stages[LINK].cmd, arg);
		} else if (strcmp(arg, "-emit-qbe") == 0) {
			last = COMPILE;
		} else if (strcmp(arg, "-include") == 0 || strcmp(arg, "-idirafter") == 0 || strcmp(arg, "-isystem") == 0 || strcmp(arg, "-iquote") == 0) {
			if (!--argc)
				usage(NULL);
			arrayaddptr(&stages[PREPROCESS].cmd, arg);
			arrayaddptr(&stages[PREPROCESS].cmd, *++argv);
		} else if (strcmp(arg, "-pipe") == 0) {
			/* ignore */
		} else if (strncmp(arg, "-std=", 5) == 0) {
			/* pass through to the preprocessor, it may
			 * affect its default definitions */
			arrayaddptr(&stages[PREPROCESS].cmd, arg);
		} else if (strcmp(arg, "-pedantic") == 0) {
			/* ignore */
		} else if (strcmp(arg, "-pthread") == 0) {
			arrayaddptr(&stages[LINK].cmd, "-l");
			arrayaddptr(&stages[LINK].cmd, "pthread");
		} else if (strcmp(arg, "-dumpmachine") == 0) {
			/* print target and exit */
			puts(target);
			return 0;
		} else {
			if (arg[2] != '\0' && strchr("cESsv", arg[1]))
				usage(NULL);
			switch (arg[1]) {
			case 'c':
				last = ASSEMBLE;
				break;
			case 'D':
				arrayaddptr(&stages[PREPROCESS].cmd, "-D");
				arrayaddptr(&stages[PREPROCESS].cmd, nextarg(&argv));
				break;
			case 'E':
				last = PREPROCESS;
				break;
			case 'g':
				/* ignore */
				break;
			case 'I':
				arrayaddptr(&stages[PREPROCESS].cmd, "-I");
				arrayaddptr(&stages[PREPROCESS].cmd, nextarg(&argv));
				break;
			case 'L':
				arrayaddptr(&stages[LINK].cmd, "-L");
				arrayaddptr(&stages[LINK].cmd, nextarg(&argv));
				break;
			case 'l':
				input = arrayadd(&inputs, sizeof(*input));
				input->name = nextarg(&argv);
				input->lib = true;
				input->filetype = OBJ;
				input->stages = 1<<LINK;
				break;
			case 'M':
				if (strcmp(arg, "-M") == 0 || strcmp(arg, "-MM") == 0) {
					arrayaddptr(&stages[PREPROCESS].cmd, arg);
					last = PREPROCESS;
				} else if (strcmp(arg, "-MD") == 0 || strcmp(arg, "-MMD") == 0) {
					arrayaddptr(&stages[PREPROCESS].cmd, arg);
				} else if (strcmp(arg, "-MT") == 0 || strcmp(arg, "-MF") == 0) {
					if (!--argc)
						usage(NULL);
					arrayaddptr(&stages[PREPROCESS].cmd, arg);
					arrayaddptr(&stages[PREPROCESS].cmd, *++argv);
				} else {
					usage(NULL);
				}
				break;
			case 'O':
				/* ignore */
				break;
			case 'o':
				output = nextarg(&argv);
				break;
			case 'P':
				arrayaddptr(&stages[PREPROCESS].cmd, "-P");
				break;
			case 'S':
				last = CODEGEN;
				break;
			case 's':
				arrayaddptr(&stages[LINK].cmd, "-s");
				break;
			case 'U':
				arrayaddptr(&stages[PREPROCESS].cmd, "-U");
				arrayaddptr(&stages[PREPROCESS].cmd, nextarg(&argv));
				break;
			case 'v':
				flags.verbose = true;
				break;
			case 'W':
				if (arg[2] && arg[3] == ',') {
					switch (arg[2]) {
					case 'p': cmd = &stages[PREPROCESS].cmd; break;
					case 'a': cmd = &stages[ASSEMBLE].cmd; break;
					case 'l': cmd = &stages[LINK].cmd; break;
					default: usage(NULL);
					}
					for (arg += 4; arg; arg = end ? end + 1 : NULL) {
						end = strchr(arg, ',');
						if (end)
							*end = '\0';
						arrayaddptr(cmd, arg);
					}
				} else {
					/* ignore warning flag */
				}
				break;
			case 'x':
				arg = nextarg(&argv);
				if (strcmp(arg, "none") == 0)
					filetype = NONE;
				else if (strcmp(arg, "c") == 0)
					filetype = C;
				else if (strcmp(arg, "c-header") == 0)
					filetype = CHDR;
				else if (strcmp(arg, "cpp-output") == 0)
					filetype = CPPOUT;
				else if (strcmp(arg, "qbe") == 0)
					filetype = QBE;
				else if (strcmp(arg, "assembler") == 0)
					filetype = ASM;
				else if (strcmp(arg, "assembler-with-cpp") == 0)
					filetype = ASMPP;
				else
					usage("unknown language '%s'", arg);
				break;
			default:
				usage("unknown option '%s'", arg);
			}
		}
	}

	for (i = 0; i < LEN(stages); ++i)
		stages[i].cmdbase = stages[i].cmd.len;
	if (inputs.len == 0)
		usage(NULL);
	if (output) {
		if (strcmp(output, "-") == 0) {
			if (last >= ASSEMBLE)
				usage("cannot write object to stdout");
		} else if (last != LINK && inputs.len > sizeof(*input)) {
			usage("cannot specify -o with multiple input files without linking");
		}
	}
	arrayforeach (&inputs, input) {
		/* ignore the input if it doesn't participate in the last stage */
		if (!(input->stages & 1 << last))
			continue;
		/* only run up through the last stage */
		input->stages &= (1 << last + 1) - 1;
		buildobj(input, output);
	}
	if (last == LINK) {
		if (!output)
			output = "a.out";
		buildexe(inputs.val, inputs.len / sizeof(*input), output);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1078, %rsp           # imm = 0x1078
movq %rsi, %rbx
movl %edi, %r15d
movq %rsi, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq (%rsi), %rdi
leaq 0x1d38(%rip), %rsi      # 0x40c8
callq 0x38d4
leaq 0x3e9c(%rip), %rcx      # 0x6238
movq %rax, (%rcx)
leaq 0x3da2(%rip), %rdi      # 0x6148
leaq 0x3913(%rip), %rsi      # 0x5cc0
pushq $0x78
popq %rdx
callq 0x397d
movq %rbx, 0x20(%rsp)
movq (%rbx), %r14
leaq 0x1f99(%rip), %rdi      # 0x435d
leaq 0x70(%rsp), %rsi
movl $0xffb, %ebx            # imm = 0xFFB
movl $0xffb, %edx            # imm = 0xFFB
callq 0x2090
cmpq $0xffb, %rax            # imm = 0xFFB
je 0x241c
movq %rax, %rbx
cmpq $-0x1, %rax
jne 0x242a
movq %r14, %rdi
callq 0x20c0
movq %rax, %rbx
cmpq $0xffc, %rax            # imm = 0xFFC
jb 0x240a
leaq 0x1f69(%rip), %rdi      # 0x436c
xorl %eax, %eax
callq 0x37c3
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2160
jmp 0x242a
leaq 0x1f5e(%rip), %rdi      # 0x4381
xorl %eax, %eax
callq 0x37c3
movb $0x0, 0x74(%rsp,%rbx)
movl $0x6562712d, 0x70(%rsp,%rbx) # imm = 0x6562712D
leaq 0x70(%rsp), %rdi
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
jne 0x2457
leaq 0x1f57(%rip), %rdi      # 0x43a7
xorl %eax, %eax
callq 0x37c3
leaq 0x3d1a(%rip), %rdi      # 0x6178
movq %rbx, %rsi
callq 0x396c
leaq 0x3d3b(%rip), %rdi      # 0x61a8
leaq 0x38c4(%rip), %rsi      # 0x5d38
pushq $0x8
popq %rbx
movq %rbx, %rdx
callq 0x397d
leaq 0x3d52(%rip), %rdi      # 0x61d8
leaq 0x38b3(%rip), %rsi      # 0x5d40
movq %rbx, %rdx
callq 0x397d
leaq 0x3d6c(%rip), %rdi      # 0x6208
leaq 0x38ad(%rip), %rsi      # 0x5d50
pushq $0x28
popq %rdx
callq 0x397d
leaq 0x1c1c(%rip), %rdi      # 0x40ce
callq 0x33d7
leaq 0x1c2b(%rip), %rbx      # 0x40e9
leaq 0x1c18(%rip), %r14      # 0x40dd
testl %eax, %eax
jne 0x251b
leaq 0x1c06(%rip), %rdi      # 0x40d6
callq 0x33d7
testl %eax, %eax
jne 0x251b
leaq 0x1c14(%rip), %rdi      # 0x40f4
callq 0x33d7
testl %eax, %eax
je 0x24f9
leaq 0x1c15(%rip), %rbx      # 0x4105
leaq 0x1c06(%rip), %r14      # 0x40fd
jmp 0x251b
leaq 0x1c0b(%rip), %rdi      # 0x410b
callq 0x33d7
testl %eax, %eax
je 0x31e2
leaq 0x1c08(%rip), %rbx      # 0x411c
leaq 0x1bf9(%rip), %r14      # 0x4114
movq %r15, (%rsp)
leaq 0x3c52(%rip), %r15      # 0x6178
leaq 0x1c0c(%rip), %r12      # 0x4139
movq %r15, %rdi
movq %r12, %rsi
callq 0x396c
movq %r15, %rdi
movq %r14, %rsi
callq 0x396c
leaq 0x3c5e(%rip), %r14      # 0x61a8
movq %r14, %rdi
movq %r12, %rsi
callq 0x396c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x396c
pushq $0x4
popq %rax
pushq $-0x10
popq %r12
pushq $-0x8
popq %rbp
pushq $0x18
popq %r13
movl %eax, 0x1c(%rsp)
xorl %eax, %eax
movq $0x0, 0x38(%rsp)
movq %rax, 0x8(%rsp)
decl %eax
cltq
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r15,8), %rbx
testq %rbx, %rbx
je 0x2d08
cmpb $0x2d, (%rbx)
jne 0x25b4
movsbl 0x1(%rbx), %r14d
testl %r14d, %r14d
jne 0x26e1
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x38f7
movq %rax, %r14
movq %rbx, (%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rax
testl %eax, %eax
je 0x25f5
movl %eax, 0xc(%r14)
cmpl $0x8, %eax
jae 0x3211
leaq 0x1ac4(%rip), %rax      # 0x40ac
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
jmp 0x26c1
cmpb $0x0, 0x1(%rbx)
je 0x320c
movq %rbx, %rdi
pushq $0x2e
popq %rsi
callq 0x20e0
testq %rax, %rax
je 0x26a5
movq %rax, %rbx
movzbl 0x1(%rax), %r13d
cmpl $0x69, %r13d
je 0x2651
cmpl $0x68, %r13d
je 0x263f
cmpl $0x63, %r13d
jne 0x2657
cmpb $0x0, 0x2(%rbx)
jne 0x2657
movl $0x3, 0xc(%r14)
pushq $0x1f
jmp 0x26bc
cmpb $0x0, 0x2(%rbx)
jne 0x2657
movl $0x4, 0xc(%r14)
pushq $0x1
jmp 0x26bc
cmpb $0x0, 0x2(%rbx)
je 0x26b2
movq %rbx, %rdi
incq %rdi
leaq 0x1b22(%rip), %rsi      # 0x4186
callq 0x2140
testl %eax, %eax
je 0x268f
cmpl $0x53, %r13d
je 0x269b
cmpl $0x73, %r13d
pushq $0x18
popq %r13
jne 0x26a5
cmpb $0x0, 0x2(%rbx)
jne 0x26a5
movl $0x1, 0xc(%r14)
pushq $0x18
jmp 0x26af
movl $0x7, 0xc(%r14)
pushq $0x1c
jmp 0x26bc
cmpb $0x0, 0x2(%rbx)
pushq $0x18
popq %r13
je 0x26d5
movl $0x6, 0xc(%r14)
pushq $0x10
popq %rax
jmp 0x26c1
movl $0x5, 0xc(%r14)
pushq $0x1e
popq %rax
pushq $0x18
popq %r13
movl %eax, 0x8(%r14)
incq %r15
addq $-0x8, %r12
addq $-0x8, %rbp
jmp 0x258e
movl $0x2, 0xc(%r14)
pushq $0x19
jmp 0x26af
movq 0x20(%rsp), %rax
subq %rbp, %rax
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
leaq 0x1a6c(%rip), %rsi      # 0x4164
callq 0x2140
movq (%rsp), %rbp
leal -0x1(%rbp), %ecx
subq %r15, %rcx
testl %eax, %eax
je 0x2884
movq %rcx, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x1a50(%rip), %rsi      # 0x416e
callq 0x2140
testl %eax, %eax
je 0x288f
movq %rbx, %rdi
leaq 0x1a43(%rip), %rsi      # 0x4178
callq 0x2140
testl %eax, %eax
je 0x2898
movq %rbx, %rdi
leaq 0x1a34(%rip), %rsi      # 0x4180
callq 0x2140
testl %eax, %eax
je 0x290f
movq %rbx, %rdi
leaq 0x1a27(%rip), %rsi      # 0x418a
callq 0x2140
testl %eax, %eax
je 0x28cb
movq %rbx, %rdi
leaq 0x1a19(%rip), %rsi      # 0x4193
callq 0x2140
testl %eax, %eax
je 0x28cb
movq %rbx, %rdi
leaq 0x1a0d(%rip), %rsi      # 0x419e
callq 0x2140
testl %eax, %eax
je 0x28cb
movq %rbx, %rdi
leaq 0x19ff(%rip), %rsi      # 0x41a7
callq 0x2140
testl %eax, %eax
je 0x28cb
movq %rbx, %rdi
leaq 0x19f0(%rip), %rsi      # 0x41af
callq 0x2140
testl %eax, %eax
je 0x28a7
movq %rbx, %rdi
leaq 0x19df(%rip), %rsi      # 0x41b5
pushq $0x5
popq %rdx
callq 0x2060
testl %eax, %eax
je 0x288f
movq %rbx, %rdi
leaq 0x19cb(%rip), %rsi      # 0x41bb
callq 0x2140
testl %eax, %eax
je 0x28a7
movq %rbx, %rdi
leaq 0x19be(%rip), %rsi      # 0x41c5
callq 0x2140
testl %eax, %eax
je 0x2921
movq %rbx, %rdi
leaq 0x19b3(%rip), %rsi      # 0x41d1
callq 0x2140
testl %eax, %eax
je 0x31fc
movzbl 0x2(%rbx), %ebp
testl %ebp, %ebp
je 0x284e
leaq 0x19a4(%rip), %rdi      # 0x41de
movl %r14d, %esi
pushq $0x6
popq %rdx
callq 0x2130
testq %rax, %rax
jne 0x3236
movzbl %r14b, %eax
leal -0x44(%rax), %ecx
cmpl $0x13, %ecx
ja 0x2946
leaq 0x17ab(%rip), %rdx      # 0x4010
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x38d3(%rip), %rbx      # 0x6148
movq %rbx, %rdi
leaq 0x1965(%rip), %rsi      # 0x41e4
jmp 0x2ab5
movb $0x1, 0x39a6(%rip)      # 0x6231
movl %ecx, %eax
jmp 0x28ac
leaq 0x38b2(%rip), %rdi      # 0x6148
jmp 0x289f
leaq 0x3969(%rip), %rdi      # 0x6208
movq %rbx, %rsi
callq 0x396c
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $-0x10
popq %r12
pushq $-0x8
popq %rbp
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x20(%rsp)
jmp 0x257d
addl $-0x2, %ebp
cmpl %r15d, %ebp
je 0x3236
subq %r15, %rbp
movq %rbp, (%rsp)
leaq 0x3863(%rip), %r14      # 0x6148
movq %r14, %rdi
movq %rbx, %rsi
callq 0x396c
movq 0x20(%rsp), %rcx
movq %rcx, %rax
subq %r12, %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rcx,%r15,8), %rsi
movq %r14, %rdi
callq 0x396c
jmp 0x28b0
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x1
popq %rax
movl %eax, 0x1c(%rsp)
jmp 0x28b0
leaq 0x38e0(%rip), %rbx      # 0x6208
movq %rbx, %rdi
leaq 0x189c(%rip), %rsi      # 0x41ce
callq 0x396c
movq %rbx, %rdi
leaq 0x1885(%rip), %rsi      # 0x41c6
jmp 0x28a2
leal -0x6f(%rax), %ecx
cmpl $0x9, %ecx
ja 0x2972
leaq 0x170b(%rip), %rdx      # 0x4060
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x28(%rsp), %rdi
callq 0x34ea
movq %rax, 0x38(%rsp)
jmp 0x28a7
cmpl $0x63, %eax
je 0x2be4
cmpl $0x6c, %eax
je 0x2bf4
cmpl $0x67, %eax
je 0x28a7
jmp 0x33bd
leaq 0x37af(%rip), %rbx      # 0x6148
movq %rbx, %rdi
leaq 0x1844(%rip), %rsi      # 0x41e7
jmp 0x2ab5
leaq 0x3859(%rip), %rbx      # 0x6208
movq %rbx, %rdi
leaq 0x1831(%rip), %rsi      # 0x41ea
jmp 0x2ab5
testl %ebp, %ebp
je 0x2c28
movq %rbx, %rdi
leaq 0x181d(%rip), %rsi      # 0x41ed
callq 0x2140
testl %eax, %eax
je 0x2c28
movq %rbx, %rdi
leaq 0x180a(%rip), %rsi      # 0x41f1
callq 0x2140
testl %eax, %eax
je 0x2c54
movq %rbx, %rdi
leaq 0x17f7(%rip), %rsi      # 0x41f5
callq 0x2140
testl %eax, %eax
je 0x2c54
movq %rbx, %rdi
leaq 0x17e5(%rip), %rsi      # 0x41fa
callq 0x2140
testl %eax, %eax
je 0x2a35
movq %rbx, %rdi
leaq 0x17d6(%rip), %rsi      # 0x41fe
callq 0x2140
testl %eax, %eax
jne 0x3236
movq (%rsp), %rax
addl $-0x2, %eax
movq %rax, (%rsp)
cmpl %r15d, %eax
je 0x3236
subq %r15, (%rsp)
leaq 0x36f4(%rip), %r14      # 0x6148
movq %r14, %rdi
movq %rbx, %rsi
callq 0x396c
movq 0x20(%rsp), %rcx
movq %rcx, %rax
subq %r12, %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rcx,%r15,8), %rsi
movq %r14, %rdi
callq 0x396c
jmp 0x2c6c
leaq 0x36c0(%rip), %rdi      # 0x6148
leaq 0x1773(%rip), %rsi      # 0x4202
jmp 0x28a2
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x2
jmp 0x291a
leaq 0x369d(%rip), %rbx      # 0x6148
movq %rbx, %rdi
leaq 0x1753(%rip), %rsi      # 0x4208
callq 0x396c
leaq 0x28(%rsp), %rdi
callq 0x34ea
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x28a2
testl %ebp, %ebp
je 0x28a7
cmpb $0x2c, 0x3(%rbx)
jne 0x2c63
leaq 0x3660(%rip), %r14      # 0x6148
cmpl $0x70, %ebp
je 0x2ca3
cmpl $0x6c, %ebp
je 0x2c9c
cmpl $0x61, %ebp
jne 0x3236
leaq 0x36ce(%rip), %r14      # 0x61d8
jmp 0x2ca3
leaq 0x36f2(%rip), %rdi      # 0x6208
leaq 0x16e8(%rip), %rsi      # 0x4205
jmp 0x28a2
movb $0x1, 0x3709(%rip)      # 0x6232
jmp 0x28a7
leaq 0x28(%rsp), %rdi
callq 0x34ea
movq %rax, %rbx
movq %rax, %rdi
leaq 0x16c6(%rip), %rsi      # 0x420b
callq 0x2140
testl %eax, %eax
je 0x2c44
cmpb $0x63, (%rbx)
jne 0x2b61
cmpb $0x0, 0x1(%rbx)
je 0x2c8f
movq %rbx, %rdi
leaq 0x16a5(%rip), %rsi      # 0x4210
callq 0x2140
testl %eax, %eax
je 0x2c75
movq %rbx, %rdi
leaq 0x1697(%rip), %rsi      # 0x4219
callq 0x2140
testl %eax, %eax
je 0x2c82
movq %rbx, %rdi
leaq 0x15ed(%rip), %rsi      # 0x4186
callq 0x2140
testl %eax, %eax
je 0x2cdf
movq %rbx, %rdi
leaq 0x1674(%rip), %rsi      # 0x4224
callq 0x2140
testl %eax, %eax
je 0x2cec
movq %rbx, %rdi
leaq 0x1667(%rip), %rsi      # 0x422e
callq 0x2140
testl %eax, %eax
jne 0x33c6
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x2
jmp 0x2cf7
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x3
jmp 0x291a
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x38f7
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x34ea
movq %rax, (%rbx)
movb $0x1, 0x10(%rbx)
movabsq $0x600000010, %rax      # imm = 0x600000010
movq %rax, 0x8(%rbx)
jmp 0x28a7
leaq 0x3519(%rip), %rdi      # 0x6148
movq %rbx, %rsi
callq 0x396c
movl $0x0, 0x1c(%rsp)
jmp 0x28a7
xorl %eax, %eax
movq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
jmp 0x2cfc
leaq 0x34ed(%rip), %rdi      # 0x6148
movq %rbx, %rsi
callq 0x396c
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x18
popq %r13
jmp 0x28b0
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x4
jmp 0x2cf7
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x5
jmp 0x2cf7
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x3
jmp 0x2cf7
leaq 0x3565(%rip), %r14      # 0x6208
addq $0x4, %rbx
pushq $0x2c
popq %r15
testq %rbx, %rbx
je 0x2c63
movq %rbx, %rdi
movl %r15d, %esi
callq 0x20d0
movq %rax, %rbp
testq %rax, %rax
je 0x2cc7
movb $0x0, (%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x396c
leaq 0x1(%rbp), %rbx
testq %rbp, %rbp
cmoveq %rbp, %rbx
jmp 0x2cab
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x7
jmp 0x2cf7
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
pushq $0x1
popq %rax
pushq $0x18
popq %r13
pushq $-0x10
popq %r12
pushq $-0x8
popq %rbp
jmp 0x28bc
movq 0x20(%rsp), %rax
subq %rbp, %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
leaq 0x3422(%rip), %r13      # 0x6140
cmpq $0xf0, %rax
je 0x2d36
movq 0x10(%rax,%r13), %rcx
movq %rcx, 0x20(%rax,%r13)
addq $0x30, %rax
jmp 0x2d1e
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x3236
cmpq $0x0, 0x38(%rsp)
je 0x2d7c
movq 0x38(%rsp), %rcx
cmpb $0x2d, (%rcx)
jne 0x2d65
movq 0x38(%rsp), %rcx
cmpb $0x0, 0x1(%rcx)
je 0x31ce
cmpl $0x4, 0x1c(%rsp)
sete %cl
cmpq $0x19, %rax
setb %dl
orb %cl, %dl
je 0x33b1
pushq $0x1
popq %r14
movl %r14d, %ebp
movl 0x1c(%rsp), %ecx
shll %cl, %ebp
movq 0x50(%rsp), %r12
pushq $0x2
popq %rdx
shll %cl, %edx
decl %edx
movl %edx, 0x4c(%rsp)
leaq 0x70(%rsp), %r15
movq %r12, %rdx
movl %ebp, 0x48(%rsp)
leaq (%r12,%rax), %rcx
cmpq %rcx, %rdx
je 0x31ad
movl 0x8(%rdx), %ecx
testl %ebp, %ecx
movq %rdx, 0x8(%rsp)
je 0x3192
andl 0x4c(%rsp), %ecx
movl %ecx, 0x8(%rdx)
cmpl $0x6, 0xc(%rdx)
je 0x3192
testb $0x10, %cl
jne 0x2e0d
movq 0x38(%rsp), %rax
testq %rax, %rax
leaq 0x16a0(%rip), %r12      # 0x4487
je 0x2e70
cmpb $0x2d, (%rax)
jne 0x2eb9
movq 0x38(%rsp), %rcx
cmpb $0x0, 0x1(%rcx)
movl $0x0, %eax
cmovneq %rcx, %rax
jmp 0x2eb9
andl $-0x11, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x8(%rax)
leaq 0x163a(%rip), %rdi      # 0x4459
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
leaq 0x1656(%rip), %r12      # 0x4487
jne 0x2e41
leaq 0x156d(%rip), %rdi      # 0x43a7
xorl %eax, %eax
callq 0x37c3
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21a0
movl %eax, %ebx
testl %eax, %eax
jns 0x2e62
leaq 0x1610(%rip), %rdi      # 0x446b
xorl %eax, %eax
callq 0x37c3
movl %ebx, %edi
callq 0x2100
movq 0x20(%rsp), %rax
jmp 0x2eb9
testb $0x8, %cl
jne 0x2e83
testb $0x4, %cl
jne 0x2e94
testb $0x2, %cl
jne 0x2ea5
xorl %eax, %eax
jmp 0x2eb9
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x15ff(%rip), %rsi      # 0x4491
jmp 0x2eb4
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x15e2(%rip), %rsi      # 0x4485
jmp 0x2eb4
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x12d2(%rip), %rsi      # 0x4186
callq 0x3516
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
cmpb $0x2d, (%rax)
jne 0x2ed5
cmpb $0x0, 0x1(%rax)
jne 0x2ed5
andq $0x0, (%rcx)
xorl %ecx, %ecx
leaq 0x328a(%rip), %rdx      # 0x6168
pushq $-0x1
popq %rax
movl %eax, 0x44(%rsp)
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ebx
testl %ebx, %ebx
je 0x308e
movl %r14d, %eax
shll %cl, %eax
btl %ecx, %ebx
jae 0x3062
movq %rcx, (%rsp)
notl %eax
andl %eax, %ebx
leaq -0x20(%rdx), %r12
movq 0x8(%rsp), %rax
movl %ebx, 0x8(%rax)
movq (%rax), %r14
movq -0x8(%rdx), %rax
movq %rdx, 0x10(%rsp)
movq %rax, -0x18(%rdx)
cmpq $0x0, 0x20(%rsp)
je 0x2f51
testl %ebx, %ebx
jne 0x2f51
movq %r12, %rdi
leaq 0x1551(%rip), %rsi      # 0x4490
callq 0x396c
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0x396c
testq %r14, %r14
je 0x2f68
cmpl $-0x1, 0x44(%rsp)
jne 0x2f68
movq %r12, %rdi
movq %r14, %rsi
callq 0x396c
movq %r12, %rdi
xorl %esi, %esi
callq 0x396c
movq %r15, %rdi
callq 0x2030
testl %eax, %eax
jne 0x30a0
movl 0x44(%rsp), %esi
cmpl $-0x1, %esi
je 0x2f95
movq %r15, %rdi
xorl %edx, %edx
callq 0x2220
testl %ebx, %ebx
je 0x2ff8
leaq 0x30(%rsp), %rdi
callq 0x2110
testl %eax, %eax
js 0x3036
movl 0x30(%rsp), %edi
pushq $0x2
popq %r15
movl %r15d, %esi
pushq $0x1
popq %r14
movl %r14d, %edx
xorl %eax, %eax
callq 0x20a0
testl %eax, %eax
js 0x3015
movl 0x34(%rsp), %edi
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x20a0
testl %eax, %eax
js 0x3015
movl 0x34(%rsp), %esi
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movl %r14d, %edx
callq 0x2220
movl %eax, %r14d
testl %eax, %eax
jne 0x3022
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3623
testl %eax, %eax
je 0x306d
movl %eax, %r14d
testl %ebx, %ebx
jne 0x3022
jmp 0x303e
callq 0x2040
movl (%rax), %r14d
leaq 0x70(%rsp), %r15
movl 0x30(%rsp), %edi
callq 0x2100
movl 0x34(%rsp), %edi
callq 0x2100
jmp 0x303e
callq 0x2040
movl (%rax), %r14d
leaq 0x1442(%rip), %r12      # 0x4487
movq %r15, %rdi
callq 0x20b0
testl %r14d, %r14d
jne 0x30aa
incq %rbp
pushq $0x1
popq %r14
movq 0x10(%rsp), %rdx
movq (%rsp), %rcx
addq $0x30, %rdx
incl %ecx
jmp 0x2ee7
xorl %r14d, %r14d
testl %ebx, %ebx
leaq 0x140e(%rip), %r12      # 0x4487
je 0x3045
movl 0x30(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x34(%rsp), %edi
callq 0x2100
jmp 0x3045
movq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, (%rax)
movb $0x1, %r14b
jmp 0x30e8
movl %eax, %r14d
leaq 0x13dd(%rip), %r12      # 0x4487
movq 0x10(%rsp), %rax
movq -0x28(%rax), %rbx
movq -0x20(%rax), %rax
movq (%rax), %r15
movl %r14d, %edi
callq 0x2240
leaq 0x13ab(%rip), %rdi      # 0x4474
movq %rbx, %rsi
movq %r15, %rdx
leaq 0x70(%rsp), %r15
movq %rax, %rcx
xorl %eax, %eax
callq 0x36c8
movb $0x1, %r14b
movq 0x20(%rsp), %rcx
jmp 0x3141
subq $0x1, %rbp
jb 0x3176
movq %r15, %rdi
callq 0x2250
movl %eax, %ebx
testl %eax, %eax
jns 0x310a
movq %r12, %rdi
xorl %eax, %eax
callq 0x37c3
pushq $-0x30
popq %rcx
leaq 0x30(%rcx), %rax
cmpq $0xf0, %rax
je 0x30f2
cmpl 0x58(%rcx,%r13), %ebx
movq %rax, %rcx
jne 0x310d
andl $0x0, 0x28(%rax,%r13)
movq (%rax,%r13), %rdi
movl 0x70(%rsp), %edx
movl %ebx, %esi
callq 0x35a2
testb %al, %al
movq 0x20(%rsp), %rcx
jne 0x30e8
movl %r14d, %eax
xorl %r14d, %r14d
testb $0x1, %al
je 0x30e8
testq %rbp, %rbp
je 0x30e8
xorl %ebx, %ebx
pushq $0xf
popq %r14
cmpq $0xf0, %rbx
je 0x31a0
movl 0x28(%rbx,%r13), %edi
testl %edi, %edi
je 0x3170
movl %r14d, %esi
callq 0x2170
addq $0x30, %rbx
jmp 0x3156
testb $0x1, %r14b
je 0x321f
movq 0x50(%rsp), %r12
movq 0x58(%rsp), %rax
pushq $0x1
popq %r14
movl 0x48(%rsp), %ebp
movq 0x8(%rsp), %rdx
addq $0x18, %rdx
jmp 0x2da5
xorl %r14d, %r14d
movq 0x20(%rsp), %rcx
jmp 0x30e8
xorl %ecx, %ecx
cmpl $0x4, 0x1c(%rsp)
je 0x323a
movl %ecx, %eax
addq $0x1078, %rsp           # imm = 0x1078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, 0x1c(%rsp)
jb 0x2d7c
leaq 0x108b(%rip), %rdi      # 0x426b
jmp 0x3218
leaq 0xf38(%rip), %rdi       # 0x4121
leaq 0xea0(%rip), %rsi       # 0x4090
xorl %eax, %eax
callq 0x37c3
pushq $0x1
popq %rcx
jmp 0x31ba
leaq 0xe8d(%rip), %rdi       # 0x4090
callq 0x2080
xorl %ecx, %ecx
jmp 0x31ba
andl $0x0, 0xc(%r14)
leaq 0xf24(%rip), %rdi       # 0x413c
xorl %eax, %eax
callq 0x33fd
testq %rcx, %rcx
je 0x322e
movq 0x20(%rsp), %rdi
callq 0x2050
pushq $0x1
popq %rdi
callq 0x2210
xorl %edi, %edi
jmp 0x3218
movq 0x38(%rsp), %rcx
testq %rcx, %rcx
leaq 0x107c(%rip), %r14      # 0x42c5
cmovneq %rcx, %r14
xorl %edx, %edx
pushq $0x18
popq %rcx
divq %rcx
movq %rax, %rbx
leaq 0x2fa9(%rip), %r15      # 0x6208
leaq 0x122a(%rip), %rsi      # 0x4490
movq %r15, %rdi
callq 0x396c
movq %r15, %rdi
movq %r14, %rsi
callq 0x396c
cmpb $0x0, 0x2fb1(%rip)      # 0x6231
jne 0x3298
leaq 0x2f7f(%rip), %rdi      # 0x6208
leaq 0x2af0(%rip), %rsi      # 0x5d80
pushq $0x30
popq %rdx
callq 0x397d
leaq 0x10(%r12), %r13
leaq 0x2f64(%rip), %r14      # 0x6208
leaq 0xf23(%rip), %r15       # 0x41ce
movq %rbx, %rbp
subq $0x1, %rbp
jb 0x32d8
cmpb $0x1, (%r13)
jne 0x32c6
movq %r14, %rdi
movq %r15, %rsi
callq 0x396c
movq -0x10(%r13), %rsi
movq %r14, %rdi
callq 0x396c
addq $0x18, %r13
jmp 0x32ae
cmpb $0x0, 0x2f52(%rip)      # 0x6231
jne 0x32f7
leaq 0x2f20(%rip), %rdi      # 0x6208
leaq 0x2ac1(%rip), %rsi      # 0x5db0
pushq $0x30
popq %rdx
callq 0x397d
leaq 0x2f0a(%rip), %r14      # 0x6208
movq %r14, %rdi
xorl %esi, %esi
callq 0x396c
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3623
testl %eax, %eax
je 0x334f
movq 0x2ede(%rip), %r14      # 0x6200
movq 0x2edf(%rip), %rax      # 0x6208
movq (%rax), %r15
callq 0x2040
movl (%rax), %edi
callq 0x2240
leaq 0x1135(%rip), %rdi      # 0x4474
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x37c3
movl 0x30(%rsp), %edi
leaq 0x70(%rsp), %rsi
xorl %edx, %edx
callq 0x21e0
testl %eax, %eax
jns 0x338d
movslq 0x30(%rsp), %rsi
leaq 0x1183(%rip), %rdi      # 0x44f2
xorl %eax, %eax
callq 0x37c3
jmp 0x338d
cmpl $0x6, 0xc(%r12)
je 0x3389
movq (%r12), %rdi
callq 0x2050
addq $0x18, %r12
subq $0x1, %rbx
jae 0x3378
movq 0x2e66(%rip), %rdi      # 0x6200
movl 0x30(%rsp), %esi
movl 0x70(%rsp), %edx
callq 0x35a2
xorb $0x1, %al
movzbl %al, %edi
callq 0x2210
leaq 0xed1(%rip), %rdi       # 0x4289
jmp 0x3218
leaq 0xe93(%rip), %rdi       # 0x4257
jmp 0x33cd
leaq 0xe74(%rip), %rdi       # 0x4241
movq %rbx, %rsi
xorl %eax, %eax
callq 0x33fd