LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_nu_m480.c
// Function: target_read
static void target_read(void)
{
  uint32_t addr = target_options.offset;
  uint32_t offs = 0;
  uint8_t *buf = target_options.file_data;
  uint32_t size = target_options.size;

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

    addr += FLASH_PAGE_SIZE;
    offs += FLASH_PAGE_SIZE;
    size -= FLASH_PAGE_SIZE;

    if (0 == (offs % (FLASH_PAGE_SIZE * STATUS_INTERVAL)))
      verbose(".");
  }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x71c67(%rip), %rbx     # 0x7eda8
movl 0x71c4d(%rip), %ebp     # 0x7ed94
testl %ebp, %ebp
je 0xd197
movl 0x71c3e(%rip), %r15d    # 0x7ed90
leaq 0x36b6(%rip), %r14      # 0x1080f
xorl %r12d, %r12d
leal (%r15,%r12), %edi
movl %r12d, %esi
addq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x7283
addl $0x1000, %r12d          # imm = 0x1000
testl $0x3000, %r12d          # imm = 0x3000
jne 0xd18a
movq %r14, %rdi
xorl %eax, %eax
callq 0x7a90
cmpl %r12d, %ebp
jne 0xd15c
movl 0x71bff(%rip), %edx     # 0x7ed94
jmp 0xd199
xorl %edx, %edx
movq 0x71be8(%rip), %rdi     # 0x7ed88
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7ea3
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_nu_m480.c
// Function: target_fuse_write
static void target_fuse_write(int section, uint8_t *data)
{
  uint32_t config[CONFIG_COUNT];

  if (section >= CONFIG_COUNT)
    return;

  dap_write_word(FMC_ISPCTL, FMC_ISPCTL_ISPEN | FMC_ISPCTL_CFGUEN);

  for (int i = 0; i < CONFIG_COUNT; i++)
    config[i] = fmc_read(CONFIG0 + i*4);

  config[section] = *(uint32_t *)data;
  config[0] |= CONFIG0_ICELOCK; // Make sure ICE is never locked for now

  dap_write_word(FMC_ISPADDR, CONFIG0);
  fmc_cmd(FMC_ISPCMD_PAGE_ERASE, PAGE_ERASE_TIME);

  for (int i = 0; i < CONFIG_COUNT; i++)
    fmc_write(CONFIG0 + i*4, config[i]);
}

