// File: goodix[P]gdix_hid_firmware_update/main.cpp
// Function: main
int main(int argc, char **argv)
{
	int ret = 0;
	int opt;
	int index;
	int chipType = -1;
	GTmodel *gt_model = NULL;
	FirmwareImage *fw_image = NULL;
	GTupdate *gt_update = NULL;
	GTUpdatePara *gt_update_para = NULL;
	unsigned int firmware_flag = 0xFFFFFFFF;
	uint8_t i2cAddr = 0;

	regex_t reg_x3xx;
	regex_t reg_x5xx;
	regex_t reg_x2xx;
	regex_t reg_x8xx;
	regex_t reg_x9xx;
	regex_t reg_7868;
	regex_t reg_brla;
	regmatch_t pamtch[1]; // match container

	char *deviceName = NULL;
	const char *firmwareName = NULL;
	const char *pid = NULL;
	const char *productionTypeName = NULL;
	bool force = false;
	static struct option long_options[] = {
		{"help", 0, NULL, 'h'},
		{"force", 0, NULL, 'f'},
		{"device", 1, NULL, 'd'},
		{"fw-props", 0, NULL, 'p'},
		{"version", 0, NULL, 'v'},
		{"type", 1, NULL, 't'},
		{"series", 1, NULL, 's'},
		{"info", 0, NULL, 'i'},
		{"module", 0, NULL, 'm'},
		{"i2c-addr", 1, NULL, 'a'},
		{0, 0, 0, 0},
	};
	bool printFirmwareProps = false;
	bool printModuleId = false;
	while ((opt = getopt_long(argc, argv, GTPUPDATE_GETOPTS, long_options,
							  &index)) != -1) {
		switch (opt) {
		case 'h':
			printHelp(argv[0]);
			return 0;
		case 'f':
			force = true;
			break;
		case 'd':
			deviceName = optarg;
			break;
		case 'p':
			printFirmwareProps = true;
			break;
		case 'v':
			printVersion();
			return 0;
		case 't':
			lowercase_str((unsigned char *)optarg);
			pid = optarg;
			gdix_dbg("pid is %s\n", pid);
			break;
		case 's':
			productionTypeName = optarg;
			gdix_dbg("product type is %s\n", productionTypeName);
			break;
		case 'i':
			pdebug = true;
			break;
		case 'm':
			printModuleId = true;
			break;
		case 'a':
			i2cAddr = strtol(optarg, NULL, 16);
			break;
		default:
			break;
		}
	}

	if (optind < argc) {
		firmwareName = argv[optind];
		gdix_dbg("firmware name:%s\n", firmwareName);
	}
	if (NULL == productionTypeName && NULL == pid) {
		gdix_err("please input pid or product type\n");
		return -1;
	}
	if (!printModuleId && !printFirmwareProps && NULL == firmwareName) {
		gdix_err("file name not found\n");
		return -1;
	}

	// check chip type
	if (pid != NULL) {
		regex_t reg_pid;
		regcomp(&reg_pid, "^011[0-9A-Fa-f]$", REG_EXTENDED); // phoenix pid
															 // 011x
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match phoenix pid 011x\n");
			chipType = TYPE_PHOENIX;
		}
		regfree(&reg_pid);

		regcomp(&reg_pid, "^0[eE][0-9A-Fa-f]{2}$",
				REG_EXTENDED); // phoenix pid 0exx
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match phoenix pid 0exx\n");
			chipType = TYPE_PHOENIX;
		}
		regfree(&reg_pid);

		regcomp(&reg_pid, "^01[fF][0-9A-Fa-f]$",
				REG_EXTENDED); // mouse pad pid 01fx
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match mousepad pid 01fx\n");
			chipType = TYPE_MOUSEPAD;
		}
		regfree(&reg_pid);

		regcomp(&reg_pid, "^0[fF][0-9A-Fa-f]{2}$",
				REG_EXTENDED); // mouse pad pid 0fxx
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match mousepad pid 0fxx\n");
			chipType = TYPE_MOUSEPAD;
		}
		regfree(&reg_pid);

		regcomp(&reg_pid, "^01[eE][0-7]$",
				REG_EXTENDED); // 7863 windows pid 01e0~01e7
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match GT7863 pid 01e0_01e7\n");
			chipType = TYPE_NORMANDYL;
		}
		regfree(&reg_pid);

		regcomp(&reg_pid, "^0[dD][0-7][0-9A-Fa-f]$",
				REG_EXTENDED); // 7863 chrome pid 0d00~0d7f
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match GT7863 pid 0d00_0d7f\n");
			chipType = TYPE_NORMANDYL;
		}
		regfree(&reg_pid);

		regcomp(&reg_pid, "^0[dD][8-9A-Ba-b][0-9A-Fa-f]$",
				REG_EXTENDED); // 7868Q chrome pid 0d80~0dbf
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match GT7868Q pid 0d80_0dbf\n");
			chipType = TYPE_YELLOWSTONE;
		}
		regfree(&reg_pid);

		/* 0EB* 0EC* is BerlinB */
		regcomp(&reg_pid, "^0[eE][bBcC][0-9A-Fa-f]$", REG_EXTENDED);
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match BerlinB pid 0EBx\n");
			chipType = TYPE_BERLINB;
		}
		regfree(&reg_pid);

		/* 0EA5~0EAF is BerlinB */
		regcomp(&reg_pid, "^0[eE][aA][5-9A-Fa-f]$", REG_EXTENDED);
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match BerlinB pid 0EA5~0EAF\n");
			chipType = TYPE_BERLINB;
		}
		regfree(&reg_pid);

		/* 0Cxx is BerlinB */
		regcomp(&reg_pid, "^0[cC][0-9A-Fa-f]{2}$", REG_EXTENDED);
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match BerlinB pid 0Cxx\n");
			chipType = TYPE_BERLINB;
		}
		regfree(&reg_pid);

		/* 0F60~0F7F is BerlinA */
		regcomp(&reg_pid, "^0[fF][6-7][0-9A-Fa-f]$", REG_EXTENDED);
		if (REG_NOERROR == regexec(&reg_pid, pid, 1, pamtch, 0)) {
			gdix_dbg("pid match BerlinA pid 0F60~0F7F\n");
			chipType = TYPE_BERLINA;
		}
		regfree(&reg_pid);		
	} else if (productionTypeName != NULL) {
		regcomp(&reg_x3xx, "^[0-9]3[0-9]{2}", REG_EXTENDED);
		regcomp(&reg_x5xx, "^[0-9]5[0-9]{2}", REG_EXTENDED);
		regcomp(&reg_x2xx, "^[0-9]2[0-9]{2}", REG_EXTENDED);
		regcomp(&reg_x8xx, "^[0-9]8[0-9]{2}", REG_EXTENDED);
		regcomp(&reg_x9xx, "^[0-9]9[0-9]{2}", REG_EXTENDED);
		regcomp(&reg_7868, "^7868", REG_EXTENDED);
		regcomp(&reg_brla, "^7726", REG_EXTENDED);

		if (REG_NOERROR == regexec(&reg_x3xx, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_PHOENIX; // 7388 match
		else if (REG_NOERROR ==
				 regexec(&reg_x5xx, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_NANJING; // 8589 match
		else if (REG_NOERROR ==
				 regexec(&reg_x2xx, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_MOUSEPAD; // 7288 match
		else if (REG_NOERROR ==
				 regexec(&reg_x8xx, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_NORMANDYL; // 7863 match
		else if (REG_NOERROR ==
				 regexec(&reg_x9xx, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_BERLINB; // 9966 match
		else if (REG_NOERROR ==
				 regexec(&reg_7868, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_YELLOWSTONE; // 7868 match
		else if (REG_NOERROR ==
				 regexec(&reg_brla, productionTypeName, 1, pamtch, 0))
			chipType = TYPE_BERLINA; // 7726 match
		else
			chipType = -1; // no match

		regfree(&reg_x3xx);
		regfree(&reg_x5xx);
		regfree(&reg_x2xx);
		regfree(&reg_x8xx);
		regfree(&reg_x9xx);
		regfree(&reg_7868);
		regfree(&reg_brla);
	}

	if (chipType < 0) {
		gdix_err("Find No match pid or product\n");
		delete gt_model;
		return -6;
	}

	/* i2c update */
	if (i2cAddr > 0 && chipType == TYPE_BERLINB) {
		gdix_do_fw_update(deviceName, firmwareName, i2cAddr);
		return 0;
	}

	if (chipType == TYPE_MOUSEPAD) {
		gt_model = new GTx2Device;
		fw_image = new GTX2FirmwareImage;
		gt_update = new GTx2Update;
		firmware_flag = 0x1400C; // update type:0x02,0x03,0x0e,0x10
	} else if (chipType == TYPE_NANJING) {
		gt_model = new GTx5Device;
		fw_image = new GTX5FirmwareImage;
		gt_update = new GTx5Update;
		firmware_flag = 0x1400C; // update type:0x02,0x03,0x03,0x10;
	} else if (chipType == TYPE_PHOENIX) {
		gt_model = new GTx3Device;
		fw_image = new GTX3FirmwareImage;
		gt_update = new GTx3Update;
		firmware_flag = 0x844; // update type:0x02,0x03,0x03,0x10;
	} else if (chipType == TYPE_NORMANDYL) {
		gt_model = new GTx8Device;
		fw_image = new GTX8FirmwareImage;
		gt_update = new GTx8Update;
		firmware_flag = 0x0C; // update type:0x02,0x03;
	} else if (chipType == TYPE_BERLINB) {
		gt_model = new GTx9Device;
		fw_image = new GTX9FirmwareImage;
		gt_update = new GTx9Update;
		firmware_flag = 0x0B; // don't update type:0x0B;
	} else if (chipType == TYPE_YELLOWSTONE) {
		gt_model = new GT7868QDevice;
		fw_image = new GT7868QFirmwareImage;
		gt_update = new GT7868QUpdate;
		firmware_flag = 0x0C; // update type:0x02,0x03;
	} else if (chipType == TYPE_BERLINA) {
		gt_model = new BrlADevice;
		fw_image = new BrlAFirmwareImage;
		gt_update = new BrlAUpdate;
	} else {
		if (pid != NULL)
			gdix_err("unsupported pid number:%s\n", pid);
		else
			gdix_err("unsupported product type number:%s\n",
					 productionTypeName);
		return -1;
	}

	/* get and print active FW version */
	if (printFirmwareProps) {
		char props_buf[60] = {0};
		ret = gt_model->GetFirmwareProps(deviceName, props_buf,
										 sizeof(props_buf));
		if (ret) {
			printf("Failed to read properties from device %s\n", deviceName);
			delete gt_model;
			return 1;
		} else {
			printf("%s\n", props_buf);
			delete gt_model;
			return 0;
		}
	}

	ret = gt_model->Open(deviceName);
	if (ret) {
		gdix_err("failed open device:%s\n", deviceName);
		delete gt_model;
		return -1;
	}

	if (printModuleId) {
		printf("module_id:%d\n", gt_model->GetSensorID());
		delete gt_model;
		return 0;
	}

	ret = fw_image->Initialize(firmwareName);
	if (ret) {
		gdix_err("Failed read firmware file:%s\n", firmwareName);
		delete gt_model;
		return -2;
	}

	ret = gt_update->Initialize(gt_model, fw_image);
	if (ret) {
		// gdix_err("Failed read firmware file:%s\n", firmwareName);
		delete gt_model;
		return -2;
	}

	// run update
	gt_update_para = new GTUpdatePara;
	gt_update_para->force = force;
	gt_update_para->firmwareFlag = firmware_flag;

	ret = gt_update->Run(gt_update_para);
	if (ret) {
		gdix_err("Firmware update err:ret=%d\n", ret);
		delete gt_model;
		return -4;
	}

	delete gt_model;
	delete fw_image;
	delete gt_update;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x45(%rbp)
movq $0x0, -0x218(%rbp)
movq $0x0, -0x220(%rbp)
movq $0x0, -0x228(%rbp)
movq $0x0, -0x230(%rbp)
movb $0x0, -0x231(%rbp)
movb $0x0, -0x232(%rbp)
movb $0x0, -0x233(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x1603b(%rip), %rdx     # 0x1c41c
leaq 0x1fd48(%rip), %rcx     # 0x26130
leaq -0x1c(%rbp), %r8
callq 0x51d0
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
je 0x655a
movl -0x18(%rbp), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x2c8(%rbp)
subl $0x15, %eax
ja 0x6553
movq -0x2c8(%rbp), %rax
leaq 0x15f65(%rip), %rcx     # 0x1c388
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7a90
movl $0x0, -0x4(%rbp)
jmp 0x7a78
movb $0x1, -0x231(%rbp)
jmp 0x6555
movq 0x1fb71(%rip), %rax     # 0x25fc8
movq (%rax), %rax
movq %rax, -0x218(%rbp)
jmp 0x6555
movb $0x1, -0x232(%rbp)
jmp 0x6555
callq 0x7bb0
movl $0x0, -0x4(%rbp)
jmp 0x7a78
movq 0x1fb3e(%rip), %rax     # 0x25fc8
movq (%rax), %rdi
callq 0x7be0
movq 0x1fb2f(%rip), %rax     # 0x25fc8
movq (%rax), %rax
movq %rax, -0x228(%rbp)
testb $0x1, 0x1fdef(%rip)     # 0x26299
je 0x64d7
movq 0x1fb05(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
movq -0x228(%rbp), %r8
leaq 0x15f67(%rip), %rsi     # 0x1c42b
leaq 0x15f7c(%rip), %rdx     # 0x1c447
movl $0xb5, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x64d9
jmp 0x6555
movq 0x1fae6(%rip), %rax     # 0x25fc8
movq (%rax), %rax
movq %rax, -0x230(%rbp)
testb $0x1, 0x1fda6(%rip)     # 0x26299
je 0x6520
movq 0x1fabc(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
movq -0x230(%rbp), %r8
leaq 0x15f3f(%rip), %rsi     # 0x1c44c
leaq 0x15f33(%rip), %rdx     # 0x1c447
movl $0xb9, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x6522
jmp 0x6555
movb $0x1, 0x1fd6e(%rip)     # 0x26299
jmp 0x6555
movb $0x1, -0x233(%rbp)
jmp 0x6555
movq 0x1fa8b(%rip), %rax     # 0x25fc8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x5160
movb %al, -0x45(%rbp)
jmp 0x6555
jmp 0x6555
jmp 0x63d3
movq 0x1fa7f(%rip), %rax     # 0x25fe0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0x65b9
movq -0x10(%rbp), %rax
movq 0x1fa6d(%rip), %rcx     # 0x25fe0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x220(%rbp)
testb $0x1, 0x1fd11(%rip)     # 0x26299
je 0x65b5
movq 0x1fa27(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
movq -0x220(%rbp), %r8
leaq 0x15ecf(%rip), %rsi     # 0x1c471
leaq 0x15e9e(%rip), %rdx     # 0x1c447
movl $0xcb, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x65b7
jmp 0x65b9
xorl %eax, %eax
cmpq -0x230(%rbp), %rax
jne 0x660c
xorl %eax, %eax
cmpq -0x228(%rbp), %rax
jne 0x660c
jmp 0x65d1
testb $0x1, 0x1fcc1(%rip)     # 0x26299
je 0x65fe
movq 0x1f9f7(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
leaq 0x15ea9(%rip), %rsi     # 0x1c494
leaq 0x15e55(%rip), %rdx     # 0x1c447
movl $0xce, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x6600
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7a78
testb $0x1, -0x233(%rbp)
jne 0x6666
testb $0x1, -0x232(%rbp)
jne 0x6666
xorl %eax, %eax
cmpq -0x220(%rbp), %rax
jne 0x6666
jmp 0x662b
testb $0x1, 0x1fc67(%rip)     # 0x26299
je 0x6658
movq 0x1f99d(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
leaq 0x15e82(%rip), %rsi     # 0x1c4c7
leaq 0x15dfb(%rip), %rdx     # 0x1c447
movl $0xd2, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x665a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7a78
cmpq $0x0, -0x228(%rbp)
je 0x6c3b
leaq -0x278(%rbp), %rdi
leaq 0x15e6b(%rip), %rsi     # 0x1c4ed
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x66ee
jmp 0x66b8
testb $0x1, 0x1fbda(%rip)     # 0x26299
je 0x66e5
movq 0x1f8f0(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15e2c(%rip), %rsi     # 0x1c4fe
leaq 0x15d6e(%rip), %rdx     # 0x1c447
movl $0xdc, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x66e7
movl $0x0, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15e23(%rip), %rsi     # 0x1c52b
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6774
jmp 0x673e
testb $0x1, 0x1fb54(%rip)     # 0x26299
je 0x676b
movq 0x1f86a(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15de9(%rip), %rsi     # 0x1c541
leaq 0x15ce8(%rip), %rdx     # 0x1c447
movl $0xe4, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x676d
movl $0x0, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15de0(%rip), %rsi     # 0x1c56e
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x67fa
jmp 0x67c4
testb $0x1, 0x1face(%rip)     # 0x26299
je 0x67f1
movq 0x1f7e4(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15da4(%rip), %rsi     # 0x1c582
leaq 0x15c62(%rip), %rdx     # 0x1c447
movl $0xec, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x67f3
movl $0x2, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15d9c(%rip), %rsi     # 0x1c5b0
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6880
jmp 0x684a
testb $0x1, 0x1fa48(%rip)     # 0x26299
je 0x6877
movq 0x1f75e(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15d62(%rip), %rsi     # 0x1c5c6
leaq 0x15bdc(%rip), %rdx     # 0x1c447
movl $0xf4, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x6879
movl $0x2, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15d5a(%rip), %rsi     # 0x1c5f4
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6906
jmp 0x68d0
testb $0x1, 0x1f9c2(%rip)     # 0x26299
je 0x68fd
movq 0x1f6d8(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15d18(%rip), %rsi     # 0x1c602
leaq 0x15b56(%rip), %rdx     # 0x1c447
movl $0xfc, %ecx
movb $0x0, %al
callq 0x5190
jmp 0x68ff
movl $0x3, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15d13(%rip), %rsi     # 0x1c633
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x698c
jmp 0x6956
testb $0x1, 0x1f93c(%rip)     # 0x26299
je 0x6983
movq 0x1f652(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15cdb(%rip), %rsi     # 0x1c64b
leaq 0x15ad0(%rip), %rdx     # 0x1c447
movl $0x104, %ecx            # imm = 0x104
movb $0x0, %al
callq 0x5190
jmp 0x6985
movl $0x3, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15cd6(%rip), %rsi     # 0x1c67c
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6a12
jmp 0x69dc
testb $0x1, 0x1f8b6(%rip)     # 0x26299
je 0x6a09
movq 0x1f5cc(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15ca4(%rip), %rsi     # 0x1c69a
leaq 0x15a4a(%rip), %rdx     # 0x1c447
movl $0x10c, %ecx            # imm = 0x10C
movb $0x0, %al
callq 0x5190
jmp 0x6a0b
movl $0x4, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15ca0(%rip), %rsi     # 0x1c6cc
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6a98
jmp 0x6a62
testb $0x1, 0x1f830(%rip)     # 0x26299
je 0x6a8f
movq 0x1f546(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15c69(%rip), %rsi     # 0x1c6e5
leaq 0x159c4(%rip), %rdx     # 0x1c447
movl $0x114, %ecx            # imm = 0x114
movb $0x0, %al
callq 0x5190
jmp 0x6a91
movl $0x6, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15c60(%rip), %rsi     # 0x1c712
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6b1e
jmp 0x6ae8
testb $0x1, 0x1f7aa(%rip)     # 0x26299
je 0x6b15
movq 0x1f4c0(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15c27(%rip), %rsi     # 0x1c729
leaq 0x1593e(%rip), %rdx     # 0x1c447
movl $0x11c, %ecx            # imm = 0x11C
movb $0x0, %al
callq 0x5190
jmp 0x6b17
movl $0x6, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15c23(%rip), %rsi     # 0x1c75b
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6ba4
jmp 0x6b6e
testb $0x1, 0x1f724(%rip)     # 0x26299
je 0x6b9b
movq 0x1f43a(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15be9(%rip), %rsi     # 0x1c771
leaq 0x158b8(%rip), %rdx     # 0x1c447
movl $0x124, %ecx            # imm = 0x124
movb $0x0, %al
callq 0x5190
jmp 0x6b9d
movl $0x6, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
leaq -0x278(%rbp), %rdi
leaq 0x15be0(%rip), %rsi     # 0x1c79e
movl $0x1, %edx
callq 0x5110
movq -0x228(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c2a
jmp 0x6bf4
testb $0x1, 0x1f69e(%rip)     # 0x26299
je 0x6c21
movq 0x1f3b4(%rip), %rax     # 0x25fb8
movq (%rax), %rdi
leaq 0x15ba8(%rip), %rsi     # 0x1c7b6
leaq 0x15832(%rip), %rdx     # 0x1c447
movl $0x12c, %ecx            # imm = 0x12C
movb $0x0, %al
callq 0x5190
jmp 0x6c23
movl $0x5, -0x20(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x50f0
jmp 0x6ecb
cmpq $0x0, -0x230(%rbp)
je 0x6ec9
leaq -0x88(%rbp), %rdi
leaq 0x15b91(%rip), %rsi     # 0x1c7e8
movl $0x1, %edx
callq 0x5110
leaq -0xc8(%rbp), %rdi
leaq 0x15b89(%rip), %rsi     # 0x1c7f8
movl $0x1, %edx
callq 0x5110
leaq -0x108(%rbp), %rdi
leaq 0x15b81(%rip), %rsi     # 0x1c808
movl $0x1, %edx
callq 0x5110
leaq -0x148(%rbp), %rdi
leaq 0x15b79(%rip), %rsi     # 0x1c818
movl $0x1, %edx
callq 0x5110
leaq -0x188(%rbp), %rdi
leaq 0x15b71(%rip), %rsi     # 0x1c828
movl $0x1, %edx
callq 0x5110
leaq -0x1c8(%rbp), %rdi
leaq 0x15b69(%rip), %rsi     # 0x1c838
movl $0x1, %edx
callq 0x5110
leaq -0x208(%rbp), %rdi
leaq 0x15b57(%rip), %rsi     # 0x1c83e
movl $0x1, %edx
callq 0x5110
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x88(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6d27
movl $0x0, -0x20(%rbp)
jmp 0x6e75
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0xc8(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6d5d
movl $0x1, -0x20(%rbp)
jmp 0x6e73
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x108(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6d93
movl $0x2, -0x20(%rbp)
jmp 0x6e71
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x148(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6dc9
movl $0x3, -0x20(%rbp)
jmp 0x6e6f
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x188(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6dfc
movl $0x6, -0x20(%rbp)
jmp 0x6e6d
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x1c8(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6e2f
movl $0x4, -0x20(%rbp)
jmp 0x6e6b
movq -0x230(%rbp), %rsi
leaq -0x210(%rbp), %rcx
leaq -0x208(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x5130
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6e62
movl $0x5, -0x20(%rbp)
jmp 0x6e69
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
jmp 0x6e6b
jmp 0x6e6d
jmp 0x6e6f
jmp 0x6e71
jmp 0x6e73
jmp 0x6e75
leaq -0x88(%rbp), %rdi
callq 0x50f0
leaq -0xc8(%rbp), %rdi
callq 0x50f0
leaq -0x108(%rbp), %rdi
callq 0x50f0
leaq -0x148(%rbp), %rdi
callq 0x50f0
leaq -0x188(%rbp), %rdi
callq 0x50f0
leaq -0x1c8(%rbp), %rdi
callq 0x50f0
leaq -0x208(%rbp), %rdi
callq 0x50f0
jmp 0x6ecb
cmpl $0x0, -0x20(%rbp)
jge 0x6f2c
jmp 0x6ed3
testb $0x1, 0x1f3bf(%rip)     # 0x26299
je 0x6f00
movq 0x1f0f5(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
leaq 0x15957(%rip), %rsi     # 0x1c844
leaq 0x15553(%rip), %rdx     # 0x1c447
movl $0x15a, %ecx            # imm = 0x15A
movb $0x0, %al
callq 0x5190
jmp 0x6f02
movq -0x28(%rbp), %rax
movq %rax, -0x2d0(%rbp)
cmpq $0x0, %rax
je 0x6f20
movq -0x2d0(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0x7a78
movzbl -0x45(%rbp), %eax
cmpl $0x0, %eax
jle 0x6f5e
cmpl $0x6, -0x20(%rbp)
jne 0x6f5e
movq -0x218(%rbp), %rdi
movq -0x220(%rbp), %rsi
movzbl -0x45(%rbp), %edx
callq 0x15110
movl $0x0, -0x4(%rbp)
jmp 0x7a78
cmpl $0x2, -0x20(%rbp)
jne 0x7067
movl $0x48, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2d8(%rbp)
callq 0x7c30
jmp 0x6f86
movq -0x2d8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x38, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2e0(%rbp)
callq 0xaf40
jmp 0x6faf
movq -0x2e0(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2e8(%rbp)
callq 0xb290
jmp 0x6fd8
movq -0x2e8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x1400c, -0x44(%rbp)   # imm = 0x1400C
jmp 0x772c
movq -0x2d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x48, %esi
callq 0x5100
jmp 0x7a84
movq -0x2e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x38, %esi
callq 0x5100
jmp 0x7a84
movq -0x2e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpl $0x1, -0x20(%rbp)
jne 0x7170
movl $0x48, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2f0(%rbp)
callq 0xe930
jmp 0x708f
movq -0x2f0(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x38, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2f8(%rbp)
callq 0xf9c0
jmp 0x70b8
movq -0x2f8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x300(%rbp)
callq 0x7c70
jmp 0x70e1
movq -0x300(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x1400c, -0x44(%rbp)   # imm = 0x1400C
jmp 0x772a
movq -0x2f0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x48, %esi
callq 0x5100
jmp 0x7a84
movq -0x2f8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x38, %esi
callq 0x5100
jmp 0x7a84
movq -0x300(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpl $0x0, -0x20(%rbp)
jne 0x7279
movl $0x48, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x308(%rbp)
callq 0xc690
jmp 0x7198
movq -0x308(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x38, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x310(%rbp)
callq 0xcb50
jmp 0x71c1
movq -0x310(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x318(%rbp)
callq 0xce80
jmp 0x71ea
movq -0x318(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x844, -0x44(%rbp)     # imm = 0x844
jmp 0x7728
movq -0x308(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x48, %esi
callq 0x5100
jmp 0x7a84
movq -0x310(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x38, %esi
callq 0x5100
jmp 0x7a84
movq -0x318(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpl $0x3, -0x20(%rbp)
jne 0x7382
movl $0x48, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x320(%rbp)
callq 0x10be0
jmp 0x72a1
movq -0x320(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x38, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x328(%rbp)
callq 0x11180
jmp 0x72ca
movq -0x328(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x330(%rbp)
callq 0x114b0
jmp 0x72f3
movq -0x330(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0xc, -0x44(%rbp)
jmp 0x7726
movq -0x320(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x48, %esi
callq 0x5100
jmp 0x7a84
movq -0x328(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x38, %esi
callq 0x5100
jmp 0x7a84
movq -0x330(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpl $0x6, -0x20(%rbp)
jne 0x748b
movl $0x30, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x338(%rbp)
callq 0x13170
jmp 0x73aa
movq -0x338(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x4e0, %edi            # imm = 0x4E0
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x340(%rbp)
callq 0x14450
jmp 0x73d3
movq -0x340(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x348(%rbp)
callq 0x7cb0
jmp 0x73fc
movq -0x348(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0xb, -0x44(%rbp)
jmp 0x7724
movq -0x338(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x30, %esi
callq 0x5100
jmp 0x7a84
movq -0x340(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x4e0, %esi            # imm = 0x4E0
callq 0x5100
jmp 0x7a84
movq -0x348(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpl $0x4, -0x20(%rbp)
jne 0x7594
movl $0x48, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x350(%rbp)
callq 0x7d30
jmp 0x74b3
movq -0x350(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x38, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x358(%rbp)
callq 0x86c0
jmp 0x74dc
movq -0x358(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x360(%rbp)
callq 0x89f0
jmp 0x7505
movq -0x360(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0xc, -0x44(%rbp)
jmp 0x7722
movq -0x350(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x48, %esi
callq 0x5100
jmp 0x7a84
movq -0x358(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x38, %esi
callq 0x5100
jmp 0x7a84
movq -0x360(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpl $0x5, -0x20(%rbp)
jne 0x7696
movl $0x30, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x368(%rbp)
callq 0x188b0
jmp 0x75bc
movq -0x368(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x4e0, %edi            # imm = 0x4E0
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x370(%rbp)
callq 0x19b90
jmp 0x75e5
movq -0x370(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x50e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x378(%rbp)
callq 0x7cf0
jmp 0x760e
movq -0x378(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x7720
movq -0x368(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x30, %esi
callq 0x5100
jmp 0x7a84
movq -0x370(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x4e0, %esi            # imm = 0x4E0
callq 0x5100
jmp 0x7a84
movq -0x378(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
movl $0x20, %esi
callq 0x5100
jmp 0x7a84
cmpq $0x0, -0x228(%rbp)
je 0x76da
jmp 0x76a2
testb $0x1, 0x1ebf0(%rip)     # 0x26299
je 0x76d6
movq 0x1e926(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
movq -0x228(%rbp), %r8
leaq 0x151b0(%rip), %rsi     # 0x1c873
leaq 0x14d7d(%rip), %rdx     # 0x1c447
movl $0x189, %ecx            # imm = 0x189
movb $0x0, %al
callq 0x5190
jmp 0x76d8
jmp 0x7714
jmp 0x76dc
testb $0x1, 0x1ebb6(%rip)     # 0x26299
je 0x7710
movq 0x1e8ec(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
movq -0x230(%rbp), %r8
leaq 0x151a2(%rip), %rsi     # 0x1c89f
leaq 0x14d43(%rip), %rdx     # 0x1c447
movl $0x18c, %ecx            # imm = 0x18C
movb $0x0, %al
callq 0x5190
jmp 0x7712
jmp 0x7714
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7a78
jmp 0x7722
jmp 0x7724
jmp 0x7726
jmp 0x7728
jmp 0x772a
jmp 0x772c
testb $0x1, -0x232(%rbp)
je 0x77f0
leaq -0x2c0(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x50a0
movq -0x28(%rbp), %rdi
movq -0x218(%rbp), %rsi
leaq -0x2c0(%rbp), %rdx
movq (%rdi), %rax
movl $0x3c, %ecx
callq *0x58(%rax)
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x77b1
movq -0x218(%rbp), %rsi
leaq 0x15154(%rip), %rdi     # 0x1c8d4
movb $0x0, %al
callq 0x5050
movq -0x28(%rbp), %rax
movq %rax, -0x380(%rbp)
cmpq $0x0, %rax
je 0x77a5
movq -0x380(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x7a78
leaq -0x2c0(%rbp), %rsi
leaq 0x18264(%rip), %rdi     # 0x1fa23
movb $0x0, %al
callq 0x5050
movq -0x28(%rbp), %rax
movq %rax, -0x388(%rbp)
cmpq $0x0, %rax
je 0x77e4
movq -0x388(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7a78
movq -0x28(%rbp), %rdi
movq -0x218(%rbp), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x786c
jmp 0x780c
testb $0x1, 0x1ea86(%rip)     # 0x26299
je 0x7840
movq 0x1e7bc(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
movq -0x218(%rbp), %r8
leaq 0x150d1(%rip), %rsi     # 0x1c8fe
leaq 0x14c13(%rip), %rdx     # 0x1c447
movl $0x1a2, %ecx            # imm = 0x1A2
movb $0x0, %al
callq 0x5190
jmp 0x7842
movq -0x28(%rbp), %rax
movq %rax, -0x390(%rbp)
cmpq $0x0, %rax
je 0x7860
movq -0x390(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7a78
testb $0x1, -0x233(%rbp)
je 0x78bd
movq -0x28(%rbp), %rdi
movq (%rdi), %rax
callq *0x80(%rax)
movzbl %al, %esi
leaq 0x1509a(%rip), %rdi     # 0x1c926
movb $0x0, %al
callq 0x5050
movq -0x28(%rbp), %rax
movq %rax, -0x398(%rbp)
cmpq $0x0, %rax
je 0x78b1
movq -0x398(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7a78
movq -0x30(%rbp), %rdi
movq -0x220(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x7938
jmp 0x78d8
testb $0x1, 0x1e9ba(%rip)     # 0x26299
je 0x790c
movq 0x1e6f0(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
movq -0x220(%rbp), %r8
leaq 0x1503b(%rip), %rsi     # 0x1c934
leaq 0x14b47(%rip), %rdx     # 0x1c447
movl $0x1af, %ecx            # imm = 0x1AF
movb $0x0, %al
callq 0x5190
jmp 0x790e
movq -0x28(%rbp), %rax
movq %rax, -0x3a0(%rbp)
cmpq $0x0, %rax
je 0x792c
movq -0x3a0(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7a78
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x797d
movq -0x28(%rbp), %rax
movq %rax, -0x3a8(%rbp)
cmpq $0x0, %rax
je 0x7971
movq -0x3a8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7a78
movl $0x8, %edi
callq 0x50e0
movq %rax, -0x40(%rbp)
movb -0x231(%rbp), %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movl -0x44(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x7a17
jmp 0x79bd
testb $0x1, 0x1e8d5(%rip)     # 0x26299
je 0x79ee
movq 0x1e60b(%rip), %rax     # 0x25fd8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
leaq 0x14f88(%rip), %rsi     # 0x1c963
leaq 0x14a65(%rip), %rdx     # 0x1c447
movl $0x1c2, %ecx            # imm = 0x1C2
movb $0x0, %al
callq 0x5190
jmp 0x79f0
movq -0x28(%rbp), %rax
movq %rax, -0x3b0(%rbp)
cmpq $0x0, %rax
je 0x7a0e
movq -0x3b0(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x7a78
movq -0x28(%rbp), %rax
movq %rax, -0x3b8(%rbp)
cmpq $0x0, %rax
je 0x7a35
movq -0x3b8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x3c0(%rbp)
cmpq $0x0, %rax
je 0x7a53
movq -0x3c0(%rbp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x3c8(%rbp)
cmpq $0x0, %rax
je 0x7a71
movq -0x3c8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
movq -0x280(%rbp), %rdi
callq 0x51f0