LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_reset_target_hw
void dap_reset_target_hw(int state)
{
  uint8_t buf[7];
  int value = state ? (DAP_SWJ_SWCLK_TCK | DAP_SWJ_SWDIO_TMS) : 0;

  //-------------
  buf[0] = ID_DAP_SWJ_PINS;
  buf[1] = value; // Value
  buf[2] = DAP_SWJ_nRESET | DAP_SWJ_SWCLK_TCK | DAP_SWJ_SWDIO_TMS; // Select
  buf[3] = 0; // Wait
  buf[4] = 0;
  buf[5] = 0;
  buf[6] = 0;
  dbg_dap_cmd(buf, sizeof(buf), 7);

  sleep_ms(10);

  //-------------
  buf[0] = ID_DAP_SWJ_PINS;
  buf[1] = DAP_SWJ_nRESET | value; // Value
  buf[2] = DAP_SWJ_nRESET | DAP_SWJ_SWCLK_TCK | DAP_SWJ_SWDIO_TMS; // Select
  buf[3] = 0; // Wait
  buf[4] = 0;
  buf[5] = 0;
  buf[6] = 0;
  dbg_dap_cmd(buf, sizeof(buf), 7);

  sleep_ms(10);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %eax, %eax
testl %edi, %edi
movb $0x10, %bpl
leaq 0x9(%rsp), %rbx
movb %bpl, (%rbx)
setne %al
leal (%rax,%rax,2), %r14d
movb %r14b, 0x1(%rbx)
movb $-0x7d, %r15b
movb %r15b, 0x2(%rbx)
xorl %r12d, %r12d
movl %r12d, 0x3(%rbx)
movq %rbx, %rdi
movl $0x7, %esi
movl $0x7, %edx
callq 0xf4a0
movl $0xa, %edi
callq 0x7d74
movb %bpl, (%rbx)
orb $-0x80, %r14b
movb %r14b, 0x1(%rbx)
movb %r15b, 0x2(%rbx)
movl %r12d, 0x3(%rbx)
movq %rbx, %rdi
movl $0x7, %esi
movl $0x7, %edx
callq 0xf4a0
movl $0xa, %edi
callq 0x7d74
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_reset_pin
void dap_reset_pin(int state)
{
  uint8_t buf[7];

  buf[0] = ID_DAP_SWJ_PINS;
  buf[1] = state ? DAP_SWJ_nRESET : 0; // Value
  buf[2] = DAP_SWJ_nRESET; // Select
  buf[3] = 0; // Wait
  buf[4] = 0;
  buf[5] = 0;
  buf[6] = 0;
  dbg_dap_cmd(buf, sizeof(buf), 7);
}

// Assembly:
pushq %rax
testl %edi, %edi
setne %al
leaq 0x1(%rsp), %rdi
movb $0x10, (%rdi)
shlb $0x7, %al
movb %al, 0x1(%rdi)
movb $-0x80, 0x2(%rdi)
movl $0x0, 0x3(%rdi)
movl $0x7, %esi
movl $0x7, %edx
callq 0xf4a0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_read_block
void dap_read_block(uint32_t addr, uint8_t *data, int size)
{
  uint32_t ptr = addr;
  uint32_t rem = size;
  int cnt = 0;

  if (size == 0)
    return;

  while (rem && (ptr % sizeof(uint32_t)))
  {
    dap_read_byte_req(ptr);
    ptr += sizeof(uint8_t);
    rem -= sizeof(uint8_t);
  }

  while (rem >= sizeof(uint32_t))
  {
    dap_read_word_req(ptr);
    ptr += sizeof(uint32_t);
    rem -= sizeof(uint32_t);
  }

  while (rem)
  {
    dap_read_byte_req(ptr);
    ptr += sizeof(uint8_t);
    rem -= sizeof(uint8_t);
  }

  dap_transfer();

  while (size && (addr % sizeof(uint32_t)))
  {
    *data = dap_response[cnt++];
    data += sizeof(uint8_t);
    addr += sizeof(uint8_t);
    size -= sizeof(uint8_t);
  }

  while (size >= (int)sizeof(uint32_t))
  {
    *(uint32_t *)data = dap_response[cnt++];
    data += sizeof(uint32_t);
    size -= sizeof(uint32_t);
  }

  while (size)
  {
    *data = dap_response[cnt++];
    data += sizeof(uint8_t);
    size -= sizeof(uint8_t);
  }
}

// Assembly:
testl %edx, %edx
je 0x73b5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %r15d
movl %edi, %ebp
movl %edx, %r12d
testb $0x3, %r15b
je 0x72a8
movl %r14d, %r12d
movl %r15d, %ebp
movl %r12d, %r13d
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x6a16
incl %ebp
leal -0x1(%r13), %r12d
cmpl $0x1, %r13d
je 0x72a8
movl %ebp, %eax
andl $0x3, %eax
jne 0x7285
cmpl $0x4, %r12d
jb 0x72cb
xorl %edi, %edi
movl $0x2, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x6a16
addl $0x4, %ebp
addl $-0x4, %r12d
cmpl $0x3, %r12d
ja 0x72ae
testl %r12d, %r12d
je 0x72e4
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x6a16
incl %ebp
decl %r12d
jne 0x72d0
callq 0x6a6f
testb $0x3, %r15b
je 0x7329
movl %r14d, %eax
decq %rax
incl %r15d
leaq 0x45701(%rip), %rcx     # 0x4ca00
xorl %r12d, %r12d
movq %r12, %rdx
incq %r12
movb (%rcx), %sil
movb %sil, (%rbx,%rdx)
cmpl %edx, %eax
je 0x7321
addl %r15d, %edx
andl $0x3, %edx
addq $0x4, %rcx
testl %edx, %edx
jne 0x7302
subl %r12d, %r14d
addq %r12, %rbx
jmp 0x732c
xorl %r12d, %r12d
cmpl $0x4, %r14d
jl 0x737b
movl %r12d, %eax
leaq 0x456c4(%rip), %rcx     # 0x4ca00
leaq (%rcx,%rax,4), %rsi
cmpl $0x7, %r14d
movl $0x7, %eax
cmovll %r14d, %eax
negl %eax
leal (%r14,%rax), %edx
addl $0x3, %edx
andl $-0x4, %edx
addq $0x4, %rdx
movq %rbx, %rdi
callq 0x6180
addq $0x4, %rbx
leal -0x4(%r14), %eax
incl %r12d
cmpl $0x7, %r14d
movl %eax, %r14d
jg 0x7365
jmp 0x737e
movl %r14d, %eax
testl %eax, %eax
je 0x73a7
movl %r12d, %ecx
shlq $0x2, %rcx
movl %eax, %eax
xorl %edx, %edx
leaq 0x4566c(%rip), %rsi     # 0x4ca00
leaq (%rcx,%rdx,4), %rdi
movb (%rsi,%rdi), %dil
movb %dil, (%rbx,%rdx)
incq %rdx
cmpl %edx, %eax
jne 0x7394
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_write_block
void dap_write_block(uint32_t addr, uint8_t *data, int size)
{
  if (size == 0)
    return;

  while (size && (addr % sizeof(uint32_t)))
  {
    dap_write_byte_req(addr, *data);
    data += sizeof(uint8_t);
    addr += sizeof(uint8_t);
    size -= sizeof(uint8_t);
  }

  while (size >= (int)sizeof(uint32_t))
  {
    dap_write_word_req(addr, *(uint32_t *)data);
    data += sizeof(uint32_t);
    addr += sizeof(uint32_t);
    size -= sizeof(uint32_t);
  }

  while (size)
  {
    dap_write_byte_req(addr, *data);
    data += sizeof(uint8_t);
    addr += sizeof(uint8_t);
    size -= sizeof(uint8_t);
  }

  dap_transfer();
}

// Assembly:
testl %edx, %edx
je 0x7429
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
testb $0x3, %bpl
je 0x73fa
movl %r14d, %r15d
movzbl (%rbx), %ecx
movl $0x1, %edi
xorl %esi, %esi
movl %ebp, %edx
callq 0x6a16
incq %rbx
incl %ebp
leal -0x1(%r15), %r14d
cmpl $0x1, %r15d
je 0x73fa
movl %ebp, %eax
andl $0x3, %eax
jne 0x73d0
cmpl $0x4, %r14d
jl 0x742a
movl (%rbx), %ecx
movl $0x1, %edi
movl $0x2, %esi
movl %ebp, %edx
callq 0x6a16
addq $0x4, %rbx
addl $0x4, %ebp
leal -0x4(%r14), %eax
cmpl $0x7, %r14d
movl %eax, %r14d
jg 0x7400
jmp 0x742d
retq
movl %r14d, %eax
testl %eax, %eax
je 0x7457
movl %eax, %r14d
movl %ebp, %r15d
xorl %r12d, %r12d
leal (%r15,%r12), %edx
movzbl (%rbx,%r12), %ecx
movl $0x1, %edi
xorl %esi, %esi
callq 0x6a16
incq %r12
cmpl %r12d, %r14d
jne 0x743a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6a6f
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_jtag_add_req
static void dap_jtag_add_req(int tdi, int tms, int tdo)
{
  dap_jtag_request_t req;
  req.tdi = tdi ? 1 : 0;
  req.opt = (tms ? JTAG_SEQUENCE_TMS : 0) | (tdo ? JTAG_SEQUENCE_TDO : 0);
  assert(dap_request_count < TRANSFER_SIZE);
  dap_jtag_request[dap_jtag_request_count++] = req;
}

// Assembly:
cmpl $0x4000, 0x14ce6(%rip)  # imm = 0x4000
jge 0x74a8
testl %edx, %edx
setne %al
testl %esi, %esi
setne %cl
shlb $0x6, %cl
shlb $0x7, %al
orb %cl, %al
movslq 0x55573(%rip), %rcx     # 0x5ca00
leal 0x1(%rcx), %edx
testl %edi, %edi
movl %edx, 0x55568(%rip)     # 0x5ca00
leaq 0x57581(%rip), %rdx     # 0x5ea20
movb %al, (%rdx,%rcx,2)
setne 0x1(%rdx,%rcx,2)
retq
pushq %rax
leaq 0x8dd7(%rip), %rdi      # 0x10287
leaq 0x8c89(%rip), %rsi      # 0x10140
leaq 0x8e1a(%rip), %rcx      # 0x102d8
movl $0x3f6, %edx            # imm = 0x3F6
callq 0x60d0
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_jtag_read
void dap_jtag_read(int offset, uint8_t *data, int size)
{
  dap_jtag_flush();

  for (int i = 0; i < size; i++)
  {
    int index = offset + i;
    int bit;

    assert(index < dap_jtag_response_count);

    bit = (dap_jtag_response_buf[index / 8] & (1 << (index % 8))) ? 1 : 0;

    if ((i % 8) == 0)
      data[i / 8] = 0;

    data[i / 8] |= (bit << (i % 8));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
callq 0x74cf
testl %ebx, %ebx
jle 0x77c9
movl 0x572aa(%rip), %eax     # 0x5ea10
cmpl %r15d, %eax
cmovlel %r15d, %eax
subl %r15d, %eax
xorl %edx, %edx
leaq 0x55297(%rip), %rsi     # 0x5ca10
cmpl %edx, %eax
je 0x77cf
movl %r15d, %ecx
addl %edx, %ecx
leal 0x7(%r15,%rdx), %edi
cmovnsl %ecx, %edi
sarl $0x3, %edi
movslq %edi, %rdi
movzbl (%rdi,%rsi), %r8d
andl $0x7, %ecx
xorl %edi, %edi
btl %ecx, %r8d
setb %r8b
movl %edx, %ecx
andl $0x7, %ecx
jne 0x77b5
movl %edx, %r9d
shrl $0x3, %r9d
movb $0x0, (%r14,%r9)
movb %r8b, %dil
shll %cl, %edi
movl %edx, %ecx
shrl $0x3, %ecx
orb %dil, (%r14,%rcx)
incl %edx
cmpl %edx, %ebx
jne 0x7779
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8a69(%rip), %rdi      # 0x1023f
leaq 0x8963(%rip), %rsi      # 0x10140
leaq 0x8a7b(%rip), %rcx      # 0x1025f
movl $0x467, %edx            # imm = 0x467
callq 0x60d0
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_jtag_write_ir
void dap_jtag_write_ir(int ir, int size)
{
  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 0);
  dap_jtag_clk(0, 0);

  for (int i = 0; i < size; i++)
    dap_jtag_clk((ir >> i) & 1, i == (size-1));

  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
testl %ebx, %ebx
jle 0x7895
negl %ebx
leal (%rbx,%r14), %eax
xorl %edi, %edi
btl %r14d, %ebp
setb %dil
xorl %esi, %esi
cmpl $-0x1, %eax
sete %sil
xorl %edx, %edx
callq 0x7468
incl %r14d
movl %ebx, %eax
addl %r14d, %eax
jne 0x786d
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x7468
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_jtag_write_dr
void dap_jtag_write_dr(uint8_t *data, int size)
{
  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 0);
  dap_jtag_clk(0, 0);

  for (int i = 0; i < size; i++)
    dap_jtag_clk((data[i / 8] >> (i % 8)) & 1, i == (size-1));

  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
testl %ebx, %ebx
jle 0x7921
negl %ebx
leal (%rbx,%r15), %eax
movl %r15d, %ecx
shrl $0x3, %ecx
movzbl (%r14,%rcx), %ecx
movl %r15d, %edx
andl $0x7, %edx
xorl %edi, %edi
btl %edx, %ecx
setb %dil
xorl %esi, %esi
cmpl $-0x1, %eax
sete %sil
xorl %edx, %edx
callq 0x7468
incl %r15d
movl %ebx, %eax
addl %r15d, %eax
jne 0x78e9
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x7468
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_jtag_read_dr
void dap_jtag_read_dr(uint8_t *data, int size)
{
  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 0);
  dap_jtag_clk(0, 0);

  for (int i = 0; i < size; i++)
    dap_jtag_clk_read(0, i == (size-1));

  dap_jtag_clk(0, 1);
  dap_jtag_clk(0, 0);

  dap_jtag_read(0, data, size);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
testl %ebx, %ebx
jle 0x798b
movl %ebx, %ebp
xorl %esi, %esi
cmpl $0x1, %ebp
sete %sil
xorl %edi, %edi
movl $0x1, %edx
callq 0x7468
decl %ebp
jne 0x7972
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
xorl %edi, %edi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x774a
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/dap.c
// Function: dap_jtag_scan_chain
int dap_jtag_scan_chain(uint32_t *idcode, int size)
{
  int count = 0;

  dap_jtag_reset();

  dap_jtag_clk(1, 1);
  dap_jtag_clk(1, 0);
  dap_jtag_clk(1, 0);

  for (int i = 0; i < size; i++)
  {
    for (int j = 0; j < 32; j++)
      dap_jtag_clk_read(0, 0);

    dap_jtag_read(0, (uint8_t *)&idcode[count], 32);

    if (idcode[count])
      count++;
    else
      break;
  }

  dap_jtag_clk(1, 1);
  dap_jtag_clk(1, 1);
  dap_jtag_clk(1, 0);

  return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x7806
xorl %ebx, %ebx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
testl %ebp, %ebp
jle 0x7a3a
movl %ebp, %r12d
xorl %ebx, %ebx
movl $0x20, %r15d
xorl %edi, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x7468
decl %r15d
jne 0x7a04
leaq (%r14,%rbx,4), %r15
xorl %edi, %edi
movq %r15, %rsi
movl $0x20, %edx
callq 0x774a
cmpl $0x0, (%r15)
je 0x7a3a
incq %rbx
cmpq %r12, %rbx
jne 0x79fe
movl %ebp, %ebx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7468
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7468
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: verbose
void verbose(char *fmt, ...)
{
  va_list args;

  if (g_verbose)
  {
    va_start(args, fmt);
    vprintf(fmt, args);
    va_end(args);

    fflush(stdout);
  }
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x7ad3
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpb $0x1, 0x76f56(%rip)     # 0x7ea30
jne 0x7b15
leaq 0x20(%rsp), %rax
movq %rsp, %rsi
movq %rax, 0x10(%rsi)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsi)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsi)
callq 0x61c0
movq 0x134b3(%rip), %rax     # 0x1afc0
movq (%rax), %rdi
callq 0x61b0
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: check
void check(bool cond, char *fmt, ...)
{
  if (cond)
    return;

  va_list args;

  va_start(args, fmt);
  fprintf(stderr, "Error: ");
  vfprintf(stderr, fmt, args);
  fprintf(stderr, "\n");
  va_end(args);

  exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x7c0f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testl %edi, %edi
je 0x7c20
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %r14
movq %rax, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r14)
movq 0x133a1(%rip), %r15     # 0x1aff0
movq (%r15), %rcx
leaq 0x8941(%rip), %rdi      # 0x1059a
movl $0x7, %esi
movl $0x1, %edx
callq 0x6280
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6230
movq (%r15), %rsi
movl $0xa, %edi
callq 0x6130
movl $0x1, %edi
callq 0x6270
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: error_exit
void error_exit(char *fmt, ...)
{
  va_list args;

  va_start(args, fmt);
  fprintf(stderr, "Error: ");
  vfprintf(stderr, fmt, args);
  fprintf(stderr, "\n");
  va_end(args);

  exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x7cf0
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0x132d9(%rip), %r15     # 0x1aff0
movq (%r15), %rcx
leaq 0x8879(%rip), %rdi      # 0x1059a
movl $0x7, %esi
movl $0x1, %edx
callq 0x6280
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6230
movq (%r15), %rsi
movl $0xa, %edi
callq 0x6130
movl $0x1, %edi
callq 0x6270
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: sleep_ms
void sleep_ms(int ms)
{
#ifdef _WIN32
  Sleep(ms);
#else
  struct timespec ts;

  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000;

  nanosleep(&ts, NULL);
#endif
}

// Assembly:
subq $0x18, %rsp
movslq %edi, %rax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movslq %ecx, %rcx
leaq 0x8(%rsp), %rdi
movq %rcx, (%rdi)
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
imull $0xf4240, %eax, %eax    # imm = 0xF4240
cltq
movq %rax, 0x8(%rdi)
xorl %esi, %esi
callq 0x60c0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: load_file
int load_file(char *name, uint8_t *data, int size)
{
  struct stat stat;
  int fd, rsize;

  check(NULL != name, "input file name is not specified");

  fd = open(name, O_RDONLY | O_BINARY);

  if (fd < 0)
    perror_exit("open()");

  fstat(fd, &stat);

  if (stat.st_size < size)
    size = stat.st_size;

  rsize = read(fd, data, size);

  if (rsize < 0)
    perror_exit("read()");

  check(rsize == size, "cannot fully read file");

  close(fd);

  return rsize;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x879f(%rip), %rsi      # 0x105b0
xorl %eax, %eax
callq 0x7bb4
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x6200
testl %eax, %eax
js 0x7e8b
movl %eax, %ebx
leaq 0x8(%rsp), %r15
movl %eax, %edi
movq %r15, %rsi
callq 0x62b0
movq 0x30(%r15), %rax
movslq %ebp, %r15
cmpq %r15, %rax
cmovll %eax, %r15d
movslq %r15d, %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x6140
movq %rax, %r14
testl %r14d, %r14d
js 0x7e90
xorl %edi, %edi
cmpl %r14d, %r15d
sete %dil
leaq 0x8773(%rip), %rsi      # 0x105df
xorl %eax, %eax
callq 0x7bb4
movl %ebx, %edi
callq 0x6120
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x63ca
callq 0x63b5
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: save_file
void save_file(char *name, uint8_t *data, int size)
{
  int fd, rsize;

  check(NULL != name, "output file name is not specified");

  fd = open(name, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0644);

  if (fd < 0)
    perror_exit("open()");

  rsize = write(fd, data, size);

  if (rsize < 0)
    perror_exit("write()");

  check(rsize == size, "error writing the file");

  close(fd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %edi, %edi
testq %r15, %r15
setne %dil
leaq 0x8742(%rip), %rsi      # 0x105f6
xorl %eax, %eax
callq 0x7bb4
movq %r15, %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x6200
testl %eax, %eax
js 0x7f0d
movl %eax, %ebp
movslq %ebx, %rdx
movl %eax, %edi
movq %r14, %rsi
callq 0x6060
testl %eax, %eax
js 0x7f12
xorl %edi, %edi
cmpl %ebx, %eax
sete %dil
leaq 0x8723(%rip), %rsi      # 0x10618
xorl %eax, %eax
callq 0x7bb4
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6120
callq 0x63f4
callq 0x63df
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/edbg.c
// Function: mem_find
uint8_t *mem_find(uint8_t *haystack, int haystack_size, uint8_t *needle, int needle_size)
{
  if (haystack_size == 0 || needle_size == 0 || haystack_size < needle_size)
    return NULL;

  for (int i = 0; i < (haystack_size - needle_size); i++)
  {
    if (memcmp(haystack + i, needle, needle_size) == 0)
      return haystack + i;
  }

  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %ebx, %ebx
cmpl %ecx, %esi
jl 0x7f63
testl %esi, %esi
je 0x7f63
testl %ecx, %ecx
je 0x7f63
subl %ecx, %esi
jle 0x7f5c
movq %rdx, %r14
movq %rdi, %r15
movslq %ecx, %r12
movl %esi, %r13d
xorl %ebx, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x61d0
testl %eax, %eax
je 0x7f60
incq %r15
decq %r13
jne 0x7f40
jmp 0x7f63
xorl %ebx, %ebx
jmp 0x7f63
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/utils.c
// Function: sha256
void sha256(uint8_t *data, int size, uint8_t *hash)
{
  uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 };
  uint64_t bit_size = size * 8;
  uint8_t buf[64];

  while (size >= 64)
  {
    sha256_process(H, data);
    data += 64;
    size -= 64;
  }

  memset(buf, 0, sizeof(buf));
  memcpy(buf, data, size);

  buf[size] = 0x80;

  if (size >= 56)
  {
    sha256_process(H, buf);
    memset(buf, 0, sizeof(buf));
  }

  buf[56] = bit_size >> 56;
  buf[57] = bit_size >> 48;
  buf[58] = bit_size >> 40;
  buf[59] = bit_size >> 32;
  buf[60] = bit_size >> 24;
  buf[61] = bit_size >> 16;
  buf[62] = bit_size >> 8;
  buf[63] = bit_size;

  sha256_process(H, buf);

  for (int i = 0; i < 8; i++)
  {
    hash[i*4+0] = H[i] >> 24;
    hash[i*4+1] = H[i] >> 16;
    hash[i*4+2] = H[i] >> 8;
    hash[i*4+3] = H[i];
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
movaps 0x8996(%rip), %xmm0     # 0x11390
movaps %xmm0, 0x10(%rsp)
movaps 0x897a(%rip), %xmm0     # 0x11380
movaps %xmm0, (%rsp)
leal (,%r14,8), %ebp
cmpl $0x40, %esi
jl 0x8a3b
movq %rsp, %r12
movl %r14d, %r13d
movq %r12, %rdi
movq %r15, %rsi
callq 0x8b0c
addq $0x40, %r15
leal -0x40(%r13), %eax
cmpl $0x7f, %r13d
movl %eax, %r13d
jg 0x8a1d
jmp 0x8a3e
movl %r14d, %eax
movslq %ebp, %r13
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movslq %eax, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x6180
movb $-0x80, 0x20(%rsp,%r12)
cmpl $0x38, %r12d
jl 0x8a98
movq %rsp, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x8b0c
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq %r13, %rax
shrq $0x38, %rax
leaq 0x20(%rsp), %rsi
movb %al, 0x38(%rsi)
movq %r13, %rax
shrq $0x30, %rax
movb %al, 0x39(%rsi)
movq %r13, %rax
shrq $0x28, %rax
movb %al, 0x3a(%rsi)
movl %r14d, %eax
sarl $0x1c, %eax
movb %al, 0x3b(%rsi)
movl %r14d, %eax
shrl $0x15, %eax
movb %al, 0x3c(%rsi)
movl %r14d, %eax
shrl $0xd, %eax
movb %al, 0x3d(%rsi)
shrl $0x5, %r14d
movb %r14b, 0x3e(%rsi)
movb %r13b, 0x3f(%rsi)
movq %rsp, %rdi
callq 0x8b0c
xorl %eax, %eax
movl (%rsp,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x8aec
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/utils.c
// Function: sha256_process
static void sha256_process(uint32_t *H, uint8_t *data)
{
  uint32_t W[64];
  uint32_t ah[8]; // Working variables 'a' to 'h'

  for (int t = 0; t < 16; t++)
    W[t] = (data[t*4] << 24) | (data[t*4+1] << 16) | (data[t*4+2] << 8) | (data[t*4+3]);

  for (int t = 16; t < 64; t++)
    W[t] = SL1(W[t-2]) + W[t-7] + SL0(W[t-15]) + W[t-16];

  for(int t = 0; t < 8; t++)
    ah[t] = H[t];

  for (int t = 0; t < 64; t++)
  {
    uint32_t T1 = ah[7] + SU1(ah[4]) + CH(ah[4], ah[5], ah[6]) + K[t] + W[t];
    uint32_t T2 = SU0(ah[0]) + MAJ(ah[0], ah[1], ah[2]);

    ah[7] = ah[6];
    ah[6] = ah[5];
    ah[5] = ah[4];
    ah[4] = ah[3] + T1;
    ah[3] = ah[2];
    ah[2] = ah[1];
    ah[1] = ah[0];
    ah[0] = T1 + T2;
  }

  for (int t = 0; t < 8; t++)
    H[t] += ah[t];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorl %eax, %eax
movl (%rsi,%rax,4), %ecx
bswapl %ecx
movl %ecx, -0x60(%rsp,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x8b1f
movl $0x10, %eax
movl -0x68(%rsp,%rax,4), %ecx
movl %ecx, %edx
roll $0xf, %edx
movl %ecx, %esi
roll $0xd, %esi
xorl %edx, %esi
shrl $0xa, %ecx
xorl %esi, %ecx
addl -0x7c(%rsp,%rax,4), %ecx
movl -0x9c(%rsp,%rax,4), %edx
movl %edx, %esi
roll $0x19, %esi
movl %edx, %r8d
roll $0xe, %r8d
xorl %esi, %r8d
shrl $0x3, %edx
xorl %r8d, %edx
addl -0xa0(%rsp,%rax,4), %ecx
addl %edx, %ecx
movl %ecx, -0x60(%rsp,%rax,4)
incq %rax
cmpq $0x40, %rax
jne 0x8b36
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movaps %xmm1, -0x70(%rsp)
movaps %xmm0, -0x80(%rsp)
movl -0x64(%rsp), %ebx
movl -0x70(%rsp), %ebp
movl -0x6c(%rsp), %eax
movl -0x68(%rsp), %ecx
movl -0x80(%rsp), %r9d
movl -0x7c(%rsp), %r10d
movl -0x78(%rsp), %edx
xorl %esi, %esi
movl -0x74(%rsp), %r14d
leaq 0x8be2(%rip), %r8       # 0x117a0
movl %ecx, %r11d
movl %eax, %ecx
movl %ebp, %eax
movl %r14d, %ebp
movl %eax, %r15d
roll $0x1a, %r15d
movl %edx, %r14d
movl %eax, %r12d
roll $0x15, %r12d
movl %r10d, %edx
movl %eax, %r13d
roll $0x7, %r13d
xorl %r15d, %r12d
xorl %r12d, %r13d
addl %ebx, %r13d
movl %ecx, %r10d
xorl %r11d, %r10d
andl %eax, %r10d
addl (%rsi,%r8), %r13d
xorl %r11d, %r10d
addl %r10d, %r13d
addl -0x60(%rsp,%rsi), %r13d
movl %r9d, %r10d
roll $0x1e, %r9d
movl %r10d, %ebx
roll $0x13, %ebx
xorl %r9d, %ebx
movl %r10d, %r15d
roll $0xa, %r15d
xorl %ebx, %r15d
movl %r14d, %ebx
xorl %edx, %ebx
andl %r10d, %ebx
movl %r14d, %r9d
andl %edx, %r9d
xorl %ebx, %r9d
addl %r15d, %r9d
addl %r13d, %ebp
addl %r13d, %r9d
addq $0x4, %rsi
movl %r11d, %ebx
cmpq $0x100, %rsi            # imm = 0x100
jne 0x8bbe
movl %r11d, -0x64(%rsp)
movl %ebp, -0x70(%rsp)
movl %eax, -0x6c(%rsp)
movl %ecx, -0x68(%rsp)
movl %r9d, -0x80(%rsp)
movl %r10d, -0x7c(%rsp)
movl %edx, -0x78(%rsp)
movl %r14d, -0x74(%rsp)
xorl %eax, %eax
movl -0x80(%rsp,%rax,4), %ecx
addl %ecx, (%rdi,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x8c72
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/utils.c
// Function: crc32
uint32_t crc32(uint8_t *data, int size)
{
  uint32_t crc = 0xffffffff;

  for (int i = 0; i < size; i++)
    crc = crc32_tab[(crc ^ data[i]) & 0xff] ^ (crc >> 8);

  return crc;
}

// Assembly:
testl %esi, %esi
jle 0x8cc3
movl %esi, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %edx, %edx
leaq 0x86f8(%rip), %rsi      # 0x113a0
movb (%rdi,%rdx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rsi,%r8,4), %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x8ca8
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target.c
// Function: target_list
void target_list(void)
{
  message("Supported device families:\n");

  for (int i = 0; i < ARRAY_SIZE(targets); i++)
  {
    char *family_name[MAX_FAMILIES];
    int family_count = 0;

    message("  %s:\n", targets[i].description);

    for (int j = 0; true; j++)
    {
      char *family = targets[i].ops->enumerate(j);
      bool match = false;

      if (NULL == family)
        break;

      for (int k = 0; k < family_count; k++)
      {
        if (0 == strcmp(family_name[k], family))
        {
          match = true;
          break;
        }
      }

      if (!match)
        family_name[family_count++] = family;

      check(family_count < MAX_FAMILIES, "internal: too many families in enumeration");
    }

    message("    ");

    for (int j = 0; j < family_count; j++)
      message("%s ", family_name[j]);

    message("\n\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
leaq 0x8bbc(%rip), %rdi      # 0x118a0
xorl %eax, %eax
callq 0x7b1d
xorl %eax, %eax
movq %rax, 0x8(%rsp)
leaq (%rax,%rax,2), %rax
leaq 0xf9a3(%rip), %rcx      # 0x186a0
movq 0x8(%rcx,%rax,8), %rsi
movq 0x10(%rcx,%rax,8), %r12
leaq 0x8bae(%rip), %rdi      # 0x118bc
xorl %eax, %eax
callq 0x7b1d
xorl %r14d, %r14d
xorl %ebp, %ebp
movl %ebp, %edi
callq *0x50(%r12)
movq %rax, %rbx
testq %rax, %rax
je 0x8d70
testl %r14d, %r14d
jle 0x8d4d
movl %r14d, %r15d
xorl %r13d, %r13d
movq 0x10(%rsp,%r13,8), %rdi
movq %rbx, %rsi
callq 0x6170
testl %eax, %eax
je 0x8d58
incq %r13
cmpq %r13, %r15
jne 0x8d34
movslq %r14d, %rax
incl %r14d
movq %rbx, 0x10(%rsp,%rax,8)
xorl %edi, %edi
cmpl $0x64, %r14d
setl %dil
leaq 0x8b5a(%rip), %rsi      # 0x118c3
xorl %eax, %eax
callq 0x7bb4
incl %ebp
testq %rbx, %rbx
jne 0x8d1a
leaq 0x8b70(%rip), %rdi      # 0x118ee
xorl %eax, %eax
callq 0x7b1d
testl %r14d, %r14d
leaq 0x8b64(%rip), %r15      # 0x118f3
jle 0x8dae
movl %r14d, %ebx
xorl %r14d, %r14d
movq 0x10(%rsp,%r14,8), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x7b1d
incq %r14
cmpq %r14, %rbx
jne 0x8d97
leaq 0x7b36(%rip), %rdi      # 0x108eb
xorl %eax, %eax
callq 0x7b1d
movq 0x8(%rsp), %rax
incq %rax
cmpq $0xd, %rax
jne 0x8ced
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target.c
// Function: target_get_ops
target_ops_t *target_get_ops(const char *name)
{
  for (int i = 0; i < ARRAY_SIZE(targets); i++)
  {
    for (int j = 0; true; j++)
    {
      char *family = targets[i].ops->enumerate(j);

      if (NULL == family)
        break;

      if (0 == strcmp(family, name))
        return targets[i].ops;
    }
  }

  // Note: This is deprecated and will be removed in future versions
  for (int i = 0; i < ARRAY_SIZE(targets); i++)
  {
    if (NULL != targets[i].name && 0 == strcmp(targets[i].name, name))
    {
      warning("specifying '%s' as a target name is deprecated; see '-t list' for a list of supported targets", name);
      return targets[i].ops;
    }
  }

  error_exit("unknown target type '%s'; see '-t list' for a list of supported targets", name);

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r13d, %r13d
movq $0x0, (%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
leaq 0xf895(%rip), %rcx      # 0x186a0
movq 0x10(%rcx,%rax,8), %r12
xorl %ebp, %ebp
movl %ebp, %edi
callq *0x50(%r12)
movq %rax, %r15
testq %rax, %rax
je 0x8e37
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6170
testl %eax, %eax
setne %al
cmoveq %r12, %r14
jmp 0x8e39
xorl %eax, %eax
incl %ebp
testb %al, %al
jne 0x8e12
testq %r15, %r15
jne 0x8e5c
cmpq $0xc, %r13
leaq 0x1(%r13), %rax
setae %cl
movq %rcx, (%rsp)
movq %rax, %r13
cmpq $0xd, %rax
jne 0x8df9
testb $0x1, (%rsp)
je 0x8ecd
leaq 0xf847(%rip), %r15      # 0x186b0
xorl %r13d, %r13d
xorl %r12d, %r12d
movq -0x10(%r15), %rdi
testq %rdi, %rdi
je 0x8e84
movq %rbx, %rsi
callq 0x6170
testl %eax, %eax
je 0x8e9f
cmpq $0xc, %r13
leaq 0x1(%r13), %rax
setae %r12b
addq $0x18, %r15
movq %rax, %r13
cmpq $0xd, %rax
jne 0x8e6f
jmp 0x8eb3
leaq 0x8a51(%rip), %rdi      # 0x118f7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x62f0
movq (%r15), %r14
testb $0x1, %r12b
je 0x8ecd
leaq 0x8a95(%rip), %rdi      # 0x11955
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x7c8d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target.c
// Function: target_check_options
void target_check_options(target_options_t *options, int size, int align)
{
  options->file_data = NULL;
  options->file_size = 0;

  if (-1 == options->offset)
    options->offset = 0;

  if (-1 == options->size)
    options->size = size - options->offset;

  if (0 != (options->offset % align))
    error_exit("offset must be a multiple of %d for the selected target", align);

  if (0 != (options->size % align))
    error_exit("size must be a multiple of %d for the selected target", align);

  check(options->size <= size, "size is too big for the selected target");
  check(options->offset < size, "offset is too big for the selected target");

  if (options->program || options->verify)
  {
    options->file_data = buf_alloc(options->size);
    options->file_size = load_file(options->name, options->file_data, options->size);
    memset(&options->file_data[options->file_size], 0xff, options->size - options->file_size);

    check((options->file_size + options->offset) <= size, "file is too big for the selected target");
  }
  else if (options->read)
  {
    options->file_data = buf_alloc(options->size);
    options->file_size = options->size;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq $0x0, 0x30(%rdi)
movl $0x0, 0x28(%rdi)
cmpl $-0x1, 0x18(%rdi)
jne 0x8f07
movl $0x0, 0x18(%rbx)
cmpl $-0x1, 0x1c(%rbx)
jne 0x8f15
movl %ebp, %eax
subl 0x18(%rbx), %eax
movl %eax, 0x1c(%rbx)
movl 0x18(%rbx), %eax
cltd
idivl %r14d
testl %edx, %edx
je 0x8f31
leaq 0x8a76(%rip), %rdi      # 0x1199d
movl %r14d, %esi
xorl %eax, %eax
callq 0x7c8d
movl 0x1c(%rbx), %eax
cltd
idivl %r14d
testl %edx, %edx
je 0x8f4d
leaq 0x8a92(%rip), %rdi      # 0x119d5
movl %r14d, %esi
xorl %eax, %eax
callq 0x7c8d
xorl %edi, %edi
cmpl %ebp, 0x1c(%rbx)
setle %dil
leaq 0x8aae(%rip), %rsi      # 0x11a0b
xorl %eax, %eax
callq 0x7bb4
xorl %edi, %edi
cmpl %ebp, 0x18(%rbx)
setl %dil
leaq 0x8abf(%rip), %rsi      # 0x11a33
xorl %eax, %eax
callq 0x7bb4
cmpb $0x0, 0x5(%rbx)
jne 0x8f87
cmpb $0x1, 0x6(%rbx)
jne 0x8fdf
movl 0x1c(%rbx), %edi
callq 0x7dba
movq %rax, 0x30(%rbx)
movq 0x10(%rbx), %rdi
movl 0x1c(%rbx), %edx
movq %rax, %rsi
callq 0x7dec
movl %eax, 0x28(%rbx)
cltq
movq 0x30(%rbx), %rdi
addq %rax, %rdi
movslq 0x1c(%rbx), %rdx
subq %rax, %rdx
movl $0xff, %esi
callq 0x60e0
movl 0x18(%rbx), %eax
addl 0x28(%rbx), %eax
xorl %edi, %edi
cmpl %ebp, %eax
setle %dil
leaq 0x8a89(%rip), %rsi      # 0x11a5d
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x7bb4
cmpb $0x1, 0x9(%rbx)
jne 0x8ff7
movl 0x1c(%rbx), %edi
callq 0x7dba
movq %rax, 0x30(%rbx)
movl 0x1c(%rbx), %eax
movl %eax, 0x28(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: target_select
static void target_select(target_options_t *options)
{
  uint32_t dsu_did, id, rev;
  bool locked;

  reset_with_extension();

  dsu_did = dap_read_word(DSU_DID);
  id = dsu_did & DEVICE_ID_MASK;
  rev = (dsu_did >> DEVICE_REV_SHIFT) & DEVICE_REV_MASK;

  for (int i = 0; i < ARRAY_SIZE(devices); i++)
  {
    if (devices[i].dsu_did != id)
      continue;

    verbose("Target: %s (Rev %c)\n", devices[i].name, 'A' + rev);

    target_device = devices[i];
    target_options = *options;

    target_check_options(&target_options, devices[i].flash_size, FLASH_ROW_SIZE);

    locked = dap_read_byte(DSU_STATUSB) & DSU_STATUSB_PROT;

    if (locked && !options->unlock)
      error_exit("target is locked, unlock is necessary");

    if (!locked)
      finish_reset();

    return;
  }

  error_exit("unknown target device (DSU_DID = 0x%08x)", dsu_did);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x6fe8
movl $0xa, %edi
callq 0x7d74
callq 0x6789
movl $0x41002118, %edi       # imm = 0x41002118
callq 0x71ef
movl %eax, %ecx
andl $0xfffff0ff, %ecx       # imm = 0xFFFFF0FF
movl %eax, %edx
shrl $0x8, %edx
andl $0xf, %edx
leaq 0xf092(%rip), %r15      # 0x187e0
cmpl %ecx, (%r14,%r15)
je 0x9776
addq $0x20, %r14
cmpq $0x1140, %r14           # imm = 0x1140
jne 0x974e
leaq 0x88f9(%rip), %rdi      # 0x12061
movl %eax, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x7c8d
movq 0x10(%r14,%r15), %rsi
addl $0x41, %edx
leaq 0x88a1(%rip), %rdi      # 0x12026
xorl %eax, %eax
callq 0x7a78
movups (%r14,%r15), %xmm0
movups 0x10(%r14,%r15), %xmm1
movups %xmm1, 0x752ba(%rip)    # 0x7ea58
movups %xmm0, 0x752a3(%rip)    # 0x7ea48
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm0, 0x752b1(%rip)    # 0x7ea68
movups %xmm1, 0x752ba(%rip)    # 0x7ea78
movups %xmm2, 0x752c3(%rip)    # 0x7ea88
movq 0x30(%rbx), %rax
movq %rax, 0x752c8(%rip)     # 0x7ea98
leaq 0x75291(%rip), %rdi     # 0x7ea68
movl 0x18(%r14,%r15), %esi
movl $0x100, %edx            # imm = 0x100
callq 0x8edf
movl $0x41002102, %edi       # imm = 0x41002102
callq 0x71b5
testb $0x1, %al
jne 0x97fe
popq %rbx
popq %r14
popq %r15
jmp 0x9bb7
cmpb $0x0, 0x8(%rbx)
je 0x980a
popq %rbx
popq %r14
popq %r15
retq
leaq 0x882a(%rip), %rdi      # 0x1203b
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x7c8d
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: target_erase
static void target_erase(void)
{
  dap_write_byte(DSU_STATUSA, DSU_STATUSA_DONE);
  dap_write_byte(DSU_CTRL, DSU_CTRL_CE);
  sleep_ms(100);
  while (0 == (dap_read_byte(DSU_STATUSA) & DSU_STATUSA_DONE));

  reset_with_extension();
  finish_reset();
}

// Assembly:
pushq %rax
movl $0x41002101, %edi       # imm = 0x41002101
movl $0x1, %esi
callq 0x720d
movl $0x41002100, %edi       # imm = 0x41002100
movl $0x10, %esi
callq 0x720d
movl $0x64, %edi
callq 0x7d74
movl $0x41002101, %edi       # imm = 0x41002101
callq 0x71b5
testb $0x1, %al
je 0x986f
xorl %edi, %edi
callq 0x6fe8
movl $0xa, %edi
callq 0x7d74
callq 0x6789
popq %rax
jmp 0x9bb7
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: target_program
static void target_program(void)
{
  uint32_t addr = FLASH_ADDR + target_options.offset;
  uint32_t offs = 0;
  uint32_t number_of_rows;
  uint8_t *buf = target_options.file_data;
  uint32_t size = target_options.file_size;

  number_of_rows = (size + FLASH_ROW_SIZE - 1) / FLASH_ROW_SIZE;

  dap_write_word(NVMCTRL_CTRLB, 0); // Enable automatic write

  for (uint32_t row = 0; row < number_of_rows; row++)
  {
    dap_write_word(NVMCTRL_ADDR, addr >> 1);

    dap_write_half(NVMCTRL_CTRLA, NVMCTRL_CMD_UR); // Unlock Region
    while (0 == (dap_read_byte(NVMCTRL_INTFLAG) & NVMCTRL_INTFLAG_READY));

    dap_write_half(NVMCTRL_CTRLA, NVMCTRL_CMD_ER); // Erase Row
    while (0 == (dap_read_byte(NVMCTRL_INTFLAG) & NVMCTRL_INTFLAG_READY));

    dap_write_block(addr, &buf[offs], FLASH_ROW_SIZE);

    addr += FLASH_ROW_SIZE;
    offs += FLASH_ROW_SIZE;

    if (0 == (row % STATUS_INTERVAL))
      verbose(".");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x751c7(%rip), %ebx     # 0x7ea80
movq 0x751d8(%rip), %r15     # 0x7ea98
movl $0xff, %ebp
addl 0x751c5(%rip), %ebp     # 0x7ea90
movl $0x41004004, %edi       # imm = 0x41004004
xorl %esi, %esi
callq 0x723e
cmpl $0x100, %ebp            # imm = 0x100
jb 0x9970
shrl $0x8, %ebp
leaq 0x6f32(%rip), %r14      # 0x1081f
xorl %r12d, %r12d
xorl %r13d, %r13d
movl %ebx, %esi
shrl %esi
movl $0x4100401c, %edi       # imm = 0x4100401C
callq 0x723e
movl $0x41004000, %edi       # imm = 0x41004000
movl $0xa541, %esi           # imm = 0xA541
callq 0x7224
movl $0x41004014, %edi       # imm = 0x41004014
callq 0x71b5
testb $0x1, %al
je 0x9910
movl $0x41004000, %edi       # imm = 0x41004000
movl $0xa502, %esi           # imm = 0xA502
callq 0x7224
movl $0x41004014, %edi       # imm = 0x41004014
callq 0x71b5
testb $0x1, %al
je 0x992d
leaq (%r15,%r12), %rsi
movl %ebx, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x73b6
testb $0x1f, %r13b
jne 0x995b
movq %r14, %rdi
xorl %eax, %eax
callq 0x7a78
addl $0x100, %ebx            # imm = 0x100
addq $0x100, %r12            # imm = 0x100
incl %r13d
cmpl %ebp, %r13d
jne 0x98f3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: target_verify
static void target_verify(void)
{
  uint32_t addr = FLASH_ADDR + target_options.offset;
  uint32_t block_size;
  uint32_t offs = 0;
  uint8_t *bufb;
  uint8_t *bufa = target_options.file_data;
  uint32_t size = target_options.file_size;
  int row = 0;

  bufb = buf_alloc(FLASH_ROW_SIZE);

  while (size)
  {
    dap_read_block(addr, bufb, FLASH_ROW_SIZE);

    block_size = (size > FLASH_ROW_SIZE) ? FLASH_ROW_SIZE : size;

    for (int i = 0; i < (int)block_size; i++)
    {
      if (bufa[offs + i] != bufb[i])
      {
        verbose("\nat address 0x%x expected 0x%02x, read 0x%02x\n",
            addr + i, bufa[offs + i], bufb[i]);
        buf_free(bufb);
        error_exit("verification failed");
      }
    }

    addr += FLASH_ROW_SIZE;
    offs += FLASH_ROW_SIZE;
    size -= block_size;

    if (0 == (row++ % STATUS_INTERVAL))
      verbose(".");
  }

  buf_free(bufb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x750ed(%rip), %ebx     # 0x7ea80
movq 0x750fe(%rip), %rax     # 0x7ea98
movq %rax, 0x10(%rsp)
movl 0x750eb(%rip), %ebp     # 0x7ea90
movl $0x100, %edi            # imm = 0x100
callq 0x7dba
movq %rax, %r14
testl %ebp, %ebp
je 0x9a77
leaq 0xa0b7(%rip), %r13      # 0x13a78
xorl %r15d, %r15d
xorl %eax, %eax
movl %r15d, 0x8(%rsp)
movl %eax, 0x4(%rsp)
movl %eax, %r12d
addq 0x10(%rsp), %r12
movl %ebx, %edi
movq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x7258
movl $0x100, %eax            # imm = 0x100
cmpl %eax, %ebp
movl %ebp, 0xc(%rsp)
cmovbl %ebp, %eax
cmpl $0x1, %eax
movl %eax, (%rsp)
movl %eax, %r15d
adcl $0x0, %r15d
xorl %ebp, %ebp
movzbl (%r12,%rbp), %edx
movzbl (%r14,%rbp), %ecx
cmpb %cl, %dl
je 0x9a34
leal (%rbx,%rbp), %esi
leaq 0x8df2(%rip), %rdi      # 0x1280d
xorl %eax, %eax
callq 0x7a78
movq %r14, %rdi
callq 0x7de7
movq %r13, %rdi
xorl %eax, %eax
callq 0x7c8d
incq %rbp
cmpq %rbp, %r15
jne 0x9a03
movl 0x8(%rsp), %r15d
testb $0x1f, %r15b
jne 0x9a55
leaq 0x6dd1(%rip), %rdi      # 0x1081f
xorl %eax, %eax
callq 0x7a78
addq $0x100, %rbx            # imm = 0x100
movl 0x4(%rsp), %eax
addl $0x100, %eax            # imm = 0x100
movl 0xc(%rsp), %ebp
subl (%rsp), %ebp
incl %r15d
testl %ebp, %ebp
jne 0x99c6
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7de7
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: target_read
static void target_read(void)
{
  uint32_t addr = FLASH_ADDR + target_options.offset;
  uint32_t offs = 0;
  uint8_t *buf = target_options.file_data;
  uint32_t size = target_options.size;
  int row = 0;

  while (size)
  {
    dap_read_block(addr, &buf[offs], FLASH_ROW_SIZE);

    addr += FLASH_ROW_SIZE;
    offs += FLASH_ROW_SIZE;
    size -= FLASH_ROW_SIZE;

    if (0 == (row++ % STATUS_INTERVAL))
      verbose(".");
  }

  save_file(target_options.name, buf, target_options.size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x74ff9(%rip), %rbx     # 0x7ea98
movl 0x74fdf(%rip), %ebp     # 0x7ea84
testl %ebp, %ebp
je 0x9af0
movl 0x74fd0(%rip), %r15d    # 0x7ea80
leaq 0x6d68(%rip), %r14      # 0x1081f
xorl %r12d, %r12d
xorl %r13d, %r13d
leal (%r15,%r13), %edi
movl %r13d, %esi
addq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x7258
testb $0x1f, %r12b
jne 0x9ae1
movq %r14, %rdi
xorl %eax, %eax
callq 0x7a78
addl $0x100, %r13d           # imm = 0x100
incl %r12d
cmpl %r13d, %ebp
jne 0x9abd
movq 0x74f81(%rip), %rdi     # 0x7ea78
movl 0x74f87(%rip), %edx     # 0x7ea84
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7e95
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: target_fuse_write
static void target_fuse_write(int section, uint8_t *data)
{
  check(0 == section, "internal: incorrect section index in target_fuse_write()");

  dap_write_word(NVMCTRL_CTRLB, 0);
  dap_write_word(NVMCTRL_ADDR, USER_ROW_ADDR >> 1);
  dap_write_half(NVMCTRL_CTRLA, NVMCTRL_CMD_EAR);
  while (0 == (dap_read_byte(NVMCTRL_INTFLAG) & NVMCTRL_INTFLAG_READY));

  dap_write_block(USER_ROW_ADDR, data, USER_ROW_SIZE);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
xorl %eax, %eax
testl %edi, %edi
sete %al
leaq 0x8cf8(%rip), %rsi      # 0x1283c
movl %eax, %edi
xorl %eax, %eax
callq 0x7bb4
movl $0x41004004, %edi       # imm = 0x41004004
xorl %esi, %esi
callq 0x723e
movl $0x4100401c, %edi       # imm = 0x4100401C
movl $0x402000, %esi         # imm = 0x402000
callq 0x723e
movl $0x41004000, %edi       # imm = 0x41004000
movl $0xa505, %esi           # imm = 0xA505
callq 0x7224
movl $0x41004014, %edi       # imm = 0x41004014
callq 0x71b5
testb $0x1, %al
je 0x9b77
movl $0x804000, %edi         # imm = 0x804000
movq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
popq %rbx
jmp 0x73b6
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm0p.c
// Function: finish_reset
static void finish_reset(void)
{
  // Stop the core
  dap_write_word(DHCSR, DHCSR_DBGKEY | DHCSR_DEBUGEN | DHCSR_HALT);
  dap_write_word(DEMCR, DEMCR_VC_CORERESET);
  dap_write_word(AIRCR, AIRCR_VECTKEY | AIRCR_SYSRESETREQ);

  // Release the reset
  dap_write_byte(DSU_STATUSA, DSU_STATUSA_CRSTEXT);
}

// Assembly:
pushq %rax
movl $0xe000edf0, %edi       # imm = 0xE000EDF0
movl $0xa05f0003, %esi       # imm = 0xA05F0003
callq 0x723e
movl $0xe000edfc, %edi       # imm = 0xE000EDFC
movl $0x1, %esi
callq 0x723e
movl $0xe000ed0c, %edi       # imm = 0xE000ED0C
movl $0x5fa0004, %esi        # imm = 0x5FA0004
callq 0x723e
movl $0x41002101, %edi       # imm = 0x41002101
movl $0x2, %esi
popq %rax
jmp 0x720d
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm3.c
// Function: target_erase
static void target_erase(void)
{
  for (int i = 0; i < target_device.n_planes; i++)
    dap_write_word(EEFC_FCR(target_device.plane[i].eefc_base), CMD_EA);

  for (int i = 0; i < target_device.n_planes; i++)
    while (0 == (dap_read_word(EEFC_FSR(target_device.plane[i].eefc_base)) & FSR_FRDY));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x74c24(%rip)     # 0x7eabc
jle 0x9ec6
leaq 0x74c1f(%rip), %rbx     # 0x7eac0
xorl %r14d, %r14d
movl (%rbx), %edi
addl $0x4, %edi
movl $0x5a000005, %esi       # imm = 0x5A000005
callq 0x723e
incq %r14
movslq 0x74bff(%rip), %rax     # 0x7eabc
addq $0xc, %rbx
cmpq %rax, %r14
jl 0x9ea4
cmpl $0x0, 0x74bef(%rip)     # 0x7eabc
jle 0x9f02
xorl %ebx, %ebx
leaq 0x74bc8(%rip), %r14     # 0x7eaa0
leaq (%rbx,%rbx,2), %rax
leaq (%r14,%rax,4), %r15
addq $0x20, %r15
movl (%r15), %edi
addl $0x8, %edi
callq 0x71ef
testb $0x1, %al
je 0x9ee4
incq %rbx
movslq 0x74bbf(%rip), %rax     # 0x7eabc
cmpq %rax, %rbx
jl 0x9ed8
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ataradov[P]edbg/target_atmel_cm3.c
// Function: target_program
static void target_program(void)
{
  uint32_t addr = target_options.offset;
  uint32_t number_of_pages, eefc_base;
  uint32_t offs = 0;
  uint8_t *buf = target_options.file_data;
  uint32_t size = target_options.file_size;

  number_of_pages = (size + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE;

  for (uint32_t page = 0; page < number_of_pages; page++)
  {
    eefc_base = get_eefc_base(addr);

    dap_write_block(get_flash_addr(addr), &buf[offs], FLASH_PAGE_SIZE);

    dap_write_word(EEFC_FCR(eefc_base), CMD_EWP | (page << 8));
    while (0 == (dap_read_word(EEFC_FSR(eefc_base)) & FSR_FRDY));

    addr += FLASH_PAGE_SIZE;
    offs += FLASH_PAGE_SIZE;

    verbose(".");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xff, %ebp
addl 0x74ba1(%rip), %ebp     # 0x7eb00
cmpl $0x100, %ebp            # imm = 0x100
jb 0x9fe6
movq 0x74b9a(%rip), %r12     # 0x7eb08
shrl $0x8, %ebp
movl 0x74b79(%rip), %ebx     # 0x7eaf0
xorl %r13d, %r13d
xorl %r14d, %r14d
movl %ebx, %edi
callq 0xa233
movl %eax, %r15d
movl %ebx, %edi
callq 0xa2af
leaq (%r12,%r13), %rsi
movl %eax, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x73b6
leal 0x4(%r15), %edi
movl %r14d, %esi
shll $0x8, %esi
orl $0x5a000003, %esi       # imm = 0x5A000003
callq 0x723e
addl $0x8, %r15d
movl %r15d, %edi
callq 0x71ef
testb $0x1, %al
je 0x9fb7
addl $0x100, %ebx            # imm = 0x100
addq $0x100, %r13            # imm = 0x100
leaq 0x6848(%rip), %rdi      # 0x1081f
xorl %eax, %eax
callq 0x7a78
incl %r14d
cmpl %ebp, %r14d
jne 0x9f7d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq