LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/dap.c
// Function: dap_read_idcode
uint32_t dap_read_idcode(void)
{
  if (DAP_INTERFACE_SWD == dap_interface)
  {
    dap_read_idcode_req();
    dap_transfer();
    return dap_response[0];
  }
  else if (DAP_INTERFACE_JTAG == dap_interface)
  {
    uint8_t buf[16];

    buf[0] = ID_DAP_JTAG_IDCODE;
    buf[1] = dap_jtag_index;

    dbg_dap_cmd(buf, sizeof(buf), 2);
    check(DAP_OK == buf[0], "JTAG_IDCODE failed");

    return *((uint32_t *)&buf[1]);
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x1, %eax
cmpl 0x18d9d(%rip), %eax     # 0x1f8b0
jne 0x6b2a
callq 0x70f0
callq 0x6c70
movl 0x4963b(%rip), %eax     # 0x50160
movl %eax, -0x4(%rbp)
jmp 0x6b87
movl $0x2, %eax
cmpl 0x18d7b(%rip), %eax     # 0x1f8b0
jne 0x6b7e
movb $0x16, -0x20(%rbp)
movl 0x18d73(%rip), %eax     # 0x1f8b4
movb %al, -0x1f(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x10, %esi
movl $0x2, %edx
callq 0x130d0
movzbl -0x20(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
sete %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xd68c(%rip), %rsi      # 0x141fb
xorl %eax, %eax
callq 0x8880
movl -0x1f(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b87
jmp 0x6b80
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/dap.c
// Function: dap_parity
static uint32_t dap_parity(uint32_t value)
{
  value ^= value >> 16;
  value ^= value >> 8;
  value ^= value >> 4;
  value &= 0x0f;

  return (0x6996 >> value) & 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0x8, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0x4, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %ecx
movl $0x6996, %eax           # imm = 0x6996
sarl %cl, %eax
andl $0x1, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/dap.c
// Function: dap_add_req
static void dap_add_req(int type, int size, uint32_t addr, uint32_t data)
{
  dap_request_t req;
  req.type = type;
  req.size = size;
  req.addr = addr;
  req.data = data;
  assert(dap_request_count < TRANSFER_SIZE);
  dap_request[dap_request_count++] = req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl -0x4(%rbp), %eax
movb %al, -0x1c(%rbp)
movl -0x8(%rbp), %eax
movb %al, -0x1b(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x4000, 0x18ca2(%rip)  # imm = 0x4000
jge 0x6c1a
jmp 0x6c39
leaq 0xd64a(%rip), %rdi      # 0x1426b
leaq 0xd4fc(%rip), %rsi      # 0x14124
movl $0x250, %edx            # imm = 0x250
leaq 0xd659(%rip), %rcx      # 0x1428d
callq 0x60e0
movl 0x18c79(%rip), %eax     # 0x1f8b8
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x18c6e(%rip)     # 0x1f8b8
movslq %eax, %rcx
leaq 0x18c6c(%rip), %rax     # 0x1f8c0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x1c(%rbp), %rcx
movq %rcx, (%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edx
xorl %eax, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x10(%rbp)
movb $0x10, -0xb(%rbp)
movl -0x10(%rbp), %eax
movb %al, -0xa(%rbp)
movb $-0x7d, -0x9(%rbp)
movb $0x0, -0x8(%rbp)
movb $0x0, -0x7(%rbp)
movb $0x0, -0x6(%rbp)
movb $0x0, -0x5(%rbp)
leaq -0xb(%rbp), %rdi
movl $0x7, %edx
movl %edx, %esi
callq 0x130d0
movl $0xa, %edi
callq 0x8a90
movb $0x10, -0xb(%rbp)
movl -0x10(%rbp), %eax
orl $0x80, %eax
movb %al, -0xa(%rbp)
movb $-0x7d, -0x9(%rbp)
movb $0x0, -0x8(%rbp)
movb $0x0, -0x7(%rbp)
movb $0x0, -0x6(%rbp)
movb $0x0, -0x5(%rbp)
leaq -0xb(%rbp), %rdi
movl $0x7, %edx
movl %edx, %esi
callq 0x130d0
movl $0xa, %edi
callq 0x8a90
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movb $0x10, -0xb(%rbp)
movl -0x4(%rbp), %edx
xorl %eax, %eax
movl $0x80, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0xa(%rbp)
movb $-0x80, -0x9(%rbp)
movb $0x0, -0x8(%rbp)
movb $0x0, -0x7(%rbp)
movb $0x0, -0x6(%rbp)
movb $0x0, -0x5(%rbp)
leaq -0xb(%rbp), %rdi
movl $0x7, %edx
movl %edx, %esi
callq 0x130d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/dap.c
// Function: from_lane
static uint32_t from_lane(int size, uint32_t addr, uint32_t data)
{
  if (TRANSFER_SIZE_WORD == size)
    return data;
  else if (TRANSFER_SIZE_HALF == size)
    return (data >> ((addr & 2) * 8)) & 0xffff;
  else if (TRANSFER_SIZE_BYTE == size)
    return (data >> ((addr & 3) * 8)) & 0xff;
  else
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x2, %eax
cmpl -0x8(%rbp), %eax
jne 0x763f
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7687
movl $0x1, %eax
cmpl -0x8(%rbp), %eax
jne 0x7661
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
andl $0x2, %ecx
shll $0x3, %ecx
shrl %cl, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x4(%rbp)
jmp 0x7687
xorl %eax, %eax
cmpl -0x8(%rbp), %eax
jne 0x7680
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
andl $0x3, %ecx
shll $0x3, %ecx
shrl %cl, %eax
andl $0xff, %eax
movl %eax, -0x4(%rbp)
jmp 0x7687
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x79dd
jmp 0x7aae
jmp 0x79df
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x15(%rbp)
je 0x79fb
movl -0x4(%rbp), %eax
andq $0x3, %rax
cmpq $0x0, %rax
setne %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0x7a04
jmp 0x7a36
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movzbl (%rax), %esi
callq 0x7060
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x4(%rbp)
movslq -0x14(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x14(%rbp)
jmp 0x79df
jmp 0x7a38
cmpl $0x4, -0x14(%rbp)
jl 0x7a6f
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0x70c0
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
addq $0x4, %rax
movl %eax, -0x4(%rbp)
movslq -0x14(%rbp), %rax
subq $0x4, %rax
movl %eax, -0x14(%rbp)
jmp 0x7a38
jmp 0x7a71
cmpl $0x0, -0x14(%rbp)
je 0x7aa9
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movzbl (%rax), %esi
callq 0x7060
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
addq $0x1, %rax
movl %eax, -0x4(%rbp)
movslq -0x14(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x14(%rbp)
jmp 0x7a71
callq 0x6c70
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x4(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0xd(%rbp)
movl -0x8(%rbp), %edx
xorl %eax, %eax
movl $0x40, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl -0xc(%rbp), %esi
xorl %ecx, %ecx
movl $0x80, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
orl %ecx, %eax
movb %al, -0xe(%rbp)
cmpl $0x4000, 0x17d75(%rip)  # imm = 0x4000
jge 0x7b47
jmp 0x7b66
leaq 0xc71d(%rip), %rdi      # 0x1426b
leaq 0xc5cf(%rip), %rsi      # 0x14124
movl $0x3f6, %edx            # imm = 0x3F6
leaq 0xc75b(%rip), %rcx      # 0x142bc
callq 0x60e0
movl 0x585f4(%rip), %eax     # 0x60160
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x585e9(%rip)     # 0x60160
movslq %eax, %rcx
leaq 0x5a5ff(%rip), %rax     # 0x62180
movw -0xe(%rbp), %dx
movw %dx, (%rax,%rcx,2)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
callq 0x7bc0
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x81d9
movl -0x4(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x5a074(%rip), %eax     # 0x62170
jge 0x8100
jmp 0x811f
leaq 0xc11c(%rip), %rdi      # 0x14223
leaq 0xc016(%rip), %rsi      # 0x14124
movl $0x467, %edx            # imm = 0x467
leaq 0xc129(%rip), %rcx      # 0x14243
callq 0x60e0
movl -0x1c(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movslq %eax, %rcx
leaq 0x5803c(%rip), %rax     # 0x60170
movzbl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, %ecx
movl -0x24(%rbp), %edx
movl $0x1, %eax
shll %cl, %eax
andl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x8194
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %esi
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, %ecx
shll %cl, %esi
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x80de
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x82d5
movl -0x4(%rbp), %edi
movl -0xc(%rbp), %ecx
sarl %cl, %edi
andl $0x1, %edi
movl -0xc(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x7ac0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x829f
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x8381
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edi
movl -0x10(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, %ecx
sarl %cl, %edi
andl $0x1, %edi
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x7ac0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8324
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x8401
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
xorl %edi, %edi
callq 0x7b90
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x83d4
xorl %edi, %edi
movl $0x1, %esi
callq 0x7ac0
xorl %esi, %esi
movl %esi, %edi
callq 0x7ac0
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
xorl %edi, %edi
callq 0x80c0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
callq 0x8220
movl $0x1, %esi
movl %esi, %edi
callq 0x7ac0
movl $0x1, %edi
xorl %esi, %esi
callq 0x7ac0
movl $0x1, %edi
xorl %esi, %esi
callq 0x7ac0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x84e2
movl $0x0, -0x18(%rbp)
cmpl $0x20, -0x18(%rbp)
jge 0x849f
xorl %esi, %esi
movl %esi, %edi
callq 0x7b90
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8485
movq -0x8(%rbp), %rsi
movslq -0x10(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
xorl %edi, %edi
movl $0x20, %edx
callq 0x80c0
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x84d3
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x84d5
jmp 0x84e2
jmp 0x84d7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8476
movl $0x1, %esi
movl %esi, %edi
callq 0x7ac0
movl $0x1, %esi
movl %esi, %edi
callq 0x7ac0
movl $0x1, %edi
xorl %esi, %esi
callq 0x7ac0
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/dap.c
// Function: append_word
static void append_word(uint32_t value)
{
  dap_buf[dap_buf_size + 0] = value & 0xff;
  dap_buf[dap_buf_size + 1] = (value >> 8) & 0xff;
  dap_buf[dap_buf_size + 2] = (value >> 16) & 0xff;
  dap_buf[dap_buf_size + 3] = (value >> 24) & 0xff;
  dap_buf_size += sizeof(uint32_t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
movb %al, %dl
movl 0x477e9(%rip), %eax     # 0x4fd10
addl $0x0, %eax
movslq %eax, %rcx
leaq 0x4739c(%rip), %rax     # 0x4f8d0
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %dl
movl 0x477c6(%rip), %eax     # 0x4fd10
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x47379(%rip), %rax     # 0x4f8d0
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, %dl
movl 0x477a3(%rip), %eax     # 0x4fd10
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x47356(%rip), %rax     # 0x4f8d0
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, %dl
movl 0x47780(%rip), %eax     # 0x4fd10
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x47333(%rip), %rax     # 0x4f8d0
movb %dl, (%rax,%rcx)
movslq 0x47769(%rip), %rax     # 0x4fd10
addq $0x4, %rax
movl %eax, 0x4775f(%rip)     # 0x4fd10
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/dap.c
// Function: to_lane
static uint32_t to_lane(int size, uint32_t addr, uint32_t data)
{
  if (TRANSFER_SIZE_WORD == size)
    return data;
  else if (TRANSFER_SIZE_HALF == size)
    return (data << ((addr & 2) * 8));
  else if (TRANSFER_SIZE_BYTE == size)
    return (data << ((addr & 3) * 8));
  else
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x2, %eax
cmpl -0x8(%rbp), %eax
jne 0x85df
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x861d
movl $0x1, %eax
cmpl -0x8(%rbp), %eax
jne 0x85fc
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
andl $0x2, %ecx
shll $0x3, %ecx
shll %cl, %eax
movl %eax, -0x4(%rbp)
jmp 0x861d
xorl %eax, %eax
cmpl -0x8(%rbp), %eax
jne 0x8616
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
andl $0x3, %ecx
shll $0x3, %ecx
shll %cl, %eax
movl %eax, -0x4(%rbp)
jmp 0x861d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x8665
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
testb $0x1, 0x79af5(%rip)     # 0x82188
je 0x86d9
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x61e0
leaq -0x20(%rbp), %rax
movq 0x138f7(%rip), %rax     # 0x1bfc8
movq (%rax), %rdi
callq 0x61d0
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/edbg.c
// Function: warning
void warning(char *fmt, ...)
{
  va_list args;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x87d5
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0xd0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x30, -0x1c(%rbp)
movl $0x8, -0x20(%rbp)
movq 0x137d4(%rip), %rax     # 0x1bff8
movq %rax, -0xe0(%rbp)
movq (%rax), %rdi
leaq 0xbdab(%rip), %rsi      # 0x145e0
xorl %eax, %eax
movb %al, -0xd1(%rbp)
callq 0x6190
movq -0xe0(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x6240
movq -0xe0(%rbp), %rcx
movb -0xd1(%rbp), %al
movq (%rcx), %rdi
leaq 0xc0cc(%rip), %rsi      # 0x1493c
callq 0x6190
addq $0xe0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x88b8
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movq %rsi, -0x10(%rbp)
testb $0x1, -0x1(%rbp)
je 0x88ef
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq 0x136de(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0xbcc6(%rip), %rsi      # 0x145ea
movb $0x0, %al
callq 0x6190
movq 0x136c6(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x6240
movq 0x136af(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0xbfe9(%rip), %rsi      # 0x1493c
movb $0x0, %al
callq 0x6190
leaq -0x30(%rbp), %rax
movl $0x1, %edi
callq 0x6280
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x89a5
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x13601(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0xbbe9(%rip), %rsi      # 0x145ea
movb $0x0, %al
callq 0x6190
movq 0x135e9(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x6240
movq 0x135d2(%rip), %rax     # 0x1bff8
movq (%rax), %rdi
leaq 0xbf0c(%rip), %rsi      # 0x1493c
movb $0x0, %al
callq 0x6190
leaq -0x20(%rbp), %rax
movl $0x1, %edi
callq 0x6280
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/edbg.c
// Function: buf_alloc
void *buf_alloc(int size)
{
  void *buf;

  if (NULL == (buf = malloc(size)))
    error_exit("out of memory");

  memset(buf, 0, size);

  return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rdi
callq 0x61c0
movq %rax, %rcx
movq %rcx, -0x10(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x8b10
leaq 0xbae9(%rip), %rdi      # 0x145f2
movb $0x0, %al
callq 0x8970
movq -0x10(%rbp), %rdi
movslq -0x4(%rbp), %rdx
xorl %esi, %esi
callq 0x60f0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
setne %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xba84(%rip), %rsi      # 0x14600
xorl %eax, %eax
callq 0x8880
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x6210
movl %eax, -0xac(%rbp)
cmpl $0x0, -0xac(%rbp)
jge 0x8bab
leaq 0xba7b(%rip), %rdi      # 0x14621
callq 0x8a50
movl -0xac(%rbp), %edi
leaq -0xa8(%rbp), %rsi
callq 0x62b0
movq -0x78(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpq %rcx, %rax
jge 0x8bd1
movq -0x78(%rbp), %rax
movl %eax, -0x14(%rbp)
movl -0xac(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x6140
movl %eax, -0xb0(%rbp)
cmpl $0x0, -0xb0(%rbp)
jge 0x8bff
leaq 0xba2e(%rip), %rdi      # 0x14628
callq 0x8a50
movl -0xb0(%rbp), %eax
cmpl -0x14(%rbp), %eax
sete %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xba17(%rip), %rsi      # 0x1462f
xorl %eax, %eax
callq 0x8880
movl -0xac(%rbp), %edi
callq 0x6130
movl -0xb0(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
setne %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xb9dd(%rip), %rsi      # 0x14646
xorl %eax, %eax
callq 0x8880
movq -0x8(%rbp), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x6210
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x8c9a
leaq 0xb98c(%rip), %rdi      # 0x14621
callq 0x8a50
movl -0x18(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x6070
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x8cbf
leaq 0xdc13(%rip), %rdi      # 0x168cd
callq 0x8a50
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
sete %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xb993(%rip), %rsi      # 0x14668
xorl %eax, %eax
callq 0x8880
movl -0x18(%rbp), %edi
callq 0x6130
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x8d1a
cmpl $0x0, -0x24(%rbp)
je 0x8d1a
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x8d24
movq $0x0, -0x8(%rbp)
jmp 0x8d7b
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x14(%rbp), %ecx
subl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8d73
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movslq -0x24(%rbp), %rdx
callq 0x6150
cmpl $0x0, %eax
jne 0x8d66
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x8d7b
jmp 0x8d68
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x8d2b
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/edbg.c
// Function: print_clock_freq
static void print_clock_freq(int freq)
{
  float value = freq;
  char *unit;

  if (value < 1.0e6)
  {
    value /= 1.0e3;
    unit = "kHz";
  }
  else
  {
    value /= 1.0e6;
    unit = "MHz";
  }

  verbose("Clock frequency: %.1f %s\n", value, unit);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cvtsi2ssl -0x4(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0xab5a(%rip), %xmm0     # 0x145d0
ucomisd %xmm1, %xmm0
jbe 0x9aa7
movss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xab4b(%rip), %xmm1     # 0x145d8
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8(%rbp)
leaq 0xb910(%rip), %rax      # 0x153b1
movq %rax, -0x10(%rbp)
jmp 0x9ad0
movss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xab18(%rip), %xmm1     # 0x145d0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8(%rbp)
leaq 0xb8e9(%rip), %rax      # 0x153b5
movq %rax, -0x10(%rbp)
movss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rsi
leaq 0xb8d5(%rip), %rdi      # 0x153b9
movb $0x1, %al
callq 0x8630
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/edbg.c
// Function: reconnect_debugger
static void reconnect_debugger(void)
{
  dap_disconnect();
  dap_connect(DAP_INTERFACE_SWD);
  dap_transfer_configure(0, 32768, 128);
  dap_swd_configure(0);
  dap_swj_clock(g_clock);
  dap_led(0, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x64f0
movl $0x1, %edi
callq 0x6480
xorl %edi, %edi
movl $0x8000, %esi           # imm = 0x8000
movl $0x80, %edx
callq 0x65a0
xorl %edi, %edi
callq 0x6640
movq 0x1269e(%rip), %rax     # 0x1c1d0
movl %eax, %edi
callq 0x6520
xorl %edi, %edi
movl $0x1, %esi
callq 0x6420
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xa2ab
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0xb16e(%rip), %rax      # 0x15400
movl (%rax,%rcx,4), %eax
movl -0x10(%rbp), %ecx
shrl $0x8, %ecx
xorl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa269
movl -0x10(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
leaq 0xb63e(%rip), %rdi      # 0x15900
movb $0x0, %al
callq 0x86f0
movl $0x0, -0x4(%rbp)
cmpl $0xd, -0x4(%rbp)
jge 0xa481
movl $0x0, -0x334(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x11ef1(%rip), %rax     # 0x1c1e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
leaq 0xb61b(%rip), %rdi      # 0x1591c
movb $0x0, %al
callq 0x86f0
movl $0x0, -0x338(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0xa31d
jmp 0xa411
movslq -0x4(%rbp), %rcx
leaq 0x11eb8(%rip), %rax     # 0x1c1e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x50(%rax), %rax
movl -0x338(%rbp), %edi
callq *%rax
movq %rax, -0x340(%rbp)
movb $0x0, -0x341(%rbp)
xorl %eax, %eax
cmpq -0x340(%rbp), %rax
jne 0xa35d
jmp 0xa411
movl $0x0, -0x348(%rbp)
movl -0x348(%rbp), %eax
cmpl -0x334(%rbp), %eax
jge 0xa3b4
movslq -0x348(%rbp), %rax
movq -0x330(%rbp,%rax,8), %rdi
movq -0x340(%rbp), %rsi
callq 0x6180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa3a1
movb $0x1, -0x341(%rbp)
jmp 0xa3b4
jmp 0xa3a3
movl -0x348(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x348(%rbp)
jmp 0xa367
testb $0x1, -0x341(%rbp)
jne 0xa3df
movq -0x340(%rbp), %rcx
movl -0x334(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x334(%rbp)
cltq
movq %rcx, -0x330(%rbp,%rax,8)
cmpl $0x64, -0x334(%rbp)
setl %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xb52d(%rip), %rsi      # 0x15923
xorl %eax, %eax
callq 0x8880
movl -0x338(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x338(%rbp)
jmp 0xa312
leaq 0xb536(%rip), %rdi      # 0x1594e
movb $0x0, %al
callq 0x86f0
movl $0x0, -0x34c(%rbp)
movl -0x34c(%rbp), %eax
cmpl -0x334(%rbp), %eax
jge 0xa465
movslq -0x34c(%rbp), %rax
movq -0x330(%rbp,%rax,8), %rsi
leaq 0xb506(%rip), %rdi      # 0x15953
movb $0x0, %al
callq 0x86f0
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
jmp 0xa429
leaq 0xa4cf(%rip), %rdi      # 0x1493b
movb $0x0, %al
callq 0x86f0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xa2d0
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0xd, -0x14(%rbp)
jge 0xa53a
movl $0x0, -0x18(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0xa4bc
jmp 0xa52a
movslq -0x14(%rbp), %rcx
leaq 0x11d19(%rip), %rax     # 0x1c1e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x50(%rax), %rax
movl -0x18(%rbp), %edi
callq *%rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0xa4e9
jmp 0xa52a
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa51d
movslq -0x14(%rbp), %rcx
leaq 0x11cd7(%rip), %rax     # 0x1c1e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xa5db
jmp 0xa51f
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xa4b4
jmp 0xa52c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa4a3
movl $0x0, -0x24(%rbp)
cmpl $0xd, -0x24(%rbp)
jge 0xa5c1
movslq -0x24(%rbp), %rax
leaq 0x11c8e(%rip), %rcx     # 0x1c1e0
imulq $0x18, %rax, %rax
addq %rax, %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0xa5b4
movslq -0x24(%rbp), %rcx
leaq 0x11c75(%rip), %rax     # 0x1c1e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x6180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa5b4
movq -0x10(%rbp), %rsi
leaq 0xb3c6(%rip), %rdi      # 0x15957
movb $0x0, %al
callq 0x87a0
movslq -0x24(%rbp), %rcx
leaq 0x11c3d(%rip), %rax     # 0x1c1e0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xa5db
jmp 0xa5b6
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xa541
movq -0x10(%rbp), %rsi
leaq 0xb3e9(%rip), %rdi      # 0x159b5
movb $0x0, %al
callq 0x8970
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/target.c
// Function: target_fuse_commands
void target_fuse_commands(target_ops_t *ops, char *cmd)
{
  while (true)
  {
    cmd = process_fuse_commands(ops, cmd);

    if (*cmd == ';')
    {
      cmd++;
      continue;
    }
    else if (*cmd == 0)
    {
      break;
    }
    else
    {
      error_exit("junk at the end of the fuse operations: '%s'", cmd);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa850
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0xa81b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xa7f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xa829
jmp 0xa83f
movq -0x10(%rbp), %rsi
leaq 0xb2b1(%rip), %rdi      # 0x15ae5
movb $0x0, %al
callq 0x8970
jmp 0xa83d
jmp 0xa7f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/target.c
// Function: get_file_name
static char *get_file_name(char **str)
{
  char *end = *str;
  char *res;
  int size;

  while (*end != 0 && *end != ';')
    end++;

  size = end - *str + 1;

  res = buf_alloc(size);

  memcpy(res, *str, size - 1);

  *str = end;

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1d(%rbp)
je 0xaf38
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
setne %al
movb %al, -0x1d(%rbp)
movb -0x1d(%rbp), %al
testb $0x1, %al
jne 0xaf41
jmp 0xaf4f
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xaf17
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
addq $0x1, %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x8ae0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
callq 0x61a0
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/target.c
// Function: extract_value
static uint32_t extract_value(uint8_t *buf, int start, int end)
{
  uint32_t value = 0;
  int bit = start;
  int index = 0;

  do
  {
    int by = bit / 8;
    int bt = bit % 8;

    if (buf[by] & (1 << bt))
      value |= (1 << index);

    bit++;
    index++;
  } while (bit <= end);

  return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x24(%rbp)
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x24(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xb00d
movl -0x1c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0xafc2
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/target.c
// Function: apply_value
static void apply_value(uint8_t *buf, uint32_t value, int start, int end)
{
  int bit = start;
  int index = 0;

  do
  {
    int by = bit / 8;
    int bt = bit % 8;

    if (value & (1 << index))
      buf[by] |= (1 << bt);
    else
      buf[by] &= ~(1 << bt);

    bit++;
    index++;
  } while (bit <= end);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x24(%rbp)
movl -0xc(%rbp), %eax
movl -0x1c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xb09d
movl -0x24(%rbp), %ecx
movl $0x1, %esi
shll %cl, %esi
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
jmp 0xb0bb
movl -0x24(%rbp), %ecx
movl $0x1, %esi
shll %cl, %esi
xorl $-0x1, %esi
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %edx
andl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jle 0xb04e
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0xb760
movl $0x41002118, %edi       # imm = 0x41002118
callq 0x7740
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0xfffff0ff, %eax       # imm = 0xFFFFF0FF
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xf, %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x8a, -0x1c(%rbp)
jge 0xb23d
movslq -0x1c(%rbp), %rcx
leaq 0x112ac(%rip), %rax     # 0x1c3e0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x10(%rbp), %eax
je 0xb147
jmp 0xb22f
movslq -0x1c(%rbp), %rcx
leaq 0x1128e(%rip), %rax     # 0x1c3e0
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x41, %edx
leaq 0xaf1c(%rip), %rdi      # 0x16086
movb $0x0, %al
callq 0x8630
movslq -0x1c(%rbp), %rcx
leaq 0x11264(%rip), %rax     # 0x1c3e0
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, 0x7701b(%rip)     # 0x821a8
movq 0x8(%rax), %rcx
movq %rcx, 0x77018(%rip)     # 0x821b0
movq 0x10(%rax), %rcx
movq %rcx, 0x77015(%rip)     # 0x821b8
movq 0x18(%rax), %rax
movq %rax, 0x77012(%rip)     # 0x821c0
movq -0x8(%rbp), %rsi
leaq 0x7700f(%rip), %rdi     # 0x821c8
movl $0x38, %edx
callq 0x61a0
movslq -0x1c(%rbp), %rcx
leaq 0x11212(%rip), %rax     # 0x1c3e0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %esi
leaq 0x76fe9(%rip), %rdi     # 0x821c8
movl $0x100, %edx            # imm = 0x100
callq 0xa5f0
movl $0x41002102, %edi       # imm = 0x41002102
callq 0x76e0
movzbl %al, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
je 0xb222
movq -0x8(%rbp), %rax
testb $0x1, 0x8(%rax)
jne 0xb222
leaq 0xae80(%rip), %rdi      # 0x1609b
movb $0x0, %al
callq 0x8970
testb $0x1, -0x15(%rbp)
jne 0xb22d
callq 0xb780
jmp 0xb24e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb11c
movl -0xc(%rbp), %esi
leaq 0xae7a(%rip), %rdi      # 0x160c1
movb $0x0, %al
callq 0x8970
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
movl $0x41002101, %edi       # imm = 0x41002101
movl $0x1, %esi
callq 0x7770
movl $0x41002100, %edi       # imm = 0x41002100
movl $0x10, %esi
callq 0x7770
movl $0x64, %edi
callq 0x8a90
movl $0x41002101, %edi       # imm = 0x41002101
callq 0x76e0
movzbl %al, %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xb2d4
jmp 0xb2bc
callq 0xb760
callq 0xb780
popq %rbp
retq