LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xd0, %rsp
movl %edi, -0x4(%rbp)
movw 0x66f0(%rip), %ax       # 0xcef5
movw %ax, -0xc3(%rbp)
movb 0x66e5(%rip), %al       # 0xcef7
movb %al, -0xc1(%rbp)
leaq -0xc3(%rbp), %rsi
leaq 0x9eaa(%rip), %rdi      # 0x106d0
movl $0x3, %edx
movl $0x1, %ecx
callq 0x5600
movq %rax, -0xd0(%rbp)
cmpq $0x0, 0x9eac(%rip)      # 0x106f0
je 0x685d
movq 0x9ea3(%rip), %rdi      # 0x106f0
callq 0x66c0
movq $0x0, 0x9e93(%rip) # 0x106f0
movq -0xd0(%rbp), %rax
movq %rax, 0x9e85(%rip)      # 0x106f0
movl -0x4(%rbp), %edi
movq -0xd0(%rbp), %rsi
addq $0x8, %rsi
movq -0xd0(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2070
movl $0x1, 0x9ebc(%rip)      # 0x10750
cmpb $0x0, 0x9a35(%rip)      # 0x102d0
je 0x68bc
movq 0x9754(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x545d(%rip), %rsi      # 0xbd0b
leaq 0x4cd4(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x68be
xorl %edi, %edi
callq 0x20f0
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x20d0
movl $0x1, -0x38(%rbp)
leaq 0x8a(%rip), %rax        # 0x6970
movq %rax, -0xc0(%rbp)
movl $0xe, %edi
leaq -0xc0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movl $0x3, %edi
callq 0x20f0
cmpl $0x2, 0x9e3d(%rip)      # 0x10750
je 0x6951
movl -0x4(%rbp), %edi
leaq -0x20(%rbp), %rsi
movl $0x10, %edx
callq 0x5850
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x693c
leaq 0x540e(%rip), %rdi      # 0xbd43
callq 0x2220
jmp 0x6958
movl -0x24(%rbp), %edx
leaq 0x9d8a(%rip), %rdi      # 0x106d0
leaq -0x20(%rbp), %rsi
callq 0x58f0
jmp 0x690c
xorl %edi, %edi
callq 0x20f0
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpb $0x0, 0x9947(%rip)      # 0x102d0
je 0x69aa
movq 0x9666(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x60fd(%rip), %rsi      # 0xca99
leaq 0x4be6(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x69ac
movl 0xadde(%rip), %eax      # 0x11790
cmpl 0x9d48(%rip), %eax      # 0x10700
jge 0x6a3e
jmp 0x69c0
cmpb $0x0, 0x9909(%rip)      # 0x102d0
je 0x69ee
movq 0x9628(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xadb7(%rip), %ecx      # 0x11790
leaq 0x60f0(%rip), %rsi      # 0xcad0
leaq 0x4ba2(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x69f0
cmpq $0x0, 0x9cf8(%rip)      # 0x106f0
je 0x6a1f
movl 0x9d10(%rip), %edi      # 0x10710
movq 0x9ce9(%rip), %rsi      # 0x106f0
addq $0x8, %rsi
movq 0x9cde(%rip), %rax      # 0x106f0
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2070
movl %eax, -0x8(%rbp)
movl 0xad6b(%rip), %eax      # 0x11790
addl $0x1, %eax
movl %eax, 0xad62(%rip)      # 0x11790
movl $0x3, %edi
callq 0x20f0
addq $0x10, %rsp
popq %rbp
retq
movl 0x9ccc(%rip), %edi      # 0x10710
movl $0x2, %esi
callq 0x20a0
movq 0x95a3(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x609b(%rip), %rsi      # 0xcafa
leaq 0x4b23(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xd0, %rsp
movl %edi, -0x4(%rbp)
movw 0x641c(%rip), %ax       # 0xceb1
movw %ax, -0xc3(%rbp)
movb 0x6411(%rip), %al       # 0xceb3
movb %al, -0xc1(%rbp)
leaq -0xc3(%rbp), %rsi
leaq 0x9c1a(%rip), %rdi      # 0x106d0
movl $0x3, %edx
movl $0x1, %ecx
callq 0x5600
movq %rax, -0xd0(%rbp)
cmpq $0x0, 0x9c1c(%rip)      # 0x106f0
je 0x6aed
movq 0x9c13(%rip), %rdi      # 0x106f0
callq 0x66c0
movq $0x0, 0x9c03(%rip) # 0x106f0
movq -0xd0(%rbp), %rax
movq %rax, 0x9bf5(%rip)      # 0x106f0
movl -0x4(%rbp), %edi
movq -0xd0(%rbp), %rsi
addq $0x8, %rsi
movq -0xd0(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2070
movl $0x1, 0x9c30(%rip)      # 0x10754
cmpb $0x0, 0x97a5(%rip)      # 0x102d0
je 0x6b4c
movq 0x94c4(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x51cd(%rip), %rsi      # 0xbd0b
leaq 0x4a44(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x6b4e
xorl %edi, %edi
callq 0x20f0
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x20d0
movl $0x1, -0x38(%rbp)
leaq 0x8a(%rip), %rax        # 0x6c00
movq %rax, -0xc0(%rbp)
movl $0xe, %edi
leaq -0xc0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movl $0x3, %edi
callq 0x20f0
cmpl $0x2, 0x9bb1(%rip)      # 0x10754
je 0x6be1
movl -0x4(%rbp), %edi
leaq -0x20(%rbp), %rsi
movl $0x10, %edx
callq 0x5850
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x6bcc
leaq 0x513c(%rip), %rdi      # 0xbd01
callq 0x2220
jmp 0x6be8
movl -0x24(%rbp), %edx
leaq 0x9afa(%rip), %rdi      # 0x106d0
leaq -0x20(%rbp), %rsi
callq 0x58f0
jmp 0x6b9c
xorl %edi, %edi
callq 0x20f0
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpb $0x0, 0x96be(%rip)      # 0x102d0
je 0x6c33
movq 0x93dd(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x5f0f(%rip), %rsi      # 0xcb34
leaq 0x495d(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x6c35
movl 0xab59(%rip), %eax      # 0x11794
cmpl 0x9abf(%rip), %eax      # 0x10700
jge 0x6cc7
jmp 0x6c49
cmpb $0x0, 0x9680(%rip)      # 0x102d0
je 0x6c77
movq 0x939f(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xab32(%rip), %ecx      # 0x11794
leaq 0x5f02(%rip), %rsi      # 0xcb6b
leaq 0x4919(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x6c79
cmpq $0x0, 0x9a6f(%rip)      # 0x106f0
je 0x6ca8
movl 0x9a87(%rip), %edi      # 0x10710
movq 0x9a60(%rip), %rsi      # 0x106f0
addq $0x8, %rsi
movq 0x9a55(%rip), %rax      # 0x106f0
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2070
movl %eax, -0x8(%rbp)
movl 0xaae6(%rip), %eax      # 0x11794
addl $0x1, %eax
movl %eax, 0xaadd(%rip)      # 0x11794
movl $0x3, %edi
callq 0x20f0
addq $0x10, %rsp
popq %rbp
retq
movl 0x9a43(%rip), %edi      # 0x10710
movl $0x2, %esi
callq 0x20a0
movq 0x931a(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x5eb0(%rip), %rsi      # 0xcb98
leaq 0x489a(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0xb(%rbp)
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb -0x1(%rax), %al
movb %al, -0xa(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x6da2
movzbl -0xa(%rbp), %eax
cmpl $0x1, %eax
jne 0x6d79
movq -0x8(%rbp), %rax
movb -0x2(%rax), %al
movb %al, -0xb(%rbp)
cmpb $0x0, 0x958a(%rip)      # 0x102d0
je 0x6d75
movq 0x92a9(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl -0x9(%rbp), %ecx
movzbl -0xa(%rbp), %r8d
movzbl -0xb(%rbp), %r9d
leaq 0x4ff8(%rip), %rsi      # 0xbd5f
leaq 0x481b(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x6d77
jmp 0x6dce
jmp 0x6d7b
movq 0x9276(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl -0xa(%rbp), %ecx
leaq 0x5006(%rip), %rsi      # 0xbd96
leaq 0x47f2(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x6da0
jmp 0x6da2
movzbl -0xa(%rbp), %ecx
addl $0x2, %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x6d10
movb -0xb(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_init
int rtk_init(int fd, int proto, int speed, struct termios *ti)
{
	struct sigaction sa;
	int retlen;
	RS_DBG("Realtek hciattach version %s \n", RTK_VERSION);

	memset(&rtk_hw_cfg, 0, sizeof(rtk_hw_cfg));
	rtk_hw_cfg.serial_fd = fd;
	rtk_hw_cfg.dl_fw_flag = 1;

	/* h4 will do nothing for init */
	if (proto == HCI_UART_3WIRE) {
		if (rtk_init_h5(fd, ti) < 0)
			return -1;;
	}

	return rtk_config(fd, proto, speed, ti);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
cmpb $0x0, 0x8ba1(%rip)      # 0x102d0
je 0x7757
movq 0x88c0(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x48d5(%rip), %rsi      # 0xc017
leaq 0x3e40(%rip), %rdx      # 0xb589
leaq 0x48eb(%rip), %rcx      # 0xc03b
movb $0x0, %al
callq 0x2150
jmp 0x7759
leaq 0x8f70(%rip), %rdi      # 0x106d0
xorl %esi, %esi
movl $0xa0, %edx
callq 0x20d0
movl -0x8(%rbp), %eax
movl %eax, 0x8f9b(%rip)      # 0x10710
movb $0x1, 0x8f90(%rip)      # 0x1070c
cmpl $0x2, -0xc(%rbp)
jne 0x779e
movl -0x8(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x5d30
cmpl $0x0, %eax
jge 0x779c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x77b3
jmp 0x779e
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x77c0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: config_proc
static void config_proc(uint8_t *buff, int len)
{
	uint8_t *head = buff;
	uint8_t *ptr = buff;
	int l;

	while (len > 0) {
		ptr = strchr(head, '\n');
		if (!ptr)
			break;
		*ptr++ = '\0';
		while (*head == ' ' || *head == '\t')
			head++;
		l = ptr - head;
		if (l > 0 && *head != '#')
			line_proc(head, l);
		head = ptr;
		len -= l;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x8145
movq -0x18(%rbp), %rdi
movl $0xa, %esi
callq 0x20b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x80b7
jmp 0x8145
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
movzbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x25(%rbp)
je 0x80ea
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x80f3
jmp 0x8101
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x80c9
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x812d
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x812d
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8150
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
jmp 0x808f
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: skb_alloc
static __inline struct sk_buff *skb_alloc(unsigned int len)
{
	struct sk_buff *skb = NULL;
	if ((skb = malloc(len + 8))) {
		skb->max_len = len;
		skb->data_len = 0;
	} else {
		RS_ERR("Allocate skb fails!!!");
		skb = NULL;
	}
	memset(skb->data, 0, len);
	return skb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x4(%rbp), %eax
addl $0x8, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2190
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x8532
movl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x855b
jmp 0x8534
movq 0x7abd(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x3f1f(%rip), %rsi      # 0xc464
leaq 0x303d(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl -0x4(%rbp), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x20d0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movw $0xdcdb, -0xc(%rbp)     # imm = 0xDCDB
movw $0xdddb, -0xe(%rbp)     # imm = 0xDDDB
movw $0xdedb, -0x10(%rbp)    # imm = 0xDEDB
movw $0xdfdb, -0x12(%rbp)    # imm = 0xDFDB
movzbl -0x9(%rbp), %eax
movl %eax, -0x18(%rbp)
subl $0x11, %eax
je 0x8638
jmp 0x85e8
movl -0x18(%rbp), %eax
subl $0x13, %eax
je 0x864f
jmp 0x85f2
movl -0x18(%rbp), %eax
subl $0xc0, %eax
je 0x860a
jmp 0x85fe
movl -0x18(%rbp), %eax
subl $0xdb, %eax
je 0x8621
jmp 0x8666
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x8750
movw -0xc(%rbp), %cx
movw %cx, (%rax)
jmp 0x8679
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x8750
movw -0xe(%rbp), %cx
movw %cx, (%rax)
jmp 0x8679
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x8750
movw -0x10(%rbp), %cx
movw %cx, (%rax)
jmp 0x8679
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x8750
movw -0x12(%rbp), %cx
movw %cx, (%rax)
jmp 0x8679
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x8750
movb -0x9(%rbp), %cl
movb %cl, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_crc_update
static void h5_crc_update(RT_U16 * crc, RT_U8 d)
{
	RT_U16 reg = *crc;

	reg = (reg >> 4) ^ crc_table[(reg ^ d) & 0x000f];
	reg = (reg >> 4) ^ crc_table[(reg ^ (d >> 4)) & 0x000f];

	*crc = reg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %ax
movw %ax, -0xc(%rbp)
movzwl -0xc(%rbp), %eax
sarl $0x4, %eax
movzwl -0xc(%rbp), %ecx
movzbl -0x9(%rbp), %edx
xorl %edx, %ecx
andl $0xf, %ecx
movslq %ecx, %rdx
leaq 0x2e99(%rip), %rcx      # 0xb550
movzwl (%rcx,%rdx,2), %ecx
xorl %ecx, %eax
movw %ax, -0xc(%rbp)
movzwl -0xc(%rbp), %eax
sarl $0x4, %eax
movzwl -0xc(%rbp), %ecx
movzbl -0x9(%rbp), %edx
sarl $0x4, %edx
xorl %edx, %ecx
andl $0xf, %ecx
movslq %ecx, %rdx
leaq 0x2e6e(%rip), %rcx      # 0xb550
movzwl (%rcx,%rdx,2), %ecx
xorl %ecx, %eax
movw %ax, -0xc(%rbp)
movw -0xc(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: skb_put
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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jbe 0x87a6
jmp 0x877d
movq 0x7874(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x3cf7(%rip), %rsi      # 0xc485
leaq 0x2df4(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq $0x0, -0x8(%rbp)
jmp 0x87c5
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movl -0x18(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_complete_rx_pkt
static void h5_complete_rx_pkt(rtk_hw_cfg_t * h5)
{
	int pass_up = 1;
	uint8_t *h5_hdr = NULL;

	h5_hdr = (uint8_t *) (h5->rx_skb->data);
	if (H5_HDR_RELIABLE(h5_hdr)) {
		RS_DBG("Received reliable seqno %u from card", h5->rxseq_txack);
		h5->rxseq_txack = H5_HDR_SEQ(h5_hdr) + 1;
		h5->rxseq_txack %= 8;
		h5->is_txack_req = 1;
	}

	h5->rxack = H5_HDR_ACK(h5_hdr);

	switch (H5_HDR_PKT_TYPE(h5_hdr)) {
	case HCI_ACLDATA_PKT:
	case HCI_EVENT_PKT:
	case HCI_SCODATA_PKT:
	case HCI_COMMAND_PKT:
	case H5_LINK_CTL_PKT:
		pass_up = 1;
		break;

	default:
		pass_up = 0;
		break;
	}

	h5_remove_acked_pkt(h5);

	if (pass_up) {
		skb_pull(h5->rx_skb, H5_HDR_SIZE);
		hci_recv_frame(h5->rx_skb);
	} else {
		skb_free(h5->rx_skb);
	}

	h5->rx_state = H5_W4_PKT_DELIMITER;
	h5->rx_skb = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
sarl $0x7, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x8b68
jmp 0x8aff
cmpb $0x0, 0x77ca(%rip)      # 0x102d0
je 0x8b2e
movq 0x74e9(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movzbl (%rax), %ecx
leaq 0x3a68(%rip), %rsi      # 0xc588
leaq 0x2a62(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x8b30
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $0x7, %eax
addl $0x1, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movzbl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movq -0x20(%rbp), %rax
movb %dl, %cl
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x3(%rax)
movq -0x18(%rbp), %rax
movb (%rax), %cl
shrb $0x3, %cl
andb $0x7, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x18(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0xf, %eax
movl %eax, -0x24(%rbp)
decl %eax
subl $0x4, %eax
jb 0x8b9c
jmp 0x8b92
movl -0x24(%rbp), %eax
subl $0xf, %eax
jne 0x8ba5
jmp 0x8b9c
movl $0x1, -0xc(%rbp)
jmp 0x8bac
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8cc0
cmpl $0x0, -0xc(%rbp)
je 0x8bdc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x8dd0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x8e90
jmp 0x8be9
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x66c0
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_get_crc
static RT_U16 h5_get_crc(rtk_hw_cfg_t * h5)
{
	RT_U16 crc = 0;
	RT_U8 *data = h5->rx_skb->data + h5->rx_skb->data_len - 2;
	crc = data[1] + (data[0] << 8);
	return crc;
//    return get_unaligned_be16(&h5->rx_skb->data[h5->rx_skb->data_len - 2]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movw $0x0, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x4(%rcx), %ecx
addq %rcx, %rax
addq $-0x2, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x1(%rax), %eax
movq -0x18(%rbp), %rcx
movzbl (%rcx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: skb_trim
static void skb_trim(struct sk_buff *skb, unsigned int len)
{
	if (skb->data_len > len) {
		skb->data_len = len;
	} else {
		RS_ERR("Error: skb->data_len(%d) < len(%d)", skb->data_len,
		       len);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0xc(%rbp), %eax
jbe 0x8c87
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x8cb5
jmp 0x8c89
movq 0x7368(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movl -0xc(%rbp), %r8d
leaq 0x3c8e(%rip), %rsi      # 0xc933
leaq 0x28dd(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x8cb5
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_remove_acked_pkt
static void h5_remove_acked_pkt(rtk_hw_cfg_t * h5)
{
	int pkts_to_be_removed = 0;
	int seqno = 0;
	int i = 0;

	seqno = h5->msgq_txseq;
	//pkts_to_be_removed = GetListLength(h5->unacked);

	while (pkts_to_be_removed) {
		if (h5->rxack == seqno)
			break;

		pkts_to_be_removed--;
		seqno = (seqno - 1) & 0x07;
	}

	if (h5->rxack != seqno) {
		RS_DBG("Peer acked invalid packet");
	}
	//skb_queue_walk_safe(&h5->unack, skb, tmp) // remove ack'ed packet from h5->unack queue
	for (i = 0; i < 5; ++i) {
		if (i >= pkts_to_be_removed)
			break;
		i++;
		//__skb_unlink(skb, &h5->unack);
		//skb_free(skb);
	}

	//  if (skb_queue_empty(&h5->unack))
	//          del_timer(&h5->th5);
	//  spin_unlock_irqrestore(&h5->unack.lock, flags);

	if (i != pkts_to_be_removed)
		RS_DBG("Removed only (%u) out of (%u) pkts", i,
		       pkts_to_be_removed);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x8d18
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl -0x10(%rbp), %eax
jne 0x8d01
jmp 0x8d18
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
subl $0x1, %eax
andl $0x7, %eax
movl %eax, -0x10(%rbp)
jmp 0x8cec
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl -0x10(%rbp), %eax
je 0x8d53
jmp 0x8d27
cmpb $0x0, 0x75a2(%rip)      # 0x102d0
je 0x8d4f
movq 0x72c1(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x3871(%rip), %rsi      # 0xc5b2
leaq 0x2841(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x8d51
jmp 0x8d53
movl $0x0, -0x14(%rbp)
cmpl $0x5, -0x14(%rbp)
jge 0x8d7e
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jl 0x8d6a
jmp 0x8d7e
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8d5a
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0x8dbb
jmp 0x8d88
cmpb $0x0, 0x7541(%rip)      # 0x102d0
je 0x8db7
movq 0x7260(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl -0x14(%rbp), %ecx
movl -0xc(%rbp), %r8d
leaq 0x3828(%rip), %rsi      # 0xc5d1
leaq 0x27d9(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x8db9
jmp 0x8dbb
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: skb_pull
static RT_U8 *skb_pull(struct sk_buff *skb, RT_U32 len)
{
	skb->data_len -= len;
	unsigned char *buf;
	if (!(buf = malloc(skb->data_len))) {
		RS_ERR("Unable to allocate file buffer");
		exit(1);
	}
	memcpy(buf, skb->data + len, skb->data_len);
	memcpy(skb->data, buf, skb->data_len);
	free(buf);
	return (skb->data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edi
callq 0x2190
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x8e31
jmp 0x8e08
movq 0x71e9(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x37e0(%rip), %rsi      # 0xc5f9
leaq 0x2769(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
movl -0xc(%rbp), %eax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2180
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2180
movq -0x18(%rbp), %rdi
callq 0x2030
movq -0x8(%rbp), %rax
addq $0x8, %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_hci_local_ver
static void rtk_hci_local_ver(int fd)
{
	struct sigaction sa;
	uint8_t result[258];
	int ret;

	alarm(0);

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

	rtk_local_ver_sig_alarm(0);

	while (1) {
		ret = read_hci_evt(fd, result, 0x0e);
		/* break down is not needed if read fails, because the program
		 * will exit when alarm timeout
		 */
		if (ret < 0)
			RS_ERR("%s: Read HCI event error.", __func__);
		else
			break;
	}

	/* Cancel pending alarm */
	alarm(0);

	if (ret != 15) {
		RS_ERR("%s: incorrect complete event, len %u", __func__, ret);
		exit(1);
	}

	if (result[6]) {
		RS_ERR("%s: status is %u", __func__, result[6]);
		exit(1);
	}

	rtk_hw_cfg.hci_ver = result[7];
	rtk_hw_cfg.hci_rev = (uint32_t)result[9] << 8 | result[8];
	rtk_hw_cfg.lmp_subver = (uint32_t)result[14] << 8 | result[13];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movl %edi, -0x4(%rbp)
xorl %edi, %edi
callq 0x20f0
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x20d0
movl $0x1, -0x18(%rbp)
leaq 0x8ea(%rip), %rax       # 0xa080
movq %rax, -0xa0(%rbp)
movl $0xe, %edi
leaq -0xa0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
xorl %edi, %edi
callq 0xa080
movl -0x4(%rbp), %edi
leaq -0x1b0(%rbp), %rsi
movl $0xe, %edx
callq 0x3f70
movl %eax, -0x1b4(%rbp)
cmpl $0x0, -0x1b4(%rbp)
jge 0x9806
jmp 0x97de
movq 0x6813(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x363e(%rip), %rsi      # 0xce2d
leaq 0x1d93(%rip), %rdx      # 0xb589
leaq 0x3655(%rip), %rcx      # 0xce52
movb $0x0, %al
callq 0x2150
jmp 0x9808
jmp 0x980a
jmp 0x97b9
xorl %edi, %edi
callq 0x20f0
cmpl $0xf, -0x1b4(%rbp)
je 0x9853
jmp 0x981c
movq 0x67d5(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl -0x1b4(%rbp), %r8d
leaq 0x3630(%rip), %rsi      # 0xce64
leaq 0x1d4e(%rip), %rdx      # 0xb589
leaq 0x3610(%rip), %rcx      # 0xce52
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
cmpb $0x0, -0x1aa(%rbp)
je 0x9896
jmp 0x985e
movq 0x6793(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl -0x1aa(%rbp), %r8d
leaq 0x361d(%rip), %rsi      # 0xce94
leaq 0x1d0b(%rip), %rdx      # 0xb589
leaq 0x35cd(%rip), %rcx      # 0xce52
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
movb -0x1a9(%rbp), %al
movb %al, 0x6e5c(%rip)       # 0x106fe
movzbl -0x1a7(%rbp), %eax
shll $0x8, %eax
movzbl -0x1a8(%rbp), %ecx
orl %ecx, %eax
movw %ax, 0x6e40(%rip)       # 0x106fc
movzbl -0x1a2(%rbp), %eax
shll $0x8, %eax
movzbl -0x1a3(%rbp), %ecx
orl %ecx, %eax
movw %ax, 0x6e24(%rip)       # 0x106fa
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_hci_rom_ver
static void rtk_hci_rom_ver(int fd)
{
	struct sigaction sa;
	uint8_t result[256];
	int ret;

	alarm(0);

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

	rtk_rom_ver_sig_alarm(0);

	while (1) {
		ret = read_hci_evt(fd, result, 0x0e);
		/* break down is not needed if read fails, because the program
		 * will exit when alarm timeout
		 */
		if (ret < 0)
			RS_ERR("%s: Read HCI event error.", __func__);
		else
			break;
	}

	/* Cancel pending alarm */
	alarm(0);

	if (ret != 8) {
		RS_ERR("%s: incorrect complete event, len %u", __func__, ret);
		exit(1);
	}

	if (result[6]) {
		RS_ERR("%s: status is %u", __func__, result[6]);
		rtk_hw_cfg.eversion = 0;
	} else
		rtk_hw_cfg.eversion = result[7];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movl %edi, -0x4(%rbp)
xorl %edi, %edi
callq 0x20f0
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x20d0
movl $0x1, -0x18(%rbp)
leaq 0x80a(%rip), %rax       # 0xa120
movq %rax, -0xa0(%rbp)
movl $0xe, %edi
leaq -0xa0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
xorl %edi, %edi
callq 0xa120
movl -0x4(%rbp), %edi
leaq -0x1a0(%rbp), %rsi
movl $0xe, %edx
callq 0x3f70
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
jge 0x9986
jmp 0x995e
movq 0x6693(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x34be(%rip), %rsi      # 0xce2d
leaq 0x1c13(%rip), %rdx      # 0xb589
leaq 0x3567(%rip), %rcx      # 0xcee4
movb $0x0, %al
callq 0x2150
jmp 0x9988
jmp 0x998a
jmp 0x9939
xorl %edi, %edi
callq 0x20f0
cmpl $0x8, -0x1a4(%rbp)
je 0x99d3
jmp 0x999c
movq 0x6655(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl -0x1a4(%rbp), %r8d
leaq 0x34b0(%rip), %rsi      # 0xce64
leaq 0x1bce(%rip), %rdx      # 0xb589
leaq 0x3522(%rip), %rcx      # 0xcee4
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
cmpb $0x0, -0x19a(%rbp)
je 0x9a15
jmp 0x99de
movq 0x6613(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl -0x19a(%rbp), %r8d
leaq 0x349d(%rip), %rsi      # 0xce94
leaq 0x1b8b(%rip), %rdx      # 0xb589
leaq 0x34df(%rip), %rcx      # 0xcee4
movb $0x0, %al
callq 0x2150
movb $0x0, 0x6cec(%rip)      # 0x106ff
jmp 0x9a21
movb -0x199(%rbp), %al
movb %al, 0x6cde(%rip)       # 0x106ff
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: uart_speed_to_rtk_speed
static inline void uart_speed_to_rtk_speed(int uart_speed, RT_U32 * rtk_speed)
{
	*rtk_speed = 0x701D;

	unsigned int i;
	for (i = 0; i < sizeof(baudrates) / sizeof(baudrate_ex); i++) {
		if (baudrates[i].uart_speed == uart_speed) {
			*rtk_speed = baudrates[i].rtk_speed;
			return;
		}
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x701d, (%rax)         # imm = 0x701D
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0xb, %rax
jae 0x9a8e
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x6b6f(%rip), %rax      # 0x105d0
movl 0x4(%rax,%rcx,8), %eax
cmpl -0x4(%rbp), %eax
jne 0x9a81
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x6b5a(%rip), %rax      # 0x105d0
movl (%rax,%rcx,8), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
jmp 0x9a90
jmp 0x9a83
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9a4c
jmp 0x9a90
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_speed_to_uart_speed
static void rtk_speed_to_uart_speed(RT_U32 rtk_speed, RT_U32 * uart_speed)
{
	*uart_speed = 115200;

	unsigned int i;
	for (i = 0; i < sizeof(baudrates) / sizeof(baudrate_ex); i++) {
		if (baudrates[i].rtk_speed == rtk_speed) {
			*uart_speed = baudrates[i].uart_speed;
			return;
		}
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x1c200, (%rax)        # imm = 0x1C200
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0xb, %rax
jae 0x9afe
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x6aff(%rip), %rax      # 0x105d0
movl (%rax,%rcx,8), %eax
cmpl -0x4(%rbp), %eax
jne 0x9af1
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x6aeb(%rip), %rax      # 0x105d0
movl 0x4(%rax,%rcx,8), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
jmp 0x9b00
jmp 0x9af3
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9abc
jmp 0x9b00
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl 0x2e1f(%rip), %eax      # 0xceb0
movl %eax, -0x8(%rbp)
movl 0x76fe(%rip), %eax      # 0x11798
cmpl 0x6588(%rip), %eax      # 0x10628
jge 0xa0d9
movl 0x76f0(%rip), %eax      # 0x11798
addl $0x1, %eax
movl %eax, 0x76e7(%rip)      # 0x11798
movl 0x6659(%rip), %edi      # 0x10710
leaq -0x8(%rbp), %rsi
movl $0x4, %edx
callq 0x2070
cmpq $0x0, %rax
jge 0xa0cd
jmp 0xa112
movl $0x1, %edi
callq 0x20f0
jmp 0xa112
movl 0x6631(%rip), %edi      # 0x10710
movl $0x2, %esi
callq 0x20a0
movq 0x5f08(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2dba(%rip), %rsi      # 0xceb4
leaq 0x1488(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl 0x2dc3(%rip), %eax      # 0xcef4
movl %eax, -0x8(%rbp)
movl 0x7662(%rip), %eax      # 0x1179c
cmpl 0x64e8(%rip), %eax      # 0x10628
jge 0xa179
movl 0x7654(%rip), %eax      # 0x1179c
addl $0x1, %eax
movl %eax, 0x764b(%rip)      # 0x1179c
movl 0x65b9(%rip), %edi      # 0x10710
leaq -0x8(%rbp), %rsi
movl $0x4, %edx
callq 0x2070
cmpq $0x0, %rax
jge 0xa16d
jmp 0xa1b2
movl $0x1, %edi
callq 0x20f0
jmp 0xa1b2
movl 0x6591(%rip), %edi      # 0x10710
movl $0x2, %esi
callq 0x20a0
movq 0x5e68(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2d5e(%rip), %rsi      # 0xcef8
leaq 0x13e8(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_tpatch_sig_alarm
static void h5_tpatch_sig_alarm(int sig)
{
	static int retries = 0;
	if (retries < rtk_hw_cfg.h5_max_retries) {
		RS_ERR("patch timerout, retry:\n");
		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 download patch re send:%d", retries);
		}
		retries++;
		alarm(3);
		return;
	}
	RS_ERR("H5 patch timed out\n");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl 0x70df(%rip), %eax      # 0x117a0
cmpl 0x6039(%rip), %eax      # 0x10700
jge 0xa76e
jmp 0xa6cf
movq 0x5922(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2b28(%rip), %rsi      # 0xd208
leaq 0xea2(%rip), %rdx       # 0xb589
movb $0x0, %al
callq 0x2150
cmpq $0x0, 0x5ffa(%rip)      # 0x106f0
je 0xa74f
movl 0x6012(%rip), %edi      # 0x10710
movq 0x5feb(%rip), %rsi      # 0x106f0
addq $0x8, %rsi
movq 0x5fe0(%rip), %rax      # 0x106f0
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x2070
movl %eax, -0x8(%rbp)
cmpb $0x0, 0x5bac(%rip)      # 0x102d0
je 0xa74b
movq 0x58cb(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0x706a(%rip), %ecx      # 0x117a0
leaq 0x2aee(%rip), %rsi      # 0xd22b
leaq 0xe45(%rip), %rdx       # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0xa74d
jmp 0xa74f
movl 0x704b(%rip), %eax      # 0x117a0
addl $0x1, %eax
movl %eax, 0x7042(%rip)      # 0x117a0
movl $0x3, %edi
callq 0x20f0
addq $0x10, %rsp
popq %rbp
retq
jmp 0xa770
movq 0x5881(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x2ad0(%rip), %rsi      # 0xd251
leaq 0xe01(%rip), %rdx       # 0xb589
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x4, -0x4(%rbp)
jge 0x11ad
movl $0x0, -0x8(%rbp)
cmpl $0x4, -0x8(%rbp)
jge 0x1194
movslq -0x4(%rbp), %rcx
leaq 0x2ec3(%rip), %rax      # 0x4030
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0xe82(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x115c
leaq 0xe79(%rip), %rdi       # 0x2014
movb $0x0, %al
callq 0x1030
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x114f
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x3, -0x4(%rbp)
jge 0x122d
movl $0x0, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x1214
movslq -0x4(%rbp), %rcx
leaq 0x2ea3(%rip), %rax      # 0x4090
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0xe02(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x11dc
leaq 0xdf9(%rip), %rdi       # 0x2014
movb $0x0, %al
callq 0x1030
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x11cf
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x133c
movl $0x0, -0xc(%rbp)
cmpl $0x3, -0xc(%rbp)
jge 0x132c
movl $0x0, -0x4(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1302
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x12f2
movslq -0x10(%rbp), %rcx
leaq 0x2d8b(%rip), %rax      # 0x4030
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $0x1, %ecx
subl -0x10(%rbp), %ecx
addl -0x8(%rbp), %ecx
movslq %ecx, %rdx
leaq 0x2da8(%rip), %rcx      # 0x4070
shlq $0x3, %rdx
addq %rdx, %rcx
movl $0x1, %edx
subl -0x14(%rbp), %edx
addl -0xc(%rbp), %edx
movslq %edx, %rdx
imull (%rcx,%rdx,4), %eax
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x128d
jmp 0x12f4
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x127a
movl -0x4(%rbp), %edx
movslq -0x8(%rbp), %rcx
leaq 0x2d80(%rip), %rax      # 0x4090
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1263
jmp 0x132e
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1252
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/xtanitfy[P]Murphy/test/test_conv.c
// Function: conv_fast
int conv_fast(void)
{
	int tmp = 0;
	int h = (4-2+1) * (4-2+1);
	int w = 2*2;
	int bigMartix[h][w];
	int linearK[w];
	
	for (int i = 0;i < 3;i++) {
		for (int j = 0;j < 3;j++) {
			tmp = 0;
			
			dst[i][j] = tmp;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl $0x9, -0x8(%rbp)
movl $0x4, -0xc(%rbp)
movl -0x8(%rbp), %eax
movl %eax, %ecx
movl -0xc(%rbp), %eax
movq %rsp, %rdx
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x13d0
movl $0x0, -0x38(%rbp)
cmpl $0x3, -0x38(%rbp)
jge 0x13c3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %edx
movslq -0x34(%rbp), %rcx
leaq 0x2ce6(%rip), %rax      # 0x4090
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x138f
jmp 0x13c5
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1382
movq -0x18(%rbp), %rax
movq %rax, %rsp
xorl %eax, %eax
movq %rbp, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
leaq 0xc12(%rip), %rdi       # 0x2008
movb $0x0, %al
callq 0x1030
callq 0x1140
callq 0x1240
leaq 0xc08(%rip), %rdi       # 0x2016
movb $0x0, %al
callq 0x1030
callq 0x11c0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x14(%rbp), %rdi
callq 0x1050
cmpl $-0x1, %eax
jne 0x1203
movl $0x1, %edi
leaq 0xe08(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1070
jmp 0x1205
jmp 0x1207
callq 0x10b0
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
jne 0x1227
movl $0x1, %edi
leaq 0xdee(%rip), %rsi       # 0x200e
movb $0x0, %al
callq 0x1070
jmp 0x1229
cmpl $0x0, -0x18(%rbp)
jne 0x1258
movl $0x5, %edi
callq 0x10a0
movq 0x2db8(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xdd1(%rip), %rsi       # 0x201b
movb $0x0, %al
callq 0x1060
xorl %edi, %edi
callq 0x1090
leaq -0x9f(%rip), %rax       # 0x11c0
movq %rax, -0xb0(%rbp)
movl $0x10000000, -0x28(%rbp) # imm = 0x10000000
movl $0x11, %edi
leaq -0xb0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1040
cmpl $-0x1, %eax
jne 0x129a
movl $0x1, %edi
leaq 0xd95(%rip), %rsi       # 0x2028
movb $0x0, %al
callq 0x1070
jmp 0x129c
movl -0x14(%rbp), %eax
movl %eax, -0xc(%rbp)
movw $0x1, -0x8(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1080
movl %eax, -0xb4(%rbp)
cmpl $-0x1, -0xb4(%rbp)
jne 0x12ec
callq 0x1030
cmpl $0x4, (%rax)
jne 0x12ec
movq 0x2d1d(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd61(%rip), %rsi       # 0x2046
movb $0x0, %al
callq 0x1060
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x2010
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %esi
leaq 0x2fd7(%rip), %rdi      # 0x71e0
addq $0x10, %rdi
callq 0x2010
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4570
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x4530
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
leaq 0xeae(%rip), %rax       # 0x2004
movq %rax, -0x10(%rbp)
leaq 0xea9(%rip), %rdi       # 0x200a
leaq 0xe9c(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1030
movq -0x10(%rbp), %rsi
leaq 0xea3(%rip), %rdi       # 0x201d
movb $0x0, %al
callq 0x1030
movq -0x10(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x10(%rbp), %rsi
leaq 0xe9e(%rip), %rdi       # 0x2032
movb $0x0, %al
callq 0x1030
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq