// File: /workspace/github_c_makefile_star2_O0/mikecat[P]x86_interpreter/x86_interpreter.c
// Function: main
int main(int argc, char *argv[]) {
	int i;
	int enable_trace = 0;
	int enable_args = 0;
	int import_as_iat = 0;
	int enable_fs = 0;
	uint32_t initial_eip = 0;
	uint32_t initial_esp = UINT32_C(0xfffff000);
	uint32_t stack_size = 4096;
	uint32_t xv6_syscall_work = UINT32_C(0x80000000);
	uint32_t pe_import_work = UINT32_C(0x80000000);
	uint32_t fs_addr = UINT32_C(0x7ffff000);
	uint32_t argc2 = 0, argv_addr = 0;
	for (i = 1; i < argc; i++) {
		if (strcmp(argv[i], "--raw") == 0) {
			if (++i < argc) { if (!read_raw(argv[i])) return 1; }
			else { fprintf(stderr, "no filename for --raw\n"); return 1; }
		} else if (strcmp(argv[i], "--elf") == 0) {
			if (++i < argc) { if (!read_elf(&initial_eip, argv[i])) return 1; }
			else { fprintf(stderr, "no filename for --elf\n"); return 1; }
		} else if (strcmp(argv[i], "--pe") == 0) {
			if (++i < argc) { if (!read_pe(&initial_eip, &stack_size, &import_params, argv[i])) return 1; }
			else { fprintf(stderr, "no filename for --pe\n"); return 1; }
		} else if (strcmp(argv[i], "--trace") == 0) {
			enable_trace = 1;
		} else if (strcmp(argv[i], "--eip") == 0) {
			if (++i < argc) {
				if (!str_to_uint32(&initial_eip, argv[i])) {
					fprintf(stderr, "invalid initial eip value %s\n", argv[i]);
					return 1;
				}
			} else { fprintf(stderr, "no eip value for --eip\n"); return 1;}
		} else if (strcmp(argv[i], "--esp") == 0) {
			if (++i < argc) {
				if (!str_to_uint32(&initial_esp, argv[i])) {
					fprintf(stderr, "invalid initial esp value %s\n", argv[i]);
					return 1;
				}
			} else { fprintf(stderr, "no esp value for --esp\n"); return 1;}
		} else if (strcmp(argv[i], "--stacksize") == 0) {
			if (++i < argc) {
				if (!str_to_uint32(&stack_size, argv[i])) {
					fprintf(stderr, "invalid stack size %s\n", argv[i]);
					return 1;
				}
			} else { fprintf(stderr, "no stack size for --stacksize\n"); return 1;}
		} else if (strcmp(argv[i], "--args") == 0) {
			i++;
			enable_args = 1;
			break;
		} else if (strcmp(argv[i], "--xv6-syscall") == 0) {
			use_xv6_syscall = 1;
			if (++i < argc) {
				if (!str_to_uint32(&xv6_syscall_work, argv[i])) {
					fprintf(stderr, "invalid xv6 system call work buffer origin %s\n", argv[i]);
					return 1;
				}
			} else { fprintf(stderr, "no work buffer origin for --xv6-syscall\n"); return 1;}
		} else if (strcmp(argv[i], "--pe-import") == 0) {
			use_pe_import = 1;
			if (++i < argc) {
				if (!str_to_uint32(&pe_import_work, argv[i])) {
					fprintf(stderr, "invalid PE import libs work buffer origin %s\n", argv[i]);
					return 1;
				}
			} else { fprintf(stderr, "no work buffer origin for --pe-import\n"); return 1;}
		} else if (strcmp(argv[i], "--pe-import-as-iat") == 0) {
			import_as_iat = 1;
		} else if (strcmp(argv[i], "--pe-fs") == 0) {
			enable_fs = 1;
			if (++i < argc) {
				if (!str_to_uint32(&fs_addr, argv[i])) {
					fprintf(stderr, "invalid FS buffer origin %s\n", argv[i]);
					return 1;
				}
			} else { fprintf(stderr, "no FS buffer origin for --pe-fs\n"); return 1;}
		} else if (strcmp(argv[i], "--strict") == 0) {
			strict_mode = 1;
		} else {
			fprintf(stderr, "unknown command line option %s\n", argv[i]);
			return 1;
		}
	}
	if (stack_size > initial_esp) {
		fprintf(stderr, "stack too big compared to esp\n");
		return 1;
	}

	eip = initial_eip;
	eflags = UINT32_C(0x00000002);
	regs[ESP] = initial_esp;
	dmemory_allocate(initial_esp - stack_size, stack_size);
	if (enable_args) {
		uint32_t j;
		char** argv2 = argv + i;
		uint32_t stack_limit = initial_esp - stack_size;
		uint32_t current_addr = initial_esp;
		uint32_t num_buffer = 0;
		argc2 = argc - i;
		/* argvが指す配列の領域を確保する */
		if (argc2 == UINT32_MAX || UINT32_MAX / 4 < (argc2 + 1)) {
			fprintf(stderr, "too many arguments\n");
			return 1;
		}
		if (current_addr - stack_limit < 4 * (argc2 + 1)) {
			fprintf(stderr, "stack too small to hold argv table\n");
			return 1;
		}
		current_addr -= 4 * (argc2 + 1);
		argv_addr = current_addr;
		/* 引数の文字列とargvが指す配列の値を書き込む */
		for (j = 0; j < argc2; j++) {
			uint32_t stack_left = current_addr - stack_limit;
			size_t alen = strlen(argv2[j]);
			if (stack_left == 0 || stack_left - 1 < alen) {
				fprintf(stderr, "stack too small to hold argv[%"PRIu32"]\n", j);
				return 1;
			}
			current_addr -= alen + 1;
			dmemory_write(argv2[j], current_addr, alen + 1);
			dmemory_write(&current_addr, argv_addr + j * 4, sizeof(current_addr));
		}
		dmemory_write(&num_buffer, argv_addr + argc2 * 4, sizeof(num_buffer));
		if (current_addr - stack_limit < 12) {
			fprintf(stderr, "stack too small to hold arguments\n");
			return 1;
		}
		/* main関数に渡す引数とダミーのリターンアドレスを書き込む */
		current_addr -= 12;
		dmemory_write(&argv_addr, current_addr + 8, sizeof(argv_addr));
		dmemory_write(&argc2, current_addr + 4, sizeof(argc2));
		num_buffer = UINT32_C(0xfffffff0);
		dmemory_write(&num_buffer, current_addr, sizeof(num_buffer));
		regs[ESP] = current_addr;
	}
	if (import_as_iat) {
		import_params.iat_addr = import_params.import_addr;
		import_params.iat_size = import_params.import_size;
	}
	if (use_xv6_syscall) {
		if (!initialize_xv6_syscall(xv6_syscall_work)) return 1;
	}
	if (use_pe_import) {
		if (!pe_import_initialize(&import_params, pe_import_work, argc2, argv_addr)) return 1;
	}
	if (enable_fs) {
		if (UINT32_MAX - 0x1000  + 1 < fs_addr) {
			fprintf(stderr, "FS buffer address too high!\n");
			return 1;
		}
		segment_offsets[FS] = fs_addr;
		dmemory_allocate(fs_addr, 0x1000);
		dmem_write_uint(fs_addr + 0x004, initial_esp, 4);
		dmem_write_uint(fs_addr + 0x008, initial_esp - stack_size, 4);
		dmem_write_uint(fs_addr + 0x018, fs_addr, 4);
	}

	if (enable_trace) {
		print_regs(stdout);
		putchar('\n');
	}
	while(step()) {
		if (enable_trace) {
			print_regs(stdout);
			putchar('\n');
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0xfffff000, -0x2c(%rbp) # imm = 0xFFFFF000
movl $0x1000, -0x30(%rbp)    # imm = 0x1000
movl $0x80000000, -0x34(%rbp) # imm = 0x80000000
movl $0x80000000, -0x38(%rbp) # imm = 0x80000000
movl $0x7ffff000, -0x3c(%rbp) # imm = 0x7FFFF000
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x74bd
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa9e6(%rip), %rsi      # 0x11846
callq 0x10c0
cmpl $0x0, %eax
jne 0x6ec5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x6e9c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xc980
cmpl $0x0, %eax
jne 0x6e9a
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x6ec0
movq 0xe14d(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa99f(%rip), %rsi      # 0x1184c
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x74ad
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa98b(%rip), %rsi      # 0x11863
callq 0x10c0
cmpl $0x0, %eax
jne 0x6f41
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x6f18
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x28(%rbp), %rdi
callq 0xc9f0
cmpl $0x0, %eax
jne 0x6f16
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x6f3c
movq 0xe0d1(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa940(%rip), %rsi      # 0x11869
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x74ab
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa92c(%rip), %rsi      # 0x11880
callq 0x10c0
cmpl $0x0, %eax
jne 0x6fc8
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x6f9f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq 0xe265(%rip), %rdx      # 0x151ec
callq 0xcec0
cmpl $0x0, %eax
jne 0x6f9d
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x6fc3
movq 0xe04a(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa8d5(%rip), %rsi      # 0x11885
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x74a9
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa8c0(%rip), %rsi      # 0x1189b
callq 0x10c0
cmpl $0x0, %eax
jne 0x6ff1
movl $0x1, -0x18(%rbp)
jmp 0x74a7
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa89f(%rip), %rsi      # 0x118a3
callq 0x10c0
cmpl $0x0, %eax
jne 0x7095
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x706c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x28(%rbp), %rdi
callq 0x6be0
cmpl $0x0, %eax
jne 0x706a
movq 0xdfaf(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa852(%rip), %rsi      # 0x118a9
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x7090
movq 0xdf7d(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa84a(%rip), %rsi      # 0x118c7
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x74a5
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa837(%rip), %rsi      # 0x118df
callq 0x10c0
cmpl $0x0, %eax
jne 0x7139
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x7110
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x2c(%rbp), %rdi
callq 0x6be0
cmpl $0x0, %eax
jne 0x710e
movq 0xdf0b(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa7ea(%rip), %rsi      # 0x118e5
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x7134
movq 0xded9(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa7e2(%rip), %rsi      # 0x11903
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x74a3
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa7cf(%rip), %rsi      # 0x1191b
callq 0x10c0
cmpl $0x0, %eax
jne 0x71dd
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x71b4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6be0
cmpl $0x0, %eax
jne 0x71b2
movq 0xde67(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa788(%rip), %rsi      # 0x11927
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x71d8
movq 0xde35(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa779(%rip), %rsi      # 0x1193e
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x74a1
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa76d(%rip), %rsi      # 0x1195d
callq 0x10c0
cmpl $0x0, %eax
jne 0x720f
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl $0x1, -0x1c(%rbp)
jmp 0x74bd
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa742(%rip), %rsi      # 0x11964
callq 0x10c0
cmpl $0x0, %eax
jne 0x72bd
movl $0x1, 0xdfca(%rip)      # 0x15204
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x7294
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x34(%rbp), %rdi
callq 0x6be0
cmpl $0x0, %eax
jne 0x7292
movq 0xdd87(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa6f3(%rip), %rsi      # 0x11972
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x72b8
movq 0xdd55(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa6fc(%rip), %rsi      # 0x119a1
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x749d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa6fa(%rip), %rsi      # 0x119ca
callq 0x10c0
cmpl $0x0, %eax
jne 0x736b
movl $0x1, 0xdf00(%rip)      # 0x151e8
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x7342
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x38(%rbp), %rdi
callq 0x6be0
cmpl $0x0, %eax
jne 0x7340
movq 0xdcd9(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa6a9(%rip), %rsi      # 0x119d6
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x7366
movq 0xdca7(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa6b1(%rip), %rsi      # 0x11a04
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x749b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa6ad(%rip), %rsi      # 0x11a2b
callq 0x10c0
cmpl $0x0, %eax
jne 0x7394
movl $0x1, -0x20(%rbp)
jmp 0x7499
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa697(%rip), %rsi      # 0x11a3e
callq 0x10c0
cmpl $0x0, %eax
jne 0x743c
movl $0x1, -0x24(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x8(%rbp), %eax
jge 0x7416
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x3c(%rbp), %rdi
callq 0x6be0
cmpl $0x0, %eax
jne 0x7414
movq 0xdc05(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa645(%rip), %rsi      # 0x11a46
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x743a
movq 0xdbd3(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa63c(%rip), %rsi      # 0x11a63
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x7497
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa635(%rip), %rsi      # 0x11a84
callq 0x10c0
cmpl $0x0, %eax
jne 0x7465
movl $0x1, 0xdd9d(%rip)      # 0x15200
jmp 0x7495
movq 0xdb84(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xa60b(%rip), %rsi      # 0x11a8d
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x7497
jmp 0x7499
jmp 0x749b
jmp 0x749d
jmp 0x749f
jmp 0x74a1
jmp 0x74a3
jmp 0x74a5
jmp 0x74a7
jmp 0x74a9
jmp 0x74ab
jmp 0x74ad
jmp 0x74af
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6e41
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jbe 0x74e9
movq 0xdb24(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa5d7(%rip), %rsi      # 0x11aad
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
movl -0x28(%rbp), %eax
movl %eax, 0xdcee(%rip)      # 0x151e0
movl $0x2, 0xdce8(%rip)      # 0x151e4
movl -0x2c(%rbp), %eax
movl %eax, 0xdccb(%rip)      # 0x151d0
movl -0x2c(%rbp), %edi
subl -0x30(%rbp), %edi
movl -0x30(%rbp), %esi
callq 0x7c60
cmpl $0x0, -0x1c(%rbp)
je 0x7730
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x2c(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x40(%rbp)
cmpl $-0x1, -0x40(%rbp)
je 0x7564
movl -0x40(%rbp), %ecx
addl $0x1, %ecx
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
cmpl %ecx, %eax
jae 0x7588
movq 0xda85(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa557(%rip), %rsi      # 0x11acc
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
movl -0x58(%rbp), %eax
subl -0x54(%rbp), %eax
movl -0x40(%rbp), %ecx
addl $0x1, %ecx
shll $0x2, %ecx
cmpl %ecx, %eax
jae 0x75bf
movq 0xda4e(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa534(%rip), %rsi      # 0x11ae0
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
movl -0x40(%rbp), %ecx
addl $0x1, %ecx
shll $0x2, %ecx
movl -0x58(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x40(%rbp), %eax
jae 0x7696
movl -0x58(%rbp), %eax
subl -0x54(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movl -0x48(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x1080
movq %rax, -0x68(%rbp)
cmpl $0x0, -0x60(%rbp)
je 0x761a
movl -0x60(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
cmpq -0x68(%rbp), %rax
jae 0x7641
movq 0xd9cf(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
movl -0x48(%rbp), %edx
leaq 0xa4d6(%rip), %rsi      # 0x11b04
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
movq -0x68(%rbp), %rcx
addq $0x1, %rcx
movl -0x58(%rbp), %eax
subq %rcx, %rax
movl %eax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movl -0x48(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
movl -0x58(%rbp), %esi
movq -0x68(%rbp), %rax
addq $0x1, %rax
movl %eax, %edx
callq 0x7ad0
movl -0x44(%rbp), %esi
movl -0x48(%rbp), %eax
shll $0x2, %eax
addl %eax, %esi
leaq -0x58(%rbp), %rdi
movl $0x4, %edx
callq 0x7ad0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x75dd
movl -0x44(%rbp), %esi
movl -0x40(%rbp), %eax
shll $0x2, %eax
addl %eax, %esi
leaq -0x5c(%rbp), %rdi
movl $0x4, %edx
callq 0x7ad0
movl -0x58(%rbp), %eax
subl -0x54(%rbp), %eax
cmpl $0xc, %eax
jae 0x76de
movq 0xd92f(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa45b(%rip), %rsi      # 0x11b26
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
movl -0x58(%rbp), %eax
subl $0xc, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %esi
addl $0x8, %esi
leaq -0x44(%rbp), %rdi
movl $0x4, %edx
callq 0x7ad0
movl -0x58(%rbp), %esi
addl $0x4, %esi
leaq -0x40(%rbp), %rdi
movl $0x4, %edx
callq 0x7ad0
movl $0xfffffff0, -0x5c(%rbp) # imm = 0xFFFFFFF0
movl -0x58(%rbp), %esi
leaq -0x5c(%rbp), %rdi
movl $0x4, %edx
callq 0x7ad0
movl -0x58(%rbp), %eax
movl %eax, 0xdaa0(%rip)      # 0x151d0
cmpl $0x0, -0x20(%rbp)
je 0x774e
movl 0xdab4(%rip), %eax      # 0x151f0
movl %eax, 0xdab6(%rip)      # 0x151f8
movl 0xdaac(%rip), %eax      # 0x151f4
movl %eax, 0xdaae(%rip)      # 0x151fc
cmpl $0x0, 0xdaaf(%rip)      # 0x15204
je 0x7772
movl -0x34(%rbp), %edi
callq 0xd630
cmpl $0x0, %eax
jne 0x7770
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x7772
cmpl $0x0, 0xda6f(%rip)      # 0x151e8
je 0x77a3
movl -0x38(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x44(%rbp), %ecx
leaq 0xda61(%rip), %rdi      # 0x151ec
callq 0xe200
cmpl $0x0, %eax
jne 0x77a1
movl $0x1, -0x4(%rbp)
jmp 0x7880
jmp 0x77a3
cmpl $0x0, -0x24(%rbp)
je 0x782d
movl $0xfffff000, %eax       # imm = 0xFFFFF000
cmpl -0x3c(%rbp), %eax
jae 0x77db
movq 0xd832(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0xa381(%rip), %rsi      # 0x11b49
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x7880
movl -0x3c(%rbp), %eax
movl %eax, 0xda3c(%rip)      # 0x15220
movl -0x3c(%rbp), %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x7c60
movl -0x3c(%rbp), %edi
addl $0x4, %edi
movl -0x2c(%rbp), %esi
movl $0x4, %edx
callq 0x8070
movl -0x3c(%rbp), %edi
addl $0x8, %edi
movl -0x2c(%rbp), %esi
subl -0x30(%rbp), %esi
movl $0x4, %edx
callq 0x8070
movl -0x3c(%rbp), %edi
addl $0x18, %edi
movl -0x3c(%rbp), %esi
movl $0x4, %edx
callq 0x8070
cmpl $0x0, -0x18(%rbp)
je 0x784c
movq 0xd78e(%rip), %rax      # 0x14fc8
movq (%rax), %rdi
callq 0x12b0
movl $0xa, %edi
callq 0x1040
jmp 0x784e
callq 0x14c0
cmpl $0x0, %eax
je 0x7879
cmpl $0x0, -0x18(%rbp)
je 0x7877
movq 0xd763(%rip), %rax      # 0x14fc8
movq (%rax), %rdi
callq 0x12b0
movl $0xa, %edi
callq 0x1040
jmp 0x784e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)