// File: /workspace/github_cpp_makefile_star2_O2/rofl0r[P]ascc/main.cpp
// Function: main
int main(int argc, char** argv) {
	char exepath[1024];
	int c;
	int only_preprocess = 0;
	int disas_flag = 0;
	char oname_buf[2048], *oname = oname_buf;
	char *headers = 0;
	char *cppcmd = 0;
	const char *req_api = "350";
	char *systemhdr_dir = NULL;
	int abi = 350;

	set_compiler_default_options();

	while((c = getopt(argc, argv, "gWESD:A:a:f:i:H:o:P:")) != EOF) switch(c) {
		case 'a': abi = atoi(optarg); break;
		case 'A': req_api = optarg; break;
		case 'i': systemhdr_dir = optarg; break;
		case 'f': process_compiler_option(optarg); break;
		case 'o': oname = optarg; break;
		case 'H': headers = optarg; break;
		case 'P': cppcmd = optarg; break;
		case 'D': parse_macro(optarg); break;
		case 'E': only_preprocess = 1; break;
		case 'W': ccPrintAllErrors = 1; break;
		case 'S': disas_flag = 1; break;
		case 'g':
			add_macro("DEBUG", "1");
			ccSetOption(SCOPT_LINENUMBERS, 1);
			ccSetOption(SCOPT_CHECKBOUNDS, 1);
			break;
		default: return usage(argv[0]);
	}
	if(!argv[optind]) return usage(argv[0]);
	if(optind +1 != argc) {
		fprintf(stderr, "error: only one filename can be passed.\n"
				"arguments after first filename:\n");
		for(c=optind+1;c<argc;c++)
			fprintf(stderr, "%s\n", argv[c]);
		return usage(argv[0]);
	}
	char *filename = argv[optind];

	add_macro("__ASCC__", "3");
	add_macro("__ASCC_MINOR__", "5");

	// Editor/AGS.Editor/AGSEditor.cs
	add_macro("AGS_SUPPORTS_IFVER", "1");

	// FIXME: these should all be toggled by options
	//add_macro("STRICT", "1");
	add_macro("LRPRECEDENCE", "1");
	//add_macro("STRICT_STRINGS", "1");
	//add_macro("STRICT_AUDIO", "1");
	add_macro("NEW_DIALOGOPTS_API", "1");

        // Don't allow them to override imports in the room script
	// FIXME needs better check for whether it's a roomfile
        ccSetOption(SCOPT_NOIMPORTOVERRIDE, !!strstr(filename, "room") );

	if(abi < 271) {
		cc_set_max_command(SCMD_SHIFTRIGHT);
		ccSetOption(SCOPT_CHECKBOUNDS, 0);
		//ccSetOption(SCOPT_EXPLICITRET, 0);
	} else {
		add_macro("AGS_NEW_STRINGS", "1");
	}

	unsigned i;
	{
		int enable_api = 0;
		char abuf[16];
		snprintf(abuf, sizeof abuf, "%s000", req_api);
		add_macro("SCRIPT_API", abuf);
		for(i=0;apiv[i];++i) {
			char buf[64];
			// enable only requested and lower APIs
			if(!enable_api) {
				if(!strcmp(req_api, apiv[i]))
					enable_api = 1;
			} else
			// do not activate 3.x APIs for 2.x and vice versa
				if(req_api[0] != apiv[i][0])
					enable_api = 0;

			if(enable_api) {
				sprintf(buf, "SCRIPT_API_v%s", apiv[i]);
				add_macro(buf, "1");
				sprintf(buf, "SCRIPT_COMPAT_v%s", apiv[i]);
				add_macro(buf, "1");
			}
		}
	}

	FILE *f;
	char filename_wo_ext[2048];
	char *p = filename, *e = strrchr(filename, '.');
	char *q = filename_wo_ext;
	if(!e) return usage(argv[0]);
	while(p < e) *(q++) = *(p++);
	*q = 0;
	q = getbasename(filename_wo_ext);

	if(!opt_freestanding) {
		snprintf(oname_buf, sizeof oname_buf, "%s/agsdefns.sh", systemhdr_dir?systemhdr_dir:"systemhdrs");
		f = fopen(oname_buf, "r");
		if(!f && !systemhdr_dir && search_executable_dir(argv[0], exepath, sizeof exepath)) {
			snprintf(oname_buf, sizeof oname_buf, "%s/%s/agsdefns.sh", exepath, "systemhdrs");
			f = fopen(oname_buf, "r");
		}
		if(!f) fprintf(stderr, "warning: default header agsdefns.sh not found, you may want to set -i to the dir containing it!\n");
		else preproc_add(f, "_BuiltInScriptHeader.ash", !!cppcmd);
	}
	if(headers && !load_headers(headers, !!cppcmd)) return 1;

	if(oname == oname_buf) {
		if(only_preprocess)
			sprintf(oname, "%s.i", filename_wo_ext);
		else if(disas_flag)
			sprintf(oname, "%s.s", filename_wo_ext);
		else
			sprintf(oname, "%s.o", filename_wo_ext);
	}

	f = fopen(filename, "r");
	if(!f) {
		fprintf(stderr, "error opening %s\n", filename);
		return 1;
	}
	char *mem = slurp_file(f);
	if(only_preprocess) {
		char *outp;
		if(cppcmd) {
			outp = run_cpp(cppcmd, mem);
			if(!outp) return 1;
		} else {
			// FIXME, buf may be to small for elab. macro expansions
			outp = (char*)malloc(strlen(mem)*2+5000);
			cc_preprocess(mem, outp);
		}
		f = fopen(oname, "w");
		if(!f) {
			fprintf(stderr, "error opening %s\n", oname);
			return 1;
		}
		fwrite(outp, 1, strlen(outp), f);
		fclose(f);
		return ccError != 0;
	} else if(cppcmd) {
		char *outp = run_cpp(cppcmd, mem);
		if(!outp) return 1;
		free(mem);
		mem = outp;
	}
	ccScript* obj = ccCompileText(mem, q);
	if(!obj || (ccError != 0)) {
		std::cerr << ccErrorString;
		std::cerr << std::endl;
		return 1;
		//std::cout << ccErrorLine;
	} else {
		char *fn;
		if(disas_flag) fn = tempfile();
		else fn = strdup(oname);
		FileWriteStream fout;
		if(!fout.Open(fn)) {
			fprintf(stderr, "error opening %s\n", fn);
			return 1;
		}
		obj->Write(&fout);
		fout.Close();
		if(disas_flag) {
			char cmd[2048 + 64], *out_tmp = tempfile();
			sprintf(cmd, "agsdisas %s %s", fn, out_tmp);
			int status = system(cmd);
			if(status == -1 || !WIFEXITED(status)) {
				fprintf(stderr, "agsdisas failed! : ");
				perror("");
				return 1;
			}
			if(rename(out_tmp, oname) == -1) {
				perror("rename");
				return 1;
			}
			unlink(fn);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2458, %rsp           # imm = 0x2458
movq %rsi, %r13
movl %edi, %ebx
leaq 0x149f2(%rip), %rdi     # 0x18234
callq 0x14ec5
pushq $0x4
popq %rdi
movq $0x0, 0x20(%rsp)
xorl %esi, %esi
callq 0x127c4
pushq $0x1
popq %rbp
movl %ebp, %edi
movl %ebp, %esi
callq 0x127c4
pushq $0x20
popq %rdi
xorl %esi, %esi
callq 0x127c4
pushq $0x40
popq %rdi
movl %ebp, %esi
callq 0x127c4
movl $0x80, %edi
movl %ebp, %esi
callq 0x127c4
leaq 0xc50(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x15e, 0x18(%rsp)      # imm = 0x15E
leaq 0x147b4(%rip), %rax     # 0x18056
movq %rax, 0x10(%rsp)
leaq 0x1794a(%rip), %r15     # 0x1b1f8
movq $0x0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0xc(%rsp)
xorl %ecx, %ecx
movq %r13, 0x28(%rsp)
movl %ecx, %r12d
movl %ebx, %edi
movq %r13, %rsi
leaq 0x1477c(%rip), %rdx     # 0x1805a
callq 0x30e0
leal -0x41(%rax), %ecx
cmpl $0x7, %ecx
jbe 0x392f
leal -0x66(%rax), %ecx
cmpl $0x9, %ecx
jbe 0x3958
cmpl $0x50, %eax
je 0x3a70
cmpl $0x53, %eax
je 0x3a9c
cmpl $0x57, %eax
je 0x3a87
cmpl $0x61, %eax
jne 0x3b19
movq 0x2168a(%rip), %rax     # 0x24fa8
movq (%rax), %rdi
callq 0x34c0
movl %eax, 0x18(%rsp)
movl %r12d, %ecx
jmp 0x38cf
leaq 0x146ce(%rip), %rdx     # 0x18004
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
movl %ebp, %ecx
jmpq *%rax
movq 0x21660(%rip), %rax     # 0x24fa8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movl %r12d, %ecx
jmp 0x38cf
leaq 0x146c5(%rip), %rdx     # 0x18024
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl %ebp, %r13d
movq 0x21636(%rip), %rax     # 0x24fa8
movq (%rax), %r14
movq %r14, %rdi
pushq $0x3d
popq %rsi
callq 0x3170
testq %rax, %rax
je 0x3ac1
movq %rax, %rbp
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x12738
testl %eax, %eax
je 0x3ae1
movl %eax, %r15d
incq %rbp
movq %rbp, %rdi
callq 0x34c0
movl %r15d, %edi
movl %eax, %esi
callq 0x127c4
movl %r12d, %ecx
leaq 0x17837(%rip), %r15     # 0x1b1f8
movl %r13d, %ebp
movq 0x28(%rsp), %r13
jmp 0x38cf
movq 0x215d3(%rip), %rax     # 0x24fa8
movq (%rax), %r14
movq %r14, %rdi
pushq $0x3d
popq %rsi
callq 0x3170
testq %rax, %rax
je 0x3aa8
movq %rax, %rsi
incq %rsi
movb $0x0, (%rax)
jmp 0x3aaa
movq 0x215a7(%rip), %rax     # 0x24fa8
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movl %r12d, %ecx
jmp 0x38cf
movq 0x21590(%rip), %rax     # 0x24fa8
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movl %r12d, %ecx
jmp 0x38cf
leaq 0x14640(%rip), %rdi     # 0x1806f
leaq 0x16676(%rip), %rsi     # 0x1a0ac
callq 0x42bd
pushq $0x4
popq %rdi
movl %ebp, %esi
callq 0x127c4
movl $0x100, %edi            # imm = 0x100
movl %ebp, %esi
callq 0x127c4
movl %r12d, %ecx
jmp 0x38cf
movq 0x21548(%rip), %rax     # 0x24fa8
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl %r12d, %ecx
jmp 0x38cf
movq 0x21531(%rip), %rax     # 0x24fa8
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movl %r12d, %ecx
jmp 0x38cf
leaq 0x21c3e(%rip), %rax     # 0x256cc
movl $0x1, (%rax)
movl %r12d, %ecx
jmp 0x38cf
movl %ebp, 0xc(%rsp)
movl %r12d, %ecx
jmp 0x38cf
xorl %esi, %esi
testq %rsi, %rsi
cmoveq %r15, %rsi
movq %r14, %rdi
callq 0x42bd
movl %r12d, %ecx
jmp 0x38cf
movq %r14, %rdi
callq 0x45e0
movl %r12d, %ecx
testl %eax, %eax
movl %r13d, %ebp
movq 0x28(%rsp), %r13
jne 0x38cf
jmp 0x429a
movq %r14, %rdi
callq 0x45e0
movl %r12d, %ecx
testl %eax, %eax
leaq 0x17703(%rip), %r15     # 0x1b1f8
movl %r13d, %ebp
movq 0x28(%rsp), %r13
jne 0x38cf
movq 0x214b6(%rip), %rax     # 0x24fc0
movq (%rax), %rdi
leaq 0x1474d(%rip), %rsi     # 0x18261
jmp 0x42ab
cmpl $-0x1, %eax
jne 0x4120
movq 0x2149f(%rip), %r15     # 0x24fc8
movslq (%r15), %rax
movq (%r13,%rax,8), %r14
testq %r14, %r14
je 0x4120
incl %eax
cmpl %ebx, %eax
jne 0x40d8
leaq 0x14573(%rip), %rdi     # 0x180be
leaq 0x14575(%rip), %rsi     # 0x180c7
callq 0x42bd
leaq 0x1456b(%rip), %rdi     # 0x180c9
leaq 0x14c5b(%rip), %rsi     # 0x187c0
callq 0x42bd
leaq 0x14567(%rip), %rdi     # 0x180d8
leaq 0x16534(%rip), %rbx     # 0x1a0ac
movq %rbx, %rsi
callq 0x42bd
leaq 0x14564(%rip), %rdi     # 0x180eb
movq %rbx, %rsi
callq 0x42bd
leaq 0x14562(%rip), %rdi     # 0x180f8
movq %rbx, %rsi
callq 0x42bd
leaq 0x14566(%rip), %rsi     # 0x1810b
movq %r14, %rdi
callq 0x30d0
xorl %esi, %esi
testq %rax, %rax
setne %sil
pushq $0x20
popq %rdi
callq 0x127c4
cmpl $0x10e, 0x18(%rsp)      # imm = 0x10E
movq %r14, 0x18(%rsp)
jg 0x3be3
pushq $0x2c
popq %rdi
callq 0x4694
movl $0x100, %edi            # imm = 0x100
xorl %esi, %esi
callq 0x127c4
jmp 0x3bf6
leaq 0x14526(%rip), %rdi     # 0x18110
leaq 0x164bb(%rip), %rsi     # 0x1a0ac
callq 0x42bd
leaq 0x14523(%rip), %rdx     # 0x18120
leaq 0x450(%rsp), %rbx
pushq $0x10
popq %rsi
movq %rbx, %rdi
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x3500
leaq 0x14508(%rip), %rdi     # 0x18126
movq %rbx, %rsi
callq 0x42bd
leaq 0x20e93(%rip), %r14     # 0x24ac0
xorl %r15d, %r15d
xorl %eax, %eax
cmpq $0x40, %r15
je 0x3cc8
testl %eax, %eax
jne 0x3c59
movq (%r15,%r14), %rbx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3450
testl %eax, %eax
je 0x3c68
xorl %eax, %eax
jmp 0x3cbf
movq 0x10(%rsp), %rax
movb (%rax), %al
movq (%r15,%r14), %rbx
cmpb (%rbx), %al
jne 0x3c55
leaq 0x1450(%rsp), %r14
movq %r14, %rdi
leaq 0x144b7(%rip), %rsi     # 0x18131
movq %rbx, %rdx
xorl %eax, %eax
callq 0x30c0
movq %r14, %rdi
leaq 0x1641e(%rip), %rbp     # 0x1a0ac
movq %rbp, %rsi
callq 0x42bd
movq %r14, %rdi
leaq 0x144a0(%rip), %rsi     # 0x18140
movq %rbx, %rdx
xorl %eax, %eax
callq 0x30c0
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x20e09(%rip), %r14     # 0x24ac0
callq 0x42bd
pushq $0x1
popq %rax
addq $0x8, %r15
jmp 0x3c32
pushq $0x2e
popq %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x3360
testq %rax, %rax
je 0x4120
xorl %ecx, %ecx
leaq (%rbx,%rcx), %rdx
cmpq %rax, %rdx
jae 0x3cfa
movb (%rdx), %dl
movb %dl, 0x450(%rsp,%rcx)
incq %rcx
jmp 0x3ce3
movb $0x0, 0x450(%rsp,%rcx)
leaq 0x450(%rsp), %rdi
callq 0x4424
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x21671(%rip)     # 0x2538c
jne 0x3ed4
movq 0x30(%rsp), %r14
testq %r14, %r14
leaq 0x14422(%rip), %rcx     # 0x18152
cmovneq %r14, %rcx
leaq 0x14425(%rip), %rdx     # 0x18160
leaq 0xc50(%rsp), %rbx
movl $0x800, %esi            # imm = 0x800
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3500
leaq 0x1767a(%rip), %rsi     # 0x1b3d3
movq %rbx, %rdi
callq 0x3390
orq %rax, %r14
jne 0x3eb1
movq (%r13), %r14
leaq 0x1699f(%rip), %rdx     # 0x1a714
leaq 0x50(%rsp), %r15
movl $0x400, %r13d           # imm = 0x400
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3500
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x3540
testl %eax, %eax
je 0x3e0e
leaq 0x14a2a(%rip), %rdi     # 0x187d2
callq 0x33c0
movq %rax, %rbp
pushq $0x1
popq %rbx
movq %r15, %rdi
testq %r13, %r13
je 0x3dc8
movzbl (%rbp), %eax
testl %eax, %eax
je 0x3dc8
cmpl $0x3a, %eax
jne 0x3e01
movq %r13, %rsi
leaq 0x14a05(%rip), %rdx     # 0x187d7
movq %r14, %rcx
xorl %eax, %eax
callq 0x3500
movq %r15, %rdi
movl %ebx, %esi
callq 0x3540
testl %eax, %eax
je 0x3e0e
xorl %eax, %eax
cmpb $0x3a, (%rbp)
sete %al
addq %rax, %rbp
movq %r15, %rdi
movl $0x400, %r13d           # imm = 0x400
jmp 0x3db6
incq %rbp
movb %al, (%rdi)
incq %rdi
decq %r13
jmp 0x3db6
leaq 0x50(%rsp), %rdi
leaq 0x1450(%rsp), %rsi
callq 0x3150
testq %rax, %rax
je 0x413e
leaq 0x168e4(%rip), %rdx     # 0x1a714
leaq 0x50(%rsp), %rbx
leaq 0x1450(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3500
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3540
testl %eax, %eax
jne 0x413e
leaq 0x50(%rsp), %rdi
pushq $0x2f
popq %rsi
callq 0x3360
testq %rax, %rax
je 0x413e
movb $0x0, (%rax)
leaq 0x142de(%rip), %rdx     # 0x1815d
leaq 0x142cc(%rip), %r8      # 0x18152
leaq 0xc50(%rsp), %rbx
leaq 0x50(%rsp), %rcx
movl $0x800, %esi            # imm = 0x800
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3500
leaq 0x1752a(%rip), %rsi     # 0x1b3d3
movq %rbx, %rdi
callq 0x3390
testq %rax, %rax
je 0x413e
xorl %edx, %edx
cmpq $0x0, 0x20(%rsp)
setne %dl
leaq 0x14304(%rip), %rsi     # 0x181d0
movq %rax, %rdi
callq 0x4450
movq 0x40(%rsp), %r13
testq %r13, %r13
je 0x3f48
xorl %ebx, %ebx
cmpq $0x0, 0x20(%rsp)
setne %bl
pushq $0x3a
popq %rbp
leaq 0x174e0(%rip), %r14     # 0x1b3d3
cmpb $0x0, (%r13)
je 0x3f48
movq %r13, %rdi
movl %ebp, %esi
callq 0x3170
movq %rax, %r15
testq %rax, %rax
je 0x3f10
movb $0x0, (%r15)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3390
movq %r13, %rdx
testq %rax, %rax
je 0x424a
movq %rax, %r13
movq %rdx, %rdi
callq 0x4424
movq %r13, %rdi
movq %rax, %rsi
movl %ebx, %edx
callq 0x4450
leaq 0x1(%r15), %r13
testq %r15, %r15
jne 0x3ef3
leaq 0xc50(%rsp), %rax
movq 0x38(%rsp), %r13
cmpq %rax, %r13
jne 0x3f91
cmpl $0x0, 0xc(%rsp)
leaq 0x1428d(%rip), %rax     # 0x181f3
leaq 0x14281(%rip), %rcx     # 0x181ee
cmoveq %rax, %rcx
testl %r12d, %r12d
leaq 0x1426e(%rip), %rsi     # 0x181e9
cmoveq %rcx, %rsi
leaq 0x450(%rsp), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x30c0
leaq 0x1743b(%rip), %rsi     # 0x1b3d3
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x3390
testq %rax, %rax
je 0x4214
movq %rax, %rdi
callq 0x37c6
movq %rax, %rbx
testl %r12d, %r12d
je 0x3fe5
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x404c
movq %rbx, %rsi
callq 0x448c
movq %rax, %r14
testq %rax, %rax
jne 0x406f
jmp 0x4129
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x400e
movq %rbx, %rsi
callq 0x448c
testq %rax, %rax
je 0x4129
movq %rax, %r14
movq %rbx, %rdi
callq 0x33a0
movq %r14, %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x14ecd
testq %rax, %rax
je 0x40bc
movq %rax, %r14
leaq 0x216a2(%rip), %rax     # 0x256d0
cmpl $0x0, (%rax)
jne 0x40bc
cmpl $0x0, 0xc(%rsp)
je 0x417f
callq 0x379c
jmp 0x4187
movq %rbx, %rdi
callq 0x3190
leaq 0x1388(,%rax,2), %rdi
callq 0x3430
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x15c3d
leaq 0x169b8(%rip), %rsi     # 0x1aa2e
movq %r13, %rdi
callq 0x3390
testq %rax, %rax
je 0x422a
movq %rax, %rbx
movq %r14, %rdi
callq 0x3190
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x35b0
movq %rbx, %rdi
callq 0x32e0
leaq 0x2161e(%rip), %rcx     # 0x256d0
xorl %eax, %eax
cmpl $0x0, (%rcx)
setne %al
jmp 0x412c
leaq 0x21615(%rip), %rax     # 0x256d8
movq (%rax), %rax
testq %rax, %rax
je 0x415f
movq 0x18(%rax), %rsi
jmp 0x4166
movq 0x20ee1(%rip), %r14     # 0x24fc0
movq (%r14), %rcx
leaq 0x13f8c(%rip), %rdi     # 0x18075
pushq $0x48
popq %rsi
pushq $0x1
popq %rdx
callq 0x35b0
movslq (%r15), %r15
movslq %ebx, %r12
incq %r15
leaq 0x14345(%rip), %rbx     # 0x18449
cmpq %r12, %r15
jge 0x4120
movq (%r14), %rdi
movq (%r13,%r15,8), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3480
incq %r15
jmp 0x4104
movq (%r13), %rdi
callq 0x4317
pushq $0x1
popq %rax
addq $0x2458, %rsp           # imm = 0x2458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20e7b(%rip), %rax     # 0x24fc0
movq (%rax), %rcx
leaq 0x14020(%rip), %rdi     # 0x1816f
pushq $0x60
popq %rsi
pushq $0x1
popq %rdx
callq 0x35b0
jmp 0x3ed4
leaq 0x17092(%rip), %rsi     # 0x1b1f8
movq 0x20e7b(%rip), %rbx     # 0x24fe8
movq %rbx, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x31e0
jmp 0x4129
movq %r13, %rdi
callq 0x3590
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x466e
testl %eax, %eax
je 0x4214
leaq 0x48(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1308c
movq (%r15), %rdi
callq 0x32e0
cmpl $0x0, 0xc(%rsp)
je 0x420d
callq 0x379c
movq %rax, %r14
leaq 0x14041(%rip), %rsi     # 0x1820a
leaq 0x1450(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x30c0
movq %r15, %rdi
callq 0x32a0
testb $0x7f, %al
jne 0x4273
movq %r14, %rdi
movq %r13, %rsi
callq 0x3220
cmpl $-0x1, %eax
je 0x4291
movq %rbx, %rdi
callq 0x31c0
xorl %eax, %eax
jmp 0x412c
movq 0x20da5(%rip), %rax     # 0x24fc0
movq (%rax), %rdi
leaq 0x13fd3(%rip), %rsi     # 0x181f8
movq %rbx, %rdx
jmp 0x423e
movq 0x20d8f(%rip), %rax     # 0x24fc0
movq (%rax), %rdi
leaq 0x13fbd(%rip), %rsi     # 0x181f8
movq %r13, %rdx
xorl %eax, %eax
callq 0x3480
jmp 0x4129
movq 0x20d6f(%rip), %rax     # 0x24fc0
movq (%rax), %rdi
leaq 0x14580(%rip), %rsi     # 0x187db
xorl %eax, %eax
callq 0x3480
leaq 0x16f8f(%rip), %rdi     # 0x1b1f8
callq 0x3290
jmp 0x4129
movq 0x20d46(%rip), %rax     # 0x24fc0
movq (%rax), %rcx
leaq 0x13f95(%rip), %rdi     # 0x18219
pushq $0x13
popq %rsi
pushq $0x1
popq %rdx
callq 0x35b0
jmp 0x4262
leaq 0x13f95(%rip), %rdi     # 0x1822d
jmp 0x4269
movq 0x20d1f(%rip), %rax     # 0x24fc0
movq (%rax), %rdi
leaq 0x13f92(%rip), %rsi     # 0x1823d
movq %r14, %rdx
xorl %eax, %eax
callq 0x3480
pushq $0x1
popq %rdi
callq 0x33b0