LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jakubsvehla[P]hex/src/config.cpp
// Function: Config::ParseOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Config::ParseOption (string line)
{
  string tokens[TOKEN_NUM];
  bool   boolean;

  Tokenize(line, tokens);

  boolean = true;
  if (tokens[0].find("no") == 0) {
    boolean = false;
    tokens[0] = tokens[0].substr(2);
  }

  if (tokens[0].compare("ascii") == 0) {
    m_ShowASCII = boolean;
  }
  if (tokens[0].compare("number") == 0) {
    m_Number = boolean;
  }
  if (tokens[0].compare("group") == 0) {
    if (!boolean) ; // FIXME: raise an exception

    m_Group = atoi(tokens[1].c_str());
  }

  // ...

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movl $0x10, %eax
leaq (%rsp,%rax), %rcx
addq $0x20, %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x50f8
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rsp, %rdi
movq %rax, %rsi
callq 0x5342
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x52a4
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x515a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0x11cb(%rip), %rsi      # 0x632c
leaq 0x20(%rsp), %rdi
movl $0x2, %ecx
xorl %edx, %edx
callq 0x3430
movq %rax, %r14
testq %rax, %rax
jne 0x51c1
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x2, %edx
movq $-0x1, %rcx
callq 0x3280
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %r15
movq %r15, %rsi
callq 0x3340
movq (%r15), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x51c1
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0x1167(%rip), %rsi      # 0x632f
leaq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0x51dd
testq %r14, %r14
setne 0x1(%rbx)
leaq 0x1151(%rip), %rsi      # 0x6335
leaq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0x51f8
testq %r14, %r14
setne (%rbx)
leaq 0x113d(%rip), %rsi      # 0x633c
leaq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0x521a
movq 0x40(%rsp), %rdi
callq 0x33c0
movl %eax, 0x4(%rbx)
movq $-0x40, %rbx
leaq 0x50(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x523a
movq (%r14), %rsi
incq %rsi
callq 0x3270
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x5226
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x526e
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x5271
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0x5271
movq %rax, %rbx
movq $-0x40, %r14
leaq 0x50(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x5291
movq (%r15), %rsi
incq %rsi
callq 0x3270
addq $-0x20, %r15
addq $0x20, %r14
jne 0x527d
movq %rbx, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O1/jakubsvehla[P]hex/src/config.cpp
// Function: Config::Tokenize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
void Config::Tokenize (string line, string tokens [TOKEN_NUM])
{
  char * str;
  char * p;
  char   delim[] = " ";
  int    i = 0;

  str = new char [line.size()+1];
  strcpy(str, line.c_str());

  p = strtok(str, delim);
  for (i = 0; i < TOKEN_NUM; i ++) {
    if (p != NULL)
      tokens[i] = p;
    p = strtok(NULL, delim);
  }

  delete [] str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq 0x8(%rsi), %rdi
incq %rdi
callq 0x3030
movq %rax, %r14
movq (%r15), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xef9(%rip), %r15       # 0x61cf
movq %r14, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x33d0
movq %rax, %r12
xorl %r14d, %r14d
testq %r12, %r12
je 0x5314
leaq (%rbx,%r14), %r13
movq 0x8(%rbx,%r14), %rbp
movq %r12, %rdi
callq 0x3140
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x33b0
xorl %edi, %edi
movq %r15, %rsi
callq 0x33d0
movq %rax, %r12
addq $0x20, %r14
cmpq $0x20, %r14
je 0x52eb
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3360
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/firmware_image.cpp
// Function: FirmwareImage::InitPid()
int FirmwareImage::InitPid()
{
	gdix_dbg("FirmwareImage %s run\n", __func__);
	m_pid[0] = '\0';
	gdix_dbg("FirmwareImage %s exit\n", __func__);
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x19f9b(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0x7323
movq 0x19cb5(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xecf7(%rip), %rsi      # 0x16004
leaq 0xef2e(%rip), %rdx      # 0x16242
movl $0xe4, %ecx
movq %rdx, %r8
xorl %eax, %eax
callq 0x5180
movb $0x0, 0x19(%rbx)
cmpb $0x1, (%r14)
jne 0x7354
movq 0x19c84(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xef0c(%rip), %rsi      # 0x1624a
leaq 0xeefd(%rip), %rdx      # 0x16242
movl $0xe6, %ecx
movq %rdx, %r8
xorl %eax, %eax
callq 0x5180
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/firmware_image.cpp
// Function: FirmwareImage::InitVid()
int FirmwareImage::InitVid()
{
	gdix_dbg("FirmwareImage %s run\n", __func__);
	m_firmwareVersionMajor = 0;
	m_firmwareVersionMinor = 0;
	gdix_dbg("FirmwareImage %s exit\n", __func__);
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x19f21(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0x739d
movq 0x19c3b(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xec7d(%rip), %rsi      # 0x16004
leaq 0xeee4(%rip), %rdx      # 0x16272
movl $0xeb, %ecx
movq %rdx, %r8
xorl %eax, %eax
callq 0x5180
movq $0x0, 0x24(%rbx)
cmpb $0x1, (%r14)
jne 0x73d2
movq 0x19c06(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xee8e(%rip), %rsi      # 0x1624a
leaq 0xeeaf(%rip), %rdx      # 0x16272
movl $0xee, %ecx
movq %rdx, %r8
xorl %eax, %eax
callq 0x5180
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/firmware_image.cpp
// Function: FirmwareImage::Close()
void FirmwareImage::Close()
{
	if (!m_initialized)
		return;

	m_initialized = false;
	if (NULL != m_firmwareData) {
		delete[] m_firmwareData;
		m_firmwareData = NULL;
	}
}

// Assembly:
cmpb $0x1, 0x8(%rdi)
jne 0x745d
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x8(%rdi)
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x745c
callq 0x5130
movq $0x0, 0x30(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gt_update.cpp
// Function: GTupdate::Initialize(GTmodel*, FirmwareImage*)
int GTupdate::Initialize(GTmodel *dev, FirmwareImage *image)
{
	m_Initialized = false;
	this->dev = dev;
	this->image = image;
	if (dev != NULL && dev->IsOpened() && image != NULL && image->IsOpened()) {
		m_Initialized = true;
		return 0;
	}
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movb $0x0, 0x18(%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x7578
movq %rdx, %r15
movq %rdi, %r14
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x18(%rax)
testq %r15, %r15
je 0x7578
testb %al, %al
je 0x7578
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
testb %al, %al
je 0x7578
movb $0x1, 0x18(%r14)
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/gt7868q/gt7868q.cpp
// Function: GT7868QDevice::ChecksumU8_ys(unsigned char*, int)
unsigned short GT7868QDevice::ChecksumU8_ys(unsigned char *data, int len)
{
	unsigned short chksum = 0;
	int i = 0;

	for (i = 0; i < len - 2; i++)
		chksum += data[i];
	gdix_dbg("calu chksum:0x%x, chksum in fw:0x%x\n", chksum,
			 ((data[len - 2] << 8) | data[len - 1]));
	return chksum - ((data[len - 2] << 8) | data[len - 1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leal -0x2(%rdx), %eax
cmpl $0x3, %edx
jl 0x87fc
movl %eax, %ecx
xorl %esi, %esi
xorl %ebp, %ebp
movzbl (%rbx,%rsi), %edi
addl %edi, %ebp
incq %rsi
cmpq %rsi, %rcx
jne 0x87ec
jmp 0x87fe
xorl %ebp, %ebp
leaq 0x18a8c(%rip), %rcx     # 0x21291
cmpb $0x1, (%rcx)
movslq %eax, %r15
movslq %edx, %r14
jne 0x8849
movq 0x187a1(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
movzwl %bp, %r8d
movzbl (%rbx,%r15), %eax
shll $0x8, %eax
movzbl -0x1(%rbx,%r14), %r9d
orl %eax, %r9d
leaq 0xe415(%rip), %rsi      # 0x16c4b
leaq 0xe444(%rip), %rdx      # 0x16c81
movl $0x23, %ecx
xorl %eax, %eax
callq 0x5180
movzbl (%rbx,%r15), %eax
shll $0x8, %eax
movzbl -0x1(%rbx,%r14), %ecx
orl %eax, %ecx
subl %ecx, %ebp
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/gt7868q/gt7868q_firmware_image.cpp
// Function: GT7868QFirmwareImage::InitPid()
int GT7868QFirmwareImage::InitPid()
{
	gdix_dbg("GT7868QFirmwareImage::InitPid run\n");
	int ret = -1;
	int i = 0;
	int j = 0;

	if (!m_firmwareData) {
		goto exit;
	}
	for (i = 0, j = 0; i < GT7868Q_FW_IMAGE_PID_LEN; i++)
		if (m_firmwareData[GT7868Q_FW_IMAGE_PID_OFFSET + i] != 0)
			m_pid[j++] = m_firmwareData[GT7868Q_FW_IMAGE_PID_OFFSET + i];
	m_pid[j] = '\0';
	ret = 0;

exit:
	gdix_dbg("GT7868QFirmwareImage::InitPid exit\n");
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x18487(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0x8e34
movq 0x181a1(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xe12f(%rip), %rsi      # 0x16f50
leaq 0xd41a(%rip), %rdx      # 0x16242
movl $0x20, %ecx
xorl %eax, %eax
callq 0x5180
cmpq $0x0, 0x30(%rbx)
je 0x8e69
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x30(%rbx), %rdx
movb 0xf(%rdx,%rax), %dl
testb %dl, %dl
je 0x8e54
movslq %ecx, %rsi
incl %ecx
movb %dl, 0x19(%rbx,%rsi)
incq %rax
cmpq $0x8, %rax
jne 0x8e3f
movslq %ecx, %rax
movb $0x0, 0x19(%rbx,%rax)
xorl %ebx, %ebx
jmp 0x8e6e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0x8e98
movq 0x1813d(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xe0ff(%rip), %rsi      # 0x16f84
leaq 0xd3b6(%rip), %rdx      # 0x16242
movl $0x2f, %ecx
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gt7868q/gt7868q_firmware_image.cpp
// Function: GT7868QFirmwareImage::InitVid()
int GT7868QFirmwareImage::InitVid()
{
	gdix_dbg("GT7868QFirmwareImage InitVid run\n");
	int ret = -1;

	if (!m_firmwareData)
		goto exit;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x183e1(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0x8eda
movq 0x180fb(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xe0f2(%rip), %rsi      # 0x16fb9
leaq 0xd3a4(%rip), %rdx      # 0x16272
movl $0x35, %ecx
xorl %eax, %eax
callq 0x5180
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x8f49
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 0x8f4e
movq 0x180ac(%rip), %rcx     # 0x20fb8
movq (%rcx), %rdi
movzbl 0x17(%rax), %r8d
movzbl 0x18(%rax), %r9d
movzbl 0x19(%rax), %r10d
movzbl 0x1a(%rax), %r11d
leaq 0xe0c2(%rip), %rsi      # 0x16fec
leaq 0xd341(%rip), %rdx      # 0x16272
xorl %ebx, %ebx
movl $0x46, %ecx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x5180
addq $0x10, %rsp
jmp 0x8f4e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0x8f7b
movq 0x1805d(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xe0bd(%rip), %rsi      # 0x17022
leaq 0xd306(%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/gt7868q/gt7868q_update.cpp
// Function: GT7868QUpdate::cmd_init(unsigned char*, unsigned char, unsigned short)
void GT7868QUpdate::cmd_init(unsigned char *cmd_buf, unsigned char cmd,
							 unsigned short cmd_data)
{
	unsigned short chksum;
	cmd_buf[0] = cmd;
	cmd_buf[1] = (cmd_data >> 8) & 0xff;
	cmd_buf[2] = cmd_data & 0xff;
	chksum = cmd_buf[0] + cmd_buf[1] + cmd_buf[2];
	cmd_buf[3] = (chksum >> 8) & 0xff;
	cmd_buf[4] = chksum & 0xff;
}

// Assembly:
movb %dl, (%rsi)
movl %ecx, %eax
shrl $0x8, %eax
movb %al, 0x1(%rsi)
movb %cl, 0x2(%rsi)
addl %edx, %eax
movzbl %cl, %ecx
addl %eax, %ecx
movb %ch, 0x3(%rsi)
movb %cl, 0x4(%rsi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx2/gtx2.cpp
// Function: GTx2Device::GetCfgVersion()
int GTx2Device::GetCfgVersion()
{
	int ret;
	unsigned char cfg_ver;
	unsigned char pid[5] = {0};
	int sensor_id;
	unsigned char fw_info[12] = {0};

	ret = Read(0x8050, &cfg_ver, 1);
	if (ret < 0) {
		gdix_err("Failed read cfg VERSION\n");
		return ret;
	}
	ret = Read(0x8140, fw_info, sizeof(fw_info));
	if (ret < 0) {
		gdix_err("Failed read VERSION\n");
		return ret;
	}

	memcpy(pid, fw_info, 4);
	sensor_id = fw_info[10] & 0x0f;
	fprintf(stdout, "PID:%s\n", pid);
	fprintf(stdout, "sensorID:%d\n", sensor_id);
	fprintf(stdout, "cfg version:%d\n", cfg_ver);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
xorl %eax, %eax
movl %eax, 0x8(%rsp)
movb $0x0, 0xc(%rsp)
movl %eax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq (%rdi), %rax
leaq 0x7(%rsp), %rdx
movl $0x8050, %esi           # imm = 0x8050
movl $0x1, %ecx
callq *0x20(%rax)
testl %eax, %eax
js 0xa8ce
movq (%r14), %rax
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movl $0x8140, %esi           # imm = 0x8140
movl $0xc, %ecx
callq *0x20(%rax)
testl %eax, %eax
js 0xa8e3
movl 0x10(%rsp), %eax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movzbl 0x1a(%rsp), %ebp
andl $0xf, %ebp
movq 0x16728(%rip), %r14     # 0x20fb8
movq (%r14), %rdi
leaq 0xe559(%rip), %rsi      # 0x18df3
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x5180
movq (%r14), %rdi
leaq 0xe589(%rip), %rsi      # 0x18e36
movl %ebp, %edx
xorl %eax, %eax
callq 0x5180
movq (%r14), %rdi
movzbl 0x7(%rsp), %edx
leaq 0xd2c9(%rip), %rsi      # 0x17b8e
xorl %eax, %eax
callq 0x5180
jmp 0xa8f1
movl %eax, %ebx
leaq 0x169ba(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0xa8f1
callq 0x5727
jmp 0xa8f1
movl %eax, %ebx
leaq 0x169a5(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
je 0xa8fc
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x56ff
jmp 0xa8f1
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx2/gtx2_firmware_image.cpp
// Function: GTX2FirmwareImage::InitPid()
int GTX2FirmwareImage::InitPid()
{
	gdix_dbg("GTX2FirmwareImage %s run\n", __func__);
	int ret = -1;
	int i = 0;
	int j = 0;

	if (!m_firmwareData) {
		goto exit;
	}

	for (i = 0, j = 0; i < GTX2_FW_IMAGE_PID_LEN; i++)
		if (m_firmwareData[GTX2_FW_IMAGE_PID_OFFSET + i] != 0)
			m_pid[j++] = m_firmwareData[GTX2_FW_IMAGE_PID_OFFSET + i];
	m_pid[j] = '\0';
	ret = 0;
exit:
	gdix_dbg("GTX2FirmwareImage %s exit,exit code:%d\n", __func__, ret);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x168f7(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xa9c7
movq 0x16611(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xd258(%rip), %rsi      # 0x17c09
leaq 0xb88a(%rip), %rdx      # 0x16242
movl $0x21, %ecx
movq %rdx, %r8
xorl %eax, %eax
callq 0x5180
cmpq $0x0, 0x30(%rbx)
je 0xa9fc
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x30(%rbx), %rdx
movb 0xf(%rdx,%rax), %dl
testb %dl, %dl
je 0xa9e7
movslq %ecx, %rsi
incl %ecx
movb %dl, 0x19(%rbx,%rsi)
incq %rax
cmpq $0x6, %rax
jne 0xa9d2
movslq %ecx, %rax
movb $0x0, 0x19(%rbx,%rax)
xorl %ebx, %ebx
jmp 0xaa01
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xaa31
movq 0x165aa(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xd21c(%rip), %rsi      # 0x17c34
leaq 0xb823(%rip), %rdx      # 0x16242
movl $0x30, %ecx
movq %rdx, %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx2/gtx2_firmware_image.cpp
// Function: GTX2FirmwareImage::InitVid()
int GTX2FirmwareImage::InitVid()
{
	gdix_dbg("GTX2FirmwareImage %s run\n", __func__);
	int ret = -1;

	if (!m_firmwareData)
		goto exit;

	m_firmwareVersionMajor = 0;
	m_firmwareVersionMinor =
		((m_firmwareData[GTX2_FW_IMAGE_VID_OFFSET] << 16) |
		 (m_firmwareData[GTX2_FW_IMAGE_VID_OFFSET + 1] << 8) |
		 (m_firmwareData[GTX2_FW_IMAGE_VID_OFFSET + 2]));
	gdix_dbg("vid 0x%02X,0x%02X,0x%02X\n",
			 m_firmwareData[GTX2_FW_IMAGE_VID_OFFSET],
			 m_firmwareData[GTX2_FW_IMAGE_VID_OFFSET + 1],
			 m_firmwareData[GTX2_FW_IMAGE_VID_OFFSET + 2]);
	ret = 0;
exit:
	gdix_dbg("GTX2FirmwareImage %s exit,exit code:%d\n", __func__, ret);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x16847(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xaa77
movq 0x16561(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xd1a8(%rip), %rsi      # 0x17c09
leaq 0xb80a(%rip), %rdx      # 0x16272
movl $0x36, %ecx
movq %rdx, %r8
xorl %eax, %eax
callq 0x5180
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xaae1
movl $0x0, 0x24(%rbx)
movzbl 0x15(%rax), %ecx
shll $0x10, %ecx
movzbl 0x16(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x17(%rax), %ecx
orl %edx, %ecx
movl %ecx, 0x28(%rbx)
xorl %ebx, %ebx
cmpb $0x1, (%r14)
jne 0xaae6
movq 0x16509(%rip), %rcx     # 0x20fb8
movq (%rcx), %rdi
movzbl 0x15(%rax), %r8d
movzbl 0x16(%rax), %r9d
movzbl 0x17(%rax), %eax
movl %eax, (%rsp)
leaq 0xd1a3(%rip), %rsi      # 0x17c6d
leaq 0xb7a1(%rip), %rdx      # 0x16272
xorl %ebx, %ebx
movl $0x44, %ecx
xorl %eax, %eax
callq 0x5180
jmp 0xaae6
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xab16
movq 0x164c5(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xd137(%rip), %rsi      # 0x17c34
leaq 0xb76e(%rip), %rdx      # 0x16272
movl $0x47, %ecx
movq %rdx, %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx3/gtx3_firmware_image.cpp
// Function: GTX3FirmwareImage::InitPid()
int GTX3FirmwareImage::InitPid()
{
	gdix_dbg("GTX3FirmwareImage::InitPid run\n");
	int ret = -1;
	int i = 0;
	int j = 0;

	if (!m_firmwareData) {
		goto exit;
	}
	for (i = 0, j = 0; i < GTX3_FW_IMAGE_PID_LEN; i++)
		if (m_firmwareData[GTX3_FW_IMAGE_PID_OFFSET + i] != 0)
			m_pid[j++] = m_firmwareData[GTX3_FW_IMAGE_PID_OFFSET + i];
	m_pid[j] = '\0';
	ret = 0;

exit:
	gdix_dbg("GTX3FirmwareImage::InitPid exit\n");
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1554b(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xbd70
movq 0x15265(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xc278(%rip), %rsi      # 0x17fd5
leaq 0xa4de(%rip), %rdx      # 0x16242
movl $0x20, %ecx
xorl %eax, %eax
callq 0x5180
cmpq $0x0, 0x30(%rbx)
je 0xbda5
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x30(%rbx), %rdx
movb 0xf(%rdx,%rax), %dl
testb %dl, %dl
je 0xbd90
movslq %ecx, %rsi
incl %ecx
movb %dl, 0x19(%rbx,%rsi)
incq %rax
cmpq $0x8, %rax
jne 0xbd7b
movslq %ecx, %rax
movb $0x0, 0x19(%rbx,%rax)
xorl %ebx, %ebx
jmp 0xbdaa
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xbdd4
movq 0x15201(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xc245(%rip), %rsi      # 0x18006
leaq 0xa47a(%rip), %rdx      # 0x16242
movl $0x2f, %ecx
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx3/gtx3_firmware_image.cpp
// Function: GTX3FirmwareImage::InitVid()
int GTX3FirmwareImage::InitVid()
{
	gdix_dbg("GTX3FirmwareImage InitVid run\n");
	int ret = -1;

	if (!m_firmwareData)
		goto exit;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x154a5(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xbe16
movq 0x151bf(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xc235(%rip), %rsi      # 0x18038
leaq 0xa468(%rip), %rdx      # 0x16272
movl $0x35, %ecx
xorl %eax, %eax
callq 0x5180
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xbe85
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 0xbe8a
movq 0x15170(%rip), %rcx     # 0x20fb8
movq (%rcx), %rdi
movzbl 0x17(%rax), %r8d
movzbl 0x18(%rax), %r9d
movzbl 0x19(%rax), %r10d
movzbl 0x1a(%rax), %r11d
leaq 0xb186(%rip), %rsi      # 0x16fec
leaq 0xa405(%rip), %rdx      # 0x16272
xorl %ebx, %ebx
movl $0x46, %ecx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x5180
addq $0x10, %rsp
jmp 0xbe8a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xbeb7
movq 0x15121(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xc1c7(%rip), %rsi      # 0x18068
leaq 0xa3ca(%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/gtx3/gtx3_update.cpp
// Function: need_upgrade_hid_subsystem(GTmodel*, FirmwareImage*)
bool need_upgrade_hid_subsystem(GTmodel *dev, FirmwareImage *fw_img)
{
	int dev_fw_ver = 0;
	int img_fw_ver = 0;
	int boundary_fw_ver =
		(HID_FORCE_UPDATE_VER_MAJOR << 16) | HID_FORCE_UPDATE_VER_MINOR;

	if (fw_img->GetUpdateFlag() & NEED_UPDATE_HID_SUBSYSTEM) {
		gdix_dbg("get hid subsystem update flag from fw_img file:0x%x\n",
				 fw_img->GetUpdateFlag());
		return true;
	}
	/* ignore the config_id byte */
	dev_fw_ver = (dev->GetFirmwareVersionMajor() << 16) |
				 ((dev->GetFirmwareVersionMinor() >> 8) & 0xFFFF);
	img_fw_ver = (fw_img->GetFirmwareVersionMajor() << 16) |
				 ((fw_img->GetFirmwareVersionMinor() >> 8) & 0xFFFF);

	gdix_dbg("boundery_ver 0x%x, dev_ver 0x%x, fw_ver 0x%x\n", boundary_fw_ver,
			 dev_fw_ver, img_fw_ver);
	if (dev_fw_ver < boundary_fw_ver || img_fw_ver < boundary_fw_ver) {
		gdix_dbg("hid subsystem need update judged by fw_ver\n");
		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *0xa8(%rax)
testb %al, %al
js 0xc263
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x60(%rax)
movl %eax, %ebp
shll $0x10, %ebp
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
movl %eax, %ebx
shrl $0x8, %ebx
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %ebx
orl %ebp, %ebx
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
movl %eax, %r15d
shll $0x10, %r15d
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movl %eax, %ebp
shrl $0x8, %ebp
andl %r12d, %ebp
orl %r15d, %ebp
leaq 0x15078(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xc24f
movq 0x14d92(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
movl %ebp, (%rsp)
leaq 0xbf15(%rip), %rsi      # 0x18148
leaq 0xbef3(%rip), %rdx      # 0x1812d
movl $0x91, %ecx
movl $0x117, %r8d            # imm = 0x117
movl %ebx, %r9d
xorl %eax, %eax
callq 0x5180
cmpl $0x117, %ebx            # imm = 0x117
jl 0xc2a9
cmpl $0x116, %ebp            # imm = 0x116
jle 0xc2a9
xorl %ebx, %ebx
jmp 0xc2d5
leaq 0x15027(%rip), %rax     # 0x21291
movb $0x1, %bl
cmpb $0x1, (%rax)
jne 0xc2d5
movq 0x14d40(%rip), %rax     # 0x20fb8
movq (%rax), %r15
movq (%r14), %rax
movq %r14, %rdi
callq *0xa8(%rax)
leaq 0xbe59(%rip), %rsi      # 0x180e7
leaq 0xbe98(%rip), %rdx      # 0x1812d
movq %r15, %rdi
movl $0x87, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0xc2d5
movb $0x1, %bl
cmpb $0x1, (%r14)
jne 0xc2d5
movq 0x14d00(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xbec5(%rip), %rsi      # 0x18187
leaq 0xbe64(%rip), %rdx      # 0x1812d
movl $0x93, %ecx
xorl %eax, %eax
callq 0x5180
movl %ebx, %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/gtx5/gtx5.cpp
// Function: GTx5Device::GTx5Device()
GTx5Device::GTx5Device()
{
	m_inputReportSize = 0;
	m_outputReportSize = 0;
	m_inputReport = nullptr;
	m_outputReport = nullptr;
	m_firmwareVersionMajor = 0;
	m_firmwareVersionMinor = 0;
	m_sensorID = 16; /* > 15 invalid ID */
	memset(m_pid, 0, sizeof(m_pid));
	m_hidDevType = HID_MACHINE;
	m_deviceOpen = false;
	m_bCancel = false;
	m_fd = -1;
}

// Assembly:
leaq 0x13275(%rip), %rax     # 0x204c0
movq %rax, (%rdi)
xorl %eax, %eax
movl %eax, 0x14(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movq $0x0, 0x38(%rdi)
movq $0x10, 0x18(%rdi)
movl %eax, 0x1f(%rdi)
movl $0x1, 0x24(%rdi)
movb %al, 0x8(%rdi)
movb %al, 0x40(%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0xc(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::GetFirmwareProps(char const*, char*, int)
int GTx5Device::GetFirmwareProps(const char *deviceName, char *props_buf,
								 int len)
{
	int ret;

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

	snprintf(props_buf, len, "%d.%d", GetFirmwareVersionMajor(),
			 GetFirmwareVersionMinor());
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
testl %eax, %eax
je 0xd2da
leaq 0x13fea(%rip), %rax     # 0x21291
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%rax)
jne 0xd30c
movq 0x13d00(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xb0b8(%rip), %rsi      # 0x1837a
leaq 0xb0d9(%rip), %rdx      # 0x183a2
movl $0x3a, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x5180
jmp 0xd30c
movslq %ebp, %r15
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x60(%rax)
movl %eax, %ebp
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
leaq 0xb0bb(%rip), %rdx      # 0x183b3
xorl %ebx, %ebx
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x51c0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::Open(char const*)
int GTx5Device::Open(const char *filename)
{
	int rc;

	if (!filename)
		return -EINVAL;
	m_fd = open(filename, O_RDWR);
	if (m_fd < 0)
		return -1;
	m_deviceOpen = true;
	m_inputReportSize = 65;
	m_outputReportSize = 65;
	m_inputReport = new unsigned char[m_inputReportSize]();
	if (!m_inputReport) {
		errno = -ENOMEM;
		rc = -1;
		goto error;
	}
	m_outputReport = new unsigned char[m_outputReportSize]();
	if (!m_outputReport) {
		errno = -ENOMEM;
		rc = -1;
		goto error;
	}
	/* get active firmware info */
	return SetBasicProperties();
error:
	Close();
	return rc;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xd3ad
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x51e0
movl %eax, 0xc(%rbx)
testl %eax, %eax
js 0xd3b4
movb $0x1, 0x8(%rbx)
movabsq $0x4100000041, %rax     # imm = 0x4100000041
movq %rax, 0x28(%rbx)
movl $0x41, %edi
callq 0x5030
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
xorl %ebp, %ebp
movb %bpl, 0x40(%rax)
movq %rax, 0x30(%rbx)
movl $0x41, %edi
callq 0x5030
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movb %bpl, 0x40(%rax)
movq %rax, 0x38(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *0xa0(%rax)
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
jmp 0xd3b9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::Close()
void GTx5Device::Close()
{
	if (!m_deviceOpen)
		return;
	close(m_fd);
	m_fd = -1;
	m_deviceOpen = false;
	delete[] m_inputReport;
	m_inputReport = NULL;
	delete[] m_outputReport;
	m_outputReport = NULL;
}

// Assembly:
cmpb $0x1, 0x8(%rdi)
jne 0xd40a
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %edi
callq 0x5210
movl $0xffffffff, 0xc(%rbx)  # imm = 0xFFFFFFFF
movb $0x0, 0x8(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xd3eb
callq 0x5130
movq $0x0, 0x30(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xd401
callq 0x5130
movq $0x0, 0x38(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::GetReport(unsigned char, unsigned char*)
int GTx5Device::GetReport(unsigned char reportId, unsigned char *buf)
{
	int ret;
	unsigned char rcv_buf[66] = {0};
	if (!m_deviceOpen)
		return -1;

	rcv_buf[0] = reportId;
	ret = ioctl(m_fd, HIDIOCGFEATURE(m_inputReportSize), rcv_buf);
	if (ret < 0) {
		gdix_dbg("failed get feature retry, ret=%d\n", ret);
		return ret;
	} else {
		if (rcv_buf[0] == reportId) {
			memcpy(buf, rcv_buf, 65);
			return 0;
		} else {
			gdix_dbg("Get Wrong reportId:id=0x%x\n", rcv_buf[0]);
			return -1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movw $0x0, 0x40(%rsp)
cmpb $0x1, 0x8(%rdi)
jne 0xd4e8
movq %rdx, %rbx
movl %esi, %r14d
movq %rsp, %rdx
movb %r14b, (%rdx)
movl 0xc(%rdi), %eax
movl 0x28(%rdi), %esi
shll $0x10, %esi
orl $0xc0004807, %esi       # imm = 0xC0004807
movl %eax, %edi
xorl %eax, %eax
callq 0x5160
testl %eax, %eax
js 0xd481
movzbl (%rsp), %r8d
cmpb %r14b, %r8b
jne 0xd4b8
movq %rsp, %rsi
movl $0x41, %edx
movq %rbx, %rdi
callq 0x5090
xorl %ebp, %ebp
jmp 0xd4ed
movl %eax, %ebp
leaq 0x13e07(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0xd4ed
movq 0x13b22(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xaf19(%rip), %rsi      # 0x183b9
leaq 0xaf45(%rip), %rdx      # 0x183ec
movl $0x78, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0xd4ed
leaq 0x13dd2(%rip), %rax     # 0x21291
cmpb $0x1, (%rax)
jne 0xd4e8
movq 0x13aed(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xaf21(%rip), %rsi      # 0x183f6
leaq 0xaf10(%rip), %rdx      # 0x183ec
movl $0x7f, %ecx
xorl %eax, %eax
callq 0x5180
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::Read(unsigned int, unsigned char*, unsigned int)
int GTx5Device::Read(unsigned int addr, unsigned char *buf, unsigned int len)
{
	int ret = 0;
	int i = 0;
	unsigned short tmp_addr;
	int pkg_size = m_inputReportSize - 10;
	int pkg_num;
	int read_len;
	int code_len = len;

	pkg_num = code_len / pkg_size + 1;
	tmp_addr = addr;
	read_len = pkg_size;
	for (i = 0; i < pkg_num; i++) {
		if (read_len > code_len)
			read_len = code_len;
		/*read data*/
		ret = ReadPkg(tmp_addr, &buf[tmp_addr - addr], read_len);
		if (ret < 0)
			return ret;
		tmp_addr += read_len;
		code_len -= read_len;
		if (code_len <= 0)
			break;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movl 0x28(%rdi), %r12d
addl $-0xa, %r12d
movl %ecx, %eax
cltd
idivl %r12d
testl %eax, %eax
js 0xd80e
movl %ecx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movl %eax, %r13d
incl %r13d
movl %esi, %ebp
cmpl %ebx, %r12d
cmovgel %ebx, %r12d
movzwl %bp, %ebp
movl %ebp, %edx
subl %r14d, %edx
addq (%rsp), %rdx
movq %r15, %rdi
movl %ebp, %esi
movl %r12d, %ecx
callq 0xd4f8
testl %eax, %eax
js 0xd810
subl %r12d, %ebx
jle 0xd810
addl %r12d, %ebp
decl %r13d
jne 0xd7db
jmp 0xd810
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::Write(unsigned char const*, unsigned int)
int GTx5Device::Write(const unsigned char *buf, unsigned int len)
{
	unsigned char temp_buf[65];
	int ret;
	int retry = GDIX_RETRY_TIMES;
	if (!m_deviceOpen)
		return -1;
	if (sizeof(temp_buf) < len)
		return -1;
	memset(temp_buf, 0, sizeof(temp_buf));
	memcpy(&temp_buf[0], buf, len);
	temp_buf[0] = 0x0E;
	gdix_dbg_array(temp_buf, len);
	do {
		ret = ioctl(m_fd, HIDIOCSFEATURE(len), temp_buf);
		if (ret < 0) {
			if (!m_deviceOpen || m_bCancel) {
				gdix_dbg("Operation beCancled or m_fd closed\n");
				break;
			}
			gdix_dbg("failed set feature, retry: ret=%d,retry:%d\n", ret,
					 retry);
			usleep(10000);
		} else {
			break;
		}
	} while (--retry);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x41, %edx
ja 0xda3f
movq %rdi, %r14
cmpb $0x0, 0x8(%rdi)
je 0xda3f
movl %edx, %ebx
movl %edx, %edx
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movb $0x0, 0x40(%r15)
movq %r15, %rdi
callq 0x5090
movb $0xe, (%r15)
shll $0x10, %ebx
orl $0xc0004806, %ebx       # imm = 0xC0004806
movl $0x6, %r12d
leaq 0x138e4(%rip), %r13     # 0x21291
movl 0xc(%r14), %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x5160
movl %eax, %ebp
testl %eax, %eax
jns 0xda3f
cmpb $0x1, 0x8(%r14)
jne 0xda14
cmpb $0x1, 0x40(%r14)
je 0xda14
cmpb $0x1, (%r13)
jne 0xda03
movq 0x135d8(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xabb5(%rip), %rsi      # 0x1859f
leaq 0xab73(%rip), %rdx      # 0x18564
movl $0x12e, %ecx            # imm = 0x12E
movl %ebp, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x5180
movl $0x2710, %edi           # imm = 0x2710
callq 0x5170
decl %r12d
jne 0xd9ad
jmp 0xda3f
cmpb $0x1, (%r13)
jne 0xda3f
movq 0x13596(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xab3e(%rip), %rsi      # 0x1856a
leaq 0xab31(%rip), %rdx      # 0x18564
movl $0x12a, %ecx            # imm = 0x12A
xorl %eax, %eax
callq 0x5180
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::WriteSpeCmd(unsigned char const*, unsigned int)
int GTx5Device::WriteSpeCmd(const unsigned char *buf, unsigned int len)
{
	unsigned char temp_buf[65];
	int ret;
	int retry = GDIX_RETRY_TIMES;
	if (!m_deviceOpen)
		return -1;
	if (sizeof(temp_buf) < len)
		return -1;
	memset(temp_buf, 0, sizeof(temp_buf));
	memcpy(&temp_buf[0], buf, len);
	gdix_dbg_array(temp_buf, len);
	do {
		ret = ioctl(m_fd, HIDIOCSFEATURE(len), temp_buf);
		if (ret < 0) {
			if (!m_deviceOpen || m_bCancel) {
				gdix_dbg("Operation beCancled or m_fd closed\n");
				break;
			}
			gdix_dbg("failed set feature, retry: ret=%d,retry:%d\n", ret,
					 retry);
			usleep(10000);
		} else {
			break;
		}
	} while (--retry);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x41, %edx
ja 0xdb4b
movq %rdi, %r14
cmpb $0x0, 0x8(%rdi)
je 0xdb4b
movl %edx, %ebx
movl %edx, %edx
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movb $0x0, 0x40(%r15)
movq %r15, %rdi
callq 0x5090
shll $0x10, %ebx
orl $0xc0004806, %ebx       # imm = 0xC0004806
movl $0x6, %r12d
leaq 0x137d8(%rip), %r13     # 0x21291
movl 0xc(%r14), %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x5160
movl %eax, %ebp
testl %eax, %eax
jns 0xdb4b
cmpb $0x1, 0x8(%r14)
jne 0xdb20
cmpb $0x1, 0x40(%r14)
je 0xdb20
cmpb $0x1, (%r13)
jne 0xdb0f
movq 0x134cc(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xaaa9(%rip), %rsi      # 0x1859f
leaq 0xaadf(%rip), %rdx      # 0x185dc
movl $0x14f, %ecx            # imm = 0x14F
movl %ebp, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x5180
movl $0x2710, %edi           # imm = 0x2710
callq 0x5170
decl %r12d
jne 0xdab9
jmp 0xdb4b
cmpb $0x1, (%r13)
jne 0xdb4b
movq 0x1348a(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xaa32(%rip), %rsi      # 0x1856a
leaq 0xaa9d(%rip), %rdx      # 0x185dc
movl $0x14b, %ecx            # imm = 0x14B
xorl %eax, %eax
callq 0x5180
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::SetBasicProperties()
int GTx5Device::SetBasicProperties()
{
	int ret;
	unsigned char fw_info[12] = {0};
	m_firmwareVersionMajor = 20;
	m_firmwareVersionMinor = 20;
	m_sensorID = 2;
	int retry = 10;
	if (!m_deviceOpen) {
		gdix_err("Please open device first\n");
		return -1;
	}

	do {
		ret = Read(GTX5_VERSION_ADDR, fw_info, sizeof(fw_info));
		if (ret < 0)
			gdix_dbg("Failed read VERSION, retry=%d\n", retry);
		else
			break;
	} while (--retry);
	if (!retry)
		return -1;
	memcpy(m_pid, fw_info, 4);
	m_pid[4] = '\0';
	m_sensorID = fw_info[10] & 0x0F;
	m_firmwareVersionMajor = (fw_info[5] >> 4) * 10 + (fw_info[5] & 0x0F);
	m_firmwareVersionMinor = (fw_info[6] >> 4) * 10 + (fw_info[6] & 0x0F);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movabsq $0x1400000014, %rax     # imm = 0x1400000014
movq %rax, 0x10(%rdi)
movl $0x2, 0x18(%rdi)
cmpb $0x1, 0x8(%rdi)
jne 0xdc03
movq %rdi, %rbx
movl $0xa, %ebp
leaq 0x8(%rsp), %r14
leaq 0x136e7(%rip), %r13     # 0x21291
leaq 0x91d0(%rip), %r15      # 0x16d81
leaq 0x9102(%rip), %r12      # 0x16cba
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x8240, %esi           # imm = 0x8240
movq %r14, %rdx
movl $0xc, %ecx
callq *0x20(%rax)
testl %eax, %eax
jns 0xdc1b
cmpb $0x1, (%r13)
jne 0xdbf8
movq 0x133d8(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x168, %ecx            # imm = 0x168
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
decl %ebp
jne 0xdbb8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xdc5f
leaq 0x13687(%rip), %rax     # 0x21291
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%rax)
jne 0xdc5f
callq 0x5b04
jmp 0xdc5f
movl 0x8(%rsp), %eax
movl %eax, 0x1c(%rbx)
movb $0x0, 0x20(%rbx)
movzbl 0x12(%rsp), %eax
andl $0xf, %eax
movl %eax, 0x18(%rbx)
movzbl 0xd(%rsp), %eax
movl %eax, %ecx
shrl $0x4, %ecx
leal (%rcx,%rcx,4), %ecx
andl $0xf, %eax
leal (%rax,%rcx,2), %eax
movl %eax, 0x10(%rbx)
movzbl 0xe(%rsp), %eax
movl %eax, %ecx
shrl $0x4, %ecx
leal (%rcx,%rcx,4), %ecx
andl $0xf, %eax
leal (%rax,%rcx,2), %eax
movl %eax, 0x14(%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5.cpp
// Function: GTx5Device::ChecksumU8(unsigned char*, int)
unsigned char GTx5Device::ChecksumU8(unsigned char *data, int len)
{
	unsigned char chksum = 0;
	int i = 0;
	for (i = 0; i < len; i++)
		chksum += data[i];
	return chksum;
}

// Assembly:
testl %edx, %edx
jle 0xdc86
movl %edx, %ecx
xorl %edx, %edx
xorl %eax, %eax
addb (%rsi,%rdx), %al
incq %rdx
cmpq %rdx, %rcx
jne 0xdc7a
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5_firmware_image.cpp
// Function: GTX5FirmwareImage::InitPid()
int GTX5FirmwareImage::InitPid()
{
	gdix_dbg("GTX5FirmwareImage::InitPid run\n");
	int ret = -1;
	int i = 0;
	int j = 0;

	if (!m_firmwareData) {
		goto exit;
	}
	for (i = 0, j = 0; i < GTX5_FW_IMAGE_PID_LEN; i++)
		if (m_firmwareData[GTX5_FW_IMAGE_PID_OFFSET + i] != 0)
			m_pid[j++] = m_firmwareData[GTX5_FW_IMAGE_PID_OFFSET + i];
	m_pid[j] = '\0';
	ret = 0;

exit:
	gdix_dbg("GTX5FirmwareImage::InitPid exit\n");
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1356b(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xdd50
movq 0x13285(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xa8c1(%rip), %rsi      # 0x185fe
leaq 0x84fe(%rip), %rdx      # 0x16242
movl $0x25, %ecx
xorl %eax, %eax
callq 0x5180
cmpq $0x0, 0x30(%rbx)
je 0xdd85
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x30(%rbx), %rdx
movb 0xf(%rdx,%rax), %dl
testb %dl, %dl
je 0xdd70
movslq %ecx, %rsi
incl %ecx
movb %dl, 0x19(%rbx,%rsi)
incq %rax
cmpq $0x8, %rax
jne 0xdd5b
movslq %ecx, %rax
movb $0x0, 0x19(%rbx,%rax)
xorl %ebx, %ebx
jmp 0xdd8a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xddb4
movq 0x13221(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xa88e(%rip), %rsi      # 0x1862f
leaq 0x849a(%rip), %rdx      # 0x16242
movl $0x34, %ecx
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5_firmware_image.cpp
// Function: GTX5FirmwareImage::InitVid()
int GTX5FirmwareImage::InitVid()
{
	gdix_dbg("GTX5FirmwareImage InitVid run\n");
	int ret = -1;

	if (!m_firmwareData)
		goto exit;

	m_firmwareVersionMajor = m_firmwareData[GTX5_FW_IMAGE_CID_OFFSET];
	m_firmwareVersionMinor =
		((m_firmwareData[GTX5_FW_IMAGE_VID_OFFSET] << 16) |
		 (m_firmwareData[GTX5_FW_IMAGE_VID_OFFSET + 1] << 8) |
		 (m_firmwareData[GTX5_FW_IMAGE_VID_OFFSET + 2]));
	gdix_dbg("cid:0x%02x,vid 0x%02X,0x%02X,0x%02X\n",
			 m_firmwareData[GTX5_FW_IMAGE_CID_OFFSET],
			 m_firmwareData[GTX5_FW_IMAGE_VID_OFFSET],
			 m_firmwareData[GTX5_FW_IMAGE_VID_OFFSET + 1],
			 m_firmwareData[GTX5_FW_IMAGE_VID_OFFSET + 2]);
	ret = 0;
exit:
	gdix_dbg("GTX5FirmwareImage InitVid exit,exit code:%d\n", ret);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x134c5(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xddf6
movq 0x131df(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xa87e(%rip), %rsi      # 0x18661
leaq 0x8488(%rip), %rdx      # 0x16272
movl $0x3a, %ecx
xorl %eax, %eax
callq 0x5180
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xde6b
movzbl 0x17(%rax), %ecx
movl %ecx, 0x24(%rbx)
movzbl 0x18(%rax), %ecx
shll $0x10, %ecx
movzbl 0x19(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x1a(%rax), %ecx
orl %edx, %ecx
movl %ecx, 0x28(%rbx)
xorl %ebx, %ebx
cmpb $0x1, (%r14)
jne 0xde70
movq 0x1318a(%rip), %rcx     # 0x20fb8
movq (%rcx), %rdi
movzbl 0x17(%rax), %r8d
movzbl 0x18(%rax), %r9d
movzbl 0x19(%rax), %r10d
movzbl 0x1a(%rax), %r11d
leaq 0x91a0(%rip), %rsi      # 0x16fec
leaq 0x841f(%rip), %rdx      # 0x16272
xorl %ebx, %ebx
movl $0x49, %ecx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x5180
addq $0x10, %rsp
jmp 0xde70
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xde9d
movq 0x1313b(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0xa80a(%rip), %rsi      # 0x18691
leaq 0x83e4(%rip), %rdx      # 0x16272
movl $0x4c, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx5/gtx5_update.cpp
// Function: GTx5Update::Run(void*)
int GTx5Update::Run(void *para)
{
	int ret = 0;
	int retry = 0;
	if (!m_Initialized) {
		gdix_err("Can't Process Update Before Initialized.\n");
		return -1;
	}
	// get all parameter
	pGTUpdatePara parameter = (pGTUpdatePara)para;

	if (!parameter->force) {
		ret = check_update();
		if (ret) {
			gdix_err("Doesn't meet the update conditions\n");
			return -3;
		}
	}

	retry = 0;
	do {
		ret = fw_update(parameter->firmwareFlag);
		if (ret) {
			gdix_dbg("Update failed\n");
			usleep(200000);
		} else {
			usleep(300000);
			gdix_dbg("Update success\n");
			return 0;
		}
	} while (retry++ < 3);
	gdix_err("Firmware update err:ret=%d\n", ret);
	return -4;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0x18(%rdi)
je 0xdef0
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, (%rsi)
jne 0xdf0f
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
testl %eax, %eax
je 0xdf0f
leaq 0x133b9(%rip), %rax     # 0x21291
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
cmpb $0x1, (%rax)
jne 0xdfd9
callq 0x5b4a
jmp 0xdfd9
leaq 0x1339a(%rip), %rax     # 0x21291
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%rax)
jne 0xdfd9
callq 0x5b28
jmp 0xdfd9
movl $0x4, %r15d
leaq 0x13375(%rip), %r13     # 0x21291
leaq 0x9192(%rip), %r12      # 0x170b5
movl 0x4(%rbx), %esi
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
testl %eax, %eax
je 0xdfa0
movl %eax, %ebp
cmpb $0x1, (%r13)
jne 0xdf5c
movq 0x13075(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x91ca(%rip), %rsi      # 0x17117
movq %r12, %rdx
movl $0x3f, %ecx
xorl %eax, %eax
callq 0x5180
movl $0x30d40, %edi          # imm = 0x30D40
callq 0x5170
decl %r15d
jne 0xdf23
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
cmpb $0x1, (%r13)
jne 0xdfd9
movq 0x1305a(%rip), %rax     # 0x20fd8
movq (%rax), %rdi
leaq 0x89eb(%rip), %rsi      # 0x16973
leaq 0x9126(%rip), %rdx      # 0x170b5
movl $0x47, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x5180
jmp 0xdfd9
movl $0x493e0, %edi          # imm = 0x493E0
callq 0x5170
xorl %ebx, %ebx
cmpb $0x1, (%r13)
jne 0xdfd9
movq 0x12ffe(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x9173(%rip), %rsi      # 0x17137
leaq 0x90ea(%rip), %rdx      # 0x170b5
xorl %ebx, %ebx
movl $0x43, %ecx
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/goodix[P]gdix_hid_firmware_update/gtx8/gtx8_firmware_image.cpp
// Function: GTX8FirmwareImage::InitPid()
int GTX8FirmwareImage::InitPid()
{
	gdix_dbg("GTX8FirmwareImage::InitPid run\n");
	int ret = -1;
	int i = 0;
	int j = 0;

	if (!m_firmwareData) {
		goto exit;
	}
	for (i = 0, j = 0; i < GTX8_FW_IMAGE_PID_LEN; i++)
		if (m_firmwareData[GTX8_FW_IMAGE_PID_OFFSET + i] != 0)
			m_pid[j++] = m_firmwareData[GTX8_FW_IMAGE_PID_OFFSET + i];
	m_pid[j] = '\0';
	ret = 0;

exit:
	gdix_dbg("GTX8FirmwareImage::InitPid exit\n");
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x126df(%rip), %r14     # 0x21291
cmpb $0x1, (%r14)
jne 0xebdc
movq 0x123f9(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x9c07(%rip), %rsi      # 0x187d0
leaq 0x7672(%rip), %rdx      # 0x16242
movl $0x20, %ecx
xorl %eax, %eax
callq 0x5180
cmpq $0x0, 0x30(%rbx)
je 0xec11
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x30(%rbx), %rdx
movb 0xf(%rdx,%rax), %dl
testb %dl, %dl
je 0xebfc
movslq %ecx, %rsi
incl %ecx
movb %dl, 0x19(%rbx,%rsi)
incq %rax
cmpq $0x8, %rax
jne 0xebe7
movslq %ecx, %rax
movb $0x0, 0x19(%rbx,%rax)
xorl %ebx, %ebx
jmp 0xec16
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, (%r14)
jne 0xec40
movq 0x12395(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
leaq 0x9bd4(%rip), %rsi      # 0x18801
leaq 0x760e(%rip), %rdx      # 0x16242
movl $0x2f, %ecx
xorl %eax, %eax
callq 0x5180
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq