// File: /workspace/github_cpp_makefile_star2_O3/goodix[P]gdix_hid_firmware_update/gtx9/gtx9_i2c_update.cpp
// Function: gdix_do_fw_update(char const*, char const*, unsigned char)
int gdix_do_fw_update(const char *devname, const char *filename,
					  uint8_t i2c_addr)
{
	int ret;

	if (!devname || !filename) {
		gdix_err("devname or filename is NULL\n");
		return -1;
	}

	if (!strstr(devname, "dev/i2c")) {
		gdix_err("devname[%s] is invalid\n", devname);
		return -1;
	}

	g_client_addr = i2c_addr;
	gdix_dbg("i2c-addr:0x%02x\n", g_client_addr);
	g_fd = open(devname, O_RDWR);
	if (g_fd < 0) {
		gdix_err("failed to open %s\n", devname);
		return -1;
	}

	ret = switch_i2c_mode();
	if (ret < 0)
		goto err_out;

	ret = gdix_read_firmware(filename);
	if (ret < 0) {
		gdix_err("failed to read %s\n", filename);
		goto err_out;
	}

	gdix_fw_update_proc(&goodix_fw_update_ctrl);

err_out:
	close(g_fd);
	g_fd = 0;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
je 0x114b7
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7dd3(%rip), %rsi      # 0x191e0
callq 0x5050
testq %rax, %rax
je 0x114d6
movzbl %bpl, %r8d
movw %r8w, 0xfe61(%rip)      # 0x21288
leaq 0xfe63(%rip), %r13      # 0x21291
cmpb $0x1, (%r13)
jne 0x11459
movq 0xfb7c(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7dcb(%rip), %rsi      # 0x19211
leaq 0x7d81(%rip), %rdx      # 0x191ce
movl $0x36f, %ecx            # imm = 0x36F
xorl %eax, %eax
callq 0x5180
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x51e0
movl %eax, 0xfe2a(%rip)      # 0x21298
testl %eax, %eax
js 0x1150a
leaq 0x60(%rsp), %r14
movb $-0x34, (%r14)
movl $0x5, %ebp
movl $0x3030aabb, %edi       # imm = 0x3030AABB
movq %r14, %rsi
movl $0x1, %edx
callq 0x121a3
testl %eax, %eax
je 0x11546
decl %ebp
jne 0x11484
cmpb $0x1, (%r13)
jne 0x118de
callq 0x617e
jmp 0x118de
leaq 0xfdd3(%rip), %rax      # 0x21291
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%rax)
jne 0x118f5
callq 0x615a
jmp 0x118f5
leaq 0xfdb4(%rip), %rax      # 0x21291
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%rax)
jne 0x118f5
movq 0xfae6(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x7cec(%rip), %rsi      # 0x191e8
leaq 0x7ccb(%rip), %rdx      # 0x191ce
movl $0x36a, %ecx            # imm = 0x36A
jmp 0x11537
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r13)
jne 0x118f5
movq 0xfab7(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x7d08(%rip), %rsi      # 0x19233
leaq 0x7c9c(%rip), %rdx      # 0x191ce
movl $0x372, %ecx            # imm = 0x372
movq %r14, %r8
xorl %eax, %eax
callq 0x5180
jmp 0x118f5
cmpb $0x1, (%r13)
jne 0x11571
movq 0xfa64(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7d1d(%rip), %rsi      # 0x1927b
leaq 0x7d40(%rip), %rdx      # 0x192a5
movl $0x12b, %ecx            # imm = 0x12B
xorl %eax, %eax
callq 0x5180
movl $0xc350, %edi           # imm = 0xC350
callq 0x5170
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x51e0
movl %eax, %ebp
testl %eax, %eax
js 0x11789
movl %ebp, %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x50b0
movq %rax, %r12
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x50b0
movslq %r12d, %r15
movq %r15, %rdi
callq 0x5030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x5080
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5190
cmpl %r15d, %eax
jne 0x117bc
movslq (%r14), %rbx
addq $0x8, %rbx
movl %ebx, 0xfcb1(%rip)      # 0x2129c
leaq 0xfcaa(%rip), %r15      # 0x2129c
leaq 0xfca7(%rip), %rdi      # 0x212a0
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5090
movq %r15, 0x5112d(%rip)     # 0x62738
movl %r12d, %r15d
movb (%r13), %r13b
subl %ebx, %r15d
jle 0x116f0
testb $0x1, %r13b
je 0x11655
movq 0xf990(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x78e8(%rip), %rsi      # 0x18f1a
leaq 0x7d18(%rip), %rdx      # 0x19351
movl $0x158, %ecx            # imm = 0x158
movl %ebx, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x5180
leaq 0xfc3f(%rip), %rax      # 0x21291
movb (%rax), %r13b
testb $0x1, %r13b
je 0x11689
movq 0xf956(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x4ad4(%rip), %rsi      # 0x16140
leaq 0x7cde(%rip), %rdx      # 0x19351
movl $0x159, %ecx            # imm = 0x159
xorl %eax, %eax
callq 0x5180
leaq 0xfc0b(%rip), %rax      # 0x21291
movb (%rax), %r13b
addl $-0x40, %r15d
testb $0x1, %r13b
je 0x116c4
movq 0xf91e(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x78ae(%rip), %rsi      # 0x18f52
leaq 0x7ca6(%rip), %rdx      # 0x19351
movl $0x15b, %ecx            # imm = 0x15B
movl %r15d, %r8d
xorl %eax, %eax
callq 0x5180
leaq 0xfbd0(%rip), %rax      # 0x21291
movb (%rax), %r13b
movl %r15d, 0x4fbd5(%rip)    # 0x612a0
leaq 0x4fbce(%rip), %r12     # 0x612a0
leaq (%r14,%rbx), %rsi
addq $0x40, %rsi
movslq %r15d, %rdx
leaq 0x4fbc0(%rip), %rdi     # 0x612a4
callq 0x5090
movq %r12, 0x51050(%rip)     # 0x62740
testb $0x1, %r13b
je 0x1171a
movq 0xf8bb(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7c5d(%rip), %rsi      # 0x19364
leaq 0x7c43(%rip), %rdx      # 0x19351
movl $0x161, %ecx            # imm = 0x161
xorl %eax, %eax
callq 0x5180
movl %ebp, %edi
callq 0x5210
leaq 0x44(%rsp), %rdi
callq 0x122ff
testl %eax, %eax
leaq 0xfb5d(%rip), %r13      # 0x21291
jns 0x11741
cmpb $0x1, (%r13)
je 0x11c7e
movq 0x50ff0(%rip), %rbx     # 0x62738
movl (%rbx), %r8d
cmpl $0x29, %r8d
jg 0x1180d
cmpb $0x1, (%r13)
jne 0x118d3
movq 0xf871(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x7e42(%rip), %rsi      # 0x195b3
leaq 0x7e66(%rip), %rdx      # 0x195de
movl $0x177, %ecx            # imm = 0x177
xorl %eax, %eax
callq 0x5180
jmp 0x118d3
cmpb $0x1, (%r13)
jne 0x117d6
movq 0xf841(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x491c(%rip), %rsi      # 0x160bd
leaq 0x7ba9(%rip), %rdx      # 0x19351
movl $0x140, %ecx            # imm = 0x140
movq %rbx, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0x5180
jmp 0x117d6
cmpb $0x1, (%r13)
je 0x11c45
movq %r14, %rdi
callq 0x5130
movl %ebp, %edi
callq 0x5210
cmpb $0x1, (%r13)
jne 0x118de
movq 0xf7f0(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x7a65(%rip), %rsi      # 0x19257
leaq 0x79d5(%rip), %rdx      # 0x191ce
movl $0x37c, %ecx            # imm = 0x37C
movq %rbx, %r8
xorl %eax, %eax
callq 0x5180
jmp 0x118de
leaq 0x4(%rbx), %r14
leaq 0x50a90(%rip), %rdi     # 0x622a8
movl $0x48a, %edx            # imm = 0x48A
movq %r14, %rsi
callq 0x5090
movl (%rbx), %r8d
movl 0x50a79(%rip), %r9d     # 0x622a8
addl $0x8, %r9d
cmpl %r9d, %r8d
jne 0x1189b
xorl %eax, %eax
cmpl $0x9, %r8d
jl 0x11857
xorl %eax, %eax
movl $0x8, %ecx
movzwl 0x4(%rbx,%rcx), %edx
addl %edx, %eax
addq $0x2, %rcx
cmpq %r8, %rcx
jb 0x11847
cmpl 0x50a4f(%rip), %eax     # 0x622ac
jne 0x118c8
movzbl 0x50a5f(%rip), %eax     # 0x622c5
cmpl $0x2f, %eax
jbe 0x11909
cmpb $0x1, (%r13)
jne 0x118d3
movq 0xf75b(%rip), %rcx      # 0x20fd8
movq (%rcx), %rdi
leaq 0x7d99(%rip), %rsi      # 0x19620
leaq 0x7d50(%rip), %rdx      # 0x195de
movl $0x191, %ecx            # imm = 0x191
movl %eax, %r8d
jmp 0x1177d
cmpb $0x1, (%r13)
jne 0x118d3
movq 0xf72f(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x76c0(%rip), %rsi      # 0x18f73
leaq 0x7d24(%rip), %rdx      # 0x195de
movl $0x180, %ecx            # imm = 0x180
xorl %eax, %eax
callq 0x5180
jmp 0x118d3
cmpb $0x1, (%r13)
je 0x11e5c
cmpb $0x1, (%r13)
je 0x11c74
movl 0xf9b4(%rip), %edi      # 0x21298
callq 0x5210
movl $0x0, 0xf9a5(%rip)      # 0x21298
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
je 0x1195b
addl %eax, %eax
leaq (%rax,%rax,4), %rax
movl $0x200, %ecx            # imm = 0x200
leaq 0x509bb(%rip), %rdx     # 0x622da
xorl %esi, %esi
movb 0x2e(%rbx,%rsi), %dil
movb %dil, -0x10(%rdx)
movl 0x2f(%rbx,%rsi), %edi
movl %edi, -0xc(%rdx)
movl 0x33(%rbx,%rsi), %r9d
movl %r9d, -0x8(%rdx)
cmpl %r8d, %ecx
jg 0x11c88
movslq %ecx, %r9
addq %r14, %r9
movq %r9, (%rdx)
addl %edi, %ecx
addq $0xa, %rsi
addq $0x18, %rdx
cmpq %rsi, %rax
jne 0x11921
movb (%r13), %al
cmpb $0x1, %al
jne 0x11993
movq 0xf64e(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
movzbl 0x50952(%rip), %r8d     # 0x622c7
leaq 0x7cdb(%rip), %rsi      # 0x19657
leaq 0x7c5b(%rip), %rdx      # 0x195de
movl $0x1a9, %ecx            # imm = 0x1A9
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x119c6
movq 0xf61a(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7ce0(%rip), %rsi      # 0x19688
leaq 0x7c2f(%rip), %rdx      # 0x195de
leaq 0x50903(%rip), %r8      # 0x622b9
movl $0x1aa, %ecx            # imm = 0x1AA
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x119ff
movq 0xf5e7(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7cd1(%rip), %rsi      # 0x196ac
leaq 0x7bfc(%rip), %rdx      # 0x195de
leaq 0x508d8(%rip), %r9      # 0x622c1
movl $0x1ab, %ecx            # imm = 0x1AB
movl $0x4, %r8d
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x11a33
movq 0xf5ae(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
movzbl 0x508b1(%rip), %r8d     # 0x622c6
leaq 0x7cb4(%rip), %rsi      # 0x196d0
leaq 0x7bbb(%rip), %rdx      # 0x195de
movl $0x1ac, %ecx            # imm = 0x1AC
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x11a78
movq 0xf57a(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
testb $0x1, 0x50880(%rip)     # 0x622c8
leaq 0x7cd8(%rip), %rax      # 0x19727
leaq 0x7ccd(%rip), %r8       # 0x19723
cmoveq %rax, %r8
leaq 0x7c9b(%rip), %rsi      # 0x196fc
leaq 0x7b76(%rip), %rdx      # 0x195de
movl $0x1ae, %ecx            # imm = 0x1AE
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x11aab
movq 0xf535(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
movl 0x5081b(%rip), %r8d     # 0x622a8
leaq 0x7c97(%rip), %rsi      # 0x1972b
leaq 0x7b43(%rip), %rdx      # 0x195de
movl $0x1af, %ecx            # imm = 0x1AF
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x11adf
movq 0xf502(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
movzbl 0x50804(%rip), %r8d     # 0x622c5
leaq 0x7c86(%rip), %rsi      # 0x1974e
leaq 0x7b0f(%rip), %rdx      # 0x195de
movl $0x1b0, %ecx            # imm = 0x1B0
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
movl $0x1, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
testb $0x1, %al
je 0x11b2c
movq 0xf4a9(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7c61(%rip), %rsi      # 0x1977a
leaq 0x7c83(%rip), %rdx      # 0x197a3
movl $0x210, %ecx            # imm = 0x210
xorl %eax, %eax
callq 0x5180
leaq 0x10(%rsp), %rsi
movb $0x0, (%rsi)
movl $0xd808, %edi           # imm = 0xD808
movl $0x1, %edx
callq 0x121a3
movl $0x1388, %edi           # imm = 0x1388
callq 0x5170
movl $0x64, %ebp
leaq 0x60(%rsp), %r12
movl $0x2, %edi
leaq 0x8(%rsp), %rsi
movl $0x2, %edx
callq 0x121a3
movl %eax, %ebx
movl $0x2000, %edi           # imm = 0x2000
movq %r12, %rsi
movl $0x4, %edx
callq 0x124bc
movl %eax, %r14d
orl %ebx, %r14d
movl $0x2000, %edi           # imm = 0x2000
leaq 0x64(%rsp), %rsi
movl $0x4, %edx
callq 0x124bc
movl %eax, %r15d
orl %r14d, %r15d
movl $0x2000, %edi           # imm = 0x2000
leaq 0x68(%rsp), %rsi
movl $0x4, %edx
callq 0x124bc
movl %eax, %ebx
orl %r15d, %ebx
jne 0x11bce
movl 0x64(%rsp), %eax
cmpl %eax, 0x60(%rsp)
jne 0x11bce
cmpl 0x68(%rsp), %eax
je 0x11c9d
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x5170
cmpb $0x1, (%r13)
jne 0x11c06
movq 0xf3d2(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7bc7(%rip), %rsi      # 0x197b7
leaq 0x7bac(%rip), %rdx      # 0x197a3
movl $0x222, %ecx            # imm = 0x222
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
decl %ebp
jne 0x11b57
cmpb $0x1, (%r13)
jne 0x11ead
movq 0xf3b8(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x7bb1(%rip), %rsi      # 0x197db
leaq 0x7b72(%rip), %rdx      # 0x197a3
movl $0x225, %ecx            # imm = 0x225
movl %ebx, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0x11ead
movq 0xf38c(%rip), %rcx      # 0x20fd8
movq (%rcx), %rdi
leaq 0x7295(%rip), %rsi      # 0x18eeb
leaq 0x76f4(%rip), %rdx      # 0x19351
movl $0x14a, %ecx            # imm = 0x14A
movq %rbx, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0x5180
jmp 0x117c7
callq 0x6362
jmp 0x118de
callq 0x61a2
jmp 0x11741
cmpb $0x1, (%r13)
jne 0x118d3
callq 0x61f6
jmp 0x118d3
cmpb $0x1, (%r13)
jne 0x11cc8
movq 0xf30d(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7b58(%rip), %rsi      # 0x1980d
leaq 0x7ae7(%rip), %rdx      # 0x197a3
movl $0x228, %ecx            # imm = 0x228
xorl %eax, %eax
callq 0x5180
leaq 0x8(%rsp), %rsi
movb $0x40, (%rsi)
movl $0xd80b, %edi           # imm = 0xD80B
movl $0x1, %edx
callq 0x121a3
cmpb $0x1, (%r13)
jne 0x11d0a
movq 0xf2cb(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7b39(%rip), %rsi      # 0x19830
leaq 0x7aa5(%rip), %rdx      # 0x197a3
movl $0x22d, %ecx            # imm = 0x22D
xorl %eax, %eax
callq 0x5180
leaq 0x8(%rsp), %rsi
movb $0x0, (%rsi)
movl $0xd054, %edi           # imm = 0xD054
movl $0x1, %edx
callq 0x121a3
movb (%r13), %al
cmpb $0x1, %al
jne 0x11d51
movq 0xf288(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7b1c(%rip), %rsi      # 0x19856
leaq 0x7a62(%rip), %rdx      # 0x197a3
movl $0x232, %ecx            # imm = 0x232
xorl %eax, %eax
callq 0x5180
movb (%r13), %al
testb $0x1, %al
je 0x11d79
movq 0xf25c(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7b3e(%rip), %rsi      # 0x198a4
leaq 0x7b5b(%rip), %rdx      # 0x198c8
movl $0x1e6, %ecx            # imm = 0x1E6
xorl %eax, %eax
callq 0x5180
movq 0x5055a(%rip), %rsi     # 0x622da
movl 0x50548(%rip), %edx     # 0x622ce
movl $0x57000, %edi          # imm = 0x57000
callq 0x121a3
movb (%r13), %cl
testl %eax, %eax
js 0x11e66
testb %cl, %cl
je 0x11dc4
movq 0xf211(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7b49(%rip), %rsi      # 0x198fa
leaq 0x7b10(%rip), %rdx      # 0x198c8
movl $0x1ed, %ecx            # imm = 0x1ED
xorl %eax, %eax
callq 0x5180
movabsq $0x5555555555555555, %rax # imm = 0x5555555555555555
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movl $0x10000, %edi          # imm = 0x10000
movl $0x8, %edx
callq 0x121a3
movb (%r13), %cl
testl %eax, %eax
js 0x11e71
testb %cl, %cl
je 0x11e1f
movq 0xf1bc(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7b4f(%rip), %rsi      # 0x19955
leaq 0x7abb(%rip), %rdx      # 0x198c8
movl $0x1f6, %ecx            # imm = 0x1F6
movl $0x10000, %r8d          # imm = 0x10000
xorl %eax, %eax
callq 0x5180
leaq 0xf(%rsp), %rsi
movb $0x0, (%rsi)
movl $0xd808, %edi           # imm = 0xD808
movl $0x1, %edx
callq 0x121a3
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x5170
leaq 0x10(%rsp), %rdi
callq 0x122ff
testl %eax, %eax
je 0x11e7c
cmpb $0x1, (%r13)
jne 0x11ea6
callq 0x6220
jmp 0x11ea6
callq 0x61cc
jmp 0x118d3
testb %cl, %cl
je 0x11ea6
callq 0x62e4
jmp 0x11ea6
testb %cl, %cl
je 0x11ea6
callq 0x62ba
jmp 0x11ea6
movzwl 0x1d(%rsp), %eax
xorl $0x5349, %eax           # imm = 0x5349
movzbl 0x1f(%rsp), %ecx
xorl $0x50, %ecx
orw %ax, %cx
movb (%r13), %al
je 0x11ee8
testb %al, %al
leaq 0xf3f1(%rip), %r13      # 0x21291
jne 0x12111
cmpb $0x1, (%r13)
je 0x11ee1
cmpb $0x1, (%r13)
je 0x11eda
leaq 0x60(%rsp), %rsi
movb $0x0, (%rsi)
movl $0xd808, %edi           # imm = 0xD808
movl $0x1, %edx
callq 0x121a3
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x5170
jmp 0x118de
callq 0x6338
jmp 0x11eb4
callq 0x630e
jmp 0x11ead
testb %al, %al
je 0x11f10
movq 0xf0c5(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7ae4(%rip), %rsi      # 0x199e1
leaq 0x79c4(%rip), %rdx      # 0x198c8
movl $0x204, %ecx            # imm = 0x204
xorl %eax, %eax
callq 0x5180
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5080
movzbl 0x50391(%rip), %r15d    # 0x622c5
movq 0x50805(%rip), %rsi     # 0x62740
testq %rsi, %rsi
je 0x11fc6
movslq (%rsi), %rdx
testq %rdx, %rdx
je 0x11fc6
addq $0x4, %rsi
movq %rbx, %rdi
callq 0x5090
leaq 0x10(%rsp), %rdi
movq %rbx, 0x10(%rdi)
movabsq $0x4000000001000, %rax  # imm = 0x4000000001000
movq %rax, 0x4(%rdi)
movb $0x4, (%rdi)
callq 0x1260f
movl %eax, %r14d
leaq 0xf310(%rip), %rax      # 0x21291
movb (%rax), %al
testl %r14d, %r14d
je 0x11f9e
testb %al, %al
jne 0x1214b
testl %r14d, %r14d
jns 0x120d8
jmp 0x12131
testb %al, %al
je 0x11fc6
movq 0xf00f(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7aa0(%rip), %rsi      # 0x19a53
leaq 0x7a85(%rip), %rdx      # 0x19a3f
movl $0x2ff, %ecx            # imm = 0x2FF
xorl %eax, %eax
callq 0x5180
cmpb $0x2, %r15b
jb 0x120d8
movl $0x3, %ebx
movl $0x1, %ebp
leaq 0x7a5e(%rip), %r12      # 0x19a3f
leaq 0xf2a9(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x12010
movq 0xefc4(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7a85(%rip), %rsi      # 0x19a83
movq %r12, %rdx
movl $0x303, %ecx            # imm = 0x303
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
movslq %ebp, %rax
leaq (%rax,%rax,2), %rax
leaq 0x5028a(%rip), %rcx     # 0x622a8
leaq (%rcx,%rax,8), %rdi
addq $0x22, %rdi
callq 0x1260f
movl %eax, %r14d
cmpl $-0xb, %eax
je 0x1206b
testl %r14d, %r14d
jne 0x12080
leaq 0xf252(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x12067
movq 0xef6d(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7a65(%rip), %rsi      # 0x19aba
movq %r12, %rdx
movl $0x307, %ecx            # imm = 0x307
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
incl %ebp
jmp 0x12086
leal -0x1(%rbx), %r13d
leaq 0xf21b(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
je 0x120a3
movl %r13d, %ebx
jmp 0x12086
js 0x12125
cmpl %r15d, %ebp
leaq 0xf201(%rip), %rax      # 0x21291
jge 0x11f90
testl %ebx, %ebx
jne 0x11fe8
jmp 0x11f90
movq 0xef2e(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
movl $0x4, %eax
subl %ebx, %eax
movl %eax, (%rsp)
leaq 0x7a32(%rip), %rsi      # 0x19af0
movq %r12, %rdx
movl $0x30d, %ecx            # imm = 0x30D
movl %ebp, %r8d
movl $0xfffffff5, %r9d       # imm = 0xFFFFFFF5
xorl %eax, %eax
callq 0x5180
jmp 0x1207b
leaq 0xf1b2(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x11eb4
movq 0xeec9(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7350(%rip), %rsi      # 0x19449
leaq 0x72bd(%rip), %rdx      # 0x193bd
movl $0x358, %ecx            # imm = 0x358
xorl %eax, %eax
callq 0x5180
jmp 0x11eb4
leaq 0x1d(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x624a
jmp 0x11ea6
leaq 0xf165(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
je 0x12177
leaq 0xf159(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x11eb4
callq 0x6290
jmp 0x11eb4
movq 0xee86(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x78b0(%rip), %rsi      # 0x19a0c
leaq 0x78dc(%rip), %rdx      # 0x19a3f
movl $0x2fc, %ecx            # imm = 0x2FC
movl %r14d, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0x11f90
movq 0xee5a(%rip), %rax      # 0x20fd8
movq (%rax), %rdi
leaq 0x79b2(%rip), %rsi      # 0x19b3a
leaq 0x78b0(%rip), %rdx      # 0x19a3f
movl $0x310, %ecx            # imm = 0x310
movl %ebp, %r8d
movl %r14d, %r9d
xorl %eax, %eax
callq 0x5180
jmp 0x12131