// Assembly:
cmpl $0x3, %edi
jg 0xd27e
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl $0x4000c000, %edi       # imm = 0x4000C000
movl $0x11, %esi
callq 0x7269
xorl %r15d, %r15d
leal 0x300000(%r15), %edi
callq 0xd28f
movl %eax, (%rsp,%r15)
addq $0x4, %r15
cmpq $0x10, %r15
jne 0xd215
movl (%r14), %eax
movslq %ebx, %rcx
movl %eax, (%rsp,%rcx,4)
orb $0x8, 0x1(%rsp)
movl $0x4000c004, %edi       # imm = 0x4000C004
movl $0x300000, %esi         # imm = 0x300000
callq 0x7269
movl $0x22, %edi
movl $0x50, %esi
callq 0xd2de
xorl %ebx, %ebx
movl (%rsp,%rbx), %esi
leal 0x300000(%rbx), %edi
callq 0xd340
addq $0x4, %rbx
cmpq $0x10, %rbx
jne 0xd25d
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_nu_m480.c
// Function: fmc_read
static uint32_t fmc_read(uint32_t addr)
{
  dap_write_word(FMC_ISPCMD, FMC_ISPCMD_READ);
  dap_write_word(FMC_ISPADDR, addr);
  dap_write_word(FMC_ISPDAT, 0);
  dap_write_word(FMC_ISPTRG, FMC_ISPTRG_ISPGO);
  while (dap_read_word(FMC_ISPTRG));
  return dap_read_word(FMC_ISPDAT);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x4000c00c, %edi       # imm = 0x4000C00C
xorl %esi, %esi
callq 0x7269
movl $0x4000c004, %edi       # imm = 0x4000C004
movl %ebx, %esi
callq 0x7269
movl $0x4000c008, %edi       # imm = 0x4000C008
xorl %esi, %esi
callq 0x7269
movl $0x4000c010, %edi       # imm = 0x4000C010
movl $0x1, %esi
callq 0x7269
movl $0x4000c010, %edi       # imm = 0x4000C010
callq 0x721a
testl %eax, %eax
jne 0xd2c5
movl $0x4000c008, %edi       # imm = 0x4000C008
popq %rbx
jmp 0x721a
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_nu_m480.c
// Function: fmc_cmd
static void fmc_cmd(int cmd, int delay)
{
  uint32_t sts;

  dap_write_word(FMC_ISPCMD, cmd);
  dap_write_word(FMC_ISPTRG, FMC_ISPTRG_ISPGO);

  if (delay)
    sleep_ms(delay);

  while (dap_read_word(FMC_ISPTRG));

  sts = dap_read_word(FMC_ISPSTS);
  if (sts & FMC_ISPSTS_ISPFF)
    error_exit("flash error while executing command 0x%02x", cmd);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
movl $0x4000c00c, %edi       # imm = 0x4000C00C
movl %ebx, %esi
callq 0x7269
movl $0x4000c010, %edi       # imm = 0x4000C010
movl $0x1, %esi
callq 0x7269
movl %ebp, %edi
callq 0x7d8c
movl $0x4000c010, %edi       # imm = 0x4000C010
callq 0x721a
testl %eax, %eax
jne 0xd307
movl $0x4000c040, %edi       # imm = 0x4000C040
callq 0x721a
testb $0x40, %al
jne 0xd32a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x63e8(%rip), %rdi      # 0x13719
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7ca5
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_nu_m480.c
// Function: fmc_write
static void fmc_write(uint32_t addr, uint32_t data)
{
  dap_write_word(FMC_ISPCMD, FMC_ISPCMD_32B_PROG);
  dap_write_word(FMC_ISPADDR, addr);
  dap_write_word(FMC_ISPDAT, data);
  dap_write_word(FMC_ISPTRG, FMC_ISPTRG_ISPGO);
  while (dap_read_word(FMC_ISPTRG));
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0x4000c00c, %edi       # imm = 0x4000C00C
movl $0x21, %esi
callq 0x7269
movl $0x4000c004, %edi       # imm = 0x4000C004
movl %ebp, %esi
callq 0x7269
movl $0x4000c008, %edi       # imm = 0x4000C008
movl %ebx, %esi
callq 0x7269
movl $0x4000c010, %edi       # imm = 0x4000C010
movl $0x1, %esi
callq 0x7269
movl $0x4000c010, %edi       # imm = 0x4000C010
callq 0x721a
testl %eax, %eax
jne 0xd37d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_lattice_lcmxo2.c
// Function: target_select
static void target_select(target_options_t *options)
{
  uint32_t chain[MAX_CHAIN_COUNT];
  int chain_count;

  dap_connect(DAP_INTERFACE_JTAG);

  chain_count = dap_jtag_scan_chain(chain, MAX_CHAIN_COUNT);

  verbose("Detected JTAG chain:\n");
  for (int i = 0; i < chain_count; i++)
    verbose("  %d: 0x%08x\n", i, chain[i]);

  if (chain_count == 0)
    error_exit("no devices detected in the JTAG chain");

  if (chain_count > 1)
    error_exit("more than one device detected in the JTAG chain");

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

    verbose("Target: %s\n", devices[i].name);

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

    return;
  }

  error_exit("unknown target device (IDCODE = 0x%08x)", chain[0]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x2, %edi
callq 0x654e
movq %rsp, %rdi
movl $0x5, %esi
callq 0x79cf
movl %eax, %ebp
leaq 0x638d(%rip), %rdi      # 0x13750
xorl %eax, %eax
callq 0x7a90
testl %ebp, %ebp
jle 0xd3f4
movl %ebp, %r12d
leaq 0x638e(%rip), %r14      # 0x13766
xorl %r15d, %r15d
movl (%rsp,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x7a90
incq %r15
cmpq %r15, %r12
jne 0xd3db
testl %ebp, %ebp
je 0xd406
cmpl $0x2, %ebp
jl 0xd414
leaq 0x6396(%rip), %rdi      # 0x1379a
jmp 0xd40d
leaq 0x6367(%rip), %rdi      # 0x13774
xorl %eax, %eax
callq 0x7ca5
movl (%rsp), %esi
xorl %r14d, %r14d
leaq 0xd90f(%rip), %r15      # 0x1ad30
cmpl %esi, (%r14,%r15)
je 0xd441
addq $0x18, %r14
cmpq $0x48, %r14
jne 0xd421
leaq 0x6392(%rip), %rdi      # 0x137ca
xorl %eax, %eax
callq 0x7ca5
jmp 0xd497
movq 0x10(%r14,%r15), %rsi
leaq 0x5418(%rip), %rdi      # 0x12865
xorl %eax, %eax
callq 0x7a90
movq 0x10(%r14,%r15), %rax
movq %rax, 0x71960(%rip)     # 0x7edc0
movups (%r14,%r15), %xmm0
movups %xmm0, 0x71944(%rip)    # 0x7edb0
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm0, 0x7194a(%rip)    # 0x7edc8
movups %xmm1, 0x71953(%rip)    # 0x7edd8
movups %xmm2, 0x7195c(%rip)    # 0x7ede8
movq 0x30(%rbx), %rax
movq %rax, 0x71961(%rip)     # 0x7edf8
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_lattice_lcmxo2.c
// Function: target_deselect
static void target_deselect(void)
{
  dap_jtag_write_ir(CMD_ISC_PROGRAM_DONE, IR_LENGTH);
  dap_jtag_idle(1000);
  poll_busy_flag();

  dap_jtag_write_ir(CMD_ISC_DISABLE, IR_LENGTH);
  dap_jtag_idle(8);

  dap_jtag_write_ir(CMD_ISC_NOOP, IR_LENGTH);
  dap_jtag_idle(100);

  dap_jtag_write_ir(CMD_LSC_REFRESH, IR_LENGTH);
  dap_jtag_idle(8);

  dap_jtag_write_ir(CMD_ISC_NOOP, IR_LENGTH);
  dap_jtag_idle(100);

  dap_jtag_flush();
}

// Assembly:
pushq %rax
movl $0x5e, %edi
movl $0x8, %esi
callq 0x7845
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x7809
callq 0xd9a5
movl $0x26, %edi
movl $0x8, %esi
callq 0x7845
movl $0x8, %edi
callq 0x7809
movl $0xff, %edi
movl $0x8, %esi
callq 0x7845
movl $0x64, %edi
callq 0x7809
movl $0x79, %edi
movl $0x8, %esi
callq 0x7845
movl $0x8, %edi
callq 0x7809
movl $0xff, %edi
movl $0x8, %esi
callq 0x7845
movl $0x64, %edi
callq 0x7809
popq %rax
jmp 0x74f8
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_lattice_lcmxo2.c
// Function: target_erase
static void target_erase(void)
{
  erase_sram();

  // Enable Flash
  dap_jtag_write_ir(CMD_ISC_ENABLE, IR_LENGTH);
  dap_jtag_write_dr((uint8_t[]){ ISC_ENABLE_FLASH }, 8);
  dap_jtag_idle(8);

  dap_jtag_write_ir(CMD_ISC_ERASE, IR_LENGTH);
  dap_jtag_write_dr((uint8_t[]){ ISC_ERASE_ALL_NV }, 8);
  dap_jtag_idle(8);

  poll_busy_flag();
}

// Assembly:
pushq %rax
callq 0xda3c
movl $0xc6, %edi
movl $0x8, %esi
callq 0x7845
leaq 0x7(%rsp), %rdi
movb $0x8, (%rdi)
movl $0x8, %esi
callq 0x78cd
movl $0x8, %edi
callq 0x7809
movl $0xe, %edi
movl $0x8, %esi
callq 0x7845
leaq 0x6(%rsp), %rdi
movb $0xe, (%rdi)
movl $0x8, %esi
callq 0x78cd
movl $0x8, %edi
callq 0x7809
callq 0xd9a5
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_lattice_lcmxo2.c
// Function: poll_busy_flag
static void poll_busy_flag(void)
{
  uint32_t status = 0;
  uint8_t busy = 1;

  while (busy)
  {
    dap_jtag_write_ir(CMD_LSC_CHECK_BUSY, IR_LENGTH);
    dap_jtag_read_dr(&busy, 1);
  }

  dap_jtag_write_ir(CMD_LSC_READ_STATUS, IR_LENGTH);
  dap_jtag_read_dr((uint8_t *)&status, 32);
  dap_jtag_idle(8);

  if (status & STATUS_BUSY)
    error_exit("poll_busy_flag(): busy");

  if (status & STATUS_FAIL)
    error_exit("poll_busy_flag(): fail");
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl $0x0, 0xc(%rsp)
leaq 0xb(%rsp), %rbx
movb $0x1, (%rbx)
movl $0xf0, %edi
movl $0x8, %esi
callq 0x7845
movq %rbx, %rdi
movl $0x1, %esi
callq 0x795a
cmpb $0x0, 0xb(%rsp)
jne 0xd9ba
movl $0x3c, %edi
movl $0x8, %esi
callq 0x7845
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
movl $0x20, %esi
callq 0x795a
movl $0x8, %edi
callq 0x7809
movl (%rbx), %eax
btl $0xc, %eax
jae 0xda22
leaq 0x5e0b(%rip), %rdi      # 0x13822
xorl %eax, %eax
callq 0x7ca5
movl 0xc(%rsp), %eax
btl $0xd, %eax
jae 0xda36
leaq 0x5e0a(%rip), %rdi      # 0x13839
xorl %eax, %eax
callq 0x7ca5
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_lattice_lcmxo2.c
// Function: erase_sram
static void erase_sram(void)
{
  dap_jtag_write_ir(CMD_ISC_ENABLE, IR_LENGTH);
  dap_jtag_write_dr((uint8_t[]){ ISC_ENABLE_SRAM }, 8);
  dap_jtag_idle(8);

  dap_jtag_write_ir(CMD_ISC_ERASE, IR_LENGTH);
  dap_jtag_write_dr((uint8_t[]){ ISC_ERASE_SRAM }, 8);
  dap_jtag_idle(8);

  dap_jtag_write_ir(CMD_ISC_NOOP, IR_LENGTH);
}

// Assembly:
pushq %rax
movl $0xc6, %edi
movl $0x8, %esi
callq 0x7845
leaq 0x7(%rsp), %rdi
movb $0x0, (%rdi)
movl $0x8, %esi
callq 0x78cd
movl $0x8, %edi
callq 0x7809
movl $0xe, %edi
movl $0x8, %esi
callq 0x7845
leaq 0x6(%rsp), %rdi
movb $0x1, (%rdi)
movl $0x8, %esi
callq 0x78cd
movl $0x8, %edi
callq 0x7809
movl $0xff, %edi
movl $0x8, %esi
callq 0x7845
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.c
// Function: target_erase
static void target_erase(void)
{
  uint8_t buf[4];
  int cnt = 0;

  buf[0] = FLASH_CMD_CHIP_ERASE;

  flash_write_enable();

  spi_select(0);
  spi_transfer(buf, 1, 1);
  spi_select(1);

  while (flash_is_busy())
  {
    sleep_ms(100);

    if ((cnt++ % 10) == 0)
      verbose(".");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movb $-0x39, (%rbx)
callq 0xe7ca
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x200, %esi            # imm = 0x200
callq 0x711f
callq 0x6a6f
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0xe719
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x300, %esi            # imm = 0x300
callq 0x711f
callq 0x6a6f
callq 0xe808
testb %al, %al
je 0xe376
movl $0xcccccccd, %r14d      # imm = 0xCCCCCCCD
leaq 0x24d7(%rip), %rbx      # 0x1080f
xorl %ebp, %ebp
xorl %r15d, %r15d
movl %r15d, %eax
imulq %r14, %rax
shrq $0x23, %rax
leal (%rax,%rax,4), %r12d
addl %r12d, %r12d
movl $0x64, %edi
callq 0x7d8c
addl %ebp, %r12d
jne 0xe368
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7a90
callq 0xe808
decl %ebp
incl %r15d
testb %al, %al
jne 0xe33d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.c
// Function: target_program
static void target_program(void)
{
  uint32_t addr = target_options.offset;
  uint32_t offs = 0;
  uint32_t number_of_pages;
  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++)
  {
    if (0 == (addr % FLASH_SECTOR_SIZE))
      flash_erase_sector(addr);

    flash_program_page(addr, &buf[offs]);

    addr += FLASH_PAGE_SIZE;
    offs += FLASH_PAGE_SIZE;

    if (0 == (addr % (FLASH_SECTOR_SIZE * STATUS_INTERVAL)))
      verbose(".");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl $0xff, %ebp
addl 0x70a6d(%rip), %ebp     # 0x7ee28
cmpl $0x100, %ebp            # imm = 0x100
jb 0xe519
movq 0x70a62(%rip), %rax     # 0x7ee30
movq %rax, 0x8(%rsp)
shrl $0x8, %ebp
movl 0x70a3b(%rip), %r12d    # 0x7ee18
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %r12d, 0x4(%rsp)
testl $0xfff, %r12d           # imm = 0xFFF
je 0xe400
movl %r12d, %r13d
shrl $0x10, %r13d
movl %r12d, %r14d
shrl $0x8, %r14d
jmp 0xe471
movb 0xdbd2(%rip), %al       # 0x1bfd8
movb %al, 0x10(%rsp)
movl %r12d, %r13d
shrl $0x10, %r13d
movb %r13b, 0x11(%rsp)
movl %r12d, %r14d
shrl $0x8, %r14d
movb %r14b, 0x12(%rsp)
movb $0x0, 0x13(%rsp)
callq 0xe7ca
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x200, %esi            # imm = 0x200
callq 0x711f
callq 0x6a6f
leaq 0x10(%rsp), %rdi
movl $0x4, %esi
movl $0x4, %edx
callq 0xe719
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x300, %esi            # imm = 0x300
callq 0x711f
callq 0x6a6f
callq 0xe808
testb %al, %al
jne 0xe468
movq 0x8(%rsp), %rax
leaq (%rax,%r15), %rsi
movb $0x2, 0x10(%rsp)
movb %r13b, 0x11(%rsp)
movb %r14b, 0x12(%rsp)
movl 0x4(%rsp), %eax
movb %al, 0x13(%rsp)
movl $0x100, %edx            # imm = 0x100
leaq 0x14(%rsp), %rdi
callq 0x6190
callq 0xe7ca
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x200, %esi            # imm = 0x200
callq 0x711f
callq 0x6a6f
leaq 0x10(%rsp), %rdi
movl $0x104, %esi            # imm = 0x104
movl $0x104, %edx            # imm = 0x104
callq 0xe719
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x300, %esi            # imm = 0x300
callq 0x711f
callq 0x6a6f
callq 0xe808
testb %al, %al
jne 0xe4e1
addl $0x100, %r12d           # imm = 0x100
testl $0x3fff, %r12d          # imm = 0x3FFF
jne 0xe508
leaq 0x230e(%rip), %rdi      # 0x1080f
xorl %eax, %eax
callq 0x7a90
addq $0x100, %r15            # imm = 0x100
incl %ebx
cmpl %ebp, %ebx
jne 0xe3e7
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.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 sector = 0;

  bufb = buf_alloc(FLASH_SECTOR_SIZE);

  spi_xip_mode();

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

    block_size = (size > FLASH_SECTOR_SIZE) ? FLASH_SECTOR_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 - FLASH_ADDR, bufa[offs + i], bufb[i]);
        buf_free(bufb);
        error_exit("verification failed");
      }
    }

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

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

  buf_free(bufb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x708d8(%rip), %r13d    # 0x7ee18
movq 0x708e9(%rip), %rax     # 0x7ee30
movq %rax, 0x10(%rsp)
movl 0x708d5(%rip), %r15d    # 0x7ee28
movl $0x1000, %ebp           # imm = 0x1000
movl $0x1000, %edi           # imm = 0x1000
callq 0x7dd2
movq %rax, %rbx
callq 0xe869
testl %r15d, %r15d
je 0xe640
leal 0x13000000(%r13), %edi
leaq 0x54e7(%rip), %r12      # 0x13a68
xorl %r14d, %r14d
xorl %eax, %eax
movl %r14d, 0x4(%rsp)
movl %eax, (%rsp)
movl %eax, %r14d
addq 0x10(%rsp), %r14
movl %edi, 0x8(%rsp)
movq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x7283
cmpl %ebp, %r15d
movl $0x1000, %ebp           # imm = 0x1000
movl %r15d, 0xc(%rsp)
cmovbl %r15d, %ebp
xorl %r15d, %r15d
movzbl (%r14,%r15), %edx
movzbl (%rbx,%r15), %ecx
cmpb %cl, %dl
je 0xe5ed
leal (%r15,%r13), %esi
leaq 0x4229(%rip), %rdi      # 0x127fd
xorl %eax, %eax
callq 0x7a90
movq %rbx, %rdi
callq 0x7df5
movq %r12, %rdi
xorl %eax, %eax
callq 0x7ca5
incq %r15
cmpq %r15, %rbp
jne 0xe5bb
movl 0x4(%rsp), %r14d
testb $0x3, %r14b
jne 0xe60e
leaq 0x2208(%rip), %rdi      # 0x1080f
xorl %eax, %eax
callq 0x7a90
movl $0x1000, %eax           # imm = 0x1000
movl 0x8(%rsp), %edi
addl %eax, %edi
movl (%rsp), %ecx
addl %eax, %ecx
movl %ecx, %eax
movl 0xc(%rsp), %r15d
subl %ebp, %r15d
movl $0x1000, %ebp           # imm = 0x1000
incl %r14d
addq $0x1000, %r13           # imm = 0x1000
testl %r15d, %r15d
jne 0xe586
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7df5
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.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 sector = 0;

  spi_xip_mode();

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

    addr += FLASH_SECTOR_SIZE;
    offs += FLASH_SECTOR_SIZE;
    size -= FLASH_SECTOR_SIZE;

    if (0 == (sector++ % 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
movl 0x707b0(%rip), %r15d    # 0x7ee18
movq 0x707c1(%rip), %rbx     # 0x7ee30
movl 0x707a7(%rip), %ebp     # 0x7ee1c
callq 0xe869
testl %ebp, %ebp
je 0xe6c5
addl $0x13000000, %r15d      # imm = 0x13000000
leaq 0x2183(%rip), %r14      # 0x1080f
xorl %r12d, %r12d
xorl %r13d, %r13d
leal (%r15,%r13), %edi
movl %r13d, %esi
addq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x7283
testb $0x3, %r12b
jne 0xe6b6
movq %r14, %rdi
xorl %eax, %eax
callq 0x7a90
addl $0x1000, %r13d          # imm = 0x1000
incl %r12d
cmpl %r13d, %ebp
jne 0xe692
movq 0x70744(%rip), %rdi     # 0x7ee10
movl 0x7074a(%rip), %edx     # 0x7ee1c
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7ea3
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.c
// Function: spi_transfer
static void spi_transfer(uint8_t *data, int size, int rx_skip)
{
  assert(rx_skip <= size);

  dap_write_block(RAM_ADDR, data, size);

  dap_write_word_req(DMA_CH0_WRITE_ADDR, RAM_HALF_ADDR);
  dap_write_word_req(DMA_CH0_TRANS_COUNT, size);

  dap_write_word_req(DMA_CH1_READ_ADDR, RAM_ADDR);
  dap_write_word_req(DMA_CH1_TRANS_COUNT, size);

  dap_transfer();

  while (dap_read_word(DMA_CH0_CTRL) & DMA_CHx_CTRL_BUSY);

  dap_read_block(RAM_HALF_ADDR + rx_skip, data, size - rx_skip);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
subl %edx, %ebp
jl 0xe7ab
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x20000000, %edi       # imm = 0x20000000
movq %r14, %rsi
movl %r15d, %edx
callq 0x73df
movl $0x50000018, %edi       # imm = 0x50000018
movl $0x20020000, %esi       # imm = 0x20020000
callq 0x711f
movl $0x5000001c, %edi       # imm = 0x5000001C
movl %r15d, %esi
callq 0x711f
movl $0x50000054, %edi       # imm = 0x50000054
movl $0x20000000, %esi       # imm = 0x20000000
callq 0x711f
movl $0x5000005c, %edi       # imm = 0x5000005C
movl %r15d, %esi
callq 0x711f
callq 0x6a6f
movl $0x50000010, %edi       # imm = 0x50000010
callq 0x721a
btl $0x18, %eax
jb 0xe77f
addl $0x20020000, %ebx       # imm = 0x20020000
movl %ebx, %edi
movq %r14, %rsi
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7283
leaq 0x53f2(%rip), %rdi      # 0x13ba4
leaq 0x53fb(%rip), %rsi      # 0x13bb4
leaq 0x5408(%rip), %rcx      # 0x13bc8
movl $0xdc, %edx
callq 0x60d0
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.c
// Function: flash_write_enable
static void flash_write_enable(void)
{
  spi_select_req(0);
  dap_write_word_req(QSPI_DR0, FLASH_CMD_WRITE_ENABLE);
  dap_read_word_req(QSPI_DR0);
  spi_select_req(1);
  dap_transfer();
}

// Assembly:
pushq %rax
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x200, %esi            # imm = 0x200
callq 0x711f
movl $0x18000060, %edi       # imm = 0x18000060
movl $0x6, %esi
callq 0x711f
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x70ec
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x300, %esi            # imm = 0x300
callq 0x711f
popq %rax
jmp 0x6a6f
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.c
// Function: flash_is_busy
static bool flash_is_busy(void)
{
  spi_select_req(0);
  dap_write_word_req(QSPI_DR0, FLASH_CMD_READ_STATUS);
  dap_write_word_req(QSPI_DR0, 0);
  dap_read_word_req(QSPI_DR0);
  dap_read_word_req(QSPI_DR0);
  spi_select_req(1);
  dap_transfer();

  return (dap_get_response(4) & 1);
}

// Assembly:
pushq %rax
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x200, %esi            # imm = 0x200
callq 0x711f
movl $0x18000060, %edi       # imm = 0x18000060
movl $0x5, %esi
callq 0x711f
movl $0x18000060, %edi       # imm = 0x18000060
xorl %esi, %esi
callq 0x711f
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x70ec
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x70ec
movl $0x4001800c, %edi       # imm = 0x4001800C
movl $0x300, %esi            # imm = 0x300
callq 0x711f
callq 0x6a6f
movl $0x4, %edi
callq 0x71aa
andb $0x1, %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_rpi_rp2040.c
// Function: spi_xip_mode
static void spi_xip_mode(void)
{
  dap_write_word_req(GPIO_QSPI_SS_CTRL, GPIO_QSPI_xx_CTRL_OUTOVER_NORMAL);
  dap_write_word_req(QSPI_SSIENR, 0);
  dap_write_word_req(QSPI_CTRLR0, (flash_quad_mode ? QSPI_CTRLR0_SPI_FRF_QUAD : QSPI_CTRLR0_SPI_FRF_STD) |
      QSPI_CTRLR0_TMOD_EEPROM_READ | QSPI_CTRLR0_DFS_32(32-1));
  dap_write_word_req(QSPI_SPI_CTRLR0, QSPI_SPI_CTRLR0_XIP_CMD(flash_cmd_read_data) |
    QSPI_SPI_CTRLR0_ADDR_L(24 / 4) | QSPI_SPI_CTRLR0_INST_L_8B | QSPI_SPI_CTRLR0_TRANS_TYPE_1C1A |
    QSPI_SPI_CTRLR0_WAIT_CYCLES(flash_wait_cycles));
  dap_write_word_req(QSPI_SSIENR, QSPI_SSIENR_SSI_EN);

  dap_write_word_req(QSPI_DMACR, 0);

  dap_transfer();
}

// Assembly:
pushq %rax
movl $0x4001800c, %edi       # imm = 0x4001800C
xorl %esi, %esi
callq 0x711f
movl $0x18000008, %edi       # imm = 0x18000008
xorl %esi, %esi
callq 0x711f
movzbl 0x705af(%rip), %esi     # 0x7ee38
shll $0x16, %esi
orl $0x1f0300, %esi         # imm = 0x1F0300
movl $0x18000000, %edi       # imm = 0x18000000
callq 0x711f
movl 0xd73a(%rip), %eax      # 0x1bfdc
shll $0x18, %eax
movl 0x70591(%rip), %esi     # 0x7ee3c
shll $0xb, %esi
orl %eax, %esi
orl $0x218, %esi            # imm = 0x218
movl $0x180000f4, %edi       # imm = 0x180000F4
callq 0x711f
movl $0x18000008, %edi       # imm = 0x18000008
movl $0x1, %esi
callq 0x711f
movl $0x1800004c, %edi       # imm = 0x1800004C
xorl %esi, %esi
callq 0x711f
popq %rax
jmp 0x6a6f
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.c
// Function: target_erase
static void target_erase(void)
{
  dap_write_word_req(FLASH_CR, FLASH_CR_MER);
  dap_write_word_req(FLASH_ADDR, 0);
  dap_transfer();

  flash_wait_done();

  dap_write_word(FLASH_CR, 0);
}

// Assembly:
pushq %rax
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x4, %esi
callq 0x711f
movl $0x8000000, %edi        # imm = 0x8000000
xorl %esi, %esi
callq 0x711f
callq 0x6a6f
callq 0xee96
movl $0x40022014, %edi       # imm = 0x40022014
xorl %esi, %esi
popq %rax
jmp 0x7269
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.c
// Function: target_lock
static void target_lock(void)
{
  uint32_t value = (dap_read_word(OPTIONS_OPTR) & 0xff00) | 0xee;

  dap_write_word_req(FLASH_OPTR, value);
  dap_write_word_req(FLASH_CR, FLASH_CR_OPTSTRT);
  dap_write_word_req(0x40022080, 0);
  dap_transfer();

  flash_wait_done();
}

// Assembly:
pushq %rax
movl $0x1fff0e80, %edi       # imm = 0x1FFF0E80
callq 0x721a
andl $0xff00, %eax           # imm = 0xFF00
leal 0xee(%rax), %esi
movl $0x40022020, %edi       # imm = 0x40022020
callq 0x711f
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x20000, %esi          # imm = 0x20000
callq 0x711f
movl $0x40022080, %edi       # imm = 0x40022080
xorl %esi, %esi
callq 0x711f
callq 0x6a6f
popq %rax
jmp 0xee96
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.c
// Function: target_unlock
static void target_unlock(void)
{
  uint32_t value = (dap_read_word(OPTIONS_OPTR) & 0xff00) | 0xaa;

  dap_write_word_req(FLASH_OPTR, value);
  dap_write_word_req(FLASH_CR, FLASH_CR_OPTSTRT);
  dap_write_word_req(0x40022080, 0);
  dap_transfer();

  flash_wait_done();
}

// Assembly:
pushq %rax
movl $0x1fff0e80, %edi       # imm = 0x1FFF0E80
callq 0x721a
andl $0xff00, %eax           # imm = 0xFF00
leal 0xaa(%rax), %esi
movl $0x40022020, %edi       # imm = 0x40022020
callq 0x711f
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x20000, %esi          # imm = 0x20000
callq 0x711f
movl $0x40022080, %edi       # imm = 0x40022080
xorl %esi, %esi
callq 0x711f
callq 0x6a6f
popq %rax
jmp 0xee96
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.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_pages;
  uint32_t *buf = (uint32_t *)target_options.file_data;
  uint32_t size = target_options.file_size;
  int word_size = FLASH_PAGE_SIZE / sizeof(uint32_t);

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

  for (uint32_t page = 0; page < number_of_pages; page++)
  {
    // Erase Page
    dap_write_word_req(FLASH_CR, FLASH_CR_PER);
    dap_write_word_req(addr, 0);
    dap_transfer();

    flash_wait_done();

    // Program Page
    dap_write_word(FLASH_CR, FLASH_CR_PG);

    for (int i = 0; i < word_size; i++)
    {
      if (i == (word_size-1))
        dap_write_word(FLASH_CR, FLASH_CR_PG | FLASH_CR_PGSTRT);

      dap_write_word_req(addr, buf[offs]);
      addr += sizeof(uint32_t);
      offs++;
    }

    dap_transfer();

    flash_wait_done();

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

  dap_write_word(FLASH_CR, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x70304(%rip), %ebp     # 0x7ee88
addl $0x7f, %ebp
cmpl $0x80, %ebp
jb 0xec41
movq 0x702f6(%rip), %r15     # 0x7ee90
movl $0x8000000, %ebx        # imm = 0x8000000
addl 0x702d3(%rip), %ebx     # 0x7ee78
shrl $0x7, %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x2, %esi
callq 0x711f
movl %ebx, %edi
xorl %esi, %esi
callq 0x711f
callq 0x6a6f
callq 0xee96
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x1, %esi
callq 0x7269
xorl %r14d, %r14d
cmpl $0x1f, %r14d
jne 0xebf7
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x80001, %esi          # imm = 0x80001
callq 0x7269
leal (%r14,%r13), %eax
movl %eax, %eax
movl (%r15,%rax,4), %esi
movl %ebx, %edi
callq 0x711f
addl $0x4, %ebx
incl %r14d
cmpl $0x20, %r14d
jne 0xebe2
callq 0x6a6f
callq 0xee96
testb $0x1f, %r12b
jne 0xec32
leaq 0x1be4(%rip), %rdi      # 0x1080f
xorl %eax, %eax
callq 0x7a90
addl %r14d, %r13d
incl %r12d
cmpl %ebp, %r12d
jne 0xebae
movl $0x40022014, %edi       # imm = 0x40022014
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7269
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.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 page = 0;

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

    addr += FLASH_PAGE_SIZE;
    offs += FLASH_PAGE_SIZE;
    size -= FLASH_PAGE_SIZE;

    if (0 == (page++ % 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 0x70113(%rip), %rbx     # 0x7ee90
movl 0x700f9(%rip), %ebp     # 0x7ee7c
testl %ebp, %ebp
je 0xedd9
movl $0x8000000, %r15d       # imm = 0x8000000
addl 0x700e4(%rip), %r15d    # 0x7ee78
leaq 0x1a74(%rip), %r14      # 0x1080f
xorl %r12d, %r12d
xorl %r13d, %r13d
leal (%r15,%r13), %edi
movl %r13d, %esi
addq %rbx, %rsi
movl $0x80, %edx
callq 0x7283
testb $0x1f, %r12b
jne 0xedc5
movq %r14, %rdi
xorl %eax, %eax
callq 0x7a90
subl $-0x80, %r13d
incl %r12d
cmpl %r13d, %ebp
jne 0xeda1
movl 0x700a5(%rip), %edx     # 0x7ee7c
jmp 0xeddb
xorl %edx, %edx
movq 0x7008e(%rip), %rdi     # 0x7ee70
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7ea3
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.c
// Function: target_fuse_write
static void target_fuse_write(int section, uint8_t *data)
{
  uint32_t value = (data[1] << 8) | data[0];

  if (0 == section)
    dap_write_word_req(FLASH_OPTR, value);
  else if (1 == section)
    dap_write_word_req(FLASH_SDKR, value);
  else if (2 == section)
    dap_write_word_req(FLASH_BTCR, value);
  else if (3 == section)
    dap_write_word_req(FLASH_WRPR, value);
  else
    error_exit("internal: incorrect section index in target_fuse_write()");

  dap_write_word_req(FLASH_CR, FLASH_CR_OPTSTRT);
  dap_write_word_req(0x40022080, 0);
  dap_transfer();

  flash_wait_done();
}

// Assembly:
pushq %rax
cmpl $0x3, %edi
ja 0xee75
movzwl (%rsi), %esi
movl %edi, %eax
leaq 0x4e86(%rip), %rcx      # 0x13cb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x40022020, %edi       # imm = 0x40022020
jmp 0xee4d
movl $0x40022028, %edi       # imm = 0x40022028
jmp 0xee4d
movl $0x4002202c, %edi       # imm = 0x4002202C
jmp 0xee4d
movl $0x40022024, %edi       # imm = 0x40022024
callq 0x711f
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x20000, %esi          # imm = 0x20000
callq 0x711f
movl $0x40022080, %edi       # imm = 0x40022080
xorl %esi, %esi
callq 0x711f
callq 0x6a6f
popq %rax
jmp 0xee96
leaq 0x39b0(%rip), %rdi      # 0x1282c
xorl %eax, %eax
callq 0x7ca5
jmp 0xee52
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/target_puya_py32f0.c
// Function: flash_wait_done
static void flash_wait_done(void)
{
  while (dap_read_word(FLASH_SR) & FLASH_SR_BSY);

  uint32_t sr = dap_read_word(FLASH_SR);

  if (sr & FLASH_SR_ALL_ERRORS)
    error_exit("flash operation failed. FLASH_SR = 0x%08x", sr);
}

// Assembly:
pushq %rax
movl $0x40022010, %edi       # imm = 0x40022010
callq 0x721a
btl $0x10, %eax
jb 0xee97
movl $0x40022010, %edi       # imm = 0x40022010
callq 0x721a
testl $0x8010, %eax           # imm = 0x8010
je 0xeec9
leaq 0x4585(%rip), %rdi      # 0x13444
movl %eax, %esi
xorl %eax, %eax
popq %rcx
jmp 0x7ca5
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/dbg_lin.c
// Function: dbg_open
void dbg_open(debugger_t *debugger, int version)
{
  g_debugger = debugger;

  g_debugger_fd = open(g_debugger->path, O_RDWR);

  if (g_debugger_fd < 0)
    error_exit("unable to open device %s: %s",  g_debugger->path, strerror(errno));

  g_debugger->use_v2 = (DBG_CMSIS_DAP_V2 == version);

  int interface = g_debugger->use_v2 ? g_debugger->v2_interface : g_debugger->v1_interface;

  { // Disconnect kernel driver
    struct usbdevfs_disconnect_claim dc;

    dc.interface = interface;
    dc.flags = USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER;
    strcpy(dc.driver, "usbfs");

    int res = ioctl(g_debugger_fd, USBDEVFS_DISCONNECT_CLAIM, &dc);
    check(res >= 0, "ioctl(DISCONNECT_CLAIM): %d", res);
  }

  { // Claim interface
    int res = ioctl(g_debugger_fd, USBDEVFS_CLAIMINTERFACE, &interface);
    check(res >= 0, "ioctl(CLAIMINTERFACE): %d", res);
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %esi, %ebx
movq %rdi, 0x6fb81(%rip)     # 0x7ee98
movq (%rdi), %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x6200
movl %eax, 0xce04(%rip)      # 0x1c130
testl %eax, %eax
jns 0xf360
movq 0x6fb61(%rip), %rax     # 0x7ee98
movq (%rax), %r14
callq 0x6040
movl (%rax), %edi
callq 0x62a0
leaq 0x4a04(%rip), %rdi      # 0x13d51
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x7ca5
movl 0xcdd0(%rip), %eax      # 0x1c130
movq 0x6fb31(%rip), %rcx     # 0x7ee98
leaq 0x40(%rcx), %rdx
leaq 0x58(%rcx), %rsi
cmpl $0x4, %ebx
sete 0x34(%rcx)
cmoveq %rsi, %rdx
movl (%rdx), %ecx
leaq 0xc(%rsp), %rbx
movl %ecx, (%rbx)
leaq 0x10(%rsp), %rdx
movl %ecx, (%rdx)
movabsq $0x6662737500000002, %rcx # imm = 0x6662737500000002
movq %rcx, 0x4(%rdx)
movw $0x73, 0xc(%rdx)
movl $0x8004550f, %ecx       # imm = 0x8004550F
leaq 0x104000c(%rcx), %rsi
movl %eax, %edi
xorl %eax, %eax
callq 0x60f0
movl %eax, %edi
notl %edi
shrl $0x1f, %edi
leaq 0x49b3(%rip), %rsi      # 0x13d74
movl %eax, %edx
xorl %eax, %eax
callq 0x7bcc
movl 0xcd60(%rip), %edi      # 0x1c130
movl $0x8004550f, %esi       # imm = 0x8004550F
movq %rbx, %rdx
xorl %eax, %eax
callq 0x60f0
movl %eax, %edi
notl %edi
shrl $0x1f, %edi
leaq 0x49a3(%rip), %rsi      # 0x13d90
movl %eax, %edx
xorl %eax, %eax
callq 0x7bcc
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/dbg_lin.c
// Function: dbg_close
void dbg_close(void)
{
  int interface = g_debugger->use_v2 ? g_debugger->v2_interface : g_debugger->v1_interface;

  { // Release interface
    int res = ioctl(g_debugger_fd, USBDEVFS_RELEASEINTERFACE, &interface);
    check(res >= 0, "ioctl(RELEASEINTERFACE): %d", res);
  }

  close(g_debugger_fd);
}

// Assembly:
pushq %rax
movq 0x6fa8f(%rip), %rax     # 0x7ee98
leaq 0x40(%rax), %rcx
leaq 0x58(%rax), %rdx
cmpb $0x0, 0x34(%rax)
cmovneq %rdx, %rcx
movl (%rcx), %eax
leaq 0x4(%rsp), %rdx
movl %eax, (%rdx)
movl 0xcd08(%rip), %edi      # 0x1c130
movl $0x80045510, %esi       # imm = 0x80045510
xorl %eax, %eax
callq 0x60f0
movl %eax, %edi
notl %edi
shrl $0x1f, %edi
leaq 0x4968(%rip), %rsi      # 0x13daa
movl %eax, %edx
xorl %eax, %eax
callq 0x7bcc
movl 0xccdf(%rip), %edi      # 0x1c130
callq 0x6120
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/ataradov[P]edbg/dbg_lin.c
// Function: get_string
static char *get_string(int fd, int index)
{
  struct usbdevfs_ctrltransfer ctrl;
  uint16_t buf[128] = { 0 };

  ctrl.bRequestType = USB_RECIP_DEVICE | USB_TYPE_STANDARD | USB_DIR_IN;
  ctrl.bRequest     = USB_REQ_GET_DESCRIPTOR;
  ctrl.wValue       = (USB_DT_STRING << 8) | index;
  ctrl.wIndex       = LANGID_US_ENGLISH;
  ctrl.wLength      = sizeof(buf);
  ctrl.data         = buf;
  ctrl.timeout      = CONTROL_TIMEOUT;

  int res = ioctl(fd, USBDEVFS_CONTROL, &ctrl);

  if (res < 0)
    return "";

  check(res >= 2 && 0 == (res % 2), "invalid string descriptor response");

  int len = res/2 - 1;
  char *str = "<unknown>";

  if (len > 0)
  {
    str = buf_alloc(len + 1);

    for (int i = 0; i < len; i++)
      str[i] = isprint(buf[i+1]) ? buf[i+1] : '?';
  }

  return str;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movl %esi, %ebx
movl %edi, %ebp
leaq 0x20(%rsp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x60e0
leaq 0x8(%rsp), %rdx
movw $0x680, (%rdx)          # imm = 0x680
orl $0x300, %ebx            # imm = 0x300
movw %bx, 0x2(%rdx)
movabsq $0x9601000409, %rax     # imm = 0x9601000409
movq %rax, 0x4(%rdx)
movq %r14, 0x10(%rdx)
movl $0xc0185500, %esi       # imm = 0xC0185500
movl %ebp, %edi
xorl %eax, %eax
callq 0x60f0
testl %eax, %eax
js 0xf746
movl %eax, %ebx
cmpl $0x2, %eax
setae %al
testb $0x1, %bl
sete %cl
andb %al, %cl
movzbl %cl, %edi
leaq 0x47bd(%rip), %rsi      # 0x13eb9
xorl %eax, %eax
callq 0x7bcc
cmpl $0x4, %ebx
jb 0xf74f
shrl %ebx
leal -0x1(%rbx), %r14d
movl %ebx, %edi
callq 0x7dd2
movq %rax, %rbx
callq 0x62d0
xorl %ecx, %ecx
movq (%rax), %rsi
movzwl 0x22(%rsp,%rcx,2), %edx
movzwl (%rsi,%rdx,2), %esi
btl $0xe, %esi
movl $0x3f, %esi
jae 0xf738
movl %edx, %esi
movb %sil, (%rbx,%rcx)
incq %rcx
cmpq %rcx, %r14
jne 0xf71f
jmp 0xf756
leaq 0x1190(%rip), %rbx      # 0x108dd
jmp 0xf756
leaq 0x4786(%rip), %rbx      # 0x13edc
movq %rbx, %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/openshmem-org[P]openshmem-examples/c/bar_pair.c
// Function: main
int
main()
{
    int me;
    int i;

    for (i = 0; i < SHMEM_BARRIER_SYNC_SIZE; i += 1) {
        pSync[i] = SHMEM_SYNC_VALUE;
    }

    shmem_init();
    me = shmem_my_pe();

    shmem_barrier_all();

    if (me == 0) {
        shmem_int_p(&x, 4, 1);
    }

    if (me == 2) {
        printf("Process %d going to sleep\n", me);
        sleep(3);
        printf("Process %d out from sleep\n", me);
    }

    printf("Process %d before barrier\n", me);
    if (me == 2 || me == 3) {
        shmem_barrier(2, 0, 2, pSync);
    }
    printf("Process %d after barrier\n", me);

    printf("%d: x = %d\n", me, x);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbx
movq $-0x1, 0x2ec0(%rip) # 0x4078
callq 0x10a0
callq 0x1080
movl %eax, %ebx
callq 0x1090
cmpl $0x2, %ebx
je 0x11fa
testl %ebx, %ebx
jne 0x123f
leaq 0x2e8f(%rip), %rdi      # 0x4068
movl $0x4, %esi
movl $0x1, %edx
callq 0x1040
leaq 0xe4b(%rip), %rdi       # 0x203a
xorl %esi, %esi
xorl %eax, %eax
callq 0x1030
jmp 0x1271
leaq 0xe03(%rip), %rdi       # 0x2004
movl $0x2, %esi
xorl %eax, %eax
callq 0x1030
movl $0x3, %edi
callq 0x1060
leaq 0xe01(%rip), %rdi       # 0x201f
movl $0x2, %esi
xorl %eax, %eax
callq 0x1030
leaq 0xe09(%rip), %rdi       # 0x203a
movl $0x2, %esi
xorl %eax, %eax
callq 0x1030
jmp 0x1259
leaq 0xdf4(%rip), %rdi       # 0x203a
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x1271
leaq 0x2e18(%rip), %rcx      # 0x4078
movl $0x2, %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1050
leaq 0xddd(%rip), %rdi       # 0x2055
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
movl 0x2de1(%rip), %edx      # 0x4068
leaq 0xde1(%rip), %rdi       # 0x206f
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
callq 0x1070
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/read1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char buf[FILESIZE];
	char tmpfile[] = "/tmp/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);

	unlink(tmpfile);

	memset(buf, 0, sizeof(buf));
	assert(fd >= 0);
	assert(write(fd, buf, sizeof(buf)) == sizeof(buf));

	while (1) {
		int len = read(fd, buf, BUFLEN);
		assert(len >= 0);
		if (len == 0)
			lseek(fd, 0, SEEK_SET);

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100020, %rsp         # imm = 0x100020
movq %rdi, %rbx
movaps 0x6a7(%rip), %xmm0      # 0x3340
movq %rsp, %r14
movaps %xmm0, (%r14)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%r14)
movq %r14, %rdi
callq 0x21e0
movl %eax, %ebp
movq %r14, %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
movl $0x100000, %edx         # imm = 0x100000
xorl %esi, %esi
callq 0x2140
testl %ebp, %ebp
js 0x2d4c
leaq 0x20(%rsp), %rsi
movl $0x100000, %edx         # imm = 0x100000
movl %ebp, %edi
callq 0x20d0
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x2d6b
leaq 0x20(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
callq 0x2160
testl %eax, %eax
js 0x2d2d
leaq 0x20(%rsp), %r14
testl %eax, %eax
jne 0x2d17
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2120
incq (%rbx)
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x2160
testl %eax, %eax
jns 0x2d08
leaq 0x5fb(%rip), %rdi       # 0x332f
leaq 0x588(%rip), %rsi       # 0x32c3
leaq 0x58f(%rip), %rcx       # 0x32d1
movl $0x1a, %edx
callq 0x2130
leaq 0x568(%rip), %rdi       # 0x32bb
leaq 0x569(%rip), %rsi       # 0x32c3
leaq 0x570(%rip), %rcx       # 0x32d1
movl $0x15, %edx
callq 0x2130
leaq 0x592(%rip), %rdi       # 0x3304
leaq 0x54a(%rip), %rsi       # 0x32c3
leaq 0x551(%rip), %rcx       # 0x32d1
movl $0x16, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O3/florianne1212[P]Cub3D_42/srcs/check.c
// Function: check_right
int		check_right(t_map *map, int x, int y)
{
	int	i;
	int	test;

	i = 0;
	test = 0;
	while ((y + i) < map->width_map && (map->mapp[x][y + i] != 32))
	{
		if (ft_strcmp_c("012NSWE", map->mapp[x][y + i]) == 0)
		{
			put_color(RED,
			"\nError\n wrong character in map or too many elements");
			exit(0);
		}
		if (map->mapp[x][y + i] == '1')
			test = 1;
		i++;
	}
	if (test == 1)
		return (1);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %eax, %eax
cmpl %edx, 0x8(%rdi)
jle 0x65a8
movq %rdi, %rbx
movslq %esi, %r15
movslq %edx, %r12
movq (%rdi), %rax
movq (%rax,%r15,8), %rax
xorl %ebp, %ebp
leaq 0x7a9d(%rip), %r14      # 0xe004
movl $0x1, %r13d
movb (%rax,%r12), %al
cmpb $0x20, %al
je 0x65a0
movsbl %al, %esi
movq %r14, %rdi
callq 0xa87c
testl %eax, %eax
je 0x65b7
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
cmpb $0x31, (%rax,%r12)
cmovel %r13d, %ebp
movslq 0x8(%rbx), %rcx
incq %r12
cmpq %rcx, %r12
jl 0x656d
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a4e(%rip), %rdi      # 0xe00c
leaq 0x7a4d(%rip), %rsi      # 0xe012
callq 0xae58
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O3/florianne1212[P]Cub3D_42/srcs/check.c
// Function: check_left
int		check_left(t_map *map, int x, int y)
{
	int	test;

	test = 0;
	while (y >= 0 && (map->mapp[x][y] != 32))
	{
		if (ft_strcmp_c("012NSWE", map->mapp[x][y]) == 0)
		{
			put_color(RED,
			"\nError\n wrong character in map or too many elements");
			exit(0);
		}
		if (map->mapp[x][y] == '1')
			test = 1;
		y--;
	}
	if (test == 1)
		return (1);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %edx, %edx
js 0x6639
movq %rdi, %rbx
movslq %esi, %r15
movq (%rdi), %rax
movq (%rax,%r15,8), %rax
xorl %ebp, %ebp
leaq 0x7a0e(%rip), %r14      # 0xe004
movl $0x1, %r12d
movl %edx, %r13d
movb (%rax,%r13), %al
cmpb $0x20, %al
je 0x662f
movsbl %al, %esi
movq %r14, %rdi
callq 0xa87c
testl %eax, %eax
je 0x664a
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
cmpb $0x31, (%rax,%r13)
cmovel %r12d, %ebp
leal -0x1(%r13), %edx
testl %r13d, %r13d
jg 0x65fc
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
jmp 0x663b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x79bb(%rip), %rdi      # 0xe00c
leaq 0x79ba(%rip), %rsi      # 0xe012
callq 0xae58
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O3/florianne1212[P]Cub3D_42/srcs/check.c
// Function: check_above
int		check_above(t_map *map, int x, int y)
{
	int	i;
	int	test;

	i = 0;
	test = 0;
	while ((x + i) <= map->height_map && (map->mapp[x + i][y] != 32))
	{
		if (ft_strcmp_c("012NSWE", map->mapp[x + i][y]) == 0)
		{
			put_color(RED,
			"\nError\n wrong character in map or too many elements");
			exit(0);
		}
		if (map->mapp[x + i][y] == '1')
			test = 1;
		i++;
	}
	if (test == 1)
		return (1);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %eax, %eax
cmpl %esi, 0xc(%rdi)
jl 0x66d0
movq %rdi, %rbx
movslq %edx, %r15
movslq %esi, %r12
movq (%rdi), %rax
xorl %ebp, %ebp
leaq 0x7979(%rip), %r14      # 0xe004
movl $0x1, %r13d
movq (%rax,%r12,8), %rax
movb (%rax,%r15), %al
cmpb $0x20, %al
je 0x66c8
movsbl %al, %esi
movq %r14, %rdi
callq 0xa87c
testl %eax, %eax
je 0x66df
movq (%rbx), %rax
movq (%rax,%r12,8), %rcx
cmpb $0x31, (%rcx,%r15)
cmovel %r13d, %ebp
movslq 0xc(%rbx), %rcx
incq %r12
cmpq %rcx, %r12
jle 0x6691
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7926(%rip), %rdi      # 0xe00c
leaq 0x7925(%rip), %rsi      # 0xe012
callq 0xae58
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O3/florianne1212[P]Cub3D_42/srcs/check.c
// Function: check_below
int		check_below(t_map *map, int x, int y)
{
	int	test;

	test = 0;
	while ((x) >= 0 && (map->mapp[x][y] != 32))
	{
		if (ft_strcmp_c("012NSWE", map->mapp[x][y]) == 0)
		{
			put_color(RED,
			"\nError\n wrong character in map or too many elements");
			exit(0);
		}
		if (map->mapp[x][y] == '1')
			test = 1;
		x--;
	}
	if (test == 1)
		return (1);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x6761
movq %rdi, %rbx
movslq %edx, %r15
movq (%rdi), %rax
xorl %ebp, %ebp
leaq 0x78ea(%rip), %r14      # 0xe004
movl $0x1, %r12d
movl %esi, %r13d
movq (%rax,%r13,8), %rax
movb (%rax,%r15), %al
cmpb $0x20, %al
je 0x6757
movsbl %al, %esi
movq %r14, %rdi
callq 0xa87c
testl %eax, %eax
je 0x6772
movq (%rbx), %rax
movq (%rax,%r13,8), %rcx
cmpb $0x31, (%rcx,%r15)
cmovel %r12d, %ebp
leal -0x1(%r13), %esi
testl %r13d, %r13d
jg 0x6720
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
jmp 0x6763
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7893(%rip), %rdi      # 0xe00c
leaq 0x7892(%rip), %rsi      # 0xe012
callq 0xae58
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O3/florianne1212[P]Cub3D_42/srcs/check_args.c
// Function: check_cub
char		*check_cub(char *argv)
{
	char	*cub_file;
	int		i;
	int		j;

	i = 0;
	if (!(cub_file = malloc(sizeof(char) * (ft_strlen(argv) + 1))))
		return (NULL);
	while (argv[i] != '\0')
	{
		cub_file[i] = argv[i];
		i++;
	}
	cub_file[i] = '\0';
	j = ft_strlen(cub_file);
	if (cub_file[j - 1] != 'b' || cub_file[j - 2] != 'u' ||
	cub_file[j - 3] != 'c' || cub_file[j - 4] != '.')
	{
		put_color(RED, "put a .cub file");
		free(cub_file);
		exit(0);
	}
	return (cub_file);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xab20
incl %eax
movslq %eax, %rdi
callq 0x6100
movq %rax, %rbx
testq %rax, %rax
je 0x67ea
movb (%r14), %cl
xorl %eax, %eax
testb %cl, %cl
je 0x67c0
movb %cl, (%rbx,%rax)
movb 0x1(%r14,%rax), %cl
incq %rax
jmp 0x67af
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0xab20
cltq
cmpb $0x62, -0x1(%rbx,%rax)
jne 0x67f5
cmpb $0x75, -0x2(%rbx,%rax)
jne 0x67f5
cmpb $0x63, -0x3(%rbx,%rax)
jne 0x67f5
cmpb $0x2e, -0x4(%rbx,%rax)
jne 0x67f5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7810(%rip), %rdi      # 0xe00c
leaq 0x7843(%rip), %rsi      # 0xe046
callq 0xae58
movq %rbx, %rdi
callq 0x6170
xorl %edi, %edi
callq 0x60a0