LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx8/gtx8_firmware_image.cpp
// Function: GTX8FirmwareImage::InitVid()
int GTX8FirmwareImage::InitVid()
{
	gdix_dbg("GTX8FirmwareImage InitVid run\n");
	int ret = -1;

	if (!m_firmwareData)
		goto exit;

	m_firmwareVersionMajor = m_firmwareData[GTX8_FW_IMAGE_VID_OFFSET];
	/* |--vid2--|--vid3--|--cfg_id--|
	 * reserve the last byte for config ID.
	 */
	m_firmwareVersionMinor =
		(m_firmwareData[GTX8_FW_IMAGE_VID_OFFSET + 1] << 16) |
		(m_firmwareData[GTX8_FW_IMAGE_VID_OFFSET + 2] << 8);
	gdix_dbg("cid:0x%02x,vid 0x%02X,0x%02X,0x%02X\n",
			 m_firmwareData[GTX8_FW_IMAGE_CID_OFFSET],
			 m_firmwareData[GTX8_FW_IMAGE_VID_OFFSET],
			 m_firmwareData[GTX8_FW_IMAGE_VID_OFFSET + 1],
			 m_firmwareData[GTX8_FW_IMAGE_VID_OFFSET + 2]);
	ret = 0;
exit:
	gdix_dbg("GTX8FirmwareImage InitVid exit,exit code:%d\n", ret);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x12639(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xec82
movq 0x12353(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x9bc4(%rip), %rsi      # 0x18833
leaq 0x75fc(%rip), %rdx      # 0x16272
movl $0x35, %ecx
xorl %eax, %eax
callq 0x5180
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xecf1
movzbl 0x18(%rax), %ecx
movl %ecx, 0x24(%rbx)
movzbl 0x19(%rax), %ecx
shll $0x10, %ecx
movzbl 0x1a(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movl %edx, 0x28(%rbx)
xorl %ebx, %ebx
cmpb $0x1, (%r14)
jne 0xecf6
movq 0x12304(%rip), %rcx     # 0x20fb8
movq (%rcx), %rdi
movzbl 0x17(%rax), %r8d
movzbl 0x18(%rax), %r9d
movzbl 0x19(%rax), %r10d
movzbl 0x1a(%rax), %r11d
leaq 0x831a(%rip), %rsi      # 0x16fec
leaq 0x7599(%rip), %rdx      # 0x16272
xorl %ebx, %ebx
movl $0x46, %ecx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x5180
addq $0x10, %rsp
jmp 0xecf6
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xed23
movq 0x122b5(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x9b56(%rip), %rsi      # 0x18863
leaq 0x755e(%rip), %rdx      # 0x16272
movl $0x49, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx8/gtx8_update.cpp
// Function: GTx8Update::DisableReport()
int GTx8Update::DisableReport()
{
	unsigned char cmdDisable[] = {0x33, 0x00, 0xCD};
	unsigned char cmdConfirm[] = {0x35, 0x00, 0xCB};
	unsigned char buf[3] = {0};
	int ret;

	for (int i = 0; i < 3; i++) {
		ret = dev->Write(CMD_ADDR, cmdDisable, sizeof(cmdDisable));
		if (ret < 0) {
			gdix_err("send close report cmd failed\n");
			return ret;
		}
		usleep(10000);
	}

	ret = dev->Write(CMD_ADDR, cmdConfirm, sizeof(cmdConfirm));
	if (ret < 0) {
		gdix_err("send confirm cmd failed\n");
		return ret;
	}
	usleep(30000);
	ret = dev->Read(CMD_ADDR, buf, sizeof(buf));
	if (ret < 0) {
		gdix_err("read confirm flag failed\n");
		return ret;
	}

	if (buf[1] != 1) {
		gdix_err("close report failed, flag[0x%02X]\n", buf[1]);
		return -EINVAL;
	}

	gdix_info("close report success\n");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x14(%rsp), %rdx
movb $-0x33, 0x2(%rdx)
movw $0x33, (%rdx)
movb $-0x35, 0x12(%rsp)
movw $0x35, 0x10(%rsp)
movb $0x0, 0xe(%rsp)
movw $0x0, 0xc(%rsp)
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
movl $0x60cc, %esi           # imm = 0x60CC
movl $0x3, %ecx
callq *0x30(%rax)
movl %eax, %ebx
xorl %ebp, %ebp
testl %eax, %eax
js 0xf097
leaq 0x14(%rsp), %r15
movl $0x2710, %edi           # imm = 0x2710
callq 0x5170
cmpl $-0x2, %ebp
je 0xf0aa
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movl $0x60cc, %esi           # imm = 0x60CC
movq %r15, %rdx
movl $0x3, %ecx
callq *0x30(%rax)
movl %eax, %ebx
decl %ebp
testl %eax, %eax
jns 0xf062
cmpl $-0x2, %ebp
setb %bpl
leaq 0x121f3(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0xf0b3
callq 0x5caf
jmp 0xf0b3
negl %ebp
cmpl $0x2, %ebp
setae %bpl
testb %bpl, %bpl
je 0xf176
movq 0x8(%r14), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rdx
movl $0x60cc, %esi           # imm = 0x60CC
movl $0x3, %ecx
callq *0x30(%rax)
testl %eax, %eax
js 0xf143
movl $0x7530, %edi           # imm = 0x7530
callq 0x5170
movq 0x8(%r14), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rdx
movl $0x60cc, %esi           # imm = 0x60CC
movl $0x3, %ecx
callq *0x20(%rax)
testl %eax, %eax
js 0xf158
movzbl 0xd(%rsp), %r8d
leaq 0x12184(%rip), %rax     # 0x21291
movb (%rax), %al
cmpl $0x1, %r8d
jne 0xf16d
xorl %ebx, %ebx
testb %al, %al
je 0xf176
movq 0x11e96(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x984f(%rip), %rsi      # 0x1897b
leaq 0x97b1(%rip), %rdx      # 0x188e4
xorl %ebx, %ebx
movl $0x9c, %ecx
xorl %eax, %eax
callq 0x5180
jmp 0xf176
movl %eax, %ebx
leaq 0x12145(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0xf176
callq 0x5d03
jmp 0xf176
movl %eax, %ebx
leaq 0x12130(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0xf176
callq 0x5cd9
jmp 0xf176
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
testb %al, %al
jne 0xf183
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x11e4e(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
leaq 0x97b3(%rip), %rsi      # 0x18947
leaq 0x9749(%rip), %rdx      # 0x188e4
movl $0x98, %ecx
xorl %eax, %eax
callq 0x5180
jmp 0xf176
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::GTx9Device()
GTx9Device::GTx9Device()
{
	m_fd = -1;
	m_firmwareVersionMajor = 0;
	m_firmwareVersionMinor = 0;
	m_sensorID = 0;
	m_configID = 0;
	memset(m_pid, 0, sizeof(m_pid));
	memset(m_vid, 0, sizeof(m_vid));
	m_deviceOpen = false;
}

// Assembly:
leaq 0x10715(%rip), %rax     # 0x20948
movq %rax, (%rdi)
movl $0xffffffff, 0xc(%rdi)  # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, 0x28(%rdi)
movb %al, 0x1c(%rdi)
movq %rax, 0x20(%rdi)
movq %rax, 0x10(%rdi)
movl %eax, 0x18(%rdi)
movb %al, 0x8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::Open(char const*)
int GTx9Device::Open(const char *filename)
{
	if (!filename)
		return -EINVAL;

	m_fd = open(filename, O_RDWR);
	if (m_fd < 0)
		return -EINVAL;

	m_deviceOpen = true;

	return SetBasicProperties();
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x10284
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x51e0
movl %eax, 0xc(%rbx)
testl %eax, %eax
js 0x10284
movb $0x1, 0x8(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0xa0(%rax)
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::Close()
void GTx9Device::Close()
{
	if (!m_deviceOpen)
		return;
	close(m_fd);
	m_fd = -1;
	m_deviceOpen = false;
}

// Assembly:
cmpb $0x1, 0x8(%rdi)
jne 0x102aa
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %edi
callq 0x5210
movl $0xffffffff, 0xc(%rbx)  # imm = 0xFFFFFFFF
movb $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::SetReport(unsigned char*, int)
int GTx9Device::SetReport(unsigned char *buf, int len)
{
	int retry = 5;
	int ret;

	while (retry--) {
		ret = ioctl(m_fd, HIDIOCSFEATURE(len), buf);
		if (ret == len)
			return 0;
		usleep(1000);
	}

	gdix_err("Failed set report, ret:%d\n", ret);
	return -EINVAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, (%rsp)
movq %rdi, %r15
movl %edx, %r12d
shll $0x10, %r12d
orl $0xc0004806, %r12d      # imm = 0xC0004806
movl $0xfffffffb, %r14d      # imm = 0xFFFFFFFB
xorl %ebx, %ebx
movl 0xc(%r15), %edi
movq %r12, %rsi
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x5160
cmpl %ebp, %eax
je 0x104a7
movl %eax, %r13d
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x5170
incl %r14d
jne 0x1046e
leaq 0x10df4(%rip), %rax     # 0x21291
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
je 0x104b8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10b19(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
leaq 0x85a2(%rip), %rsi      # 0x18a6b
leaq 0x88b2(%rip), %rdx      # 0x18d82
movl $0x155, %ecx            # imm = 0x155
movl %r13d, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0x104a7
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::GetReport(unsigned char*)
int GTx9Device::GetReport(unsigned char *buf)
{
	int ret;
	int retry = 5;
	uint8_t rcv_buf[PACKAGE_LEN + 1] = {0};

	while (retry--) {
		rcv_buf[0] = REPORT_ID;
		ret = ioctl(m_fd, HIDIOCGFEATURE(PACKAGE_LEN), rcv_buf);
		if (ret == PACKAGE_LEN && rcv_buf[0] == REPORT_ID) {
			memcpy(buf, rcv_buf, PACKAGE_LEN);
			return 0;
		}
		usleep(1000);
	}

	gdix_err("Failed get report ret:%d rcvbuf[0]:0x%02x\n", ret, rcv_buf[0]);
	return -EINVAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movw $0x0, 0x40(%r15)
movl $0xfffffffb, %r12d      # imm = 0xFFFFFFFB
movb $0xe, (%rsp)
movl 0xc(%r14), %edi
movl $0xc0414807, %esi       # imm = 0xC0414807
movq %r15, %rdx
xorl %eax, %eax
callq 0x5160
movl %eax, %ebp
cmpl $0x41, %eax
jne 0x1053e
cmpb $0xe, (%rsp)
je 0x1058c
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x5170
incl %r12d
jne 0x1051a
leaq 0x10d3d(%rip), %rax     # 0x21291
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
jne 0x1059e
movq 0x10a73(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
movzbl (%rsp), %r9d
leaq 0x87d2(%rip), %rsi      # 0x18d46
leaq 0x7e71(%rip), %rdx      # 0x183ec
movl $0x145, %ecx            # imm = 0x145
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0x1059e
movq %rsp, %rsi
movl $0x41, %edx
movq %rbx, %rdi
callq 0x5090
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::Read(unsigned int, unsigned char*, unsigned int)
int GTx9Device::Read(unsigned int addr, unsigned char *buf, unsigned int len)
{
	int ret = 0;
	int i = 0;
	uint32_t tmp_addr = addr;
	int offset = 0;
	int pkg_size = PACKAGE_LEN - 12;
	int remain_size;
	int pkg_num;

	if (!m_deviceOpen) {
		gdix_err("Device not open\n");
		return -EINVAL;
	}

	pkg_num = len / pkg_size;
	remain_size = len % pkg_size;

	for (i = 0; i < pkg_num; i++) {
		ret = ReadPkg(tmp_addr + offset, &buf[offset], pkg_size);
		if (ret < 0)
			return ret;
		offset += pkg_size;
	}

	if (remain_size > 0) {
		ret = ReadPkg(tmp_addr + offset, &buf[offset], remain_size);
		if (ret < 0)
			return ret;
	}

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0x8(%rdi)
je 0x10649
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %r15
movl %ecx, %eax
imulq $0x3521cfb3, %rax, %rax # imm = 0x3521CFB3
shrq $0x20, %rax
movl %ecx, %ebx
subl %eax, %ebx
shrl %ebx
addl %eax, %ebx
shrl $0x5, %ebx
xorl %r13d, %r13d
cmpl $0x35, %ecx
jb 0x10624
movl %ebp, 0x4(%rsp)
movl %esi, (%rsp)
movl %esi, %ebp
xorl %r13d, %r13d
movl %ebx, %r12d
leal (%rbp,%r13), %esi
leaq (%r14,%r13), %rdx
movq %r15, %rdi
movl $0x35, %ecx
callq 0x102b4
testl %eax, %eax
js 0x10645
addq $0x35, %r13
decl %r12d
jne 0x105fa
movl 0x4(%rsp), %ebp
movl (%rsp), %esi
imull $0x35, %ebx, %eax
movl %ebp, %ecx
subl %eax, %ecx
je 0x1065a
addl %r13d, %esi
movl %r13d, %eax
addq %rax, %r14
movq %r15, %rdi
movq %r14, %rdx
callq 0x102b4
testl %eax, %eax
jns 0x1065a
movl %eax, %ebp
jmp 0x1065a
leaq 0x10c41(%rip), %rax     # 0x21291
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
je 0x1066b
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5ee3
jmp 0x1065a
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::Write(unsigned int, unsigned char const*, unsigned int)
int GTx9Device::Write(unsigned int addr, const unsigned char *buf,
					  unsigned int len)
{
	uint8_t HidBuf[PACKAGE_LEN] = {0};
	uint32_t current_addr = addr;
	uint32_t transfer_length = 0;
	uint32_t pos = 0;
	uint8_t pkg_num = 0;
	int ret;

	if (!m_deviceOpen) {
		gdix_err("Device not open\n");
		return -EINVAL;
	}

	while (pos != len) {
		HidBuf[0] = REPORT_ID;
		HidBuf[1] = I2C_DIRECT_RW;
		if (len - pos > PACKAGE_LEN - 12) {
			transfer_length = PACKAGE_LEN - 12;
			HidBuf[2] = 0x01;
		} else {
			transfer_length = len - pos;
			HidBuf[2] = 0x00;
		}
		HidBuf[3] = pkg_num++;
		HidBuf[4] = transfer_length + 7;
		HidBuf[5] = I2C_WRITE_FLAG;
		HidBuf[6] = (current_addr >> 24) & 0xFF;
		HidBuf[7] = (current_addr >> 16) & 0xFF;
		HidBuf[8] = (current_addr >> 8) & 0xFF;
		HidBuf[9] = current_addr & 0xFF;
		HidBuf[10] = (transfer_length >> 8) & 0xFF;
		HidBuf[11] = transfer_length & 0xFF;
		memcpy(&HidBuf[12], &buf[pos], transfer_length);
		ret = SetReport(HidBuf, transfer_length + 12);
		if (ret < 0) {
			gdix_err("Failed write data to addr=0x%x, len=%d,ret = %d\n",
					 current_addr, transfer_length, ret);
			return ret;
		}
		pos += transfer_length;
		current_addr += transfer_length;
	}

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movb $0x0, 0x50(%rsp)
movq %rdi, 0x58(%rsp)
cmpb $0x1, 0x8(%rdi)
jne 0x10762
movl %ecx, %ebp
testl %ecx, %ecx
je 0x1075d
movl %esi, %ebx
xorl %r14d, %r14d
xorl %r15d, %r15d
movw $0x200e, 0x10(%rsp)     # imm = 0x200E
movl %ebp, %r12d
subl %r15d, %r12d
cmpl $0x36, %r12d
jb 0x106e2
movb $0x1, 0x12(%rsp)
movl $0x35, %r12d
jmp 0x106e7
movb $0x0, 0x12(%rsp)
movb %r14b, 0x13(%rsp)
leal 0x7(%r12), %eax
movb %al, 0x14(%rsp)
xorl %ecx, %ecx
movb %cl, 0x15(%rsp)
movl %ebx, %eax
shrl $0x18, %eax
movb %al, 0x16(%rsp)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x17(%rsp)
movb %bh, 0x18(%rsp)
movb %bl, 0x19(%rsp)
movb %cl, 0x1a(%rsp)
movb %r12b, 0x1b(%rsp)
movl %r15d, %esi
addq 0x60(%rsp), %rsi
movl %r12d, %edx
leaq 0x1c(%rsp), %rdi
callq 0x5090
leal 0xc(%r12), %edx
movq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10444
testl %eax, %eax
js 0x1077b
incb %r14b
addl %r12d, %r15d
addl %r12d, %ebx
cmpl %ebp, %r15d
jne 0x106c2
movl %ebp, %r13d
jmp 0x1078a
leaq 0x10b28(%rip), %rax     # 0x21291
movl $0xffffffea, %r13d      # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
jne 0x1078a
callq 0x5f05
jmp 0x1078a
movl %eax, %r13d
leaq 0x10b0c(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
je 0x1079c
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10835(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
movl %r13d, (%rsp)
leaq 0x8339(%rip), %rsi      # 0x18aea
leaq 0x7dac(%rip), %rdx      # 0x18564
movl %ebx, %r8d
movl $0xb9, %ecx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x5180
jmp 0x1078a
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::WriteSpeCmd(unsigned char const*, unsigned int)
int GTx9Device::WriteSpeCmd(const unsigned char *buf, unsigned int len)
{
	unsigned char cmdBuf[16] = {0};
	uint16_t checksum = 0;
	uint32_t i;
	int ret;

	if (len > 11) {
		gdix_err("Cmd data len is invalid len=%d\n", len);
		return -EINVAL;
	}

	cmdBuf[0] = 0;
	cmdBuf[1] = 0;
	cmdBuf[2] = len + 3;
	memcpy(&cmdBuf[3], buf, len);
	for (i = 2; i < len + 3; i++)
		checksum += cmdBuf[i];

	cmdBuf[len + 3] = checksum & 0xFF;
	cmdBuf[len + 4] = (checksum >> 8) & 0XFF;
	ret = Write(0x10174, cmdBuf, len + 5);
	if (ret < 0) {
		gdix_err("Failed write cmd\n");
		return ret;
	}
	for (i = 0; i < 20; i++) {
		ret = Read(0x10174, cmdBuf, 2);
		if (ret < 0) {
			gdix_err("Failed read cmd status\n");
			return ret;
		}
		if (cmdBuf[1] == 0x80 && cmdBuf[0] == 0x80) {
			usleep(5000);
			return 0;
		}
		usleep(15000);
	}

	gdix_err("Failed get valid cmd ack:0x%02x sta:0x%02x\n", cmdBuf[1],
			 cmdBuf[0]);
	return -EINVAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
cmpl $0xc, %edx
jb 0x10828
leaq 0x10aa3(%rip), %rax     # 0x21291
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
jne 0x10941
movq 0x107d5(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
leaq 0x831f(%rip), %rsi      # 0x18b2c
leaq 0x7dc8(%rip), %rdx      # 0x185dc
movl $0xcb, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0x10941
movq %rdi, %rbx
leaq 0x3(%rsp), %rdi
movw $0x0, -0x3(%rdi)
leal 0x3(%r14), %r15d
movb %r15b, -0x1(%rdi)
movl %r14d, %ebp
movq %rbp, %rdx
callq 0x5090
movl $0x2, %ecx
xorl %eax, %eax
movzbl (%rsp,%rcx), %edx
addl %edx, %eax
incq %rcx
cmpq %rcx, %r15
jne 0x10850
movb %al, (%rsp,%r15)
movq %rsp, %rdx
movb %ah, 0x4(%rbp,%rdx)
addl $0x5, %r14d
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x10174, %esi          # imm = 0x10174
movl %r14d, %ecx
callq *0x30(%rax)
testl %eax, %eax
js 0x1090b
movl $0x14, %r15d
movq %rsp, %r14
xorl %r12d, %r12d
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x10174, %esi          # imm = 0x10174
movq %r14, %rdx
movl $0x2, %ecx
callq *0x20(%rax)
testl %eax, %eax
js 0x10920
cmpb 0x1(%rsp), %r12b
jno 0x108ba
movb (%rsp), %al
negb %al
jo 0x10935
movl $0x3a98, %edi           # imm = 0x3A98
callq 0x5170
decl %r15d
jne 0x10892
leaq 0x109c1(%rip), %rax     # 0x21291
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
jne 0x10941
movq 0x106f7(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
movzbl 0x1(%rsp), %r8d
movzbl (%rsp), %r9d
leaq 0x82b3(%rip), %rsi      # 0x18ba9
leaq 0x7cdf(%rip), %rdx      # 0x185dc
movl $0xeb, %ecx
xorl %eax, %eax
callq 0x5180
jmp 0x10941
movl %eax, %ebp
leaq 0x1097d(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10941
callq 0x5f53
jmp 0x10941
movl %eax, %ebp
leaq 0x10968(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10941
callq 0x5f29
jmp 0x10941
movl $0x1388, %edi           # imm = 0x1388
callq 0x5170
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::SendConfig(unsigned char*, int)
int GTx9Device::SendConfig(unsigned char *config, int len)
{
	int ret;
	uint8_t cmdBuf[5] = {0};
	uint8_t tmpBuf[4096] = {0};

	/* start write cfg */
	cmdBuf[0] = 0x04;
	ret = WriteSpeCmd(cmdBuf, 1);
	if (ret < 0) {
		gdix_err("Failed write cfg prepare cmd\n");
		return ret;
	}

	/* try send config */
	ret = Write(0x13B74, config, len);
	if (ret < 0) {
		gdix_err("Failed write config data\n");
		goto exit;
	}

	/* read back config */
	ret = Read(0x13B74, tmpBuf, len);
	if (ret < 0) {
		gdix_err("Failed read back config\n");
		goto exit;
	}

	if (memcmp(config, tmpBuf, len)) {
		gdix_err("Config data read back compare file\n");
		ret = -EINVAL;
		goto exit;
	}
	cmdBuf[0] = 0x05;
	ret = WriteSpeCmd(cmdBuf, 1);
	if (ret < 0)
		gdix_err("Failed send config data ready cmd\n");

exit:
	cmdBuf[0] = 0x06;
	ret = WriteSpeCmd(cmdBuf, 1);
	if (ret < 0)
		gdix_err("Failed send config write end command\n");

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movb $0x0, 0x4(%r15)
movl $0x0, (%r15)
leaq 0x10(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x5080
movb $0x4, (%r15)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq *0x40(%rax)
testl %eax, %eax
js 0x109f7
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x13b74, %esi          # imm = 0x13B74
movq %r14, %rdx
movl %ebp, %ecx
callq *0x30(%rax)
testl %eax, %eax
js 0x10a0d
movq (%rbx), %rax
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x13b74, %esi          # imm = 0x13B74
movl %ebp, %ecx
callq *0x20(%rax)
testl %eax, %eax
js 0x10a20
movslq %ebp, %rdx
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x50f0
testl %eax, %eax
je 0x10a33
leaq 0x108a6(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10a59
callq 0x5f7d
jmp 0x10a59
movl %eax, %r15d
leaq 0x10890(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10a82
callq 0x604f
jmp 0x10a82
leaq 0x1087d(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10a59
callq 0x5ffb
jmp 0x10a59
leaq 0x1086a(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10a59
callq 0x5fd1
jmp 0x10a59
leaq 0x8(%rsp), %rsi
movb $0x5, (%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %edx
callq *0x40(%rax)
testl %eax, %eax
jns 0x10a59
leaq 0x1083d(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
je 0x10a9a
leaq 0x8(%rsp), %rsi
movb $0x6, (%rsi)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %edx
callq *0x40(%rax)
movl %eax, %r15d
testl %eax, %eax
jns 0x10a82
leaq 0x10814(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
je 0x10a93
movl %r15d, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x6025
jmp 0x10a82
callq 0x5fa7
jmp 0x10a59
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9.cpp
// Function: GTx9Device::SendCmd(unsigned char, unsigned char*, int)
int GTx9Device::SendCmd(unsigned char cmd, unsigned char *data, int dataLen)
{
	uint8_t HidBuf[PACKAGE_LEN] = {0};
	int ret;

	if (!m_deviceOpen) {
		gdix_err("Device not open\n");
		return -EINVAL;
	}

	HidBuf[0] = REPORT_ID;
	HidBuf[1] = cmd;
	HidBuf[2] = 0x00;
	HidBuf[3] = 0x00;
	HidBuf[4] = (uint8_t)dataLen;
	memcpy(&HidBuf[5], data, dataLen);
	ret = SetReport(HidBuf, dataLen + 5);
	if (ret < 0)
		gdix_err("Failed send cmd 0x%02x\n", cmd);

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x8(%rdi)
je 0x10b23
movl %esi, %ebx
movq %rdi, %r14
leaq 0x5(%rsp), %rdi
movb $0xe, -0x5(%rdi)
movb %bl, -0x4(%rdi)
movw $0x0, -0x3(%rdi)
movb %cl, -0x1(%rdi)
movslq %ecx, %r15
movq %rdx, %rsi
movq %r15, %rdx
callq 0x5090
addl $0x5, %r15d
movq %rsp, %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x10444
movl %eax, %ebp
testl %eax, %eax
jns 0x10b34
leaq 0x1077d(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0x10b34
movzbl %bl, %edi
callq 0x609d
jmp 0x10b34
leaq 0x10767(%rip), %rax     # 0x21291
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
je 0x10b41
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x6079
jmp 0x10b34
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9_firmware_image.cpp
// Function: GTX9FirmwareImage::Initialize(char const*)
int GTX9FirmwareImage::Initialize(const char *filename)
{
	int ret;

	m_initialized = false;

	if (GetDataFromFile(filename) < 0) {
		gdix_err("Failed get firmware\n");
		return -EINVAL;
	}

	gdix_info("Parse firmware file\n");
	ret = ParseFirmware();
	if (ret < 0) {
		gdix_err("Failed parse firmware\n");
		return ret;
	}

	m_initialized = true;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x8(%rdi)
movq (%rdi), %rax
callq *0xb0(%rax)
leaq 0x10432(%rip), %r14     # 0x21291
movb (%r14), %cl
testl %eax, %eax
js 0x10ea2
testb %cl, %cl
je 0x10e8e
movq 0x10147(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x805c(%rip), %rsi      # 0x18ed7
leaq 0x51a9(%rip), %rdx      # 0x1602b
movl $0x37, %ecx
xorl %eax, %eax
callq 0x5180
movq %rbx, %rdi
callq 0x10ec8
testl %eax, %eax
js 0x10eb2
movb $0x1, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0x10eba
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
testb %cl, %cl
je 0x10eba
callq 0x6144
jmp 0x10eba
movl %eax, %ebp
cmpb $0x1, (%r14)
je 0x10ec1
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x6122
jmp 0x10eba
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9_i2c_update.cpp
// Function: checksum_cmp(unsigned char const*, int, int)
int checksum_cmp(const uint8_t *data, int size, int mode)
{
	uint32_t cal_checksum = 0;
	uint32_t r_checksum = 0;
	int i;

	if (mode == CHECKSUM_MODE_U8_LE) {
		if (size < 2)
			return 1;
		for (i = 0; i < size - 2; i++)
			cal_checksum += data[i];

		r_checksum = data[size - 2] + (data[size - 1] << 8);
		return (cal_checksum & 0xFFFF) == r_checksum ? 0 : 1;
	}

	if (size < 4)
		return 1;
	for (i = 0; i < size - 4; i += 2)
		cal_checksum += data[i] + (data[i + 1] << 8);
	r_checksum = data[size - 4] + (data[size - 3] << 8) +
				 (data[size - 2] << 16) + (data[size - 1] << 24);
	return cal_checksum == r_checksum ? 0 : 1;
}

// Assembly:
movb $0x1, %al
testl %edx, %edx
je 0x11480
cmpl $0x4, %esi
jl 0x114bd
leal -0x4(%rsi), %ecx
xorl %eax, %eax
cmpl $0x4, %esi
je 0x11456
movslq %ecx, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
movzwl (%rdi,%r8), %r9d
addl %r9d, %eax
addq $0x2, %r8
cmpq %rdx, %r8
jl 0x11445
movl %ecx, %ecx
movzbl (%rdi,%rcx), %ecx
movl %esi, %edx
movzbl -0x3(%rdi,%rdx), %esi
shll $0x8, %esi
orl %ecx, %esi
movzbl -0x2(%rdi,%rdx), %ecx
shll $0x10, %ecx
orl %esi, %ecx
movzbl -0x1(%rdi,%rdx), %edx
shll $0x18, %edx
orl %ecx, %edx
cmpl %edx, %eax
jmp 0x114ba
cmpl $0x2, %esi
jl 0x114bd
leal -0x2(%rsi), %eax
xorl %ecx, %ecx
movl %eax, %eax
cmpl $0x2, %esi
je 0x114a8
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rdi,%rcx), %r8d
addl %r8d, %edx
incq %rcx
cmpq %rcx, %rax
jne 0x11495
movzwl %dx, %ecx
movzbl (%rdi,%rax), %eax
movl %esi, %edx
movzbl -0x1(%rdi,%rdx), %edx
shll $0x8, %edx
orl %eax, %edx
cmpl %edx, %ecx
setne %al
movzbl %al, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9_i2c_update.cpp
// Function: gdix_append_checksum(unsigned char*, int, int)
uint32_t gdix_append_checksum(uint8_t *data, int len, int mode)
{
	uint32_t checksum = 0;
	int i;

	checksum = 0;
	if (mode == CHECKSUM_MODE_U8_LE) {
		for (i = 0; i < len; i++)
			checksum += data[i];
	} else {
		for (i = 0; i < len; i += 2)
			checksum += (data[i] + (data[i + 1] << 8));
	}

	if (mode == CHECKSUM_MODE_U8_LE) {
		data[len] = checksum & 0xff;
		data[len + 1] = (checksum >> 8) & 0xff;
		return 0xFFFF & checksum;
	}
	data[len] = checksum & 0xff;
	data[len + 1] = (checksum >> 8) & 0xff;
	data[len + 2] = (checksum >> 16) & 0xff;
	data[len + 3] = (checksum >> 24) & 0xff;
	return checksum;
}

// Assembly:
testl %edx, %edx
je 0x114e3
testl %esi, %esi
jle 0x11500
movl %esi, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movzwl (%rdi,%r8), %r9d
addl %r9d, %eax
addq $0x2, %r8
cmpq %rcx, %r8
jb 0x114d0
jmp 0x11502
testl %esi, %esi
jle 0x11500
movl %esi, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movzbl (%rdi,%r8), %r9d
addl %r9d, %eax
incq %r8
cmpq %r8, %rcx
jne 0x114ee
jmp 0x11502
xorl %eax, %eax
movslq %esi, %rcx
movw %ax, (%rdi,%rcx)
testl %edx, %edx
je 0x11520
movl %eax, %edx
shrl $0x10, %edx
movb %dl, 0x2(%rdi,%rcx)
movl %eax, %edx
shrl $0x18, %edx
movb %dl, 0x3(%rdi,%rcx)
retq
movzwl %ax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9_update.cpp
// Function: GTx9Update::Run(void*)
int GTx9Update::Run(void *para)
{
	int ret;

	if (!m_Initialized) {
		gdix_err("Can't Process Update Before Initialized.\n");
		return -EINVAL;
	}
	// get all parameter
	pGTUpdatePara parameter = (pGTUpdatePara)para;

	if (!parameter->force) {
		ret = check_update();
		if (ret < 0) {
			gdix_info("Upgrades are not allowed\n");
			return ret;
		} else if (ret == 0) {
			gdix_info("Skip upgrade\n");
			return 0;
		}
		gdix_info("Ready to upgrade\n");
	} else {
		gdix_info("Force to upgrade\n");
	}

	ret = prepareUpdate();
	if (ret < 0) {
		gdix_err("Failed prepare update\n");
		return ret;
	}

	ret = fw_update(parameter->firmwareFlag);
	if (ret < 0) {
		gdix_err("Failed update\n");
		return ret;
	}

	gdix_info("Success update\n");

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x18(%rdi)
je 0x12ddd
movq %rsi, %r15
movq %rdi, %r14
cmpb $0x0, (%rsi)
je 0x12dfc
leaq 0xe4dc(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x12e44
movq 0xe1f3(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x72a9(%rip), %rsi      # 0x1a078
leaq 0x42df(%rip), %rdx      # 0x170b5
movl $0x3c, %ecx
jmp 0x12e3d
leaq 0xe4ad(%rip), %rax      # 0x21291
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
cmpb $0x1, (%rax)
jne 0x12f10
callq 0x6622
jmp 0x12f10
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
testl %eax, %eax
js 0x12eaa
leaq 0xe47d(%rip), %rax      # 0x21291
movb (%rax), %al
je 0x12ee2
testb %al, %al
je 0x12e44
movq 0xe191(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7224(%rip), %rsi      # 0x1a055
leaq 0x427d(%rip), %rdx      # 0x170b5
movl $0x3a, %ecx
xorl %eax, %eax
callq 0x5180
movq %r14, %rdi
callq 0x12f18
testl %eax, %eax
js 0x12e95
movl 0x4(%r15), %esi
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movl %eax, %ebx
leaq 0xe42b(%rip), %rax      # 0x21291
movb (%rax), %al
testl %ebx, %ebx
js 0x12ed7
testb %al, %al
je 0x12f0e
movq 0xe13d(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x725e(%rip), %rsi      # 0x1a0e3
leaq 0x4229(%rip), %rdx      # 0x170b5
xorl %ebx, %ebx
movl $0x4b, %ecx
jmp 0x12f05
movl %eax, %ebx
leaq 0xe3f3(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x12f10
callq 0x6666
jmp 0x12f10
movl %eax, %ebx
leaq 0xe3de(%rip), %rax      # 0x21291
cmpb $0x1, (%rax)
jne 0x12f10
movq 0xe0f9(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x7142(%rip), %rsi      # 0x1a00b
leaq 0x41e5(%rip), %rdx      # 0x170b5
movl $0x34, %ecx
jmp 0x12f05
testb %al, %al
je 0x12f10
callq 0x6644
jmp 0x12f10
testb %al, %al
je 0x12f0e
movq 0xe0cb(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x713f(%rip), %rsi      # 0x1a036
leaq 0x41b7(%rip), %rdx      # 0x170b5
xorl %ebx, %ebx
movl $0x37, %ecx
xorl %eax, %eax
callq 0x5180
jmp 0x12f10
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx9/gtx9_update.cpp
// Function: GTx9Update::check_update()
int GTx9Update::check_update()
{
	int ret;

	ret = memcmp(dev->GetProductID(), image->GetProductID(), 8);
	if (ret != 0) {
		gdix_info("Product ID mismatch %s != %s\n", dev->GetProductID(),
				  image->GetProductID());
		return -1;
	}

	if ((dev->GetFirmwareVersionMajor() != image->GetFirmwareVersionMajor()) ||
		(dev->GetFirmwareVersionMinor() != image->GetFirmwareVersionMinor())) {
		gdix_info("Current version:%d.%d\n", dev->GetFirmwareVersionMajor(),
				  dev->GetFirmwareVersionMinor());
		gdix_info("Firmware version:%d.%d\n", image->GetFirmwareVersionMajor(),
				  image->GetFirmwareVersionMinor());
		return 1;
	}

	gdix_info("No need to upgrade\n");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq %rax, %r14
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq (%r14), %rcx
cmpq (%rax), %rcx
je 0x1322d
leaq 0xe0bb(%rip), %rax      # 0x21291
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x1, (%rax)
jne 0x1333d
movq 0xddcd(%rip), %rax      # 0x20fb8
movq (%rax), %r14
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x6ef8(%rip), %rsi      # 0x1a104
leaq 0x309a(%rip), %rdx      # 0x162ad
movq %r14, %rdi
movl $0x57, %ecx
movq %r15, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x5180
jmp 0x1333d
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movl %eax, %ebp
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl %eax, %ebp
jne 0x1329e
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movl %eax, %ebp
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
cmpl %eax, %ebp
jne 0x1329e
leaq 0xe029(%rip), %rax      # 0x21291
xorl %ebp, %ebp
cmpb $0x1, (%rax)
jne 0x1333d
movq 0xdd3e(%rip), %rax      # 0x20fb8
movq (%rax), %rdi
leaq 0x6f00(%rip), %rsi      # 0x1a184
leaq 0x3022(%rip), %rdx      # 0x162ad
xorl %ebp, %ebp
movl $0x64, %ecx
xorl %eax, %eax
callq 0x5180
jmp 0x1333d
leaq 0xdfec(%rip), %r15      # 0x21291
cmpb $0x1, (%r15)
jne 0x132ee
movq 0xdd06(%rip), %rax      # 0x20fb8
movq (%rax), %r14
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movl %eax, %ebp
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
leaq 0x6e61(%rip), %rsi      # 0x1a133
leaq 0x2fd4(%rip), %rdx      # 0x162ad
movq %r14, %rdi
movl $0x5e, %ecx
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x5180
movl $0x1, %ebp
cmpb $0x1, (%r15)
jne 0x1333d
movq 0xdcb8(%rip), %rax      # 0x20fb8
movq (%rax), %r14
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movl %eax, %r15d
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
leaq 0x6e3a(%rip), %rsi      # 0x1a15b
leaq 0x2f85(%rip), %rdx      # 0x162ad
movq %r14, %rdi
movl $0x60, %ecx
movl %r15d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x5180
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/berlin_a/brla.cpp
// Function: BrlADevice::BrlADevice()
BrlADevice::BrlADevice()
{
	m_fd = -1;
	m_firmwareVersionMajor = 0;
	m_firmwareVersionMinor = 0;
	m_sensorID = 0;
	m_configID = 0;
	memset(m_pid, 0, sizeof(m_pid));
	memset(m_vid, 0, sizeof(m_vid));
	m_deviceOpen = false;
}

// Assembly:
leaq 0xd151(%rip), %rax      # 0x20b80
movq %rax, (%rdi)
movl $0xffffffff, 0xc(%rdi)  # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, 0x28(%rdi)
movb %al, 0x1c(%rdi)
movq %rax, 0x20(%rdi)
movq %rax, 0x10(%rdi)
movl %eax, 0x18(%rdi)
movb %al, 0x8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/berlin_a/brla.cpp
// Function: BrlADevice::Close()
void BrlADevice::Close()
{
	if (!m_deviceOpen)
		return;
	close(m_fd);
	m_fd = -1;
	m_deviceOpen = false;
}

// Assembly:
cmpb $0x1, 0x8(%rdi)
jne 0x13aa6
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %edi
callq 0x5210
movl $0xffffffff, 0xc(%rbx)  # imm = 0xFFFFFFFF
movb $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/AGWA[P]logmailer/logmailer.cpp
// Function: set_cloexec(int, bool)
static void set_cloexec (int fd, bool cloexec)
{
	int		old_flags = fcntl(fd, F_GETFD);
	if (old_flags == -1) {
		throw System_error("fcntl(F_GETFD)", "", errno);
	}
	int		new_flags = old_flags;
	if (cloexec) {
		new_flags |= FD_CLOEXEC;
	} else {
		new_flags &= ~FD_CLOEXEC;
	}
	if (new_flags != old_flags && fcntl(fd, F_SETFD, new_flags) == -1) {
		throw System_error("fcntl(F_SETFD)", "", errno);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %edi, %ebx
movl $0x1, %esi
xorl %eax, %eax
callq 0x2150
cmpl $-0x1, %eax
je 0x33ea
movl %eax, %edx
orl $0x1, %edx
cmpl %eax, %edx
je 0x33dd
movl %ebx, %edi
movl $0x2, %esi
xorl %eax, %eax
callq 0x2150
cmpl $-0x1, %eax
je 0x3468
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0x2130
movq %rax, %rbx
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1d65(%rip), %rsi      # 0x516c
leaq 0x1d6c(%rip), %rdx      # 0x517a
leaq 0x20(%rsp), %rdi
callq 0x3cde
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1da8(%rip), %rdx      # 0x51d1
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x3cde
callq 0x2040
movl (%rax), %ecx
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x3c38
xorl %ebp, %ebp
leaq 0x3929(%rip), %rsi      # 0x6d80
leaq 0x84a(%rip), %rdx       # 0x3ca8
movq %rbx, %rdi
callq 0x2430
jmp 0x34e4
movl $0x48, %edi
callq 0x2130
movq %rax, %rbx
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1cf6(%rip), %rsi      # 0x517b
leaq 0x1cfd(%rip), %rdx      # 0x5189
leaq 0x20(%rsp), %rdi
callq 0x3cde
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d2a(%rip), %rdx      # 0x51d1
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x3cde
callq 0x2040
movl (%rax), %ecx
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x3c38
xorl %ebp, %ebp
leaq 0x38ab(%rip), %rsi      # 0x6d80
leaq 0x7cc(%rip), %rdx       # 0x3ca8
movq %rbx, %rdi
callq 0x2430
jmp 0x34ea
jmp 0x3505
jmp 0x3524
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x350b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2280
jmp 0x350b
movq %rax, %r14
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x352a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2280
jmp 0x352a
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3537
movq %rbx, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2450
// File: /workspace/github_cpp_makefile_star2_O1/AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::open_fifo()
void open_fifo ()
	{
		close_fifo();

		if ((fd = open(fifo_path.c_str(), O_RDONLY | O_NONBLOCK)) == -1) {
			throw System_error("open", fifo_path.c_str(), errno);
		}
		set_cloexec(fd, true);

		// try opening the FIFO for write so that we never get end-of-file when reading from it
		wfd = open(fifo_path.c_str(), O_WRONLY | O_NONBLOCK);
		if (wfd != -1) {
			set_cloexec(wfd, true);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
callq 0x3dfe
movq (%r14), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x21a0
movl %eax, 0x78(%r14)
cmpl $-0x1, %eax
je 0x36e3
movl %eax, %edi
callq 0x339e
movq (%r14), %rdi
movl $0x801, %esi            # imm = 0x801
xorl %eax, %eax
callq 0x21a0
movl %eax, 0x7c(%r14)
cmpl $-0x1, %eax
je 0x36d8
movl %eax, %edi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x339e
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0x2130
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ac5(%rip), %rsi      # 0x51c5
leaq 0x1ac2(%rip), %rdx      # 0x51c9
leaq 0x8(%rsp), %rdi
callq 0x3cde
movq (%r14), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3bfa
callq 0x2040
movl (%rax), %ecx
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x3c38
xorl %ebp, %ebp
leaq 0x3638(%rip), %rsi      # 0x6d80
leaq 0x559(%rip), %rdx       # 0x3ca8
movq %rbx, %rdi
callq 0x2430
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x377d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2280
jmp 0x377d
movq %rax, %r14
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x379c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2280
jmp 0x379c
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x37a9
movq %rbx, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2450
nop
// File: /workspace/github_cpp_makefile_star2_O1/AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::close_fifo()
void close_fifo ()
	{
		if (wfd != -1) {
			close(wfd);
			wfd = -1;
		}
		if (fd != -1) {
			close(fd);
			fd = -1;
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x7c(%rdi), %edi
cmpl $-0x1, %edi
je 0x3e16
callq 0x24a0
movl $0xffffffff, 0x7c(%rbx) # imm = 0xFFFFFFFF
movl 0x78(%rbx), %edi
cmpl $-0x1, %edi
je 0x3e2a
callq 0x24a0
movl $0xffffffff, 0x78(%rbx) # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::format_subject[abi:cxx11](char const*, unsigned long) const
std::string format_subject (const char* message, std::size_t message_len) const
	{
		std::ostringstream	subject;
		const char*		p = subject_format.c_str();
		while (p[0]) {
			if (p[0] == '%' && p[1] == 'h') {
				subject << hostname;
				p += 2;
			} else if (p[0] == '%' && p[1] == 'c') {
				subject << count_newlines(message, message_len);
				p += 2;
			} else if (p[0] == '%' && p[1] == '%') {
				subject << '%';
				p += 2;
			} else if (p[0] == '%' && p[1]) {
				p += 2;
			} else if (p[0] == '%') {
				++p;
			} else {
				subject << p[0];
				++p;
			}
		}
		return subject.str();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, 0x8(%rsp)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x2330
movq 0x40(%r13), %rbp
leaq 0x7(%rsp), %r13
movzbl (%rbp), %eax
cmpl $0x25, %eax
je 0x41dd
testl %eax, %eax
jne 0x4203
jmp 0x4298
cmpb $0x68, 0x1(%rbp)
jne 0x4203
movq 0x30a6(%rip), %rsi      # 0x7290
movl $0x2, %ebx
movq 0x30a2(%rip), %rdx      # 0x7298
movq %r12, %rdi
callq 0x22d0
jmp 0x4290
cmpb $0x25, %al
jne 0x4277
cmpb $0x63, 0x1(%rbp)
jne 0x422d
testq %r14, %r14
je 0x4253
xorl %eax, %eax
xorl %esi, %esi
xorl %ecx, %ecx
cmpb $0xa, (%r15,%rax)
sete %cl
addq %rcx, %rsi
incq %rax
cmpq %rax, %r14
jne 0x4216
jmp 0x4255
cmpb $0x25, %al
jne 0x4277
cmpb $0x25, 0x1(%rbp)
jne 0x4264
movb $0x25, 0x7(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x22d0
movl $0x2, %ebx
jmp 0x4290
xorl %esi, %esi
movl $0x2, %ebx
movq %r12, %rdi
callq 0x2160
jmp 0x4290
cmpb $0x25, %al
jne 0x4277
cmpb $0x1, 0x1(%rbp)
movl $0x2, %ebx
sbbq $0x0, %rbx
jmp 0x4290
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x22d0
movl $0x1, %ebx
addq %rbx, %rbp
jmp 0x41cb
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x23e0
movq 0x2d1f(%rip), %rsi      # 0x6fd0
leaq 0x10(%rsp), %rdi
callq 0x2140
leaq 0x80(%rsp), %rdi
callq 0x20c0
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x42df
movq %rax, %rbx
movq 0x2ce7(%rip), %rsi      # 0x6fd0
leaq 0x10(%rsp), %rdi
callq 0x2140
leaq 0x80(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2450
// File: /workspace/github_cpp_makefile_star2_O1/ljc2154[P]Rummy/rummy.cpp
// Function: initializeState()
State initializeState()
{
	State state;
	state.deck = getNewDeck();
	state.remaining = initializeRemaining();
	dealCards(state.deck, state.userHand, state.agentHand);
	adjustRemaining(state.remaining, state.agentHand);
	mergeSort(state.userHand, 0, state.userHand.size());
	state.turnCard = 52;
	return state;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
xorl %eax, %eax
movq %rax, 0x40(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq %r14, 0x50(%rdi)
movq %r14, 0x48(%rdi)
movq %rax, 0x58(%rdi)
leaq 0x18(%rsp), %rdi
callq 0x21fa
leaq 0x18(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3e16
movq (%r15), %rdi
testq %rdi, %rdi
je 0x167a
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2280
movq %r14, %rdi
movq %r15, %rsi
callq 0x3e56
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x16b1
movq (%rdi), %r12
movl $0x18, %esi
callq 0x1100
movq %r12, %rdi
cmpq %r15, %r12
jne 0x169c
leaq 0x30(%rbx), %r15
leaq 0x18(%rbx), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22f4
movq %rsp, %rdi
movq %r12, %rsi
callq 0x3bc8
movq (%rsp), %rsi
cmpq %rsi, 0x8(%rsp)
je 0x170a
xorl %r12d, %r12d
xorl %r13d, %r13d
addq %r12, %rsi
movq %r14, %rdi
callq 0x3b38
incq %r13
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
sarq $0x2, %rax
addq $0x4, %r12
cmpq %r13, %rax
ja 0x16e3
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1720
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x38(%rbx), %rdx
subq 0x30(%rbx), %rdx
shrq $0x2, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x23c7
movl $0x34, 0x60(%rbx)
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1752
jmp 0x1752
movq %rax, %r14
movq %rbx, %rdi
callq 0x3ac4
movq %r14, %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O1/ljc2154[P]Rummy/rummy.cpp
// Function: printState(State)
void printState(State state)
{
	//printHand(state.agentHand);
	printOpponentHandandDeck();
	if (state.turnCard < 52)
		printTurnCard(state.turnCard);
	printHand(state.userHand);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x2521
movl 0x60(%rbx), %edi
cmpl $0x33, %edi
jg 0x1781
callq 0x2693
addq $0x30, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bc8
movq %r14, %rdi
callq 0x2831
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x17b1
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x17d2
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %rbx, %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O1/ljc2154[P]Rummy/rummy.cpp
// Function: gameOver(State)
bool gameOver(State state)
{
	/* Check if user won */
	if (isWinner(state.userHand))
	{
		cout << "You won the game!" << endl;
		printHand(state.userHand);
		return true;
	}

	/* Check if agent won */
	if (isWinner(state.agentHand))
	{
		cout << "Read 'em and weep!" << endl;
		printHand(state.agentHand);
		cout << "You lost the game :(" << endl;
		return true;
	}

	/* No player has won */
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3bc8
movq %r15, %rdi
callq 0x2b39
movl %eax, %ebp
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x181e
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
testb %bpl, %bpl
je 0x18a8
leaq 0x40(%rsp), %r12
movq 0x479d(%rip), %rbx      # 0x5fd0
leaq 0x27d1(%rip), %rsi      # 0x400b
movl $0x11, %edx
movq %rbx, %rdi
callq 0x1110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3bc8
movq %rbx, %rdi
callq 0x2831
movq 0x30(%rsp), %rdi
movb $0x1, %bl
testq %rdi, %rdi
je 0x199f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x199f
leaq 0x28(%rsp), %r12
addq $0x18, %rbx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bc8
movq %r14, %rdi
callq 0x2b39
movl %eax, %ebp
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18e2
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
testb %bpl, %bpl
je 0x199d
leaq 0x10(%rsp), %r12
movq 0x46d9(%rip), %r14      # 0x5fd0
leaq 0x271f(%rip), %rsi      # 0x401d
movl $0x12, %edx
movq %r14, %rdi
callq 0x1110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3bc8
movq %r15, %rdi
callq 0x2831
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x195e
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0x26cb(%rip), %rsi      # 0x4030
movl $0x14, %edx
movq %r14, %rdi
callq 0x1110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movb $0x1, %bl
jmp 0x199f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
jmp 0x19c9
movq %rax, %rbx
movq 0x18(%rsp), %rdi
jmp 0x19c9
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
jne 0x19e2
jmp 0x19ee
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x19ee
leaq 0x58(%rsp), %r12
movq (%r12), %rsi
subq %rdi, %rsi
callq 0x1100
movq %rbx, %rdi
callq 0x1150