// File: /workspace/github_c_makefile_star2_O0/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
subq $0x150, %rsp            # imm = 0x150
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
callq 0x3d820
cmpl $0x1, -0x8(%rbp)
jne 0x3cc30
callq 0x3d840
xorl %edi, %edi
callq 0x3170
leaq -0x98(%rbp), %rdi
leaq -0x35cee(%rip), %rdx    # 0x6f50
leaq -0x338b5(%rip), %r8     # 0x9390
movq %rdx, %rsi
movq %r8, %rcx
callq 0x6200
movl $0x1, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x3d27d
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3d23c
movq -0xa8(%rbp), %rdi
leaq 0x423e0(%rip), %rsi     # 0x7f080
callq 0x30e0
cmpl $0x0, %eax
jne 0x3cd55
cmpq $0x0, -0x28(%rbp)
je 0x3ccc3
leaq 0x423ca(%rip), %rdi     # 0x7f086
movb $0x0, %al
callq 0x3d870
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3ccf4
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3cd09
leaq 0x423cc(%rip), %rdi     # 0x7f0c7
leaq 0x4237e(%rip), %rsi     # 0x7f080
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x3c9d1(%rip), %rsi     # 0x796f0
callq 0x30e0
cmpl $0x0, %eax
je 0x3cd50
movq -0x28(%rbp), %rdi
leaq 0x43e24(%rip), %rsi     # 0x80b58
callq 0x30e0
cmpl $0x0, %eax
je 0x3cd50
movq -0x28(%rbp), %rsi
leaq 0x423a3(%rip), %rdi     # 0x7f0ec
movb $0x0, %al
callq 0x3d870
jmp 0x3d23a
movq -0xa8(%rbp), %rdi
leaq 0x423dd(%rip), %rsi     # 0x7f140
callq 0x30e0
cmpl $0x0, %eax
jne 0x3ce2d
cmpq $0x0, -0x30(%rbp)
je 0x3cd86
leaq 0x423cb(%rip), %rdi     # 0x7f14a
movb $0x0, %al
callq 0x3d870
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3cdb7
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3cdcc
leaq 0x42309(%rip), %rdi     # 0x7f0c7
leaq 0x422bb(%rip), %rsi     # 0x7f080
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x423a9(%rip), %rsi     # 0x7f18b
callq 0x30e0
cmpl $0x0, %eax
je 0x3ce28
movq -0x30(%rbp), %rdi
leaq 0x4239c(%rip), %rsi     # 0x7f193
callq 0x30e0
cmpl $0x0, %eax
je 0x3ce28
movq -0x30(%rbp), %rdi
leaq 0x42390(%rip), %rsi     # 0x7f19c
callq 0x30e0
cmpl $0x0, %eax
je 0x3ce28
movq -0x30(%rbp), %rsi
leaq 0x42383(%rip), %rdi     # 0x7f1a4
movb $0x0, %al
callq 0x3d870
jmp 0x3d238
movq -0xa8(%rbp), %rdi
leaq 0x423d9(%rip), %rsi     # 0x7f214
callq 0x30e0
cmpl $0x0, %eax
jne 0x3ceb0
cmpq $0x0, -0x38(%rbp)
je 0x3ce5a
leaq 0x423ca(%rip), %rdi     # 0x7f21d
movb $0x0, %al
callq 0x3d870
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3ce8b
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3cea0
leaq 0x42235(%rip), %rdi     # 0x7f0c7
leaq 0x4237b(%rip), %rsi     # 0x7f214
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3d236
movq -0xa8(%rbp), %rdi
leaq 0x423a3(%rip), %rsi     # 0x7f261
callq 0x30e0
cmpl $0x0, %eax
jne 0x3cf88
cmpq $0x0, -0x40(%rbp)
je 0x3cee1
leaq 0x4238f(%rip), %rdi     # 0x7f269
movb $0x0, %al
callq 0x3d870
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3cf12
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3cf27
leaq 0x421ae(%rip), %rdi     # 0x7f0c7
leaq 0x42341(%rip), %rsi     # 0x7f261
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x42369(%rip), %rsi     # 0x7f2a6
callq 0x30e0
cmpl $0x0, %eax
je 0x3cf83
movq -0x40(%rbp), %rdi
leaq 0x4235c(%rip), %rsi     # 0x7f2ae
callq 0x30e0
cmpl $0x0, %eax
je 0x3cf83
movq -0x40(%rbp), %rdi
leaq 0x42350(%rip), %rsi     # 0x7f2b7
callq 0x30e0
cmpl $0x0, %eax
je 0x3cf83
movq -0x40(%rbp), %rsi
leaq 0x42346(%rip), %rdi     # 0x7f2c2
movb $0x0, %al
callq 0x3d870
jmp 0x3d234
movq -0xa8(%rbp), %rdi
leaq 0x4239d(%rip), %rsi     # 0x7f333
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d04b
cmpq $0x0, -0x48(%rbp)
je 0x3cfb9
leaq 0x42389(%rip), %rdi     # 0x7f33b
movb $0x0, %al
callq 0x3d870
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3cfea
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3cfff
leaq 0x420d6(%rip), %rdi     # 0x7f0c7
leaq 0x4233b(%rip), %rsi     # 0x7f333
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
leaq 0x42363(%rip), %rsi     # 0x7f378
callq 0x30e0
cmpl $0x0, %eax
je 0x3d046
movq -0x48(%rbp), %rdi
leaq 0x42352(%rip), %rsi     # 0x7f37c
callq 0x30e0
cmpl $0x0, %eax
je 0x3d046
movq -0x48(%rbp), %rsi
leaq 0x42342(%rip), %rdi     # 0x7f381
movb $0x0, %al
callq 0x3d870
jmp 0x3d232
movq -0xa8(%rbp), %rdi
leaq 0x42381(%rip), %rsi     # 0x7f3da
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d173
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3d098
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3d0ad
leaq 0x42028(%rip), %rdi     # 0x7f0c7
leaq 0x42334(%rip), %rsi     # 0x7f3da
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3d0ec
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3d101
leaq 0x41fd4(%rip), %rdi     # 0x7f0c7
leaq 0x422e0(%rip), %rsi     # 0x7f3da
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x9210
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x9210
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rsi
leaq -0x98(%rbp), %rdi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x67e0
movq -0xc0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0x98(%rbp), %rdi
movl $0x1, %ecx
callq 0x6450
jmp 0x3d230
movq -0xa8(%rbp), %rdi
leaq 0x4225e(%rip), %rsi     # 0x7f3df
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d1f3
cmpq $0x0, -0x50(%rbp)
je 0x3d1a0
leaq 0x4224e(%rip), %rdi     # 0x7f3e7
movb $0x0, %al
callq 0x3d870
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3d1d1
movq -0x10(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x9c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
jmp 0x3d1e6
leaq 0x41eef(%rip), %rdi     # 0x7f0c7
leaq 0x42200(%rip), %rsi     # 0x7f3df
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x3d22e
movq -0xa8(%rbp), %rdi
leaq 0x42223(%rip), %rsi     # 0x7f424
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d217
callq 0x3d840
xorl %edi, %edi
callq 0x3170
movq -0xa8(%rbp), %rsi
leaq 0x42205(%rip), %rdi     # 0x7f42a
movb $0x0, %al
callq 0x3d870
jmp 0x3d22e
jmp 0x3d230
jmp 0x3d232
jmp 0x3d234
jmp 0x3d236
jmp 0x3d238
jmp 0x3d23a
jmp 0x3d267
cmpq $0x0, -0x20(%rbp)
je 0x3d25c
movq -0x20(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq 0x421f1(%rip), %rdi     # 0x7f446
movb $0x0, %al
callq 0x3d870
movq -0xa8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x3d269
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x3cc5a
cmpq $0x0, -0x20(%rbp)
jne 0x3d292
leaq 0x421fb(%rip), %rdi     # 0x7f486
movb $0x0, %al
callq 0x3d870
cmpq $0x0, -0x28(%rbp)
jne 0x3d2a4
leaq 0x3c450(%rip), %rax     # 0x796f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x3d2b6
leaq 0x38c8d(%rip), %rax     # 0x75f3f
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x3d2c8
leaq 0x41fe2(%rip), %rax     # 0x7f2a6
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x3d2da
leaq 0x420a2(%rip), %rax     # 0x7f378
movq %rax, -0x48(%rbp)
leaq 0x421c7(%rip), %rdi     # 0x7f4a8
callq 0x9210
movq %rax, -0xd0(%rbp)
callq 0x91e0
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x4937a(%rip), %rsi     # 0x86685
movb $0x0, %al
callq 0x94d0
movq -0xd0(%rbp), %rsi
leaq -0x98(%rbp), %rdi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x67e0
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x98(%rbp), %rdi
movl $0x1, %ecx
callq 0x6450
leaq 0x4215f(%rip), %rdi     # 0x7f4b1
callq 0x9210
movq %rax, -0xe0(%rbp)
callq 0x91e0
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0x49309(%rip), %rsi     # 0x86685
movb $0x0, %al
callq 0x94d0
movq -0xe0(%rbp), %rsi
leaq -0x98(%rbp), %rdi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x67e0
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0x98(%rbp), %rdi
movl $0x1, %ecx
callq 0x6450
movq $0x0, -0xf0(%rbp)
movl $0x0, -0xf4(%rbp)
movq -0x20(%rbp), %rdi
leaq -0xf4(%rbp), %rsi
callq 0xb9b0
movq %rax, -0xf0(%rbp)
cmpq $0x0, -0xf0(%rbp)
jne 0x3d400
leaq 0x420c3(%rip), %rdi     # 0x7f4bc
movb $0x0, %al
callq 0x3d870
movq 0x56bd1(%rip), %rax     # 0x93fd8
movq (%rax), %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x3d44d
movq -0x50(%rbp), %rdi
leaq 0x420b2(%rip), %rsi     # 0x7f4d5
callq 0x3140
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
jne 0x3d44b
movq -0x50(%rbp), %rsi
leaq 0x42093(%rip), %rdi     # 0x7f4d7
movb $0x0, %al
callq 0x3d870
jmp 0x3d44d
leaq -0x110(%rbp), %rdi
callq 0x8c90
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0xf0(%rbp), %rdx
movl -0xf4(%rbp), %ecx
leaq -0x98(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
leaq -0x110(%rbp), %rax
movq %rax, (%rsp)
callq 0x710b0
movq -0xf0(%rbp), %rdi
callq 0x31a0
leaq -0x98(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x6350
movq -0x40(%rbp), %rdi
leaq 0x41e03(%rip), %rsi     # 0x7f2b7
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d4fe
cmpq $0x0, -0x108(%rbp)
jne 0x3d4d8
leaq 0x38a70(%rip), %rax     # 0x75f3f
movq %rax, -0x130(%rbp)
jmp 0x3d4e6
movq -0x108(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x30b0
jmp 0x3d7d7
movl $0x1, -0x114(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x3c1dd(%rip), %rsi     # 0x796f0
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d529
movl $0x1, -0x114(%rbp)
jmp 0x3d56b
movq -0x28(%rbp), %rdi
leaq 0x43624(%rip), %rsi     # 0x80b58
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d54a
movl $0x2, -0x114(%rbp)
jmp 0x3d569
leaq 0x35f09(%rip), %rdi     # 0x7345a
leaq 0x41fad(%rip), %rsi     # 0x7f505
movl $0x137, %edx            # imm = 0x137
leaq 0x41fb9(%rip), %rcx     # 0x7f51d
callq 0x30a0
jmp 0x3d56b
movq -0x20(%rbp), %rax
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x3d590
leaq 0x389b8(%rip), %rax     # 0x75f3f
movq %rax, -0x140(%rbp)
jmp 0x3d59e
movq -0x108(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rdi
movq -0x140(%rbp), %rsi
movl -0x10c(%rbp), %edx
movl -0x114(%rbp), %ecx
callq 0x3dbb0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3dcf0
movq -0x18(%rbp), %rdi
callq 0x4d0c0
movl $0x3, -0x118(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3d670
movq -0x30(%rbp), %rdi
leaq 0x41b98(%rip), %rsi     # 0x7f18b
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d609
movl $0x1, -0x118(%rbp)
jmp 0x3d66e
movq -0x30(%rbp), %rdi
leaq 0x41b7f(%rip), %rsi     # 0x7f193
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d62a
movl $0x2, -0x118(%rbp)
jmp 0x3d66c
movq -0x30(%rbp), %rdi
leaq 0x41b67(%rip), %rsi     # 0x7f19c
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d64b
movl $0x3, -0x118(%rbp)
jmp 0x3d66a
leaq 0x35e08(%rip), %rdi     # 0x7345a
leaq 0x41eac(%rip), %rsi     # 0x7f505
movl $0x14a, %edx            # imm = 0x14A
leaq 0x41eb8(%rip), %rcx     # 0x7f51d
callq 0x30a0
jmp 0x3d66c
jmp 0x3d66e
jmp 0x3d670
movq -0x40(%rbp), %rdi
leaq 0x41c2b(%rip), %rsi     # 0x7f2a6
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d78d
movq -0x48(%rbp), %rdi
leaq 0x41ce4(%rip), %rsi     # 0x7f378
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d745
cmpl $0x1, -0x114(%rbp)
jne 0x3d6e2
movq -0x18(%rbp), %rdi
movq -0x100(%rbp), %rsi
movl -0x118(%rbp), %edx
callq 0xf700
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
callq 0xf290
movq -0x120(%rbp), %rdi
callq 0xf950
jmp 0x3d743
cmpl $0x2, -0x114(%rbp)
jne 0x3d722
movq -0x18(%rbp), %rdi
movq -0x100(%rbp), %rsi
movl -0x118(%rbp), %edx
callq 0x27fc0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
callq 0x27b50
movq -0x128(%rbp), %rdi
callq 0x281e0
jmp 0x3d741
leaq 0x35d31(%rip), %rdi     # 0x7345a
leaq 0x41dd5(%rip), %rsi     # 0x7f505
movl $0x15a, %edx            # imm = 0x15A
leaq 0x41de1(%rip), %rcx     # 0x7f51d
callq 0x30a0
jmp 0x3d743
jmp 0x3d78b
movq -0x48(%rbp), %rdi
leaq 0x41c2c(%rip), %rsi     # 0x7f37c
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d76a
leaq 0x41dd3(%rip), %rdi     # 0x7f534
movb $0x0, %al
callq 0x3d870
jmp 0x3d789
leaq 0x35ce9(%rip), %rdi     # 0x7345a
leaq 0x41d8d(%rip), %rsi     # 0x7f505
movl $0x15f, %edx            # imm = 0x15F
leaq 0x41d99(%rip), %rcx     # 0x7f51d
callq 0x30a0
jmp 0x3d78b
jmp 0x3d7d5
movq -0x40(%rbp), %rdi
leaq 0x41b16(%rip), %rsi     # 0x7f2ae
callq 0x30e0
cmpl $0x0, %eax
jne 0x3d7b4
movq -0x18(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x3dea0
jmp 0x3d7d3
leaq 0x35c9f(%rip), %rdi     # 0x7345a
leaq 0x41d43(%rip), %rsi     # 0x7f505
movl $0x165, %edx            # imm = 0x165
leaq 0x41d4f(%rip), %rcx     # 0x7f51d
callq 0x30a0
jmp 0x3d7d5
jmp 0x3d7d7
leaq -0x110(%rbp), %rdi
callq 0x9310
cmpq $0x0, -0x50(%rbp)
je 0x3d7f6
movq -0x100(%rbp), %rdi
callq 0x3070
cmpq $0x0, -0x18(%rbp)
je 0x3d806
movq -0x18(%rbp), %rdi
callq 0x3dca0
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)