LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach.c
// Function: uart_speed
static int uart_speed(int s)
{
	switch (s) {
	case 9600:
		return B9600;
	case 19200:
		return B19200;
	case 38400:
		return B38400;
	case 57600:
		return B57600;
	case 115200:
		return B115200;
	case 230400:
		return B230400;
	case 460800:
		return B460800;
	case 500000:
		return B500000;
	case 576000:
		return B576000;
	case 921600:
		return B921600;
	case 1000000:
		return B1000000;
	case 1152000:
		return B1152000;
	case 1500000:
		return B1500000;
	case 2000000:
		return B2000000;
#ifdef B2500000
	case 2500000:
		return B2500000;
#endif
#ifdef B3000000
	case 3000000:
		return B3000000;
#endif
#ifdef B3500000
	case 3500000:
		return B3500000;
#endif
#ifdef B4000000
	case 4000000:
		return B4000000;
#endif
	default:
		return B57600;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0xe0fff, %edi          # imm = 0xE0FFF
jg 0x41de
cmpl $0x1c1ff, %edi          # imm = 0x1C1FF
jle 0x421c
cmpl $0x707ff, %edi          # imm = 0x707FF
jle 0x4298
cmpl $0x70800, %edi          # imm = 0x70800
je 0x42e9
cmpl $0x7a120, %edi          # imm = 0x7A120
je 0x42db
cmpl $0x8ca00, %edi          # imm = 0x8CA00
jne 0x4277
movl $0x1006, %eax           # imm = 0x1006
jmp 0x4303
cmpl $0x1e847f, %edi         # imm = 0x1E847F
jle 0x4247
cmpl $0x2dc6bf, %edi         # imm = 0x2DC6BF
jle 0x42af
cmpl $0x2dc6c0, %edi         # imm = 0x2DC6C0
je 0x42f0
cmpl $0x3567e0, %edi         # imm = 0x3567E0
je 0x42e2
cmpl $0x3d0900, %edi         # imm = 0x3D0900
jne 0x4277
movl $0x100f, %eax           # imm = 0x100F
jmp 0x4303
cmpl $0x95ff, %edi           # imm = 0x95FF
jg 0x4269
movl $0xd, %eax
cmpl $0x2580, %edi           # imm = 0x2580
je 0x4303
cmpl $0x4b00, %edi           # imm = 0x4B00
jne 0x4277
movl $0xe, %eax
jmp 0x4303
cmpl $0x1193ff, %edi         # imm = 0x1193FF
jg 0x4281
cmpl $0xe1000, %edi          # imm = 0xE1000
je 0x42c6
cmpl $0xf4240, %edi          # imm = 0xF4240
jne 0x4277
movl $0x1008, %eax           # imm = 0x1008
jmp 0x4303
cmpl $0x9600, %edi           # imm = 0x9600
je 0x42cd
cmpl $0xe100, %edi           # imm = 0xE100
movl $0x1001, %eax           # imm = 0x1001
jmp 0x4303
cmpl $0x119400, %edi         # imm = 0x119400
je 0x42d4
cmpl $0x16e360, %edi         # imm = 0x16E360
jne 0x4277
movl $0x100a, %eax           # imm = 0x100A
jmp 0x4303
cmpl $0x1c200, %edi          # imm = 0x1C200
je 0x42f7
cmpl $0x38400, %edi          # imm = 0x38400
jne 0x4277
movl $0x1003, %eax           # imm = 0x1003
jmp 0x4303
cmpl $0x1e8480, %edi         # imm = 0x1E8480
je 0x42fe
cmpl $0x2625a0, %edi         # imm = 0x2625A0
jne 0x4277
movl $0x100c, %eax           # imm = 0x100C
jmp 0x4303
movl $0x1007, %eax           # imm = 0x1007
jmp 0x4303
movl $0xf, %eax
jmp 0x4303
movl $0x1009, %eax           # imm = 0x1009
jmp 0x4303
movl $0x1005, %eax           # imm = 0x1005
jmp 0x4303
movl $0x100e, %eax           # imm = 0x100E
jmp 0x4303
movl $0x1004, %eax           # imm = 0x1004
jmp 0x4303
movl $0x100d, %eax           # imm = 0x100D
jmp 0x4303
movl $0x1002, %eax           # imm = 0x1002
jmp 0x4303
movl $0x100b, %eax           # imm = 0x100B
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach.c
// Function: read_hci_event
int read_hci_event(int fd, unsigned char* buf, int size) 
{
	int remain, r;
	int count = 0;

	if (size <= 0)
		return -1;

	/* The first byte identifies the packet type. For HCI event packets, it
	 * should be 0x04, so we read until we get to the 0x04. */
	while (1) {
		r = read(fd, buf, 1);
		if (r <= 0)
			return -1;
		if (buf[0] == 0x04)
			break;
	}
	count++;

	/* The next two bytes are the event code and parameter total length. */
	while (count < 3) {
		r = read(fd, buf + count, 3 - count);
		if (r <= 0)
			return -1;
		count += r;
	}

	/* Now we read the parameters. */
	if (buf[2] < (size - 3)) 
		remain = buf[2];
	else 
		remain = size - 3;

	while ((count - 3) < remain) {
		r = read(fd, buf + count, remain - (count - 3));
		if (r <= 0)
			return -1;
		count += r;
	}

	return count;
}

// Assembly:
testl %edx, %edx
jle 0x43b6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
movl $0x1, %edx
movl %r15d, %edi
movq %r14, %rsi
callq 0x2110
testl %eax, %eax
jle 0x43a8
cmpb $0x4, (%r14)
jne 0x4320
movl $0x1, %r12d
movl %r12d, %esi
addq %r14, %rsi
movl $0x3, %edx
subl %r12d, %edx
movl %r15d, %edi
callq 0x2110
testl %eax, %eax
jle 0x43a8
addl %eax, %r12d
cmpl $0x2, %r12d
jle 0x4340
movzbl 0x2(%r14), %eax
addl $-0x3, %ebx
cmpl %eax, %ebx
cmovgel %eax, %ebx
leal -0x3(%r12), %ecx
cmpl %ebx, %ecx
jge 0x43bc
movl %r12d, %esi
addq %r14, %rsi
movl %ebx, %eax
subl %ecx, %eax
movslq %eax, %rdx
movl %r15d, %edi
callq 0x2110
movq %rax, %rcx
testl %ecx, %ecx
jle 0x43a8
leal (%r12,%rcx), %eax
addl %r12d, %ecx
addl $-0x3, %ecx
movl %eax, %r12d
cmpl %ebx, %ecx
jl 0x4379
jmp 0x43ad
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl %r12d, %eax
jmp 0x43ad
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach.c
// Function: usage
static void usage(void)
{
	printf("hciattach - HCI UART driver initialization utility\n");
	printf("Usage:\n");
	printf("\thciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]\n");
	printf("\thciattach -l\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x451c(%rip), %rdi      # 0x92d3
callq 0x2050
leaq 0x4543(%rip), %rdi      # 0x9306
callq 0x2050
leaq 0x453e(%rip), %rdi      # 0x930d
callq 0x2050
leaq 0x45a2(%rip), %rdi      # 0x937d
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach.c
// Function: bcsp_tshy_sig_alarm
static void bcsp_tshy_sig_alarm(int sig)
{
	unsigned char bcsp_sync_pkt[10] = {0xc0,0x00,0x41,0x00,0xbe,0xda,0xdc,0xed,0xed,0xc0};
	static int retries = 0;

	if (retries < bcsp_max_retries) {
		retries++;
		if (write(serial_fd, &bcsp_sync_pkt, 10) < 0)
			return;
		alarm(1);
		return;
	}

	tcflush(serial_fd, TCIOFLUSH);
	fprintf(stderr, "BCSP initialization timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xa7f3(%rip), %eax      # 0xf64c
cmpl 0xa471(%rip), %eax      # 0xf2d0
jge 0x4e92
incl %eax
movl %eax, 0xa7e3(%rip)      # 0xf64c
movl 0xa7d9(%rip), %edi      # 0xf648
leaq 0x41de(%rip), %rsi      # 0x9054
movl $0xa, %edx
callq 0x2070
testq %rax, %rax
js 0x4e90
movl $0x1, %edi
popq %rbp
jmp 0x20f0
popq %rbp
retq
callq 0x243c
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach.c
// Function: read_check
static int read_check(int fd, void *buf, int count)
{
	int res;

	do {
		res = read(fd, buf, count);
		if (res != -1) {
			buf += res; 
			count -= res;
		}
	} while (count && (errno == 0 || errno == EINTR));

	if (count)
		return -1;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movslq %edx, %r15
movl %edi, -0x2c(%rbp)
movq %r15, %rdx
callq 0x2110
movq %rax, %r12
xorl %ecx, %ecx
cmpl $-0x1, %r12d
sete %r14b
cmovel %ecx, %eax
subl %eax, %r15d
setne %r13b
je 0x4f27
callq 0x2040
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
testl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
jne 0x4f27
movslq %r12d, %rax
testb $0x1, %r14b
movl $0x0, %ecx
cmoveq %rax, %rcx
addq %rcx, %rbx
movslq %r15d, %r15
movl -0x2c(%rbp), %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2110
movq %rax, %r12
cmpl $-0x1, %r12d
sete %r14b
movl $0x0, %ecx
cmovel %ecx, %eax
subl %eax, %r15d
setne %r13b
jne 0x4edb
movzbl %r13b, %eax
andl $0x1, %eax
negl %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach.c
// Function: bcsp_tconf_sig_alarm
static void bcsp_tconf_sig_alarm(int sig)
{
	unsigned char bcsp_conf_pkt[10] = {0xc0,0x00,0x41,0x00,0xbe,0xad,0xef,0xac,0xed,0xc0};
	static int retries = 0;

	if (retries < bcsp_max_retries){
		retries++;
		if (write(serial_fd, &bcsp_conf_pkt, 10) < 0)
			return;
		alarm(1);
		return;
	}

	tcflush(serial_fd, TCIOFLUSH);
	fprintf(stderr, "BCSP initialization timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xa707(%rip), %eax      # 0xf650
cmpl 0xa381(%rip), %eax      # 0xf2d0
jge 0x4f82
incl %eax
movl %eax, 0xa6f7(%rip)      # 0xf650
movl 0xa6e9(%rip), %edi      # 0xf648
leaq 0x40f8(%rip), %rsi      # 0x905e
movl $0xa, %edx
callq 0x2070
testq %rax, %rax
js 0x4f80
movl $0x1, %edi
popq %rbp
jmp 0x20f0
popq %rbp
retq
callq 0x2472
nop
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: util_hexdump
void util_hexdump(const uint8_t *buf, size_t len)
{
	static const char hexdigits[] = "0123456789abcdef";
	char str[16 * 3];
	size_t i;

	if (!buf || !len)
		return;

	for (i = 0; i < len; i++) {
		str[((i % 16) * 3)] = hexdigits[buf[i] >> 4];
		str[((i % 16) * 3) + 1] = hexdigits[buf[i] & 0xf];
		str[((i % 16) * 3) + 2] = ' ';
		if ((i + 1) % 16 == 0) {
			str[16 * 3 - 1] = '\0';
			RS_INFO("%s", str);
		}
	}

	if (i % 16 > 0) {
		str[(i % 16) * 3 - 1] = '\0';
		RS_INFO("%s", str);
	}
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5039
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4566(%rip), %r15      # 0x9520
leaq -0x60(%rbp), %r13
xorl %r12d, %r12d
movzbl (%r14,%r12), %eax
movl %eax, %ecx
shrl $0x4, %ecx
movb (%rcx,%r15), %cl
movl %r12d, %edx
andl $0xf, %edx
leaq (%rdx,%rdx,2), %rdx
movb %cl, -0x60(%rbp,%rdx)
andl $0xf, %eax
movb (%rax,%r15), %al
movb %al, -0x5f(%rbp,%rdx)
movb $0x20, -0x5e(%rbp,%rdx)
incq %r12
testb $0xf, %r12b
je 0x4ffd
cmpq %r12, %rbx
jne 0x4fc1
jmp 0x5025
movb $0x0, -0x31(%rbp)
movq 0x9ff0(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x451f(%rip), %rsi      # 0x9531
leaq 0x4520(%rip), %rdx      # 0x9539
movq %r13, %rcx
xorl %eax, %eax
callq 0x2150
jmp 0x4ff6
andq $0xf, %rbx
jne 0x503a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x2675
jmp 0x502b
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: get_patch_entry
struct patch_info *get_patch_entry(struct btrtl_info *btrtl)
{
	struct patch_info *n = NULL;

	if (btrtl->proto == HCI_UART_3WIRE)
		n = patch_table;
	else
		n = h4_patch_table;
	for (; n->lmp_subver; n++) {
		if ((n->match_flags & RTL_FW_MATCH_CHIP_TYPE) &&
		    n->chip_type != btrtl->chip_type)
			continue;
		if ((n->match_flags & RTL_FW_MATCH_HCI_VER) &&
		    n->hci_ver != btrtl->hci_ver)
			continue;
		if ((n->match_flags & RTL_FW_MATCH_HCI_REV) &&
		    n->hci_rev != btrtl->hci_rev)
			continue;
		if (n->lmp_subver != btrtl->lmp_subver)
			continue;

		break;
	}

	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2, 0x98(%rdi)
leaq 0xa2b6(%rip), %rcx      # 0xf310
leaq 0xa48f(%rip), %rax      # 0xf4f0
cmoveq %rcx, %rax
leaq 0xa2aa(%rip), %rcx      # 0xf316
leaq 0xa483(%rip), %rdx      # 0xf4f6
cmoveq %rcx, %rdx
movzwl (%rdx), %ecx
testw %cx, %cx
je 0x50be
movl (%rax), %edx
testb $0x1, %dl
je 0x5090
movb 0x4(%rax), %sil
cmpb 0x34(%rdi), %sil
jne 0x50b4
testb $0x2, %dl
je 0x509f
movb 0xa(%rax), %sil
cmpb 0x2e(%rdi), %sil
jne 0x50b4
testb $0x4, %dl
je 0x50ae
movzwl 0xc(%rax), %edx
cmpw 0x2c(%rdi), %dx
jne 0x50b4
cmpw 0x2a(%rdi), %cx
je 0x50be
movzwl 0x2e(%rax), %ecx
addq $0x28, %rax
jmp 0x507a
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: os_read
int os_read(int fd, uint8_t * buff, int len)
{
	int n;
	int i;
	int try = 0;

	i = 0;
	n = 0;
	while (n < len) {
		i = read(fd, buff + n, len - n);
		if (i > 0)
			n += i;
		else if (i == 0) {
			RS_DBG("read nothing.");
			continue;
		} else {
			RS_ERR("read error, %s\n", strerror(errno));
			try++;
			if (try > READ_TRY_MAX) {
				RS_ERR("read reaches max try number.\n");
				return -1;
			}
			continue;
		}
	}

	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testl %edx, %edx
jle 0x515b
movl %edi, %r15d
movl $0x0, -0x2c(%rbp)
movl %edx, %eax
movq %rsi, %r14
xorl %r12d, %r12d
movl %edx, -0x30(%rbp)
movq %rsi, -0x40(%rbp)
movslq %eax, %rbx
movl -0x2c(%rbp), %eax
cmpl $0x7, %eax
movl $0x6, %r13d
cmovgel %eax, %r13d
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2110
testl %eax, %eax
jg 0x5146
testl %eax, %eax
jne 0x512b
cmpb $0x0, 0xa1be(%rip)      # 0xf2e0
je 0x5105
callq 0x2728
jmp 0x5105
movl -0x2c(%rbp), %edi
movl %r13d, %esi
leaq -0x34(%rbp), %rdx
callq 0x26a6
movl -0x34(%rbp), %ecx
movl %ecx, -0x2c(%rbp)
testb $0x1, %al
jne 0x5105
jmp 0x5170
addl %eax, %r12d
movq -0x40(%rbp), %rsi
leaq (%rsi,%r12), %r14
movl -0x30(%rbp), %eax
subl %r12d, %eax
jg 0x50f2
jmp 0x515e
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x515e
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: hci_dump_evt
void hci_dump_evt(uint8_t * buf, uint16_t len)
{
	int n;
	int i;

	if (!buf || !len) {
		RS_ERR("Invalid parameters %p, %u.\n", buf, len);
		return;
	}

	n = 0;
	for (i = 0; i < len; i++) {
		n += sprintf(hci_dump_buf + n, "%02x ", buf[i]);
		if ((i + 1) % 16 == 0) {
			RS_DBG(" %s\n", hci_dump_buf);
			n = 0;
		}
	}

	if (i % 16)
		RS_DBG(" %s\n", hci_dump_buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5206
testw %si, %si
je 0x5206
movzwl %si, %r15d
leaq 0x442b(%rip), %r14      # 0x95c9
xorl %r13d, %r13d
xorl %r12d, %r12d
movslq %r12d, %rdi
leaq 0xa4b2(%rip), %rax      # 0xf660
addq %rax, %rdi
movzbl (%rbx,%r13), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
incq %r13
testb $0xf, %r13b
je 0x51ce
addl %eax, %r12d
jmp 0x51da
xorl %r12d, %r12d
cmpb $0x0, 0xa108(%rip)      # 0xf2e0
jne 0x51e1
cmpq %r13, %r15
jne 0x51a4
jmp 0x51e8
callq 0x274c
jmp 0x51da
testb $0xf, %r13b
je 0x51f7
cmpb $0x0, 0xa0eb(%rip)      # 0xf2e0
jne 0x523a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9deb(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movzwl %si, %r8d
leaq 0x4387(%rip), %rsi      # 0x95a2
leaq 0x4317(%rip), %rdx      # 0x9539
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
callq 0x2777
jmp 0x51f7
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: read_hci_evt
int read_hci_evt(int fd, uint8_t * buff, uint8_t evt_code)
{
	uint8_t *evt_buff = buff;
	int ret;
	int try_type = 0;
	uint8_t vendor_evt = 0xff;

start_read:
	do {
		ret = os_read(fd, evt_buff, 1);
		if (ret == 1 && evt_buff[0] == 0x04)
			break;
		else {
			RS_DBG("no pkt type, continue.");
			try_type++;
			continue;
		}
	} while (try_type < 6);

	if (try_type >= 6)
		return -1;

	ret = os_read(fd, evt_buff + 1, 1);
	if (ret < 0) {
		RS_ERR("%s: failed to read event code\n", __func__);
		return -1;
	}

	ret = os_read(fd, evt_buff + 2, 1);
	if (ret < 0) {
		RS_ERR("%s: failed to read parameter total len.\n", __func__);
		return -1;
	}

	ret = os_read(fd, evt_buff + 3, evt_buff[2]);
	if (ret < 0) {
		RS_ERR("%s: failed to read payload of event.\n", __func__);
		return -1;
	}
#ifdef DUMP_HCI_EVT
	hci_dump_evt(evt_buff, ret + 3);
#endif

	/* This event to wake up host. */
	if (evt_buff[1] == vendor_evt) {
		try_type = 0;
		RS_DBG("%s: found vendor evt, continue reading.\n", __func__);
		goto start_read;
	}

	if (evt_buff[1] != evt_code) {
		RS_ERR("%s: event code mismatches, %x, expect %x.\n",
		       __func__, evt_buff[1], evt_code);
		return -1;
	}

	return (ret + 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %r14
movl %edi, %r15d
leaq 0x1(%rsi), %rax
movq %rax, -0x38(%rbp)
leaq 0x2(%rsi), %r13
leaq 0x3(%rsi), %rbx
xorl %r12d, %r12d
movl %r15d, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x50c0
cmpl $0x1, %eax
jne 0x528e
cmpb $0x4, (%r14)
jne 0x528e
movl %r12d, %eax
jmp 0x52a9
cmpb $0x0, 0xa04b(%rip)      # 0xf2e0
jne 0x532f
incl %r12d
movl $0x6, %eax
cmpl $0x6, %r12d
jne 0x526e
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x5, %eax
ja 0x534b
movl %r15d, %edi
movq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x50c0
testl %eax, %eax
js 0x535d
movl %r15d, %edi
movq %r13, %rsi
movl $0x1, %edx
callq 0x50c0
testl %eax, %eax
js 0x5364
movzbl (%r13), %edx
movl %r15d, %edi
movq %rbx, %rsi
callq 0x50c0
testl %eax, %eax
js 0x536b
movl %eax, %r12d
addl $0x3, %r12d
movzwl %r12w, %esi
movq %r14, %rdi
callq 0x5178
movzbl 0x1(%r14), %r8d
cmpl $0xff, %r8d
jne 0x5343
cmpb $0x0, 0x9fbf(%rip)      # 0xf2e0
movl $0x0, %r12d
je 0x526e
jmp 0x5339
callq 0x27a2
jmp 0x529b
callq 0x27c6
jmp 0x526b
movl -0x2c(%rbp), %eax
cmpb %al, %r8b
jne 0x5372
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2847
jmp 0x534b
callq 0x281c
jmp 0x534b
callq 0x27f1
jmp 0x534b
movzbl %al, %r9d
movq 0x9c7b(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x4338(%rip), %rsi      # 0x96bf
leaq 0x41ab(%rip), %rdx      # 0x9539
leaq 0x428a(%rip), %rcx      # 0x961f
xorl %eax, %eax
callq 0x2150
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x534b
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: bachk
int bachk(const char *str)
{
	if (!str)
		return -1;

	if (strlen(str) != 17)
		return -1;

	while (*str) {
		if (!isxdigit(*str++))
			return -1;

		if (!isxdigit(*str++))
			return -1;

		if (*str == 0)
			break;

		if (*str++ != ':')
			return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5896
movq %rdi, %rbx
callq 0x2090
cmpq $0x11, %rax
jne 0x5896
xorl %r14d, %r14d
movsbq (%rbx), %r15
testq %r15, %r15
je 0x589c
callq 0x22e0
movq (%rax), %rax
testb $0x10, 0x1(%rax,%r15,2)
je 0x5896
movsbq 0x1(%rbx), %rcx
testb $0x10, 0x1(%rax,%rcx,2)
je 0x5896
movb 0x2(%rbx), %al
testb %al, %al
je 0x589c
addq $0x3, %rbx
cmpb $0x3a, %al
je 0x5862
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_vendor_change_speed_h5
int rtk_vendor_change_speed_h5(int fd, RT_U32 baudrate)
{
	struct sk_buff *cmd_change_bdrate = NULL;
	unsigned char cmd[7] = { 0 };
	int retlen;
	unsigned char bytes[READ_DATA_SIZE];
	struct sigaction sa;

	sa.sa_handler = h5_tinit_sig_alarm;
	sigaction(SIGALRM, &sa, NULL);

	cmd[0] = 0x17;	//ocf
	cmd[1] = 0xfc;	//ogf, vendor specified

	cmd[2] = 4;	//length;

	baudrate = cpu_to_le32(baudrate);
#ifdef BAUDRATE_4BYTES
	memcpy((RT_U16 *) & cmd[3], &baudrate, 4);
#else
	memcpy((RT_U16 *) & cmd[3], &baudrate, 2);

	cmd[5] = 0;
	cmd[6] = 0;
#endif

	RS_DBG("baudrate in change speed command: 0x%x 0x%x 0x%x 0x%x \n",
	       cmd[3], cmd[4], cmd[5], cmd[6]);

	cmd_change_bdrate =
	    h5_prepare_pkt(&rtk_hw_cfg, cmd, 7, HCI_COMMAND_PKT);
	if (!cmd_change_bdrate) {
		RS_ERR("Prepare command packet for change speed fail");
		return -1;
	}

	rtk_hw_cfg.host_last_cmd = cmd_change_bdrate;
	alarm(1);
	write(fd, cmd_change_bdrate->data, cmd_change_bdrate->data_len);

	while (rtk_hw_cfg.link_estab_state == H5_INIT) {
		if ((retlen = read_check_rtk(fd, &bytes, READ_DATA_SIZE)) == -1) {
			perror("read fail");
			return -1;
		}
		//add pure ack check
		h5_recv(&rtk_hw_cfg, &bytes, retlen);
	}

	alarm(0);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movl %esi, %r14d
movl %edi, %ebx
xorl %eax, %eax
movl %eax, -0x15(%rbp)
movl %eax, -0x18(%rbp)
leaq 0xe1(%rip), %rax        # 0x5fe5
leaq -0xc8(%rbp), %rsi
movq %rax, (%rsi)
movl $0xe, %edi
xorl %edx, %edx
callq 0x2060
movw $0xfc17, -0x18(%rbp)    # imm = 0xFC17
movb $0x4, -0x16(%rbp)
movl %r14d, -0x15(%rbp)
cmpb $0x0, 0x93b1(%rip)      # 0xf2e0
jne 0x5fb9
leaq -0x18(%rbp), %rdi
movl $0x7, %esi
movl $0x1, %edx
callq 0x604e
testq %rax, %rax
je 0x5fcb
movq %rax, %r14
movq %rax, 0x97a9(%rip)      # 0xf700
movl $0x1, %edi
callq 0x20f0
movq %r14, %rsi
addq $0x8, %rsi
movl 0x4(%r14), %edx
movl %ebx, %edi
callq 0x2070
cmpl $0x2, 0x977a(%rip)      # 0xf6f4
jne 0x5fa2
leaq -0x30(%rbp), %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x625a
cmpl $-0x1, %eax
je 0x5fd2
movq %r14, %rdi
movl %eax, %esi
callq 0x62b5
cmpl $0x2, 0x9754(%rip)      # 0xf6f4
je 0x5f80
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x20f0
movl %ebx, %eax
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x15(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2c7b
jmp 0x5f35
callq 0x2cbf
jmp 0x5fde
leaq 0x3cd5(%rip), %rdi      # 0x9cae
callq 0x2230
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x5fab
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_tinit_sig_alarm
static void h5_tinit_sig_alarm(int sig)
{
	static int retries = 0;
	if (retries < rtk_hw_cfg.h5_max_retries) {
		retries++;
		if (rtk_hw_cfg.host_last_cmd) {
			int len =
			    write(rtk_hw_cfg.serial_fd,
				  rtk_hw_cfg.host_last_cmd->data,
				  rtk_hw_cfg.host_last_cmd->data_len);
			RS_DBG("3-wire change baudrate re send:%d, len:%d",
			       retries, len);
			alarm(1);
			return;
		} else {
			RS_DBG
			    ("3-wire init timeout without last command stored\n");
		}
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("H5 init process timed out");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xa7a1(%rip), %eax      # 0x10790
cmpl 0x971b(%rip), %eax      # 0xf710
jge 0x603f
incl %eax
movl %eax, 0xa791(%rip)      # 0x10790
movq 0x96fa(%rip), %rsi      # 0xf700
testq %rsi, %rsi
je 0x6031
movl 0x970f(%rip), %edi      # 0xf720
movl 0x4(%rsi), %edx
addq $0x8, %rsi
callq 0x2070
cmpb $0x0, 0x92bc(%rip)      # 0xf2e0
jne 0x6044
movl $0x1, %edi
popq %rbp
jmp 0x20f0
cmpb $0x0, 0x92a8(%rip)      # 0xf2e0
je 0x603f
callq 0x2d11
callq 0x2d35
movq %rax, %rdi
callq 0x2ce4
jmp 0x6026
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: read_check_rtk
static int read_check_rtk(int fd, void *buf, int count)
{
	int res;
	do {
		res = read(fd, buf, count);
		if (res != -1) {
			buf = (RT_U8 *) buf + res;
			count -= res;
			return res;
		}
	} while (count && (errno == 0 || errno == EINTR));
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
movl $0x10, %edx
callq 0x2110
movq %rax, %r15
cmpl $-0x1, %r15d
jne 0x62a9
callq 0x2040
movq %rax, %r12
testl $0xfffffffb, (%r12)     # imm = 0xFFFFFFFB
jne 0x62a9
movl $0x10, %edx
movl %r14d, %edi
movq %rbx, %rsi
callq 0x2110
movq %rax, %r15
cmpl $-0x1, %r15d
je 0x6286
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_tsync_sig_alarm
static void h5_tsync_sig_alarm(int sig)
{
	unsigned char h5sync[2] = { 0x01, 0x7E };
	static int retries = 0;
	struct itimerval value;

	if (retries < rtk_hw_cfg.h5_max_retries) {
		retries++;
		struct sk_buff *nskb =
		    h5_prepare_pkt(&rtk_hw_cfg, h5sync, sizeof(h5sync),
				   H5_LINK_CTL_PKT);
		int len =
		    write(rtk_hw_cfg.serial_fd, nskb->data, nskb->data_len);
		RS_DBG("3-wire sync pattern resend : %d, len: %d\n", retries,
		       len);

		skb_free(nskb);
		//gordon add 2013-6-7 retry per 250ms
		value.it_value.tv_sec = 0;
		value.it_value.tv_usec = 250000;
		value.it_interval.tv_sec = 0;
		value.it_interval.tv_usec = 250000;
		setitimer(ITIMER_REAL, &value, NULL);
		//gordon end

		return;
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("H5 sync timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movw $0x7e01, -0xa(%rbp)     # imm = 0x7E01
movl 0x9e6a(%rip), %eax      # 0x10794
cmpl 0x8de0(%rip), %eax      # 0xf710
jge 0x69a7
incl %eax
movl %eax, 0x9e5a(%rip)      # 0x10794
leaq -0xa(%rbp), %rdi
movl $0x2, %esi
movl $0xf, %edx
callq 0x604e
movq %rax, %rbx
movl 0x8dca(%rip), %edi      # 0xf720
movl 0x4(%rax), %edx
leaq 0x8(%rax), %rsi
callq 0x2070
cmpb $0x0, 0x8977(%rip)      # 0xf2e0
jne 0x699d
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
leaq -0x30(%rbp), %rsi
movq %rax, 0x10(%rsi)
movl $0x3d090, %ecx          # imm = 0x3D090
movq %rcx, 0x18(%rsi)
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
xorl %edi, %edi
xorl %edx, %edx
callq 0x21b0
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rdi
callq 0x3125
jmp 0x696b
callq 0x30ec
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_tconf_sig_alarm
static void h5_tconf_sig_alarm(int sig)
{
	unsigned char h5conf[3] = { 0x03, 0xFC, 0x14 };
	static int retries = 0;
	struct itimerval value;

	if (retries < rtk_hw_cfg.h5_max_retries) {
		retries++;
		struct sk_buff *nskb =
		    h5_prepare_pkt(&rtk_hw_cfg, h5conf, 3, H5_LINK_CTL_PKT);
		int len =
		    write(rtk_hw_cfg.serial_fd, nskb->data, nskb->data_len);
		RS_DBG("3-wire config pattern resend : %d , len: %d", retries,
		       len);
		skb_free(nskb);

		//gordon add 2013-6-7 retry per 250ms
		value.it_value.tv_sec = 0;
		value.it_value.tv_usec = 250000;
		value.it_interval.tv_sec = 0;
		value.it_interval.tv_usec = 250000;
		setitimer(ITIMER_REAL, &value, NULL);

		return;
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("H5 config timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movl 0x9ddd(%rip), %eax      # 0x10798
cmpl 0x8d4f(%rip), %eax      # 0xf710
jge 0x6a3b
incl %eax
movl %eax, 0x9dcd(%rip)      # 0x10798
leaq 0x2b3e(%rip), %rdi      # 0x9510
movl $0x3, %esi
movl $0xf, %edx
callq 0x604e
movq %rax, %rbx
movl 0x8d36(%rip), %edi      # 0xf720
movl 0x4(%rax), %edx
leaq 0x8(%rax), %rsi
callq 0x2070
cmpb $0x0, 0x88e3(%rip)      # 0xf2e0
jne 0x6a31
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
leaq -0x28(%rbp), %rsi
movq %rax, 0x10(%rsi)
movl $0x3d090, %ecx          # imm = 0x3D090
movq %rcx, 0x18(%rsi)
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
xorl %edi, %edi
xorl %edx, %edx
callq 0x21b0
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rdi
callq 0x318b
jmp 0x69ff
callq 0x3152
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_get_bt_firmware
int rtk_get_bt_firmware(struct btrtl_info *btrtl, RT_U8 **fw_buf)
{
	const char *filename;
	struct stat st;
	int fd = -1;
	size_t fwsize;
	static char firmware_file_name[PATH_MAX] = { 0 };
	int ret = 0;

	sprintf(firmware_file_name, "%s", FIRMWARE_DIRECTORY);
	strcat(firmware_file_name, btrtl->patch_ent->patch_file);
	filename = firmware_file_name;

	if (stat(filename, &st) < 0) {
		RS_ERR("Can't access firmware %s, %s", filename,
		       strerror(errno));
		return -1;
	}

	fwsize = st.st_size;

	if ((fd = open(filename, O_RDONLY)) < 0) {
		RS_ERR("Can't open firmware, errno:%d", errno);
		return -1;
	}

	if (!(*fw_buf = malloc(fwsize))) {
		RS_ERR("Can't alloc memory for fw&config, errno:%d", errno);
		close(fd);
		return -1;
	}

	if (read(fd, *fw_buf, fwsize) < (ssize_t) fwsize) {
		free(*fw_buf);
		*fw_buf = NULL;
		close(fd);
		return -1;
	}
	RS_DBG("Load FW OK");
	close(fd);
	return fwsize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movups 0x2f45(%rip), %xmm0     # 0x99d0
movaps %xmm0, 0x8cfe(%rip)     # 0xf790
movabsq $0x2f74626c74722f, %rax # imm = 0x2F74626C74722F
movq %rax, 0x8cfa(%rip)      # 0xf79d
leaq 0x8ce6(%rip), %r14      # 0xf790
movq 0x90(%rdi), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x2270
leaq -0xa8(%rbp), %rsi
movq %r14, %rdi
callq 0x2160
testl %eax, %eax
js 0x6b4f
movq -0x78(%rbp), %r14
leaq 0x8cb5(%rip), %rdi      # 0xf790
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
testl %eax, %eax
js 0x6b56
movl %eax, %r15d
movq %r14, %rdi
callq 0x2190
movq %rax, (%rbx)
testq %rax, %rax
je 0x6b5d
movl %r15d, %edi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2110
cmpq %r14, %rax
jge 0x6b2d
movq (%rbx), %rdi
callq 0x2030
movq $0x0, (%rbx)
movl %r15d, %edi
callq 0x2100
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x6b3e
cmpb $0x0, 0x87ac(%rip)      # 0xf2e0
jne 0x6b67
movl %r15d, %edi
callq 0x2100
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x324e
jmp 0x6b25
callq 0x3219
jmp 0x6b25
movl %r15d, %edi
callq 0x31dc
jmp 0x6b25
callq 0x31b8
jmp 0x6b36
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_get_eversion
void rtk_get_eversion(int dd)
{
	unsigned char bytes[READ_DATA_SIZE];
	int retlen;
	struct sigaction sa;
	unsigned char read_rom_patch_cmd[3] = { 0x6d, 0xfc, 00 };
	struct sk_buff *nskb =
	    h5_prepare_pkt(&rtk_hw_cfg, read_rom_patch_cmd, 3, HCI_COMMAND_PKT);

	if (rtk_hw_cfg.host_last_cmd) {
		skb_free(rtk_hw_cfg.host_last_cmd);
		rtk_hw_cfg.host_last_cmd = NULL;
	}

	rtk_hw_cfg.host_last_cmd = nskb;

	write(dd, nskb->data, nskb->data_len);
	rtk_hw_cfg.rom_version_cmd_state = cmd_has_sent;
	RS_DBG("RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_Command\n");

	alarm(0);
	memset(&sa, 0, sizeof(sa));
	sa.sa_flags = SA_NOCLDSTOP;
	sa.sa_handler = rtk_get_eversion_timeout;
	sigaction(SIGALRM, &sa, NULL);

	alarm(3);
	while (rtk_hw_cfg.rom_version_cmd_state != event_received) {
		if ((retlen = read_check_rtk(dd, &bytes, READ_DATA_SIZE)) == -1) {
			perror("rtk get eversion: read fail");
			return;
		}
		h5_recv(&rtk_hw_cfg, &bytes, retlen);
	}
	alarm(0);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movl %edi, %ebx
leaq 0x429c(%rip), %rdi      # 0xae21
movl $0x3, %esi
movl $0x1, %edx
callq 0x604e
movq %rax, %r14
movq 0x8b62(%rip), %rdi      # 0xf700
testq %rdi, %rdi
je 0x6bb3
callq 0x2030
movq $0x0, 0x8b4d(%rip) # 0xf700
movq %r14, 0x8b46(%rip)      # 0xf700
movq %r14, %rsi
addq $0x8, %rsi
movl 0x4(%r14), %edx
movl %ebx, %edi
callq 0x2070
movl $0x1, 0x8b8a(%rip)      # 0xf760
cmpb $0x0, 0x8703(%rip)      # 0xf2e0
jne 0x6c70
xorl %edi, %edi
callq 0x20f0
leaq -0xb8(%rbp), %r14
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20d0
movl $0x1, 0x88(%r14)
leaq 0x76(%rip), %rax        # 0x6c88
movq %rax, (%r14)
movl $0xe, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2060
movl $0x3, %edi
callq 0x20f0
cmpl $0x2, 0x8b2b(%rip)      # 0xf760
je 0x6c5d
leaq -0x20(%rbp), %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x625a
cmpl $-0x1, %eax
je 0x6c7a
movq %r14, %rdi
movl %eax, %esi
callq 0x62b5
cmpl $0x2, 0x8b05(%rip)      # 0xf760
jne 0x6c3b
xorl %edi, %edi
callq 0x20f0
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3292
jmp 0x6be3
leaq 0x306f(%rip), %rdi      # 0x9cf0
callq 0x2230
jmp 0x6c64
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_get_eversion_timeout
static void rtk_get_eversion_timeout(int sig)
{
	static int retries = 0;
	int len = 0;

	RS_DBG("RTK get HCI_VENDOR_READ_RTK_ROM_VERISION_Command\n");
	if (retries < rtk_hw_cfg.h5_max_retries) {
		RS_DBG("rtk get eversion timerout, retry:%d\n", retries);
		if (rtk_hw_cfg.host_last_cmd) {
			len = write(rtk_hw_cfg.serial_fd,
				    rtk_hw_cfg.host_last_cmd->data,
				    rtk_hw_cfg.host_last_cmd->data_len);
		}
		retries++;
		alarm(3);
		return;
	}
	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("rtk get eversion cmd complete event timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x864d(%rip)      # 0xf2e0
jne 0x6cdb
movl 0x9b05(%rip), %ecx      # 0x107a0
cmpl 0x8a6f(%rip), %ecx      # 0xf710
jge 0x6d03
cmpb $0x0, 0x8636(%rip)      # 0xf2e0
jne 0x6ce2
movq 0x8a4d(%rip), %rsi      # 0xf700
testq %rsi, %rsi
je 0x6cca
movl 0x8a62(%rip), %edi      # 0xf720
movl 0x4(%rsi), %edx
addq $0x8, %rsi
callq 0x2070
incl 0x9ad0(%rip)            # 0x107a0
movl $0x3, %edi
popq %rbp
jmp 0x20f0
callq 0x32b6
jmp 0x6c95
movq 0x830f(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3d38(%rip), %rsi      # 0xaa2b
leaq 0x283f(%rip), %rdx      # 0x9539
xorl %eax, %eax
callq 0x2150
jmp 0x6cac
callq 0x32da
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_get_lmp_version
void rtk_get_lmp_version(int dd)
{
	unsigned char bytes[READ_DATA_SIZE];
	int retlen;
	struct sigaction sa;
	unsigned char read_rom_patch_cmd[3] = { 0x01, 0x10, 00 };
	struct sk_buff *nskb = h5_prepare_pkt(&rtk_hw_cfg, read_rom_patch_cmd, 3, HCI_COMMAND_PKT);	//data:len+head:4

	if (rtk_hw_cfg.host_last_cmd) {
		skb_free(rtk_hw_cfg.host_last_cmd);
		rtk_hw_cfg.host_last_cmd = NULL;
	}

	rtk_hw_cfg.host_last_cmd = nskb;

	write(dd, nskb->data, nskb->data_len);
	rtk_hw_cfg.hci_version_cmd_state = cmd_has_sent;
	RS_DBG("RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_Command\n");

	alarm(0);
	memset(&sa, 0, sizeof(sa));
	sa.sa_flags = SA_NOCLDSTOP;
	sa.sa_handler = rtk_get_lmp_version_timeout;
	sigaction(SIGALRM, &sa, NULL);

	alarm(3);
	while (rtk_hw_cfg.hci_version_cmd_state != event_received) {
		if ((retlen = read_check_rtk(dd, &bytes, READ_DATA_SIZE)) == -1) {
			perror("read fail");
			return;
		}
		h5_recv(&rtk_hw_cfg, &bytes, retlen);
	}
	alarm(0);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movl %edi, %ebx
leaq 0x40be(%rip), %rdi      # 0xaddd
movl $0x3, %esi
movl $0x1, %edx
callq 0x604e
movq %rax, %r14
movq 0x89c8(%rip), %rdi      # 0xf700
testq %rdi, %rdi
je 0x6d4d
callq 0x2030
movq $0x0, 0x89b3(%rip) # 0xf700
movq %r14, 0x89ac(%rip)      # 0xf700
movq %r14, %rsi
addq $0x8, %rsi
movl 0x4(%r14), %edx
movl %ebx, %edi
callq 0x2070
movl $0x1, 0x89f4(%rip)      # 0xf764
cmpb $0x0, 0x8569(%rip)      # 0xf2e0
jne 0x6e0a
xorl %edi, %edi
callq 0x20f0
leaq -0xb8(%rbp), %r14
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20d0
movl $0x1, 0x88(%r14)
leaq 0x76(%rip), %rax        # 0x6e22
movq %rax, (%r14)
movl $0xe, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2060
movl $0x3, %edi
callq 0x20f0
cmpl $0x2, 0x8995(%rip)      # 0xf764
je 0x6df7
leaq -0x20(%rbp), %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x625a
cmpl $-0x1, %eax
je 0x6e14
movq %r14, %rdi
movl %eax, %esi
callq 0x62b5
cmpl $0x2, 0x896f(%rip)      # 0xf764
jne 0x6dd5
xorl %edi, %edi
callq 0x20f0
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3313
jmp 0x6d7d
leaq 0x2e93(%rip), %rdi      # 0x9cae
callq 0x2230
jmp 0x6dfe
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_get_lmp_version_timeout
static void rtk_get_lmp_version_timeout(int sig)
{
	static int retries = 0;
	RS_DBG("RTK get HCI_VENDOR_READ_RTK_LMP_VERISION_Command\n");
	if (retries < rtk_hw_cfg.h5_max_retries) {
		RS_DBG("rtk get lmp version timeout, retry: %d\n", retries);
		if (rtk_hw_cfg.host_last_cmd) {
			int len = write(rtk_hw_cfg.serial_fd,
					rtk_hw_cfg.host_last_cmd->data,
					rtk_hw_cfg.host_last_cmd->data_len);
		}
		retries++;
		alarm(3);
		return;
	}
	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("rtk get lmp version cmd complete event timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x84b3(%rip)      # 0xf2e0
jne 0x6e75
movl 0x996f(%rip), %ecx      # 0x107a4
cmpl 0x88d5(%rip), %ecx      # 0xf710
jge 0x6e9d
cmpb $0x0, 0x849c(%rip)      # 0xf2e0
jne 0x6e7c
movq 0x88b3(%rip), %rsi      # 0xf700
testq %rsi, %rsi
je 0x6e64
movl 0x88c8(%rip), %edi      # 0xf720
movl 0x4(%rsi), %edx
addq $0x8, %rsi
callq 0x2070
incl 0x993a(%rip)            # 0x107a4
movl $0x3, %edi
popq %rbp
jmp 0x20f0
callq 0x3337
jmp 0x6e2f
movq 0x8175(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3c39(%rip), %rsi      # 0xaac6
leaq 0x26a5(%rip), %rdx      # 0x9539
xorl %eax, %eax
callq 0x2150
jmp 0x6e46
callq 0x335b
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_get_fw_project_id
uint8_t rtk_get_fw_project_id(uint8_t * p_buf)
{
	uint8_t opcode;
	uint8_t len;
	uint8_t data = 0;

	do {
		opcode = *p_buf;
		len = *(p_buf - 1);
		if (opcode == 0x00) {
			if (len == 1) {
				data = *(p_buf - 2);
				RS_DBG
				    ("rtk_get_fw_project_id: opcode %d, len %d, data %d",
				     opcode, len, data);
				break;
			} else {
				RS_ERR("rtk_get_fw_project_id: invalid len %d",
				       len);
			}
		}
		p_buf -= len + 2;
	} while (*p_buf != 0xFF);

	return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x813e(%rip), %r13      # 0xeff8
leaq 0x2e82(%rip), %r14      # 0x9d43
leaq 0x2671(%rip), %r15      # 0x9539
movzbl -0x1(%rbx), %r12d
cmpb $0x0, (%rbx)
jne 0x6eec
cmpl $0x1, %r12d
je 0x6f00
movq (%r13), %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2150
movl %r12d, %eax
subq %rax, %rbx
cmpb $-0x1, -0x2(%rbx)
leaq -0x2(%rbx), %rbx
jne 0x6ec8
xorl %ebx, %ebx
jmp 0x6f0c
movb -0x2(%rbx), %bl
cmpb $0x0, 0x83d6(%rip)      # 0xf2e0
jne 0x6f1d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %bl, %r9d
movq (%r13), %rdi
leaq 0x2de0(%rip), %rsi      # 0x9d0c
leaq 0x2606(%rip), %rdx      # 0x9539
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %eax, %eax
callq 0x2150
jmp 0x6f0c
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_slip_msgdelim
static RT_U8 *skb_put(struct sk_buff *skb, RT_U32 len)
{
	RT_U32 old_len = skb->data_len;
	if ((skb->data_len + len) > (skb->max_len)) {
		RS_ERR("Buffer too small");
		return NULL;
	}
	skb->data_len += len;
	return (skb->data + old_len);
}

// Assembly:
movl 0x4(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl (%rdi), %ecx
ja 0x812f
movl %ecx, 0x4(%rdi)
movb $-0x40, 0x8(%rdi,%rax)
retq
pushq %rbp
movq %rsp, %rbp
callq 0x3c1a
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_slip_one_byte
static void h5_slip_one_byte(struct sk_buff *skb, RT_U8 c)
{
	const RT_S8 esc_c0[2] = { 0xdb, 0xdc };
	const RT_S8 esc_db[2] = { 0xdb, 0xdd };
	const RT_S8 esc_11[2] = { 0xdb, 0xde };
	const RT_S8 esc_13[2] = { 0xdb, 0xdf };

	switch (c) {
	case 0xc0:
		memcpy(skb_put(skb, 2), &esc_c0, 2);
		break;

	case 0xdb:
		memcpy(skb_put(skb, 2), &esc_db, 2);
		break;

	case 0x11:
		memcpy(skb_put(skb, 2), &esc_11, 2);
		break;

	case 0x13:
		memcpy(skb_put(skb, 2), &esc_13, 2);
		break;

	default:
		memcpy(skb_put(skb, 1), &c, 1);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %ecx
movl 0x4(%rdi), %eax
cmpl $0xbf, %esi
jg 0x8166
cmpl $0x11, %esi
je 0x819c
cmpl $0x13, %esi
jne 0x818b
leal 0x2(%rax), %edx
cmpl %ecx, %edx
ja 0x81c9
movl %edx, 0x4(%rdi)
movw $0xdfdb, 0x8(%rdi,%rax) # imm = 0xDFDB
jmp 0x81c2
cmpl $0xdb, %esi
je 0x81af
cmpl $0xc0, %esi
jne 0x818b
movl %eax, %edx
addl $0x2, %edx
cmpl %ecx, %edx
ja 0x81ce
movl %edx, 0x4(%rdi)
movw $0xdcdb, 0x8(%rdi,%rax) # imm = 0xDCDB
jmp 0x81c2
leal 0x1(%rax), %edx
cmpl %ecx, %edx
ja 0x81c4
movl %edx, 0x4(%rdi)
movb %sil, 0x8(%rdi,%rax)
jmp 0x81c2
leal 0x2(%rax), %edx
cmpl %ecx, %edx
ja 0x81d3
movl %edx, 0x4(%rdi)
movw $0xdedb, 0x8(%rdi,%rax) # imm = 0xDEDB
jmp 0x81c2
movl %eax, %edx
addl $0x2, %edx
cmpl %ecx, %edx
ja 0x81d8
movl %edx, 0x4(%rdi)
movw $0xdddb, 0x8(%rdi,%rax) # imm = 0xDDDB
popq %rbp
retq
callq 0x3cc9
callq 0x3c3d
callq 0x3ca6
callq 0x3c60
callq 0x3c83
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_local_ver_sig_alarm
static void rtk_local_ver_sig_alarm(int sig)
{
	uint8_t cmd[4] = { 0x01, 0x01, 0x10, 0x00 };
	static int retries;

	if (retries < rtk_max_retries) {
		retries++;
		if (write(rtk_hw_cfg.serial_fd, cmd, sizeof(cmd)) < 0)
			return;
		alarm(1);
		return;
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("init timed out, read local ver fails");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x7f59(%rip), %eax      # 0x107a8
cmpl $0x4, %eax
jg 0x8885
incl %eax
movl %eax, 0x7f4c(%rip)      # 0x107a8
movl 0x6ebe(%rip), %edi      # 0xf720
leaq 0x2573(%rip), %rsi      # 0xaddc
movl $0x4, %edx
callq 0x2070
testq %rax, %rax
js 0x8883
movl $0x1, %edi
popq %rbp
jmp 0x20f0
popq %rbp
retq
callq 0x3f32
// File: /workspace/github_c_makefile_star2_O1/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_rom_ver_sig_alarm
static void rtk_rom_ver_sig_alarm(int sig)
{
	uint8_t cmd[4] = { 0x01, 0x6d, 0xfc, 0x00 };
	static int retries;

	if (retries < rtk_max_retries) {
		retries++;
		if (write(rtk_hw_cfg.serial_fd, cmd, sizeof(cmd)) < 0)
			return;
		alarm(1);
		return;
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("init timed out, read rom ver fails");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x7f18(%rip), %eax      # 0x107ac
cmpl $0x4, %eax
jg 0x88ca
incl %eax
movl %eax, 0x7f0b(%rip)      # 0x107ac
movl 0x6e79(%rip), %edi      # 0xf720
leaq 0x2572(%rip), %rsi      # 0xae20
movl $0x4, %edx
callq 0x2070
testq %rax, %rax
js 0x88c8
movl $0x1, %edi
popq %rbp
jmp 0x20f0
popq %rbp
retq
callq 0x3f6b
// File: /workspace/github_c_makefile_star2_O1/xtanitfy[P]Murphy/test/test_conv.c
// Function: print_src
int print_src(void)
{
	for (int i = 0;i < 4;i++) {
		for (int j = 0;j < 4;j++) {
			printf("%d ",arr[i][j]);
		}
		printf("\n");
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2ed5(%rip), %r14      # 0x4040
leaq 0xe92(%rip), %rbx       # 0x2004
xorl %r15d, %r15d
xorl %r12d, %r12d
movl (%r14,%r12,4), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
incq %r12
cmpq $0x4, %r12
jne 0x1178
movl $0xa, %edi
callq 0x1040
incq %r15
addq $0x10, %r14
cmpq $0x4, %r15
jne 0x1175
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xtanitfy[P]Murphy/test/test_conv.c
// Function: print_dst
int print_dst(void)
{
	for (int i = 0;i < 3;i++) {
		for (int j = 0;j < 3;j++) {
			printf("%d ",dst[i][j]);
		}
		printf("\n");
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2edd(%rip), %r14      # 0x40a0
leaq 0xe3a(%rip), %rbx       # 0x2004
xorl %r15d, %r15d
xorl %r12d, %r12d
movl (%r14,%r12,4), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
incq %r12
cmpq $0x3, %r12
jne 0x11d0
movl $0xa, %edi
callq 0x1040
incq %r15
addq $0xc, %r14
cmpq $0x3, %r15
jne 0x11cd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xtanitfy[P]Murphy/test/test_conv.c
// Function: conv_slow
int conv_slow(void)
{
	int tmp = 0;
	for (int i = 0;i < 3;i++) {
		for (int j = 0;j < 3;j++) {
			tmp = 0;
			for (int m = i;m < (i + 2);m++) {
				for (int n = j;n < (j + 2);n++) {
					tmp +=  arr[m][n] * k [1-m+i][1-n+j];
				}
			}
			dst[i][j] = tmp;
		}
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0x2, %eax
leaq 0x2e1e(%rip), %rsi      # 0x4040
xorl %edi, %edi
leaq 0x2e55(%rip), %rdx      # 0x4080
leaq 0x1(%rdi), %rcx
movq %rcx, -0x8(%rsp)
leaq (%rdi,%rdi,2), %rcx
leaq 0x2e61(%rip), %r8       # 0x40a0
leaq (%r8,%rcx,4), %r9
movq %rsi, %rcx
xorl %r11d, %r11d
leaq 0x1(%r11), %rbx
xorl %ebp, %ebp
movq %rcx, %r10
movq %rdx, %r15
movq %rdi, %r12
movl $0x3, %r13d
movq %r10, %r14
movl (%r15,%r13,4), %r8d
imull (%r14), %r8d
addl %r8d, %ebp
decq %r13
addq $0x4, %r14
cmpq $0x1, %r13
jne 0x1261
incq %r12
addq $-0x8, %r15
addq $0x10, %r10
cmpq %rax, %r12
jne 0x1258
movl %ebp, (%r9,%r11,4)
addq $0x4, %rcx
movq %rbx, %r11
cmpq $0x3, %rbx
jne 0x1249
incq %rax
addq $0x10, %rsi
movq -0x8(%rsp), %rcx
movq %rcx, %rdi
cmpq $0x3, %rcx
jne 0x122b
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xtanitfy[P]Murphy/test/test_conv.c
// Function: main
int main(void)
{
	printf("Before conv:\n");
	print_src();
	conv_slow();
	printf("After conv:\n");
	print_dst();
	
	return 0;
}

// Assembly:
pushq %rax
leaq 0xd22(%rip), %rdi       # 0x2008
callq 0x1050
callq 0x115c
callq 0x120c
leaq 0xd19(%rip), %rdi       # 0x2015
callq 0x1050
callq 0x11b4
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/marcespie[P]unix-samples/lab/pollsig3.c
// Function: main
int
main()
{
	struct pollfd pfd[1];

	int pip[2];
	errwrap(pipe(pip));

	int pid;

	errwrap(pid = fork());
	if (pid == 0) {
		sleep(5);
		fprintf(stderr, "Okay thxbye\n");
		exit(0);
	}
	struct sigaction sa;
	sa.sa_handler = reaper;
	sa.sa_flags = SA_RESTART;
	errwrap(sigaction(SIGCHLD, &sa, NULL));

	// now we "wait"

	pfd[0].fd = pip[0];
	pfd[0].events = POLLIN;
	int n = poll(pfd, 1, INFTIM);
	if (n == -1 && errno == EINTR) {
		fprintf(stderr, "Everything is okay\n");
	}
}

// Assembly:
subq $0xa8, %rsp
movq %rsp, %rdi
callq 0x1050
cmpl $-0x1, %eax
je 0x1298
callq 0x10b0
testl %eax, %eax
je 0x12a1
cmpl $-0x1, %eax
je 0x12a6
leaq -0x2a(%rip), %rax       # 0x120c
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl $0x10000000, 0x88(%rsi) # imm = 0x10000000
movl $0x11, %edi
xorl %edx, %edx
callq 0x1040
cmpl $-0x1, %eax
je 0x12af
movl (%rsp), %eax
leaq 0x8(%rsp), %rdi
movl %eax, (%rdi)
movw $0x1, 0x4(%rdi)
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1070
cmpl $-0x1, %eax
jne 0x1287
callq 0x1030
cmpl $0x4, (%rax)
je 0x1291
xorl %eax, %eax
addq $0xa8, %rsp
retq
callq 0x10fc
jmp 0x1287
leaq 0xd65(%rip), %rsi       # 0x2004
jmp 0x12b6
callq 0x10d0
leaq 0xd61(%rip), %rsi       # 0x200e
jmp 0x12b6
leaq 0xd72(%rip), %rsi       # 0x2028
movl $0x1, %edi
xorl %eax, %eax
callq 0x1060
// File: /workspace/github_c_makefile_star2_O1/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_int_atomic_inc.c
// Function: shmem_int_atomic_inc
void shmem_int_atomic_inc( int* ptr, int pe)
{ 
	int* remote_ptr = (int*)shmem_ptr((void*)ptr, pe );
	long* x = (long*)shmem_ptr((void*)&__shmem.lock_atomic_int, pe);
	__set_spin_lock(x);
	*remote_ptr += 1;
	__clear_spin_lock(x);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
callq 0x1c20
movq %rax, %r14
leaq 0x327f(%rip), %rdi      # 0x61f0
addq $0x10, %rdi
movl %ebx, %esi
callq 0x1c20
movq %rax, %rbx
movq %rax, %rdi
callq 0x3217
incl (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3208
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/eric-lo[P]3150/6-Memory/constant_ptr.c
// Function: main
int main(void) {
	char *string  = "hello"; // you get a pointer to a constant
	printf("\"hello\"      = %p\n", "hello");
	printf("String pointer = %p\n", string);
	string[4] = '\0';
	printf("Go to %s\n", string);
	return 0;
}

// Assembly:
pushq %rbx
leaq 0xec6(%rip), %rdi       # 0x200a
leaq 0xeb9(%rip), %rbx       # 0x2004
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0xec1(%rip), %rdi       # 0x201d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0xec5(%rip), %rdi       # 0x2032
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/antirez[P]stonky/canvas.c
// Function: createCanvas
canvas *createCanvas(int width, int height, int bgcolor) {
    canvas *canvas = malloc(sizeof(*canvas));
    canvas->width = width;
    canvas->height = height;
    canvas->pixels = malloc(width*height);
    memset(canvas->pixels,bgcolor,width*height);
    return canvas;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
movl $0x10, %edi
callq 0x2470
movq %rax, %r15
movl %r14d, (%rax)
movl %ebp, 0x4(%rax)
imull %r14d, %ebp
movslq %ebp, %r14
movq %r14, %rdi
callq 0x2470
movq %rax, 0x8(%r15)
movq %rax, %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0x2140
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq