// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/main.c
// Function: main
int main(int argc, char *argv[]) {

	error_clear();
	ferr = stdout; // ferr in Eclipse console not visible?

	tu58images_init();

	parse_commandline(argc, argv);
	// returns only if everything is OK
	// Std options already executed

	// some debug info
	if (opt_debug) {
		info(version);
		info(copyright);
	}

	// some warnings
	check_capabilities();

	// give some info
	info("Using serial port %s at %d baud with %d%c%d format.", opt_serial_port,
			opt_serial_speed, opt_serial_bitcount, opt_serial_parity, opt_serial_stopbits);

	if (drive_count == 0) {
		info("No simulated drives were specified, emulator not started.");
	} else {
		// emulation: must have opened at least one unit

		if (opt_mrspen)
			info("MRSP mode enabled (NOT fully tested - use with caution)");

		// setup serial and console ports
		serial_devinit(&tu58_serial, opt_serial_port, opt_serial_speed, opt_serial_bitcount,
				opt_serial_parity, opt_serial_stopbits);
		coninit(0); // normal without echo

		// start thread with tu58 emulator
		run_emulator();

		// restore serial and console ports
		conrestore();
		serial_devrestore(&tu58_serial);

		// write back unsaved files and close
		tu58images_closeall();
	}

	// boot loader?
	if (opt_boot_monitor == monitor_showcode) {
		bootloader_show_code(stdout, opt_boot_address);
	} else if (opt_boot_monitor != monitor_none) {
		int res;
		serial_device_t monitor_serial; // PDP-11 console
		serial_devinit(&monitor_serial, opt_serial_port, opt_serial_speed, opt_serial_bitcount,
				opt_serial_parity, opt_serial_stopbits);
		coninit(1); // host console, raw: no processing of PDP-11 I/O

		// download, and echo to console
		res = bootloader_download(&monitor_serial, opt_boot_monitor, opt_boot_address);
		if (!res)
			res = bootloader_go(&monitor_serial, opt_boot_monitor, opt_boot_address);
		// no error

		if (opt_boot_keep) {
			if (res) {
				run_teletype(&monitor_serial, opt_boot_monitor,
						"PDP-11 does not respond. Use this teletype session to verify console prompt.");
			} else
				// interactive tty terminal on PDP-11 monitor port
				run_teletype(&monitor_serial, opt_boot_monitor, NULL);
		}

		// restore serial and console ports
		conrestore();
		serial_devrestore(&monitor_serial);
	}
	return 0 ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2568, %rsp           # imm = 0x2568
movq %rsi, %rbx
movl %edi, %ebp
callq 0x9824
movq 0x184be(%rip), %rax     # 0x1bfd0
movq (%rax), %rax
leaq 0x1a714(%rip), %rcx     # 0x1e230
movq %rax, (%rcx)
callq 0x639c
leaq 0x18f65(%rip), %r14     # 0x1ca90
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x5008
andl $0x0, 0x18f53(%rip)     # 0x1ca90
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe35a(%rip), %rax      # 0x11eab
movq %rax, (%rsp)
leaq 0x12145(%rip), %rsi     # 0x15ca1
leaq 0xe343(%rip), %rdx      # 0x11ea6
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe338(%rip), %rax      # 0x11ebf
movq %rax, (%rsp)
leaq 0x11ba0(%rip), %rsi     # 0x15732
leaq 0xe31e(%rip), %rdx      # 0x11eb7
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe323(%rip), %rax      # 0x11ee0
movq %rax, (%rsp)
leaq 0xe30e(%rip), %rsi      # 0x11ed6
leaq 0xe30b(%rip), %rdx      # 0x11eda
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe315(%rip), %rax      # 0x11f08
movq %rax, (%rsp)
leaq 0x12444(%rip), %rsi     # 0x16042
leaq 0xe2fb(%rip), %rdx      # 0x11f00
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe307(%rip), %rax      # 0x11f30
movq %rax, (%rsp)
leaq 0x104d5(%rip), %rsi     # 0x14109
leaq 0xe2f0(%rip), %rdx      # 0x11f2b
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe301(%rip), %rax      # 0x11f60
movq %rax, (%rsp)
leaq 0x123b0(%rip), %rsi     # 0x1601a
leaq 0xe2e8(%rip), %rdx      # 0x11f59
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe301(%rip), %rax      # 0x11f96
movq %rax, (%rsp)
leaq 0x10bd8(%rip), %rsi     # 0x14878
leaq 0xe2eb(%rip), %rdx      # 0x11f92
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe30f(%rip), %rax      # 0x11fda
movq %rax, (%rsp)
leaq 0xe2f6(%rip), %rsi      # 0x11fcc
leaq 0xe2f2(%rip), %rdx      # 0x11fcf
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe320(%rip), %rax      # 0x12021
movq %rax, (%rsp)
leaq 0xf1bd(%rip), %rsi      # 0x12ec9
leaq 0xe2fd(%rip), %rdx      # 0x12010
leaq 0xe2fd(%rip), %rcx      # 0x12017
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe364(%rip), %rax      # 0x120a0
movq %rax, (%rsp)
leaq 0x122d7(%rip), %rsi     # 0x1601e
leaq 0xe343(%rip), %rcx      # 0x12091
leaq 0xe345(%rip), %r9       # 0x1209a
movq %r14, %rdi
movq %rcx, %rdx
xorl %r8d, %r8d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xe47b(%rip), %rax      # 0x121ed
movq %rax, 0x10(%rsp)
leaq 0xe46b(%rip), %rax      # 0x121e9
movq %rax, 0x8(%rsp)
leaq 0xe359(%rip), %rax      # 0x120e3
movq %rax, (%rsp)
leaq 0xe337(%rip), %rsi      # 0x120cc
leaq 0xf128(%rip), %rdx      # 0x12ec4
leaq 0xe32b(%rip), %rcx      # 0x120ce
leaq 0xe335(%rip), %r9       # 0x120df
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe46b(%rip), %rax      # 0x12234
movq %rax, (%rsp)
leaq 0xe4bf(%rip), %rsi      # 0x12293
leaq 0xe446(%rip), %rdx      # 0x12221
leaq 0xe444(%rip), %rcx      # 0x12226
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe491(%rip), %rax      # 0x12295
movq %rax, (%rsp)
leaq 0xe47e(%rip), %rsi      # 0x1228d
leaq 0xe47a(%rip), %rdx      # 0x12290
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe4e5(%rip), %rax      # 0x1231f
movq %rax, (%rsp)
leaq 0xd2e0(%rip), %rsi      # 0x11125
leaq 0xe4ce(%rip), %rdx      # 0x1231a
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xe61d(%rip), %rax      # 0x12488
movq %rax, 0x10(%rsp)
leaq 0xe60d(%rip), %rax      # 0x12484
movq %rax, 0x8(%rsp)
leaq 0xe4ce(%rip), %rax      # 0x12351
movq %rax, (%rsp)
leaq 0xea12(%rip), %rsi      # 0x128a0
leaq 0x11570(%rip), %rcx     # 0x15405
movq %r14, %rdi
movq %rcx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xe777(%rip), %rax      # 0x1262c
movq %rax, 0x10(%rsp)
leaq 0xe75c(%rip), %rax      # 0x1261d
movq %rax, 0x8(%rsp)
leaq 0xe5ff(%rip), %rax      # 0x124cc
movq %rax, (%rsp)
leaq 0x11153(%rip), %rsi     # 0x1502b
leaq 0x10323(%rip), %rdx     # 0x14202
leaq 0xe5c6(%rip), %rcx      # 0x124ac
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xe868(%rip), %rax      # 0x1276b
movq %rax, 0x10(%rsp)
leaq 0xe83f(%rip), %rax      # 0x1274e
movq %rax, 0x8(%rsp)
leaq 0xe76a(%rip), %rax      # 0x12685
movq %rax, (%rsp)
leaq 0xe72e(%rip), %rsi      # 0x12654
leaq 0xe72a(%rip), %rdx      # 0x12657
leaq 0xe730(%rip), %rcx      # 0x12664
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe847(%rip), %rax      # 0x1279d
movq %rax, (%rsp)
leaq 0x114d3(%rip), %rsi     # 0x15434
leaq 0xe829(%rip), %rdx      # 0x12791
leaq 0xee08(%rip), %rcx      # 0x12d77
leaq 0x10b4a(%rip), %r9      # 0x14ac0
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x502b
callq 0xb2cd
leaq 0xe853(%rip), %rsi      # 0x127e0
leaq 0x2160(%rsp), %r15
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3530
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movq %r15, (%rsp)
leaq 0xe8e8(%rip), %rsi      # 0x128a2
leaq 0xe8e4(%rip), %rdx      # 0x128a5
leaq 0xe8e4(%rip), %rcx      # 0x128ac
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
callq 0xb2cd
leaq 0xe8e6(%rip), %rsi      # 0x128c8
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3530
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movq %r15, (%rsp)
leaq 0xe993(%rip), %rsi      # 0x1299a
leaq 0xe899(%rip), %rdx      # 0x128a7
leaq 0xe988(%rip), %rcx      # 0x1299d
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xe994(%rip), %rax      # 0x129cb
movq %rax, (%rsp)
leaq 0xe977(%rip), %rdx      # 0x129b9
leaq 0xe975(%rip), %rcx      # 0x129be
leaq 0xe976(%rip), %r8       # 0x129c6
movq %r14, %rdi
movq %rdx, %rsi
xorl %r9d, %r9d
callq 0x502b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
leaq 0xed0d(%rip), %rax      # 0x12d7f
movq %rax, (%rsp)
leaq 0xece9(%rip), %rsi      # 0x12d66
leaq 0xece5(%rip), %rdx      # 0x12d69
leaq 0xece7(%rip), %rcx      # 0x12d72
movq %r14, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x502b
cmpl $0x1, %ebp
jle 0x4e49
andl $0x0, 0x19bbf(%rip)     # 0x1dc68
movb $0x0, 0x188b0(%rip)     # 0x1c960
andl $0x0, 0x189d1(%rip)     # 0x1ca88
leaq 0x189d2(%rip), %r14     # 0x1ca90
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x560c
leaq 0xddd4(%rip), %r15      # 0x11ea6
leaq 0xddde(%rip), %r12      # 0x11eb7
leaq 0xdfb1(%rip), %rbp      # 0x12091
leaq 0x1160(%rsp), %r13
leaq 0x18231(%rip), %rbx     # 0x1c320
movl $0x0, 0x3c(%rsp)
movq $0x0, 0x40(%rsp)
testl %eax, %eax
jle 0x4a97
movq %r14, %rdi
movq %r15, %rsi
callq 0x5288
testl %eax, %eax
jne 0x4e49
movq %r14, %rdi
movq %r12, %rsi
callq 0x5288
testl %eax, %eax
je 0x4139
movq %rbx, %rdi
xorl %eax, %eax
callq 0x99c3
jmp 0x426f
movq %r14, %rdi
leaq 0xdd97(%rip), %rsi      # 0x11eda
callq 0x5288
testl %eax, %eax
je 0x415b
movl $0x1, 0x1891e(%rip)     # 0x1ca74
jmp 0x426f
movq %r14, %rdi
leaq 0xdd9b(%rip), %rsi      # 0x11f00
callq 0x5288
testl %eax, %eax
je 0x417d
movl $0x1, 0x188ec(%rip)     # 0x1ca64
jmp 0x426f
movq %r14, %rdi
leaq 0xdda4(%rip), %rsi      # 0x11f2b
callq 0x5288
testl %eax, %eax
je 0x419f
movl $0x1, 0x188d2(%rip)     # 0x1ca6c
jmp 0x426f
movq %r14, %rdi
leaq 0xddb0(%rip), %rsi      # 0x11f59
callq 0x5288
testl %eax, %eax
je 0x41c1
movl $0x1, 0x188b4(%rip)     # 0x1ca70
jmp 0x426f
movq %r14, %rdi
leaq 0xddc7(%rip), %rsi      # 0x11f92
callq 0x5288
testl %eax, %eax
je 0x41e3
movl $0x1, 0x1889a(%rip)     # 0x1ca78
jmp 0x426f
movq %r14, %rdi
leaq 0xe5a4(%rip), %rsi      # 0x12791
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x4215
leaq 0xeb77(%rip), %rsi      # 0x12d77
leaq 0x18879(%rip), %rdx     # 0x1ca80
callq 0x5960
testl %eax, %eax
jns 0x426f
jmp 0x4e4e
leaq 0xddb3(%rip), %rsi      # 0x11fcf
callq 0x5288
testl %eax, %eax
je 0x4231
movl $0x1, 0x1884d(%rip)     # 0x1ca7c
jmp 0x426f
movq %r14, %rdi
leaq 0xddd5(%rip), %rsi      # 0x12010
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x427c
leaq 0xddc9(%rip), %rsi      # 0x12017
leaq 0x18813(%rip), %rdx     # 0x1ca68
callq 0x5960
testl %eax, %eax
js 0x4e4e
cmpl $0x3, 0x187ff(%rip)     # 0x1ca68
jge 0x4e93
movq %r14, %rdi
callq 0x5312
jmp 0x4100
movq %rbp, %rsi
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x429e
leaq 0xddff(%rip), %rsi      # 0x12091
leaq 0x187c7(%rip), %rdx     # 0x1ca60
jmp 0x4207
leaq 0xec1f(%rip), %rsi      # 0x12ec4
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x42fa
leaq 0xde16(%rip), %rsi      # 0x120ce
movq %r13, %rdx
pushq $0x50
popq %rcx
callq 0x57c3
testl %eax, %eax
js 0x4e4e
leaq 0x1160(%rsp), %rdi
leaq 0x18026(%rip), %rsi     # 0x1c300
leaq 0x18023(%rip), %rdx     # 0x1c304
leaq 0x18020(%rip), %rcx     # 0x1c308
callq 0x8243
testl %eax, %eax
je 0x426f
jmp 0x4e9c
leaq 0xdf20(%rip), %rsi      # 0x12221
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x432a
leaq 0xdf12(%rip), %rsi      # 0x12226
leaq 0x18645(%rip), %rdx     # 0x1c960
movl $0x100, %ecx            # imm = 0x100
callq 0x57c3
jmp 0x420c
leaq 0xdf5f(%rip), %rsi      # 0x12290
callq 0x5288
testl %eax, %eax
je 0x433e
pushq $0x1
jmp 0x4353
movq %r14, %rdi
leaq 0xdfd2(%rip), %rsi      # 0x1231a
callq 0x5288
testl %eax, %eax
je 0x435d
pushq $0x2
popq %rax
movl %eax, 0x3c(%rsp)
jmp 0x426f
movq %r14, %rdi
leaq 0x1109e(%rip), %rsi     # 0x15405
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x4403
leaq 0x11087(%rip), %rsi     # 0x15405
movq %r13, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x57c3
testl %eax, %eax
js 0x4e4e
movq %r13, %rdi
leaq 0xeb2e(%rip), %rsi      # 0x12ecb
callq 0x3060
testl %eax, %eax
je 0x44d9
movq %r13, %rdi
callq 0x3190
movq %rax, 0x40(%rsp)
callq 0x3030
movq (%rax), %rax
movq 0x40(%rsp), %rcx
decl %ecx
movslq %ecx, %rcx
addq %rsp, %rcx
addq $0x1160, %rcx           # imm = 0x1160
movq %rcx, 0x30(%rsp)
movsbq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
cmpl $0x4b, %eax
je 0x44e7
pushq $0x1
popq %rcx
movq %rcx, 0x40(%rsp)
cmpl $0x4d, %eax
jne 0x44f9
movl $0x100000, %eax         # imm = 0x100000
jmp 0x44ec
leaq 0xfdf8(%rip), %rsi      # 0x14202
callq 0x5288
testl %eax, %eax
jne 0x442a
movq %r14, %rdi
leaq 0xe23a(%rip), %rsi      # 0x12657
callq 0x5288
testl %eax, %eax
je 0x45f8
movq %r14, %rdi
leaq 0xe223(%rip), %rsi      # 0x12657
callq 0x5288
movl %eax, 0x30(%rsp)
movq %r14, %rdi
leaq 0xea97(%rip), %rsi      # 0x12ede
leaq 0x160(%rsp), %rdx
callq 0x5960
testl %eax, %eax
js 0x4e4e
cmpl $0x8, 0x160(%rsp)
jae 0x4eb7
movq %r14, %rdi
leaq 0xea87(%rip), %rsi      # 0x12efb
movq %r13, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
callq 0x3030
movq (%rax), %rax
movsbq 0x1160(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl $0x43, %eax
je 0x4538
movl $0x0, 0x50(%rsp)
pushq $0x1
popq %rcx
movl %ecx, 0x48(%rsp)
cmpl $0x52, %eax
je 0x4547
cmpl $0x57, %eax
jne 0x4eae
movl $0x0, 0x50(%rsp)
movl $0x0, 0x48(%rsp)
jmp 0x4547
movq $0x0, 0x40(%rsp)
jmp 0x426f
movl $0x400, %eax            # imm = 0x400
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rax
movb $0x0, (%rax)
movq %r13, %rdi
leaq 0x160(%rsp), %rsi
xorl %edx, %edx
callq 0x3330
movq 0x40(%rsp), %rcx
imull %eax, %ecx
movq %rcx, 0x40(%rsp)
testl %ecx, %ecx
je 0x4ea5
movq 0x30(%rsp), %rax
cmpq %rax, 0x160(%rsp)
je 0x426f
jmp 0x4ea5
movl $0x0, 0x48(%rsp)
pushq $0x1
popq %rax
movl %eax, 0x50(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x4579
movq %r14, %rdi
leaq 0xf8a4(%rip), %rsi      # 0x13dfc
movq %r13, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
cmpl $0x0, 0x3c(%rsp)
jne 0x4598
jmp 0x4ed4
movq %r14, %rdi
leaq 0xdf40(%rip), %rsi      # 0x124c3
movq %r13, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
movl 0x160(%rsp), %edi
movq 0x40(%rsp), %rsi
callq 0x63b7
movl 0x160(%rsp), %edi
callq 0x63f1
movq %rax, %rdi
movl 0x30(%rsp), %esi
movl 0x48(%rsp), %edx
movl 0x50(%rsp), %ecx
movq %r13, %r8
movl 0x3c(%rsp), %r9d
callq 0x77c2
testl %eax, %eax
js 0x4e4e
movl 0x160(%rsp), %edi
callq 0x63f1
movq %rax, %rdi
callq 0x7b11
incl 0x19675(%rip)           # 0x1dc68
jmp 0x426f
movq %r14, %rdi
leaq 0xe2a3(%rip), %rsi      # 0x128a5
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x47b0
leaq 0xdeaa(%rip), %rsi      # 0x124c3
movq %r13, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
movq %r14, %rdi
leaq 0xe91d(%rip), %rsi      # 0x12f55
leaq 0x160(%rsp), %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
movq %r14, %rdi
leaq 0xe352(%rip), %rsi      # 0x129ae
leaq 0x60(%rsp), %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x57c3
testl %eax, %eax
js 0x4e4e
leaq 0x60(%rsp), %rdi
callq 0xb29d
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x3c(%rsp)
je 0x4ed4
cmpl $0x0, 0x30(%rsp)
je 0x4ee0
cmpl $0x0, 0x40(%rsp)
setne %al
cmpl $0x1, 0x30(%rsp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x4ec8
movl 0x30(%rsp), %edi
movl $0xff, %esi
movq 0x40(%rsp), %rdx
callq 0x76bc
movq %rax, 0x50(%rsp)
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r13, %r8
movl 0x3c(%rsp), %r9d
callq 0x77c2
testl %eax, %eax
je 0x46f2
leaq 0xe8b5(%rip), %rdi      # 0x12fa0
xorl %eax, %eax
callq 0x9b87
movq 0x50(%rsp), %rax
movq 0x118(%rax), %rcx
movl 0x110(%rax), %r8d
movq 0xf8(%rax), %r9
movl 0x3c(%rsp), %edi
movl 0x30(%rsp), %esi
xorl %edx, %edx
callq 0xac8b
movq %rax, 0x30(%rsp)
movq %rax, %rdi
callq 0xadbf
testl %eax, %eax
je 0x473a
leaq 0xe87f(%rip), %rdi      # 0x12fb2
xorl %eax, %eax
callq 0x9b87
xorl %edi, %edi
leaq 0x160(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x8ec5
movq %rax, 0x48(%rsp)
movq %rax, %rdi
pushq $0x1
popq %rdx
movl %edx, %esi
xorl %ecx, %ecx
callq 0x882c
testl %eax, %eax
je 0x4774
leaq 0xe85d(%rip), %rdi      # 0x12fca
xorl %eax, %eax
callq 0x9b87
movq 0x48(%rsp), %rdi
callq 0x8b55
leaq 0x19aab(%rip), %rax     # 0x1e230
movq (%rax), %rsi
movq 0x30(%rsp), %rdi
callq 0xb1cc
leaq 0xe848(%rip), %rdi      # 0x12fe1
movq %r13, %rsi
leaq 0x160(%rsp), %rdx
xorl %eax, %eax
callq 0x99c3
jmp 0x4972
leaq 0xe0f0(%rip), %rsi      # 0x128a7
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x4995
leaq 0xdcf5(%rip), %rsi      # 0x124c3
movq %r13, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
movq %r14, %rdi
leaq 0xe768(%rip), %rsi      # 0x12f55
leaq 0x160(%rsp), %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x57c3
testl %eax, %eax
js 0x4e4e
movq %r14, %rdi
leaq 0xe19d(%rip), %rsi      # 0x129ae
leaq 0x60(%rsp), %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x57c3
testl %eax, %eax
js 0x4e4e
leaq 0x60(%rsp), %rdi
callq 0xb29d
testl %eax, %eax
je 0x4ee0
cmpl $0x0, 0x3c(%rsp)
je 0x4ed4
movl %eax, %edx
cmpl $0x0, 0x40(%rsp)
sete %al
cmpl $0x1, %edx
sete %cl
orb %al, %cl
je 0x4ec8
movl %edx, %edi
movl %edx, 0x30(%rsp)
movl $0xff, %esi
movq 0x40(%rsp), %rdx
callq 0x76bc
movq 0x118(%rax), %rcx
movq %rax, 0x50(%rsp)
movl 0x110(%rax), %r8d
movl 0x3c(%rsp), %edi
movl 0x30(%rsp), %esi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0xac8b
xorl %edi, %edi
leaq 0x160(%rsp), %rsi
movq %rax, 0x30(%rsp)
movq %rax, %rdx
callq 0x8ec5
movq %rax, 0x48(%rsp)
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x882c
testl %eax, %eax
je 0x48d3
leaq 0xe6fe(%rip), %rdi      # 0x12fca
xorl %eax, %eax
callq 0x9b87
movq 0x48(%rsp), %rdi
callq 0x8c6d
testl %eax, %eax
je 0x48ef
leaq 0xe728(%rip), %rdi      # 0x13010
xorl %eax, %eax
callq 0x9b87
movq 0x30(%rsp), %rdi
callq 0xb14b
testl %eax, %eax
je 0x490b
leaq 0xe725(%rip), %rdi      # 0x13029
xorl %eax, %eax
callq 0x9b87
leaq 0x1991e(%rip), %rax     # 0x1e230
movq (%rax), %rsi
movq 0x30(%rsp), %rdi
callq 0xb1cc
movq %r13, %rdi
leaq 0x117b0(%rip), %rsi     # 0x160d9
callq 0x34b0
movq %rax, 0x58(%rsp)
testq %rax, %rax
jne 0x4949
leaq 0xe703(%rip), %rdi      # 0x13042
movq %r13, %rsi
xorl %eax, %eax
callq 0x9b87
movq 0x50(%rsp), %rax
movq 0x118(%rax), %rdi
movl 0x110(%rax), %edx
pushq $0x1
popq %rsi
movq 0x58(%rsp), %rcx
callq 0x3550
movq 0x58(%rsp), %rdi
callq 0x3150
movq 0x30(%rsp), %rdi
callq 0xad3a
movq 0x48(%rsp), %rdi
callq 0x8f13
movq 0x50(%rsp), %rdi
callq 0x800d
jmp 0x426f
leaq 0xe01d(%rip), %rsi      # 0x129b9
callq 0x5288
movq %r14, %rdi
testl %eax, %eax
je 0x4a57
leaq 0xe00b(%rip), %rsi      # 0x129be
movq %r13, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x57c3
testl %eax, %eax
js 0x4e4e
leaq 0xe68a(%rip), %rdi      # 0x13059
movq %r13, %rsi
callq 0x3060
testl %eax, %eax
je 0x4a81
leaq 0xe678(%rip), %rdi      # 0x1305e
movq %r13, %rsi
callq 0x3060
pushq $0x2
popq %rcx
testl %eax, %eax
je 0x4a3b
leaq 0xe666(%rip), %rdi      # 0x13062
movq %r13, %rsi
callq 0x3060
pushq $0x3
popq %rcx
testl %eax, %eax
je 0x4a3b
leaq 0xe656(%rip), %rdi      # 0x13068
movq %r13, %rsi
callq 0x3060
pushq $0x4
popq %rcx
testl %eax, %eax
je 0x4a3b
leaq 0xe646(%rip), %rdi      # 0x1306e
movq %r13, %rsi
callq 0x3060
pushq $0x5
popq %rcx
testl %eax, %eax
jne 0x4eec
movl %ecx, 0x18047(%rip)     # 0x1ca88
movq %r14, %rdi
leaq 0xdf7b(%rip), %rsi      # 0x129c6
leaq 0x1803a(%rip), %rdx     # 0x1ca8c
jmp 0x4207
leaq 0xe30b(%rip), %rsi      # 0x12d69
callq 0x5288
testl %eax, %eax
je 0x426f
movq %r14, %rdi
leaq 0xe2fd(%rip), %rsi      # 0x12d72
leaq 0x18008(%rip), %rdx     # 0x1ca84
jmp 0x4207
movl $0x1, 0x17ffd(%rip)     # 0x1ca88
andl $0x0, 0x17ffa(%rip)     # 0x1ca8c
jmp 0x426f
leal 0x3(%rax), %ecx
cmpl $0x1, %ecx
jbe 0x4e4e
testl %eax, %eax
js 0x4e57
cmpl $0x0, 0x17fc2(%rip)     # 0x1ca74
je 0x4ad0
leaq 0x17865(%rip), %rdi     # 0x1c320
xorl %eax, %eax
callq 0x99c3
leaq 0x178b7(%rip), %rdi     # 0x1c380
xorl %eax, %eax
callq 0x99c3
movl 0x19192(%rip), %eax     # 0x1dc68
testl %eax, %eax
jle 0x4af7
cmpl $0x0, 0x17fa7(%rip)     # 0x1ca88
je 0x4af7
leaq 0xe5f8(%rip), %rdi      # 0x130e2
xorl %eax, %eax
callq 0x9b87
movl 0x19171(%rip), %eax     # 0x1dc68
testl %eax, %eax
setg %cl
movb 0x17e5e(%rip), %al      # 0x1c960
testb %al, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4b22
leaq 0xe601(%rip), %rdi      # 0x13116
xorl %eax, %eax
callq 0x9b87
movb 0x17e3e(%rip), %al      # 0x1c960
cmpl $0x2, 0x17f5f(%rip)     # 0x1ca88
jb 0x4b3d
testb %al, %al
jne 0x4b3d
leaq 0xe616(%rip), %rdi      # 0x1314c
xorl %eax, %eax
callq 0x9b87
cmpl $0x0, 0x19124(%rip)     # 0x1dc68
jle 0x4b5d
cmpl $0x8, 0x177b3(%rip)     # 0x1c300
je 0x4b5d
leaq 0xe632(%rip), %rdi      # 0x13188
xorl %eax, %eax
callq 0x9b87
xorl %edi, %edi
callq 0x63f1
testq %rax, %rax
je 0x4b99
cmpl $0x1, 0x10c(%rax)
jne 0x4b99
movq 0xe8(%rax), %rcx
movl 0xf0(%rax), %edx
imull 0x18(%rcx), %edx
cmpl %edx, 0x110(%rax)
je 0x4b99
leaq 0xe62e(%rip), %rdi      # 0x131c0
xorl %eax, %eax
callq 0x9aa5
pushq $0x2
popq %rbx
leaq 0xe654(%rip), %r14      # 0x131f7
cmpl $0x8, %ebx
je 0x4bcd
movl %ebx, %edi
callq 0x63f1
testq %rax, %rax
je 0x4bc9
cmpl $0x2, 0x10c(%rax)
jne 0x4bc9
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x9aa5
incl %ebx
jmp 0x4ba3
leaq 0xe65f(%rip), %rbx      # 0x13233
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpl $0x8, %ebp
je 0x4c0d
movl %ebp, %edi
callq 0x63f1
testq %rax, %rax
je 0x4c09
movl 0x10c(%rax), %eax
testl %r14d, %r14d
je 0x4c06
cmpl %eax, %r14d
je 0x4c09
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9b87
jmp 0x4c09
movl %eax, %r14d
incl %ebp
jmp 0x4bd9
leaq 0xe64f(%rip), %rbx      # 0x13263
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpl $0x8, %ebp
je 0x4c56
movl %ebp, %edi
callq 0x63f1
testq %rax, %rax
je 0x4c52
cmpl $0x2, 0x10c(%rax)
jne 0x4c52
movl 0x110(%rax), %eax
testl %r14d, %r14d
je 0x4c4f
cmpl %eax, %r14d
je 0x4c52
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9aa5
jmp 0x4c52
movl %eax, %r14d
incl %ebp
jmp 0x4c19
xorl %edi, %edi
callq 0x63f1
testq %rax, %rax
je 0x4c98
cmpl $0x2, 0x10c(%rax)
jne 0x4c98
movq 0xe8(%rax), %rcx
movl 0xf0(%rax), %edx
imull 0x18(%rcx), %edx
cmpl %edx, 0x110(%rax)
je 0x4c98
cmpl $0x0, 0x3c(%rax)
jne 0x4c98
leaq 0xe603(%rip), %rdi      # 0x13294
xorl %eax, %eax
callq 0x9aa5
movl 0x17dc2(%rip), %edx     # 0x1ca60
movl 0x1765c(%rip), %ecx     # 0x1c300
movsbl 0x17658(%rip), %r8d     # 0x1c304
movl 0x17655(%rip), %r9d     # 0x1c308
leaq 0xc5d0(%rip), %rdi      # 0x1128a
leaq 0x17c9f(%rip), %rsi     # 0x1c960
xorl %eax, %eax
callq 0x99c3
cmpl $0x0, 0x18f99(%rip)     # 0x1dc68
je 0x4d39
cmpl $0x0, 0x17d94(%rip)     # 0x1ca6c
je 0x4ce8
leaq 0xc617(%rip), %rdi      # 0x112f8
xorl %eax, %eax
callq 0x99c3
movl 0x17d72(%rip), %edx     # 0x1ca60
movl 0x1760c(%rip), %ecx     # 0x1c300
movsbl 0x17608(%rip), %r8d     # 0x1c304
movl 0x17605(%rip), %r9d     # 0x1c308
leaq 0x191be(%rip), %rbx     # 0x1dec8
leaq 0x17c4f(%rip), %rsi     # 0x1c960
movq %rbx, %rdi
callq 0x82cd
xorl %edi, %edi
callq 0x856e
callq 0x3888
callq 0x8651
movq %rbx, %rdi
callq 0x854e
callq 0x6400
jmp 0x4d47
leaq 0xc57e(%rip), %rdi      # 0x112be
xorl %eax, %eax
callq 0x99c3
movl 0x17d3b(%rip), %eax     # 0x1ca88
testl %eax, %eax
je 0x4e23
cmpl $0x1, %eax
jne 0x4d74
movq 0x1726f(%rip), %rax     # 0x1bfd0
movq (%rax), %rdi
movl 0x175a6(%rip), %esi     # 0x1c310
callq 0x102d0
jmp 0x4e23
movl 0x17ce6(%rip), %edx     # 0x1ca60
movl 0x17580(%rip), %ecx     # 0x1c300
movsbl 0x1757c(%rip), %r8d     # 0x1c304
movl 0x17579(%rip), %r9d     # 0x1c308
leaq 0x17bca(%rip), %rsi     # 0x1c960
leaq 0x1160(%rsp), %rbx
movq %rbx, %rdi
callq 0x82cd
pushq $0x1
popq %rdi
callq 0x856e
movl 0x17cd4(%rip), %esi     # 0x1ca88
movl 0x17556(%rip), %edx     # 0x1c310
movq %rbx, %rdi
callq 0x10345
testl %eax, %eax
je 0x4dd1
cmpl $0x0, 0x17cbf(%rip)     # 0x1ca8c
jne 0x4df7
jmp 0x4e11
movl 0x17cb1(%rip), %esi     # 0x1ca88
movl 0x17533(%rip), %edx     # 0x1c310
leaq 0x1160(%rsp), %rdi
callq 0x103f5
cmpl $0x0, 0x17c9b(%rip)     # 0x1ca8c
je 0x4e11
testl %eax, %eax
je 0x4e37
movl 0x17c8b(%rip), %esi     # 0x1ca88
leaq 0xc52c(%rip), %rdx      # 0x11330
leaq 0x1160(%rsp), %rdi
callq 0x10474
callq 0x8651
leaq 0x1160(%rsp), %rdi
callq 0x854e
xorl %eax, %eax
addq $0x2568, %rsp           # imm = 0x2568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x17c4b(%rip), %esi     # 0x1ca88
leaq 0x1160(%rsp), %rdi
xorl %edx, %edx
jmp 0x4e0c
callq 0x36dc
xorl %edi, %edi
xorl %eax, %eax
callq 0x4f02
leaq 0x193d2(%rip), %rbx     # 0x1e230
movq (%rbx), %rcx
leaq 0xe258(%rip), %rdi      # 0x130c0
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x3550
movq (%rbx), %rdi
leaq 0xff12(%rip), %rsi      # 0x14d8f
leaq 0x18290(%rip), %rdx     # 0x1d114
xorl %eax, %eax
callq 0x3310
pushq $0x1
popq %rdi
callq 0x3540
leaq 0xe013(%rip), %rdi      # 0x12ead
jmp 0x4e50
leaq 0xe019(%rip), %rdi      # 0x12ebc
jmp 0x4e50
leaq 0xe023(%rip), %rdi      # 0x12ecf
jmp 0x4e50
leaq 0xe058(%rip), %rdi      # 0x12f0d
jmp 0x4e50
leaq 0xe025(%rip), %rdi      # 0x12ee3
pushq $0x8
popq %rsi
xorl %eax, %eax
callq 0x4f02
leaq 0xe09e(%rip), %rdi      # 0x12f6d
jmp 0x4e50
leaq 0xe05c(%rip), %rdi      # 0x12f37
jmp 0x4e50
leaq 0xe076(%rip), %rdi      # 0x12f5d
jmp 0x4e50
leaq 0xe180(%rip), %rdi      # 0x13073
leaq 0x1160(%rsp), %rsi
xorl %eax, %eax
callq 0x4f02