// File: /workspace/github_c_makefile_star2_O3/Ihsoh[P]ilang/compiler/backend/main.c
// Function: main
int main(int argc, char *argv[]) {
	ParserContext *ctx = NULL;

	char *opt_file = NULL;
	char *opt_arch = NULL;
	char *opt_platform = NULL;
	char *opt_incpath = NULL;
	char *opt_action = NULL;
	char *opt_target = NULL;
	char *opt_output = NULL;

	// 跑测试。
	_test();

	// 没有任何参数时直接打印帮助信息。
	if (argc == 1) {
		_help();
		exit(0);
	}

	Map defs;
	map_init(
		&defs,
		map_rstr_comparer, map_rstr_comparer,
		(MapReleaser) rstr_delete, (MapReleaser) rstr_delete
	);

	for (int i = 1; i < argc; i++) {
		#define	_NEXT_ARG(opt_name) { if (i + 1 < argc) { opt = argv[++i]; } else { _error("the option '%s' expects a parameter.", opt_name); } }

		char *opt = argv[i];

		if (*opt == '-') {
			if (strcmp(opt, _OPT_ARCH) == 0) {
				if (opt_arch != NULL) {
					_error("the architecture option '-arch' cannot be specified multi-times.");
				}
				_NEXT_ARG(_OPT_ARCH)
				opt_arch = opt;
				if (strcmp(opt_arch, _OPT_ARCH_32) != 0
						&& strcmp(opt_arch, _OPT_ARCH_64) != 0) {
					_error(
						"the option '-arch' is specified a invalid value '%s', maybe specify a '32' or '64'.",
						opt_arch
					);
				}
			} else if (strcmp(opt, _OPT_PLATFORM) == 0) {
				if (opt_platform != NULL) {
					_error("the platform option '-platform' cannot be specified multi-times.");
				}
				_NEXT_ARG(_OPT_ARCH)
				opt_platform = opt;
				if (strcmp(opt_platform, _OPT_PLATFORM_WINDOWS) != 0
						&& strcmp(opt_platform, _OPT_PLATFORM_SYSTEM_V) != 0
						&& strcmp(opt_platform, _OPT_PLATFORM_ISYSTEM) != 0) {
					_error(
						"the option '-platform' is specified a invalid value '%s', "
							"maybe specify a 'windows' or 'system-v' or 'isystem'.",
						opt_platform
					);
				}
			} else if (strcmp(opt, _OPT_INCPATH) == 0) {
				if (opt_incpath != NULL) {
					_error("the include path option '-incpath' cannot be specified multi-times.");
				}
				_NEXT_ARG(_OPT_INCPATH)
				opt_incpath = opt;
			} else if (strcmp(opt, _OPT_ACTION) == 0) {
				if (opt_action != NULL) {
					_error("the action option '-action' cannot be specified multi-times.");
				}
				_NEXT_ARG(_OPT_ACTION)
				opt_action = opt;
				if (strcmp(opt_action, _OPT_ACTION_COMPILE) != 0
						&& strcmp(opt_action, _OPT_ACTION_PRINTAST) != 0
						&& strcmp(opt_action, _OPT_ACTION_PREPROCESS) != 0) {
					_error(
						"the option '-action' is specified a invalid value '%s', maybe specify a 'compile' or 'printast' or 'preprocess'.",
						opt_action
					);
				}
			} else if (strcmp(opt, _OPT_TARGET) == 0) {
				if (opt_target != NULL) {
					_error("the target option '-target' cannot be specified multi-times.");
				}
				_NEXT_ARG(_OPT_TARGET)
				opt_target = opt;
				if (strcmp(opt_target, _OPT_TARGET_GAS) != 0
						&& strcmp(opt_target, _OPT_TARGET_IASM) != 0) {
					_error(
						"the option '-target' is specified a invalid value '%s', maybe specify a 'gas' or 'iasm'.",
						opt_target
					);
				}
			} else if (strcmp(opt, _OPT_DEF) == 0) {
				_NEXT_ARG(_OPT_DEF)
				const char *name = opt;
				_NEXT_ARG(_OPT_DEF)
				const char *value = opt;

				ResizableString *rstr_name = rstr_new_with_cstr(name);
				ResizableString *rstr_value = rstr_new_with_cstr(value);

				map_remove(&defs, rstr_name, true, true);
				map_set(&defs, rstr_name, rstr_value, true);
			} else if (strcmp(opt, _OPT_OUTPUT) == 0) {
				if (opt_output != NULL) {
					_error("the output option '-output' cannot be specified multi-times.");
				}
				_NEXT_ARG(_OPT_OUTPUT)
				opt_output = opt;
			} else if (strcmp(opt, _OPT_HELP) == 0) {
				_help();
				exit(0);
			} else {
				_error(
					"the option '%s' is invalid.",
					opt
				);
			}
		} else {
			if (opt_file != NULL) {
				_error(
					"the source file cannot be specified multi-times, '%s' and '%s'.",
					opt_file,
					opt
				);
			}
			opt_file = opt;
		}

		#undef	_NEXT_ARG
	}

	if (opt_file == NULL) {
		_error("the source file not be specified.");
	}
	if (opt_arch == NULL) {
		opt_arch = _OPT_ARCH_32;
	}
	if (opt_incpath == NULL) {
		opt_incpath = "";
	}
	if (opt_action == NULL) {
		opt_action = _OPT_ACTION_COMPILE;
	}
	if (opt_target == NULL) {
		opt_target = _OPT_TARGET_GAS;
	}

	ResizableString *rstr_arch_name = rstr_new_with_cstr("__ARCH__");
	ResizableString *rstr_arch = rstr_new();
	rstr_appendf(rstr_arch, "\"%s\"", opt_arch);
	map_remove(&defs, rstr_arch_name, true, true);
	map_set(
		&defs,
		rstr_arch_name,
		rstr_arch,
		true
	);

	ResizableString *rstr_target_name = rstr_new_with_cstr("__TARGET__");
	ResizableString *rstr_target = rstr_new();
	rstr_appendf(rstr_target, "\"%s\"", opt_target);
	map_remove(&defs, rstr_target_name, true, true);
	map_set(
		&defs,
		rstr_target_name,
		rstr_target,
		true
	);

	// 读取源文件。
	const char *source = NULL;
	int len = 0;
	source = (const char *)util_get_file_content(opt_file, &len);
	if (source == NULL) {
		_error("cannot open source file.");
	}

	// 打开输出文件。
	FILE *output = stdout;
	if (opt_output != NULL) {
		output = fopen(opt_output, "w");
		if (output == NULL) {
			_error("cannot write target code to target file '%s'.", opt_output);
		}
	}

	// 预处理。
	ResizableString preprocessed_source;
	rstr_init(&preprocessed_source);
	pp_process(
		opt_file, opt_incpath, source, len, &defs, NULL, &preprocessed_source
	);
	free((void *)source);

	map_free(&defs, true, true);

	if (strcmp(opt_action, _OPT_ACTION_PREPROCESS) == 0) {
		fputs(RSTR_CSTR(&preprocessed_source), output);
		goto _end;
	}

	// 语法解析。
	int arch = BE_ARCH_32;
	if (strcmp(opt_arch, _OPT_ARCH_32) == 0) {
		arch = BE_ARCH_32;
	} else if (strcmp(opt_arch, _OPT_ARCH_64) == 0) {
		arch = BE_ARCH_64;
	} else {
		assert(0);
	}
	ctx = be_parser_new_context(
		opt_file, RSTR_CSTR(&preprocessed_source), RSTR_LEN(&preprocessed_source), arch
	);
	be_parser_parse(ctx);

	// 语义解析。
	be_sem_process(ctx);

	int platform = BE_ASMGEN_PLATFORM_DEFAULT;
	if (opt_platform != NULL) {
		if (strcmp(opt_platform, _OPT_PLATFORM_WINDOWS) == 0) {
			platform = BE_ASMGEN_PLATFORM_WINDOWS;
		} else if (strcmp(opt_platform, _OPT_PLATFORM_SYSTEM_V) == 0) {
			platform = BE_ASMGEN_PLATFORM_SYSTEM_V;
		} else if (strcmp(opt_platform, _OPT_PLATFORM_ISYSTEM) == 0) {
			platform = BE_ASMGEN_PLATFORM_ISYSTEM;
		} else {
			assert(0);
		}
	}

	// 执行操作（编译、打印AST）。
	if (strcmp(opt_action, _OPT_ACTION_COMPILE) == 0) {
		if (strcmp(opt_target, _OPT_TARGET_GAS) == 0) {
			if (arch == BE_ARCH_32) {
				ASMGeneratorGas32Context *asmgen_ctx = be_asmgen_gas32_new_context(ctx, output, platform);
				be_asmgen_gas32_generate(asmgen_ctx);
				be_asmgen_gas32_free_context(asmgen_ctx);
			} else if (arch == BE_ARCH_64) {
				ASMGeneratorGas64Context *asmgen_ctx = be_asmgen_gas64_new_context(ctx, output, platform);
				be_asmgen_gas64_generate(asmgen_ctx);
				be_asmgen_gas64_free_context(asmgen_ctx);
			} else {
				assert(0);
			}
		} else if (strcmp(opt_target, _OPT_TARGET_IASM) == 0) {
			_error("target 'iasm' is not supported currently.");
		} else {
			assert(0);
		}
	} else if (strcmp(opt_action, _OPT_ACTION_PRINTAST) == 0) {
		// 打印语法树。
		be_parser_print_ast(ctx, output);
	} else {
		assert(0);
	}

	// 释放资源。
_end:
	rstr_free(&preprocessed_source);
	if (opt_output != NULL) {
		fclose(output);
	}
	if (ctx != NULL) {
		be_parser_free_context(ctx);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, -0x38(%rbp)
movl %edi, %r15d
callq 0x8987
callq 0x37db
callq 0x5161
callq 0x5d12
cmpl $0x1, %r15d
je 0x22081
leaq -0x1bacc(%rip), %rdx    # 0x5d08
leaq -0x19f81(%rip), %rcx    # 0x785a
leaq -0xd0(%rbp), %rdi
movq %rdx, %rsi
movq %rcx, %r8
callq 0x54a0
cmpl $0x2, %r15d
jl 0x21fff
movl $0x1, %r12d
xorl %esi, %esi
leaq 0x271ed(%rip), %rax     # 0x489f3
movq %rax, -0x68(%rbp)
leaq 0x272b4(%rip), %rbx     # 0x48ac5
xorl %r8d, %r8d
xorl %r14d, %r14d
movq $0x0, -0x60(%rbp)
xorl %edi, %edi
xorl %edx, %edx
movq $0x0, -0x58(%rbp)
movq -0x38(%rbp), %rcx
movslq %r12d, %rax
movq (%rcx,%rax,8), %r13
cmpb $0x2d, (%r13)
jne 0x2192d
movq %r8, -0x48(%rbp)
movq %rdi, -0x40(%rbp)
movq %rdx, -0x30(%rbp)
movq %rsi, -0x50(%rbp)
movq %r13, %rdi
leaq 0x26f72(%rip), %rsi     # 0x487cd
callq 0x30e0
testl %eax, %eax
je 0x2193e
movq %r13, %rdi
leaq 0x2701b(%rip), %rsi     # 0x4888d
callq 0x30e0
testl %eax, %eax
je 0x2198a
movq %r13, %rdi
leaq 0x270d8(%rip), %rsi     # 0x48961
callq 0x30e0
testl %eax, %eax
je 0x21a0e
movq %r13, %rdi
leaq 0x2710e(%rip), %rsi     # 0x489ae
callq 0x30e0
testl %eax, %eax
je 0x21a51
movq %r13, %rdi
leaq 0x271c9(%rip), %rsi     # 0x48a80
callq 0x30e0
testl %eax, %eax
je 0x21abd
movq %r13, %rdi
leaq 0x27259(%rip), %rsi     # 0x48b27
callq 0x30e0
testl %eax, %eax
je 0x21b43
movq %r13, %rdi
leaq 0x27247(%rip), %rsi     # 0x48b2c
callq 0x30e0
testl %eax, %eax
jne 0x2206e
cmpq $0x0, -0x58(%rbp)
movq -0x50(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %r8
jne 0x2208d
incl %r12d
cmpl %r15d, %r12d
jge 0x22096
movslq %r12d, %rax
movq (%rcx,%rax,8), %rax
movq %rax, -0x58(%rbp)
jmp 0x21b21
testq %rsi, %rsi
jne 0x21f99
movq %r13, %rsi
jmp 0x21b21
cmpq $0x0, -0x48(%rbp)
jne 0x21fcb
incl %r12d
cmpl %r15d, %r12d
movq -0x50(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rdi
jge 0x21fb6
movslq %r12d, %rax
movq (%rcx,%rax,8), %r8
movzbl (%r8), %eax
cmpl $0x36, %eax
je 0x219f3
cmpl $0x33, %eax
jne 0x21faa
cmpb $0x32, 0x1(%r8)
je 0x219fe
jmp 0x21faa
testq %r14, %r14
jne 0x21fd7
incl %r12d
cmpl %r15d, %r12d
movq -0x38(%rbp), %rcx
jge 0x21fb6
movslq %r12d, %rax
movq (%rcx,%rax,8), %r13
movq %r13, %rdi
leaq 0x26f24(%rip), %rsi     # 0x488d8
callq 0x30e0
testl %eax, %eax
je 0x21a49
movq %r13, %rdi
leaq 0x26f15(%rip), %rsi     # 0x488e0
callq 0x30e0
testl %eax, %eax
je 0x21a49
movq %r13, %r14
movq %r13, %rdi
leaq 0x26f08(%rip), %rsi     # 0x488e9
callq 0x30e0
testl %eax, %eax
je 0x21b0d
jmp 0x22043
cmpb $0x34, 0x1(%r8)
jne 0x21faa
cmpb $0x0, 0x2(%r8)
je 0x21b21
jmp 0x21faa
cmpq $0x0, -0x60(%rbp)
jne 0x21fe3
incl %r12d
cmpl %r15d, %r12d
movq -0x50(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %r8
jge 0x21fef
movslq %r12d, %rax
movq (%rcx,%rax,8), %rax
movq %rax, -0x60(%rbp)
jmp 0x21b21
movq %r13, %r14
jmp 0x21b0d
cmpq $0x0, -0x40(%rbp)
jne 0x2202a
incl %r12d
cmpl %r15d, %r12d
movq -0x38(%rbp), %rcx
jge 0x22033
movslq %r12d, %rax
movq (%rcx,%rax,8), %r13
movq %r13, %rdi
leaq 0x26f76(%rip), %rsi     # 0x489f3
callq 0x30e0
testl %eax, %eax
je 0x21b32
movq %r13, %rdi
leaq 0x26f67(%rip), %rsi     # 0x489fb
callq 0x30e0
testl %eax, %eax
je 0x21b32
movq %r13, -0x40(%rbp)
movq %r13, %rdi
leaq 0x26f55(%rip), %rsi     # 0x48a04
callq 0x30e0
testl %eax, %eax
je 0x21b0d
jmp 0x220da
cmpq $0x0, -0x30(%rbp)
jne 0x220a9
incl %r12d
cmpl %r15d, %r12d
movq -0x38(%rbp), %rcx
jge 0x220b7
movslq %r12d, %rax
movq (%rcx,%rax,8), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x30e0
testl %eax, %eax
je 0x21bc6
movq %r13, -0x30(%rbp)
movq %r13, %rdi
leaq 0x26fc9(%rip), %rsi     # 0x48ac9
callq 0x30e0
testl %eax, %eax
jne 0x220ca
movq -0x50(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %r8
incl %r12d
cmpl %r15d, %r12d
jl 0x2182f
jmp 0x21bd6
movq -0x50(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq %r13, %rdi
jmp 0x21b1d
leal 0x1(%r12), %eax
cmpl %r15d, %eax
jge 0x22052
addl $0x2, %r12d
cmpl %r15d, %r12d
movq -0x38(%rbp), %rcx
jge 0x22052
cltq
movq (%rcx,%rax,8), %rdi
movslq %r12d, %rax
movq (%rcx,%rax,8), %rax
movq %rax, -0x70(%rbp)
callq 0x773e
movq %rax, %r13
movq -0x70(%rbp), %rdi
callq 0x773e
movq %rax, -0x70(%rbp)
leaq -0xd0(%rbp), %rdi
movq %r13, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x5805
leaq -0xd0(%rbp), %rdi
movq %r13, %rsi
movq -0x70(%rbp), %rdx
movl $0x1, %ecx
callq 0x560c
movq -0x38(%rbp), %rcx
movq -0x50(%rbp), %rsi
jmp 0x21b15
movq -0x50(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq %r13, %rdx
jmp 0x21b19
movq %r14, -0x40(%rbp)
testq %rsi, %rsi
movq %rsi, -0x50(%rbp)
je 0x21fff
testq %r8, %r8
leaq 0x21c82(%rip), %r15     # 0x43873
cmovneq %r8, %r15
movq -0x60(%rbp), %rax
testq %rax, %rax
leaq 0x1ee18(%rip), %rcx     # 0x40a1b
cmoveq %rcx, %rax
movq %rax, -0x60(%rbp)
testq %rdi, %rdi
movq -0x68(%rbp), %rax
cmovneq %rdi, %rax
movq %rax, -0x68(%rbp)
testq %rdx, %rdx
cmovneq %rdx, %rbx
movq %rbx, %r12
leaq 0x26fca(%rip), %rdi     # 0x48bf5
callq 0x773e
movq %rax, %r14
callq 0x7705
movq %rax, %r13
leaq 0x2da98(%rip), %rsi     # 0x4f6da
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x7905
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x5805
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x1, %ecx
callq 0x560c
leaq 0x26f79(%rip), %rdi     # 0x48bfe
callq 0x773e
movq %rax, %r14
callq 0x7705
movq %rax, %r13
movq %rax, %rdi
leaq 0x2da3b(%rip), %rsi     # 0x4f6da
movq %r12, -0x48(%rbp)
movq %r12, %rdx
xorl %eax, %eax
callq 0x7905
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x5805
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl $0x1, %ecx
callq 0x560c
leaq -0x74(%rbp), %rsi
movl $0x0, (%rsi)
movq -0x50(%rbp), %rdi
movq %rdi, %rbx
callq 0x9565
testq %rax, %rax
movq -0x58(%rbp), %r12
je 0x22065
movq %rax, %r13
testq %r12, %r12
je 0x21d27
leaq 0x26f1b(%rip), %rsi     # 0x48c22
movq %r12, %rdi
callq 0x3140
movq %rax, -0x30(%rbp)
testq %rax, %rax
jne 0x21d35
leaq 0x26f05(%rip), %rdi     # 0x48c24
movq %r12, %rsi
jmp 0x21fc4
movq 0x382aa(%rip), %rax     # 0x59fd8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x7314
movl -0x74(%rbp), %ecx
movq %r14, (%rsp)
leaq -0xd0(%rbp), %r14
movq %rbx, %rdi
movq -0x60(%rbp), %rsi
movq %r13, %rdx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x3cda8
movq %r13, %rdi
callq 0x31a0
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x557e
leaq 0x26c7c(%rip), %rsi     # 0x48a04
movq -0x68(%rbp), %rdi
callq 0x30e0
testl %eax, %eax
je 0x21dc7
movzbl (%r15), %eax
cmpl $0x36, %eax
je 0x21ded
cmpl $0x33, %eax
jne 0x2200b
cmpb $0x32, 0x1(%r15)
jne 0x2200b
cmpb $0x0, 0x2(%r15)
jne 0x2200b
movl $0x1, %ecx
movb $0x1, %r12b
jmp 0x21e0b
movq -0x80(%rbp), %rax
testq %rax, %rax
leaq 0x1ec46(%rip), %rdi     # 0x40a1b
cmovneq %rax, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x30b0
xorl %r14d, %r14d
jmp 0x21f5f
cmpb $0x34, 0x1(%r15)
jne 0x2200b
cmpb $0x0, 0x2(%r15)
jne 0x2200b
movl $0x2, %ecx
xorl %r12d, %r12d
movq -0x80(%rbp), %rax
testq %rax, %rax
leaq 0x1ec02(%rip), %rsi     # 0x40a1b
cmovneq %rax, %rsi
movl -0x84(%rbp), %edx
movq %rbx, %rdi
callq 0x22399
movq %rax, %r14
movq %rax, %rdi
callq 0x22487
movq %r14, %rdi
callq 0x2a0d4
movl $0x3, %r15d
movq -0x40(%rbp), %r13
testq %r13, %r13
je 0x21eb3
leaq 0x26a84(%rip), %rsi     # 0x488d8
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
je 0x21ea5
leaq 0x26a79(%rip), %rsi     # 0x488e0
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
je 0x21ead
leaq 0x26a6f(%rip), %rsi     # 0x488e9
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
je 0x21eb3
leaq 0x1c4dc(%rip), %rdi     # 0x3e369
leaq 0x26dbe(%rip), %rsi     # 0x48c52
leaq 0x26dcf(%rip), %rcx     # 0x48c6a
movl $0x14a, %edx            # imm = 0x14A
callq 0x30a0
movl $0x1, %r15d
jmp 0x21eb3
movl $0x2, %r15d
leaq 0x26b39(%rip), %rsi     # 0x489f3
movq -0x68(%rbp), %r13
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
je 0x21ef2
leaq 0x26b2a(%rip), %rsi     # 0x489fb
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x220f9
movq %r14, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x22a8b
jmp 0x21f5b
leaq 0x26bcc(%rip), %rsi     # 0x48ac5
movq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x22118
movq %r14, %rdi
testb %r12b, %r12b
je 0x21f39
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
movl %r15d, %edx
callq 0xbe9f
movq %rax, %r15
movq %rax, %rdi
callq 0xb794
movq %r15, %rdi
callq 0xc008
jmp 0x21f5b
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
movl %r15d, %edx
callq 0x18314
movq %rax, %r15
movq %rax, %rdi
callq 0x17c78
movq %r15, %rdi
callq 0x18475
movq -0x58(%rbp), %r12
leaq -0x88(%rbp), %rdi
callq 0x7812
testq %r12, %r12
je 0x21f78
movq %rbx, %rdi
callq 0x3070
testq %r14, %r14
je 0x21f85
movq %r14, %rdi
callq 0x22444
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26bf3(%rip), %rdi     # 0x48b93
movq %r13, %rdx
xorl %eax, %eax
callq 0x22171
leaq 0x26888(%rip), %rdi     # 0x48839
movq %r8, %rsi
jmp 0x21fc4
leaq 0x26857(%rip), %rdi     # 0x48814
leaq 0x26809(%rip), %rsi     # 0x487cd
xorl %eax, %eax
callq 0x22171
leaq 0x26801(%rip), %rdi     # 0x487d3
jmp 0x220b0
leaq 0x268b9(%rip), %rdi     # 0x48897
jmp 0x220b0
leaq 0x26980(%rip), %rdi     # 0x4896a
jmp 0x220b0
leaq 0x2681e(%rip), %rdi     # 0x48814
leaq 0x26964(%rip), %rsi     # 0x48961
jmp 0x21fc4
leaq 0x26bcd(%rip), %rdi     # 0x48bd3
jmp 0x220b0
leaq 0x1c357(%rip), %rdi     # 0x3e369
leaq 0x26c39(%rip), %rsi     # 0x48c52
leaq 0x26c4a(%rip), %rcx     # 0x48c6a
movl $0x137, %edx            # imm = 0x137
callq 0x30a0
leaq 0x26985(%rip), %rdi     # 0x489b6
jmp 0x220b0
leaq 0x267da(%rip), %rdi     # 0x48814
leaq 0x2696d(%rip), %rsi     # 0x489ae
jmp 0x21fc4
leaq 0x268a7(%rip), %rdi     # 0x488f1
movq %r14, %rsi
jmp 0x21fc4
leaq 0x267bb(%rip), %rdi     # 0x48814
leaq 0x26ac7(%rip), %rsi     # 0x48b27
jmp 0x21fc4
leaq 0x26b9d(%rip), %rdi     # 0x48c09
jmp 0x220b0
leaq 0x26afc(%rip), %rsi     # 0x48b71
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x220ea
callq 0x22156
xorl %edi, %edi
callq 0x3170
leaq 0x26aa0(%rip), %rdi     # 0x48b34
jmp 0x220b0
leaq 0x26777(%rip), %rdi     # 0x48814
leaq 0x26a88(%rip), %rsi     # 0x48b2c
jmp 0x21fc4
leaq 0x269d8(%rip), %rdi     # 0x48a88
xorl %eax, %eax
callq 0x22171
leaq 0x26756(%rip), %rdi     # 0x48814
leaq 0x269bb(%rip), %rsi     # 0x48a80
jmp 0x21fc4
leaq 0x269fd(%rip), %rdi     # 0x48ace
movq -0x30(%rbp), %rsi
jmp 0x21fc4
leaq 0x2692e(%rip), %rdi     # 0x48a0f
movq -0x40(%rbp), %rsi
jmp 0x21fc4
leaq 0x26a86(%rip), %rdi     # 0x48b77
movq %r13, %rsi
jmp 0x21fc4
leaq 0x1c269(%rip), %rdi     # 0x3e369
leaq 0x26b4b(%rip), %rsi     # 0x48c52
leaq 0x26b5c(%rip), %rcx     # 0x48c6a
movl $0x165, %edx            # imm = 0x165
callq 0x30a0
leaq 0x269aa(%rip), %rsi     # 0x48ac9
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x22137
leaq 0x26b4f(%rip), %rdi     # 0x48c81
jmp 0x220b0
leaq 0x1c22b(%rip), %rdi     # 0x3e369
leaq 0x26b0d(%rip), %rsi     # 0x48c52
leaq 0x26b1e(%rip), %rcx     # 0x48c6a
movl $0x15f, %edx            # imm = 0x15F
callq 0x30a0