// File: /workspace/github_c_makefile_star2_O3/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, %r14
movl %edi, %r12d
movq %rsi, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq (%rsi), %rdi
leaq 0x1be5(%rip), %rsi      # 0x40c8
callq 0x3887
leaq 0x3d49(%rip), %rcx      # 0x6238
movq %rax, (%rcx)
leaq 0x3c4f(%rip), %rdi      # 0x6148
leaq 0x37c0(%rip), %rsi      # 0x5cc0
movl $0x78, %edx
callq 0x3934
movq (%r14), %r15
leaq 0x1df5(%rip), %rdi      # 0x4309
leaq 0x70(%rsp), %rsi
movl $0xffb, %ebx            # imm = 0xFFB
movl $0xffb, %edx            # imm = 0xFFB
callq 0x2090
cmpq $0xffb, %rax            # imm = 0xFFB
je 0x256c
movq %rax, %rbx
cmpq $-0x1, %rax
jne 0x257a
movq %r15, %rdi
callq 0x20c0
movq %rax, %rbx
cmpq $0xffc, %rax            # imm = 0xFFC
jb 0x255a
leaq 0x1dc5(%rip), %rdi      # 0x4318
xorl %eax, %eax
callq 0x3774
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2160
jmp 0x257a
leaq 0x1dba(%rip), %rdi      # 0x432d
xorl %eax, %eax
callq 0x3774
movb $0x0, 0x74(%rsp,%rbx)
movl $0x6562712d, 0x70(%rsp,%rbx) # imm = 0x6562712D
leaq 0x70(%rsp), %rdi
callq 0x2220
movq %rax, %rbx
testq %rax, %rax
jne 0x25a7
leaq 0x1db3(%rip), %rdi      # 0x4353
xorl %eax, %eax
callq 0x3774
leaq 0x3bca(%rip), %r15      # 0x6178
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3921
leaq 0x3be8(%rip), %rbx      # 0x61a8
leaq 0x3771(%rip), %rsi      # 0x5d38
movl $0x8, %edx
movq %rbx, %rdi
callq 0x3934
leaq 0x3bfd(%rip), %rdi      # 0x61d8
leaq 0x375e(%rip), %rsi      # 0x5d40
movl $0x8, %edx
callq 0x3934
leaq 0x3c15(%rip), %rdi      # 0x6208
leaq 0x3756(%rip), %rsi      # 0x5d50
movl $0x28, %edx
callq 0x3934
leaq 0x1ada(%rip), %r13      # 0x40e5
movq %r15, %rdi
movq %r13, %rsi
callq 0x3921
leaq 0x1ab1(%rip), %rsi      # 0x40ce
movq %r15, %rdi
callq 0x3921
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3921
leaq 0x1aa3(%rip), %rsi      # 0x40da
movq %rbx, %rdi
callq 0x3921
leaq 0x8(%r14), %rax
movq 0x8(%r14), %rbx
movq $0x0, 0x20(%rsp)
testq %rbx, %rbx
je 0x2dd3
movq %r12, 0x8(%rsp)
movl $0x4, 0x1c(%rsp)
xorl %r12d, %r12d
movq %r12, 0x10(%rsp)
movq 0x20(%rsp), %rcx
leal -0x1(%rcx), %r12d
xorl %r15d, %r15d
movq %r14, %rbp
movq %rax, %r14
cmpb $0x2d, (%rbx)
jne 0x2693
movsbl 0x1(%rbx), %r13d
testl %r13d, %r13d
jne 0x27df
movl $0x18, %esi
leaq 0x50(%rsp), %rdi
callq 0x38ac
movq %rax, %r13
movq %rbx, (%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rax
testl %eax, %eax
je 0x26d3
movl %eax, 0xc(%r13)
cmpl $0x7, %r12d
jae 0x32b6
leaq 0x19e2(%rip), %rax      # 0x40ac
movl (%rax,%r12,4), %eax
jmp 0x2795
cmpb $0x0, 0x1(%rbx)
je 0x32ae
movq %rbx, %rdi
movl $0x2e, %esi
callq 0x20e0
testq %rax, %rax
je 0x2788
movq %rax, %rbx
movq %rax, %rdi
incq %rdi
movzbl 0x1(%rax), %ebp
cmpl $0x69, %ebp
je 0x275d
cmpl $0x68, %ebp
je 0x2724
cmpl $0x63, %ebp
jne 0x272e
cmpb $0x0, 0x2(%rbx)
jne 0x272e
movl $0x3, 0xc(%r13)
movl $0x1f, %eax
jmp 0x2795
cmpb $0x0, 0x2(%rbx)
je 0x27b2
leaq 0x19fd(%rip), %rsi      # 0x4132
callq 0x2140
testl %eax, %eax
je 0x2773
cmpl $0x53, %ebp
je 0x2782
cmpl $0x73, %ebp
jne 0x2788
cmpb $0x0, 0x2(%rbx)
jne 0x2788
movl $0x1, 0xc(%r13)
movl $0x18, %eax
jmp 0x2795
cmpb $0x0, 0x2(%rbx)
je 0x27c1
leaq 0x19c8(%rip), %rsi      # 0x4132
callq 0x2140
testl %eax, %eax
jne 0x2788
movl $0x7, 0xc(%r13)
movl $0x1c, %eax
jmp 0x2795
cmpb $0x0, 0x2(%rbx)
je 0x27d0
movl $0x6, 0xc(%r13)
movl $0x10, %eax
movl %eax, 0x8(%r13)
leaq 0x8(%r14), %rax
movq 0x8(%r14), %rbx
incq %r15
testq %rbx, %rbx
jne 0x267a
jmp 0x2dcc
movl $0x4, 0xc(%r13)
movl $0x1, %eax
jmp 0x2795
movl $0x5, 0xc(%r13)
movl $0x1e, %eax
jmp 0x2795
movl $0x2, 0xc(%r13)
movl $0x19, %eax
jmp 0x2795
movq %r14, 0x28(%rsp)
movq %rbx, %rdi
leaq 0x1922(%rip), %rsi      # 0x4110
callq 0x2140
movq 0x8(%rsp), %rcx
leal -0x1(%rcx), %r14d
subq %r15, %r14
testl %eax, %eax
je 0x298b
movq %rbx, %rdi
leaq 0x1909(%rip), %rsi      # 0x411a
callq 0x2140
testl %eax, %eax
movq 0x10(%rsp), %r12
je 0x299e
movq %rbx, %rdi
leaq 0x18f7(%rip), %rsi      # 0x4124
callq 0x2140
testl %eax, %eax
je 0x29a7
movq %rbx, %rdi
leaq 0x18e8(%rip), %rsi      # 0x412c
callq 0x2140
testl %eax, %eax
je 0x2a18
movq %rbx, %rdi
leaq 0x18db(%rip), %rsi      # 0x4136
callq 0x2140
testl %eax, %eax
je 0x29bd
movq %rbx, %rdi
leaq 0x18cd(%rip), %rsi      # 0x413f
callq 0x2140
testl %eax, %eax
je 0x29bd
movq %rbx, %rdi
leaq 0x18c1(%rip), %rsi      # 0x414a
callq 0x2140
testl %eax, %eax
je 0x29bd
movq %rbx, %rdi
leaq 0x18b3(%rip), %rsi      # 0x4153
callq 0x2140
testl %eax, %eax
je 0x29bd
movq %rbx, %rdi
leaq 0x18a4(%rip), %rsi      # 0x415b
callq 0x2140
testl %eax, %eax
je 0x29b6
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x188e(%rip), %rsi      # 0x4161
callq 0x2060
testl %eax, %eax
je 0x299e
movq %rbx, %rdi
leaq 0x187d(%rip), %rsi      # 0x4167
callq 0x2140
testl %eax, %eax
je 0x29b6
movq %rbx, %rdi
leaq 0x1870(%rip), %rsi      # 0x4171
callq 0x2140
testl %eax, %eax
je 0x2a22
movq %rbx, %rdi
leaq 0x1865(%rip), %rsi      # 0x417d
callq 0x2140
testl %eax, %eax
je 0x3284
movzbl 0x2(%rbx), %r12d
testl %r12d, %r12d
je 0x294c
movl $0x6, %edx
leaq 0x184f(%rip), %rdi      # 0x418a
movl %r13d, %esi
callq 0x2130
testq %rax, %rax
jne 0x345c
movzbl 0x1(%rbx), %eax
cmpl $0x66, %eax
jg 0x2a47
leal -0x44(%rax), %ecx
cmpl $0x13, %ecx
ja 0x2b8d
leaq 0x16a4(%rip), %rdx      # 0x4010
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x37cc(%rip), %rbx      # 0x6148
movq %rbx, %rdi
leaq 0x180a(%rip), %rsi      # 0x4190
jmp 0x2cb3
movb $0x1, 0x389f(%rip)      # 0x6231
movq %r14, 0x8(%rsp)
movq 0x10(%rsp), %r12
jmp 0x29fd
leaq 0x37a3(%rip), %rdi      # 0x6148
jmp 0x29ae
leaq 0x385a(%rip), %rdi      # 0x6208
movq %rbx, %rsi
callq 0x3921
movq %r14, 0x8(%rsp)
jmp 0x29fd
movq 0x8(%rsp), %rax
addl $-0x2, %eax
cmpl %r15d, %eax
je 0x3457
subq %r15, %rax
movq %rax, 0x8(%rsp)
leaq 0x376b(%rip), %r14      # 0x6148
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3921
leaq 0x10(%rbp), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rbp), %rsi
movq %r14, %rdi
callq 0x3921
movq 0x28(%rsp), %r14
leaq 0x8(%r14), %rax
movq 0x8(%r14), %rbx
testq %rbx, %rbx
jne 0x2669
jmp 0x2dde
movl $0x1, 0x1c(%rsp)
jmp 0x29b6
leaq 0x37df(%rip), %rbx      # 0x6208
movq %rbx, %rdi
leaq 0x1747(%rip), %rsi      # 0x417a
callq 0x3921
movq %rbx, %rdi
leaq 0x1730(%rip), %rsi      # 0x4172
jmp 0x29b1
leal -0x6f(%rax), %ecx
cmpl $0x9, %ecx
ja 0x2a71
leaq 0x160a(%rip), %rdx      # 0x4060
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x28(%rsp), %rdi
callq 0x356e
movq %rax, %r12
jmp 0x29b6
cmpl $0x6c, %eax
je 0x2b57
cmpl $0x67, %eax
je 0x2992
jmp 0x346c
leaq 0x3779(%rip), %rdi      # 0x6208
leaq 0x171b(%rip), %rsi      # 0x41b1
jmp 0x2cc8
movb $0x1, 0x3790(%rip)      # 0x6232
jmp 0x2992
leaq 0x28(%rsp), %rdi
callq 0x356e
movq %rax, %rbx
movq %rax, %rdi
leaq 0x16f9(%rip), %rsi      # 0x41b7
callq 0x2140
testl %eax, %eax
je 0x2d34
cmpb $0x63, (%rbx)
jne 0x2ada
cmpb $0x0, 0x1(%rbx)
je 0x2d59
movq %rbx, %rdi
leaq 0x16d8(%rip), %rsi      # 0x41bc
callq 0x2140
testl %eax, %eax
je 0x2d42
movq %rbx, %rdi
leaq 0x16ca(%rip), %rsi      # 0x41c5
callq 0x2140
testl %eax, %eax
je 0x2d52
movq %rbx, %rdi
leaq 0x1620(%rip), %rsi      # 0x4132
callq 0x2140
testl %eax, %eax
je 0x2db6
movq %rbx, %rdi
leaq 0x16a7(%rip), %rsi      # 0x41d0
callq 0x2140
testl %eax, %eax
je 0x2dbd
movq %rbx, %rdi
leaq 0x169a(%rip), %rsi      # 0x41da
callq 0x2140
testl %eax, %eax
jne 0x3463
movl $0x2, %eax
jmp 0x2dc2
movl $0x18, %esi
leaq 0x50(%rsp), %rdi
callq 0x38ac
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x356e
movq %rax, (%rbx)
movb $0x1, 0x10(%rbx)
movabsq $0x600000010, %rax      # imm = 0x600000010
movq %rax, 0x8(%rbx)
jmp 0x2992
cmpl $0x63, %eax
jne 0x346c
movl $0x3, 0x1c(%rsp)
jmp 0x2992
leaq 0x359e(%rip), %rbx      # 0x6148
movq %rbx, %rdi
leaq 0x15df(%rip), %rsi      # 0x4193
jmp 0x2cb3
leaq 0x3648(%rip), %rbx      # 0x6208
movq %rbx, %rdi
leaq 0x15cc(%rip), %rsi      # 0x4196
jmp 0x2cb3
movb (%rbx), %al
xorb $0x2d, %al
orb %r12b, %al
je 0x2d18
movq %rbx, %rdi
leaq 0x15b3(%rip), %rsi      # 0x4199
callq 0x2140
testl %eax, %eax
je 0x2d18
movq %rbx, %rdi
leaq 0x15a0(%rip), %rsi      # 0x419d
callq 0x2140
testl %eax, %eax
je 0x2d49
movq %rbx, %rdi
leaq 0x158d(%rip), %rsi      # 0x41a1
callq 0x2140
testl %eax, %eax
je 0x2d49
movq %rbx, %rdi
leaq 0x157b(%rip), %rsi      # 0x41a6
callq 0x2140
testl %eax, %eax
je 0x2c4b
movq %rbx, %rdi
leaq 0x156c(%rip), %rsi      # 0x41aa
callq 0x2140
testl %eax, %eax
jne 0x345c
movq 0x8(%rsp), %rax
addl $-0x2, %eax
movq %rax, 0x8(%rsp)
cmpl %r15d, %eax
je 0x345c
subq %r15, 0x8(%rsp)
leaq 0x34db(%rip), %r14      # 0x6148
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3921
leaq 0x10(%rbp), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rbp), %rsi
movq %r14, %rdi
callq 0x3921
jmp 0x2997
leaq 0x34af(%rip), %rdi      # 0x6148
leaq 0x150e(%rip), %rsi      # 0x41ae
jmp 0x2cc8
leaq 0x349f(%rip), %rbx      # 0x6148
movq %rbx, %rdi
leaq 0x1501(%rip), %rsi      # 0x41b4
callq 0x3921
leaq 0x28(%rsp), %rdi
callq 0x356e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3921
jmp 0x2992
testl %r12d, %r12d
je 0x2992
cmpb $0x2c, 0x3(%rbx)
jne 0x2992
leaq 0x345c(%rip), %r15      # 0x6148
cmpl $0x70, %r12d
je 0x2d67
cmpl $0x6c, %r12d
je 0x2d60
cmpl $0x61, %r12d
jne 0x345c
leaq 0x34cf(%rip), %r15      # 0x61d8
jmp 0x2d67
movl $0x2, 0x1c(%rsp)
jmp 0x2992
leaq 0x3429(%rip), %rdi      # 0x6148
movq %rbx, %rsi
callq 0x3921
movl $0x0, 0x1c(%rsp)
jmp 0x2992
movq $0x0, 0x20(%rsp)
jmp 0x2992
movl $0x4, %eax
jmp 0x2dc2
leaq 0x33f8(%rip), %rdi      # 0x6148
jmp 0x2dae
movl $0x5, %eax
jmp 0x2dc2
movl $0x3, %eax
jmp 0x2dc2
leaq 0x34a1(%rip), %r15      # 0x6208
addq $0x4, %rbx
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x20d0
testq %rax, %rax
je 0x2dab
movq %rax, %r13
movb $0x0, (%r13)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3921
movq %r13, %rbx
incq %rbx
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x20d0
movq %rax, %r13
testq %rax, %rax
jne 0x2d80
movq %r15, %rdi
movq %rbx, %rsi
jmp 0x2cc8
movl $0x7, %eax
jmp 0x2dc2
movl $0x1, %eax
movq %rax, 0x20(%rsp)
jmp 0x2992
movq 0x10(%rsp), %r12
jmp 0x2dde
movl $0x4, 0x1c(%rsp)
xorl %r12d, %r12d
movq %rax, 0x28(%rsp)
xorl %eax, %eax
leaq 0x3354(%rip), %r13      # 0x6140
movq 0x10(%rax,%r13), %rcx
movq %rcx, 0x20(%rax,%r13)
addq $0x30, %rax
cmpq $0xf0, %rax
jne 0x2dec
movq 0x58(%rsp), %r14
testq %r14, %r14
je 0x32c4
testq %r12, %r12
je 0x2e3f
cmpb $0x2d, (%r12)
jne 0x2e28
cmpb $0x0, 0x1(%r12)
je 0x3270
cmpl $0x4, 0x1c(%rsp)
sete %al
cmpq $0x19, %r14
setb %cl
orb %al, %cl
je 0x344b
movl $0x1, %eax
movl 0x1c(%rsp), %ecx
shll %cl, %eax
movl %eax, 0x4c(%rsp)
movl $0x2, %eax
shll %cl, %eax
movq 0x50(%rsp), %rbp
decl %eax
movl %eax, 0x48(%rsp)
leaq 0x70(%rsp), %r15
movq %rbp, %rcx
movq %r12, 0x10(%rsp)
movl 0x8(%rcx), %eax
testl %eax, 0x4c(%rsp)
movq %rcx, 0x8(%rsp)
je 0x323f
andl 0x48(%rsp), %eax
movl %eax, 0x8(%rcx)
cmpl $0x6, 0xc(%rcx)
je 0x323f
testb $0x10, %al
jne 0x2ec0
testq %r12, %r12
movq 0x8(%rsp), %r14
je 0x2f13
cmpb $0x2d, (%r12)
movq %r12, %rbp
jne 0x2f4d
cmpb $0x0, 0x1(%r12)
movl $0x0, %ebp
cmovneq %r12, %rbp
jmp 0x2f4d
andl $-0x11, %eax
movq 0x8(%rsp), %r14
movl %eax, 0x8(%r14)
leaq 0x1532(%rip), %rdi      # 0x4405
callq 0x2220
movq %rax, %rbp
testq %rax, %rax
jne 0x2eee
leaq 0x146c(%rip), %rdi      # 0x4353
xorl %eax, %eax
callq 0x3774
movq %rbp, %rdi
callq 0x2190
movl %eax, %ebx
testl %eax, %eax
jns 0x2f0a
leaq 0x1514(%rip), %rdi      # 0x4417
xorl %eax, %eax
callq 0x3774
movl %ebx, %edi
callq 0x2100
jmp 0x2f4d
testb $0x8, %al
jne 0x2f23
testb $0x4, %al
jne 0x2f2f
testb $0x2, %al
jne 0x2f3b
xorl %ebp, %ebp
jmp 0x2f4d
movq (%r14), %rdi
leaq 0x1510(%rip), %rsi      # 0x443d
jmp 0x2f45
movq (%r14), %rdi
leaq 0x14f8(%rip), %rsi      # 0x4431
jmp 0x2f45
movq (%r14), %rdi
leaq 0x11ed(%rip), %rsi      # 0x4132
callq 0x3596
movq %rax, %rbp
movq (%r14), %rax
cmpb $0x2d, (%rax)
jne 0x2f62
cmpb $0x0, 0x1(%rax)
jne 0x2f62
movq $0x0, (%r14)
movq %rbp, 0x40(%rsp)
movl 0x8(%r14), %r14d
testl %r14d, %r14d
je 0x3148
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
xorl %r12d, %r12d
leaq 0x31e2(%rip), %rbx      # 0x6168
xorl %ebp, %ebp
movl $0x1, %eax
movl %r12d, %ecx
shll %cl, %eax
btl %r12d, %r14d
jae 0x311b
notl %eax
andl %eax, %r14d
leaq -0x20(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rax
movl %r14d, 0x8(%rax)
movq (%rax), %rsi
movq -0x8(%rbx), %rax
movq %rax, -0x18(%rbx)
cmpq $0x0, 0x40(%rsp)
je 0x2ff6
testl %r14d, %r14d
jne 0x2ff6
movq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rsi, 0x68(%rsp)
leaq 0x145d(%rip), %rsi      # 0x443c
callq 0x3921
movq %r15, %rdi
movq 0x40(%rsp), %rsi
callq 0x3921
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x300c
cmpl $-0x1, 0x3c(%rsp)
jne 0x300c
movq 0x20(%rsp), %rdi
callq 0x3921
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x3921
leaq 0x70(%rsp), %rdi
callq 0x2030
testl %eax, %eax
jne 0x3161
movl 0x3c(%rsp), %esi
cmpl $-0x1, %esi
leaq 0x70(%rsp), %r15
je 0x3042
movq %r15, %rdi
xorl %edx, %edx
callq 0x2210
testl %r14d, %r14d
je 0x30bc
leaq 0x34(%rsp), %rdi
callq 0x2110
testl %eax, %eax
js 0x30f5
movl 0x34(%rsp), %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x20a0
testl %eax, %eax
js 0x30d4
movl 0x38(%rsp), %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x20a0
testl %eax, %eax
js 0x30d4
movl 0x38(%rsp), %esi
movq %r15, %rdi
movl $0x1, %edx
callq 0x2210
testl %eax, %eax
jne 0x30b7
movq %r15, %r14
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0x36a7
testl %eax, %eax
je 0x312d
movl %eax, %r15d
jmp 0x30dc
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0x36a7
movq %r15, %rdi
movl %eax, %r15d
jmp 0x3100
callq 0x2040
movl (%rax), %r15d
movl 0x34(%rsp), %edi
callq 0x2100
movl 0x38(%rsp), %edi
callq 0x2100
leaq 0x70(%rsp), %rdi
jmp 0x3100
callq 0x2040
movq %r15, %rdi
movl (%rax), %r15d
callq 0x20b0
testl %r15d, %r15d
jne 0x3164
incq %rbp
movq 0x8(%rsp), %rax
movl 0x8(%rax), %r14d
leaq 0x70(%rsp), %r15
addq $0x30, %rbx
incl %r12d
testl %r14d, %r14d
jne 0x2f88
jmp 0x314a
movl 0x34(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl 0x38(%rsp), %edi
callq 0x2100
movq %r14, %rdi
callq 0x20b0
jmp 0x310a
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, (%rax)
movb $0x1, %r14b
movq 0x10(%rsp), %r12
jmp 0x319d
movl %eax, %r15d
movq -0x28(%rbx), %r14
movq -0x20(%rbx), %rax
movq (%rax), %rbx
movl %r15d, %edi
callq 0x2230
leaq 0x12a2(%rip), %rdi      # 0x4420
movq %r14, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x36ec
movb $0x1, %r14b
movq 0x10(%rsp), %r12
leaq 0x70(%rsp), %r15
jmp 0x31f6
subq $0x1, %rbp
jb 0x322f
movq %r15, %rdi
callq 0x2240
movl %eax, %ebx
testl %eax, %eax
jns 0x31c3
leaq 0x1277(%rip), %rdi      # 0x4433
xorl %eax, %eax
callq 0x3774
xorl %eax, %eax
cmpl 0x28(%rax,%r13), %ebx
je 0x31da
addq $0x30, %rax
cmpq $0xf0, %rax
jne 0x31c5
jmp 0x31a7
movl $0x0, 0x28(%rax,%r13)
movq (%rax,%r13), %rdi
movl 0x70(%rsp), %edx
movl %ebx, %esi
callq 0x3626
testb %al, %al
jne 0x319d
movl %r14d, %eax
xorl %r14d, %r14d
testb $0x1, %al
je 0x319d
testq %rbp, %rbp
je 0x319d
xorl %ebx, %ebx
movl 0x28(%rbx,%r13), %edi
testl %edi, %edi
je 0x321a
movl $0xf, %esi
callq 0x2170
addq $0x30, %rbx
xorl %r14d, %r14d
cmpq $0xf0, %rbx
jne 0x3207
jmp 0x319d
testb $0x1, %r14b
je 0x3292
movq 0x50(%rsp), %rbp
movq 0x58(%rsp), %r14
movq 0x8(%rsp), %rcx
addq $0x18, %rcx
leaq (%r14,%rbp), %rax
cmpq %rax, %rcx
jne 0x2e6d
cmpl $0x4, 0x1c(%rsp)
je 0x32c9
xorl %eax, %eax
addq $0x1078, %rsp           # imm = 0x1078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, 0x1c(%rsp)
jb 0x2e3f
leaq 0xf95(%rip), %rdi       # 0x4217
jmp 0x32bd
leaq 0xe05(%rip), %rdi       # 0x4090
callq 0x2080
jmp 0x325c
cmpq $0x0, 0x40(%rsp)
je 0x32a4
movq 0x40(%rsp), %rdi
callq 0x2050
movl $0x1, %edi
callq 0x2200
movl $0x0, 0xc(%r13)
leaq 0xe2b(%rip), %rdi       # 0x40e8
xorl %eax, %eax
callq 0x347d
callq 0x228b
testq %r12, %r12
leaq 0xf9e(%rip), %r15       # 0x4271
cmovneq %r12, %r15
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
movq %r14, %rax
mulq %rcx
movq %rdx, %r12
leaq 0x2f17(%rip), %rbx      # 0x6208
leaq 0x1144(%rip), %rsi      # 0x443c
movq %rbx, %rdi
callq 0x3921
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3921
cmpb $0x0, 0x2f1f(%rip)      # 0x6231
jne 0x332c
leaq 0x2eed(%rip), %rdi      # 0x6208
leaq 0x2a5e(%rip), %rsi      # 0x5d80
movl $0x30, %edx
callq 0x3934
shrq $0x4, %r12
cmpq $0x18, %r14
jb 0x336f
leaq 0x10(%rbp), %r13
leaq 0x2ec7(%rip), %r15      # 0x6208
movq %r12, %rbx
cmpb $0x1, (%r13)
jne 0x335a
movq %r15, %rdi
leaq 0xe25(%rip), %rsi       # 0x417a
callq 0x3921
movq -0x10(%r13), %rsi
movq %r15, %rdi
callq 0x3921
addq $0x18, %r13
decq %rbx
jne 0x3344
cmpb $0x0, 0x2ebb(%rip)      # 0x6231
jne 0x3390
leaq 0x2e89(%rip), %rdi      # 0x6208
leaq 0x2a2a(%rip), %rsi      # 0x5db0
movl $0x30, %edx
callq 0x3934
leaq 0x2e71(%rip), %r15      # 0x6208
movq %r15, %rdi
xorl %esi, %esi
callq 0x3921
leaq 0x34(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x36a7
testl %eax, %eax
je 0x33e8
movq 0x2e45(%rip), %r15      # 0x6200
movq 0x2e46(%rip), %rax      # 0x6208
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x2230
leaq 0x1048(%rip), %rdi      # 0x4420
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3774
movl 0x34(%rsp), %edi
leaq 0x70(%rsp), %rsi
xorl %edx, %edx
callq 0x21d0
testl %eax, %eax
jns 0x340f
movslq 0x34(%rsp), %rsi
leaq 0x1096(%rip), %rdi      # 0x449e
xorl %eax, %eax
callq 0x3774
cmpq $0x18, %r14
jb 0x342d
cmpl $0x6, 0xc(%rbp)
je 0x3424
movq (%rbp), %rdi
callq 0x2050
addq $0x18, %rbp
decq %r12
jne 0x3415
movq 0x2dcc(%rip), %rdi      # 0x6200
movl 0x34(%rsp), %esi
movl 0x70(%rsp), %edx
callq 0x3626
xorb $0x1, %al
movzbl %al, %edi
callq 0x2200
leaq 0xde3(%rip), %rdi       # 0x4235
jmp 0x32bd
callq 0x2260
xorl %edi, %edi
jmp 0x32bd
leaq 0xd83(%rip), %rdi       # 0x41ed
jmp 0x3473
leaq 0xd90(%rip), %rdi       # 0x4203
movq %rbx, %rsi
xorl %eax, %eax
callq 0x347d