LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x2
popq %rdi
callq 0x6429
movq %rsp, %rdi
pushq $0x5
popq %rsi
callq 0x7682
movl %eax, %ebp
leaq 0x697d(%rip), %rdi      # 0x13750
xorl %eax, %eax
callq 0x773c
testl %ebp, %ebp
movl $0x0, %r12d
cmovgl %ebp, %r12d
leaq 0x6979(%rip), %r14      # 0x13766
xorl %r15d, %r15d
cmpq %r15, %r12
je 0xce0b
movl (%rsp,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x773c
incq %r15
jmp 0xcdf0
testl %ebp, %ebp
je 0xce1d
cmpl $0x2, %ebp
jl 0xce2b
leaq 0x697f(%rip), %rdi      # 0x1379a
jmp 0xce24
leaq 0x6950(%rip), %rdi      # 0x13774
xorl %eax, %eax
callq 0x7a0e
movl (%rsp), %esi
xorl %eax, %eax
leaq 0xeef9(%rip), %r14      # 0x1bd30
leaq 0x18(%rax), %r15
cmpq $0x60, %r15
je 0xcea3
cmpl %esi, (%rax,%r14)
movq %r15, %rax
jne 0xce37
movq -0x8(%r15,%r14), %rsi
leaq 0x5a0f(%rip), %rdi      # 0x12865
xorl %eax, %eax
callq 0x773c
movq -0x8(%r15,%r14), %rax
movq %rax, 0x72f57(%rip)     # 0x7fdc0
movups -0x18(%r15,%r14), %xmm0
movups %xmm0, 0x72f3a(%rip)    # 0x7fdb0
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm0, 0x72f40(%rip)    # 0x7fdc8
movups %xmm1, 0x72f49(%rip)    # 0x7fdd8
movups %xmm2, 0x72f52(%rip)    # 0x7fde8
movq 0x30(%rbx), %rax
movq %rax, 0x72f57(%rip)     # 0x7fdf8
jmp 0xceb1
leaq 0x6920(%rip), %rdi      # 0x137ca
xorl %eax, %eax
callq 0x7a0e
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
pushq $0x5e
popq %rdi
pushq $0x8
popq %rbx
movl %ebx, %esi
callq 0x7508
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x74c6
callq 0xd368
pushq $0x26
popq %rdi
movl %ebx, %esi
callq 0x7508
movl %ebx, %edi
callq 0x74c6
movl $0xff, %edi
movl %ebx, %esi
callq 0x7508
pushq $0x64
popq %rbp
movl %ebp, %edi
callq 0x74c6
pushq $0x79
popq %rdi
movl %ebx, %esi
callq 0x7508
movl %ebx, %edi
callq 0x74c6
movl $0xff, %edi
movl %ebx, %esi
callq 0x7508
movl %ebp, %edi
callq 0x74c6
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x71db
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x10, %rsp
callq 0xd403
pushq $0x8
popq %rbx
movl $0xc6, %edi
movl %ebx, %esi
callq 0x7508
leaq 0xf(%rsp), %rdi
movb $0x8, (%rdi)
movl %ebx, %esi
callq 0x7589
movl %ebx, %edi
callq 0x74c6
pushq $0xe
popq %rdi
movl %ebx, %esi
callq 0x7508
leaq 0xe(%rsp), %rdi
movb $0xe, (%rdi)
movl %ebx, %esi
callq 0x7589
movl %ebx, %edi
callq 0x74c6
callq 0xd368
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
andl $0x0, 0xc(%rsp)
leaq 0xb(%rsp), %rbx
movb $0x1, (%rbx)
movb $0x1, %al
pushq $0x8
popq %rbp
pushq $0x1
popq %r14
testb %al, %al
je 0xd3a7
movl $0xf0, %edi
movl %ebp, %esi
callq 0x7508
movq %rbx, %rdi
movl %r14d, %esi
callq 0x7607
movb 0xb(%rsp), %al
jmp 0xd386
pushq $0x3c
popq %rdi
pushq $0x8
popq %rbx
movl %ebx, %esi
callq 0x7508
leaq 0xc(%rsp), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x7607
movl %ebx, %edi
callq 0x74c6
movl (%r14), %eax
btl $0xc, %eax
jae 0xd3e6
leaq 0x6447(%rip), %rdi      # 0x13822
xorl %eax, %eax
callq 0x7a0e
movl 0xc(%rsp), %eax
btl $0xd, %eax
jae 0xd3fa
leaq 0x6446(%rip), %rdi      # 0x13839
xorl %eax, %eax
callq 0x7a0e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x10, %rsp
pushq $0x8
popq %rbx
movl $0xc6, %edi
movl %ebx, %esi
callq 0x7508
leaq 0xf(%rsp), %rdi
movb $0x0, (%rdi)
movl %ebx, %esi
callq 0x7589
movl %ebx, %edi
callq 0x74c6
pushq $0xe
popq %rdi
movl %ebx, %esi
callq 0x7508
leaq 0xe(%rsp), %rdi
movb $0x1, (%rdi)
movl %ebx, %esi
callq 0x7589
movl %ebx, %edi
callq 0x74c6
movl $0xff, %edi
movl %ebx, %esi
callq 0x7508
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4(%rsp), %rbx
movb $-0x39, (%rbx)
callq 0xe0a0
xorl %edi, %edi
callq 0xdfcb
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0xdfd7
movl %ebp, %edi
callq 0xdfcb
pushq $0xa
popq %r12
pushq $0x64
popq %rbx
leaq 0x2bd4(%rip), %r14      # 0x1080f
xorl %r13d, %r13d
xorl %ebp, %ebp
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
movl %eax, %r15d
callq 0xe0cd
testb %al, %al
je 0xdc77
imull $0xa, %r15d, %r15d
addl %r13d, %r15d
movl %ebx, %edi
callq 0x7aeb
testl %r15d, %r15d
jne 0xdc70
movq %r14, %rdi
xorl %eax, %eax
callq 0x773c
decl %r13d
incl %ebp
jmp 0xdc40
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7215e(%rip), %r12d    # 0x7fe18
movq 0x7216f(%rip), %rax     # 0x7fe30
movq %rax, 0x8(%rsp)
movl $0xff, %ebp
addl 0x72157(%rip), %ebp     # 0x7fe28
shrl $0x8, %ebp
xorl %ebx, %ebx
movl %r12d, 0x4(%rsp)
xorl %r15d, %r15d
cmpl %ebp, %r15d
je 0xddde
testw $0xfff, %r12w           # imm = 0xFFF
je 0xdcff
movl %r12d, %r13d
shrl $0x10, %r13d
movl %r12d, %r14d
shrl $0x8, %r14d
jmp 0xdd52
movb 0xf2d3(%rip), %al       # 0x1cfd8
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 0xe0a0
xorl %edi, %edi
callq 0xdfcb
leaq 0x10(%rsp), %rdi
pushq $0x4
popq %rdx
movl %edx, %esi
callq 0xdfd7
pushq $0x1
popq %rdi
callq 0xdfcb
callq 0xe0cd
testb %al, %al
jne 0xdd49
movq 0x8(%rsp), %rax
leaq (%rax,%rbx), %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 0xe0a0
xorl %edi, %edi
callq 0xdfcb
leaq 0x10(%rsp), %rdi
movl $0x104, %esi            # imm = 0x104
movl $0x104, %edx            # imm = 0x104
callq 0xdfd7
pushq $0x1
popq %rdi
callq 0xdfcb
callq 0xe0cd
testb %al, %al
jne 0xdda9
addl $0x100, %r12d           # imm = 0x100
testw $0x3fff, %r12w          # imm = 0x3FFF
jne 0xddcf
leaq 0x2a47(%rip), %rdi      # 0x1080f
xorl %eax, %eax
callq 0x773c
addq $0x100, %rbx            # imm = 0x100
incl %r15d
jmp 0xdcde
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x72014(%rip), %ebp     # 0x7fe18
leal 0x13000000(%rbp), %r13d
movq 0x7201e(%rip), %r15     # 0x7fe30
movl 0x7200f(%rip), %r12d    # 0x7fe28
movl $0x1000, %edi           # imm = 0x1000
callq 0x7b1b
movq %rax, %r14
callq 0xe11b
xorl %ebx, %ebx
xorl %ecx, %ecx
testl %r12d, %r12d
je 0xdef5
movl %ecx, 0xc(%rsp)
movl %r13d, 0x14(%rsp)
movl %r13d, %edi
movq %r14, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x7018
movl $0x1000, %eax           # imm = 0x1000
cmpl %eax, %r12d
movl %r12d, %eax
movl $0x1000, %r12d          # imm = 0x1000
movl %eax, 0x10(%rsp)
cmovbl %eax, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0xdeb2
leal (%rbx,%r13), %eax
movzbl (%r15,%rax), %edx
movzbl (%r14,%r13), %ecx
cmpb %cl, %dl
je 0xdead
leal (%rbp,%r13), %esi
leaq 0x496d(%rip), %rdi      # 0x127fd
xorl %eax, %eax
callq 0x773c
movq %r14, %rdi
callq 0x7b3c
leaq 0x5bc2(%rip), %rdi      # 0x13a68
xorl %eax, %eax
callq 0x7a0e
incq %r13
jmp 0xde6d
movl 0xc(%rsp), %ecx
testb $0x3, %cl
jne 0xdecd
leaq 0x294d(%rip), %rdi      # 0x1080f
xorl %eax, %eax
callq 0x773c
movl 0xc(%rsp), %ecx
movl 0x14(%rsp), %r13d
addl $0x1000, %r13d          # imm = 0x1000
movl 0x10(%rsp), %eax
subl %r12d, %eax
movl %eax, %r12d
incl %ecx
movl $0x1000, %eax           # imm = 0x1000
addq %rax, %rbp
addq %rax, %rbx
jmp 0xde2f
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7b3c
// File: /workspace/github_c_makefile_star2_O2/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 $0x13000000, %r15d      # imm = 0x13000000
addl 0x71ef5(%rip), %r15d    # 0x7fe18
movq 0x71f06(%rip), %rbx     # 0x7fe30
movl 0x71eec(%rip), %ebp     # 0x7fe1c
callq 0xe11b
leaq 0x28d3(%rip), %r14      # 0x1080f
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpl %r12d, %ebp
je 0xdf77
leal (%r15,%r12), %edi
movl %r12d, %esi
addq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x7018
testb $0x3, %r13b
jne 0xdf6b
movq %r14, %rdi
xorl %eax, %eax
callq 0x773c
addl $0x1000, %r12d          # imm = 0x1000
incl %r13d
jmp 0xdf42
movq 0x71e92(%rip), %rdi     # 0x7fe10
movl 0x71e98(%rip), %edx     # 0x7fe1c
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7bf8
// File: /workspace/github_c_makefile_star2_O2/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 0xe069
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x20000000, %edi       # imm = 0x20000000
movq %r14, %rsi
movl %r15d, %edx
callq 0x70ef
movl $0x50000018, %edi       # imm = 0x50000018
movl $0x20020000, %esi       # imm = 0x20020000
callq 0x6f02
movl $0x5000001c, %edi       # imm = 0x5000001C
movl %r15d, %esi
callq 0x6f02
movl $0x50000054, %edi       # imm = 0x50000054
movl $0x20000000, %esi       # imm = 0x20000000
callq 0x6f02
movl $0x5000005c, %edi       # imm = 0x5000005C
movl %r15d, %esi
callq 0x6f02
callq 0x68f4
movl $0x50000010, %edi       # imm = 0x50000010
callq 0x6fe1
btl $0x18, %eax
jb 0xe03d
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 0x7018
leaq 0x5b34(%rip), %rdi      # 0x13ba4
leaq 0x5b3d(%rip), %rsi      # 0x13bb4
leaq 0x5b4a(%rip), %rcx      # 0x13bc8
movl $0xdc, %edx
callq 0x60d0
// File: /workspace/github_c_makefile_star2_O2/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
xorl %edi, %edi
callq 0xe088
pushq $0x6
popq %rsi
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x6f02
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x6ed8
pushq $0x1
popq %rdi
callq 0xe088
popq %rax
jmp 0x68f4
// File: /workspace/github_c_makefile_star2_O2/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
xorl %edi, %edi
callq 0xe088
pushq $0x5
popq %rsi
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x6f02
movl $0x18000060, %edi       # imm = 0x18000060
xorl %esi, %esi
callq 0x6f02
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x6ed8
movl $0x18000060, %edi       # imm = 0x18000060
callq 0x6ed8
pushq $0x1
popq %rdi
callq 0xe088
callq 0x68f4
pushq $0x4
popq %rdi
callq 0x6f84
andb $0x1, %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6f02
movl $0x18000008, %edi       # imm = 0x18000008
xorl %esi, %esi
callq 0x6f02
movzbl 0x71cfd(%rip), %esi     # 0x7fe38
shll $0x16, %esi
orl $0x1f0300, %esi         # imm = 0x1F0300
movl $0x18000000, %edi       # imm = 0x18000000
callq 0x6f02
movl 0xee88(%rip), %eax      # 0x1cfdc
shll $0x18, %eax
movl 0x71cdf(%rip), %esi     # 0x7fe3c
shll $0xb, %esi
orl %eax, %esi
orl $0x218, %esi            # imm = 0x218
movl $0x180000f4, %edi       # imm = 0x180000F4
callq 0x6f02
pushq $0x1
popq %rsi
movl $0x18000008, %edi       # imm = 0x18000008
callq 0x6f02
movl $0x1800004c, %edi       # imm = 0x1800004C
xorl %esi, %esi
callq 0x6f02
popq %rax
jmp 0x68f4
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x4
popq %rsi
movl $0x40022014, %edi       # imm = 0x40022014
callq 0x6f02
movl $0x8000000, %edi        # imm = 0x8000000
xorl %esi, %esi
callq 0x6f02
callq 0x68f4
callq 0xe711
movl $0x40022014, %edi       # imm = 0x40022014
xorl %esi, %esi
popq %rax
jmp 0x700c
// File: /workspace/github_c_makefile_star2_O2/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 0x6fe1
andl $0xff00, %eax           # imm = 0xFF00
leal 0xee(%rax), %esi
movl $0x40022020, %edi       # imm = 0x40022020
callq 0x6f02
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x20000, %esi          # imm = 0x20000
callq 0x6f02
movl $0x40022080, %edi       # imm = 0x40022080
xorl %esi, %esi
callq 0x6f02
callq 0x68f4
popq %rax
jmp 0xe711
// File: /workspace/github_c_makefile_star2_O2/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 0x6fe1
andl $0xff00, %eax           # imm = 0xFF00
leal 0xaa(%rax), %esi
movl $0x40022020, %edi       # imm = 0x40022020
callq 0x6f02
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x20000, %esi          # imm = 0x20000
callq 0x6f02
movl $0x40022080, %edi       # imm = 0x40022080
xorl %esi, %esi
callq 0x6f02
callq 0x68f4
popq %rax
jmp 0xe711
// File: /workspace/github_c_makefile_star2_O2/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 $0x8000000, %ebx        # imm = 0x8000000
addl 0x71a4f(%rip), %ebx     # 0x7fe78
movq 0x71a60(%rip), %r12     # 0x7fe90
movl 0x71a52(%rip), %eax     # 0x7fe88
addl $0x7f, %eax
shrl $0x7, %eax
movl %eax, 0x4(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x4(%rsp), %r15d
je 0xe4e0
movl $0x40022014, %edi       # imm = 0x40022014
pushq $0x2
popq %rsi
callq 0x6f02
xorl %r14d, %r14d
movl %ebx, %edi
xorl %esi, %esi
callq 0x6f02
callq 0x68f4
callq 0xe711
movl $0x40022014, %edi       # imm = 0x40022014
pushq $0x1
popq %rsi
callq 0x700c
leal (%r14,%rbp), %r13d
cmpl $0x1f, %r14d
je 0xe492
cmpl $0x20, %r14d
jne 0xe4a1
jmp 0xe4b7
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x80001, %esi          # imm = 0x80001
callq 0x700c
movl %r13d, %eax
movl (%r12,%rax,4), %esi
movl %ebx, %edi
callq 0x6f02
addl $0x4, %ebx
incl %r14d
jmp 0xe480
callq 0x68f4
callq 0xe711
testb $0x1f, %r15b
jne 0xe4d5
leaq 0x2341(%rip), %rdi      # 0x1080f
xorl %eax, %eax
callq 0x773c
incl %r15d
movl %r13d, %ebp
jmp 0xe445
movl $0x40022014, %edi       # imm = 0x40022014
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x700c
// File: /workspace/github_c_makefile_star2_O2/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
movl $0x8000000, %r15d       # imm = 0x8000000
addl 0x71872(%rip), %r15d    # 0x7fe78
movq 0x71883(%rip), %rbx     # 0x7fe90
movl 0x71869(%rip), %ebp     # 0x7fe7c
leaq 0x21f5(%rip), %r14      # 0x1080f
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpl %r12d, %ebp
je 0xe652
leal (%r15,%r12), %edi
movl %r12d, %esi
addq %rbx, %rsi
movl $0x80, %edx
callq 0x7018
testb $0x1f, %r13b
jne 0xe649
movq %r14, %rdi
xorl %eax, %eax
callq 0x773c
subl $-0x80, %r12d
incl %r13d
jmp 0xe620
movq 0x71817(%rip), %rdi     # 0x7fe70
movl 0x7181d(%rip), %edx     # 0x7fe7c
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7bf8
// File: /workspace/github_c_makefile_star2_O2/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 0xe6f0
movzwl (%rsi), %esi
movl %edi, %eax
leaq 0x560b(%rip), %rcx      # 0x13cb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x40022020, %edi       # imm = 0x40022020
jmp 0xe6c8
movl $0x40022028, %edi       # imm = 0x40022028
jmp 0xe6c8
movl $0x4002202c, %edi       # imm = 0x4002202C
jmp 0xe6c8
movl $0x40022024, %edi       # imm = 0x40022024
callq 0x6f02
movl $0x40022014, %edi       # imm = 0x40022014
movl $0x20000, %esi          # imm = 0x20000
callq 0x6f02
movl $0x40022080, %edi       # imm = 0x40022080
xorl %esi, %esi
callq 0x6f02
callq 0x68f4
popq %rax
jmp 0xe711
leaq 0x4135(%rip), %rdi      # 0x1282c
xorl %eax, %eax
callq 0x7a0e
jmp 0xe6cd
// File: /workspace/github_c_makefile_star2_O2/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 0x6fe1
btl $0x10, %eax
jb 0xe712
movl $0x40022010, %edi       # imm = 0x40022010
callq 0x6fe1
testw $0x8010, %ax            # imm = 0x8010
je 0xe743
leaq 0x4d0b(%rip), %rdi      # 0x13444
movl %eax, %esi
xorl %eax, %eax
popq %rcx
jmp 0x7a0e
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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, 0x712c3(%rip)     # 0x7fe98
movq (%rdi), %rdi
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x6200
movl %eax, 0xe548(%rip)      # 0x1d130
testl %eax, %eax
jns 0xec1c
movq 0x712a5(%rip), %rax     # 0x7fe98
movq (%rax), %r14
callq 0x6040
movl (%rax), %edi
callq 0x62a0
leaq 0x5148(%rip), %rdi      # 0x13d51
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x7a0e
movl 0xe514(%rip), %eax      # 0x1d130
movq 0x71275(%rip), %rcx     # 0x7fe98
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 0x50f7(%rip), %rsi      # 0x13d74
movl %eax, %edx
xorl %eax, %eax
callq 0x793d
movl 0xe4a4(%rip), %edi      # 0x1d130
movl $0x8004550f, %esi       # imm = 0x8004550F
movq %rbx, %rdx
xorl %eax, %eax
callq 0x60f0
movl %eax, %edi
notl %edi
shrl $0x1f, %edi
leaq 0x50e7(%rip), %rsi      # 0x13d90
movl %eax, %edx
xorl %eax, %eax
callq 0x793d
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x711d3(%rip), %rax     # 0x7fe98
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 0xe44c(%rip), %edi      # 0x1d130
movl $0x80045510, %esi       # imm = 0x80045510
xorl %eax, %eax
callq 0x60f0
movl %eax, %edi
notl %edi
shrl $0x1f, %edi
leaq 0x50ac(%rip), %rsi      # 0x13daa
movl %eax, %edx
xorl %eax, %eax
callq 0x793d
movl 0xe423(%rip), %edi      # 0x1d130
callq 0x6120
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/ataradov[P]edbg/dbg_lin.c
// Function: find_descriptor
static void *find_descriptor(uint8_t **desc, int *size, int desc_type, int desc_size)
{
  while (*size >= desc_size)
  {
    struct usb_descriptor_header *hdr = (struct usb_descriptor_header *)*desc;

    *desc += hdr->bLength;
    *size -= hdr->bLength;

    if (hdr->bDescriptorType == desc_type)
      return hdr;
  }

  return NULL;
}

// Assembly:
movl (%rsi), %r8d
cmpl %ecx, %r8d
jl 0xef6a
movq (%rdi), %rax
movzbl (%rax), %r9d
leaq (%r9,%rax), %r10
movq %r10, (%rdi)
subl %r9d, %r8d
movl %r8d, (%rsi)
movzbl 0x1(%rax), %r9d
cmpl %edx, %r9d
jne 0xef46
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
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 0xf030
movl %eax, %ebx
cmpl $0x2, %eax
setae %al
testb $0x1, %bl
sete %cl
andb %al, %cl
movzbl %cl, %edi
leaq 0x4ed5(%rip), %rsi      # 0x13eb9
xorl %eax, %eax
callq 0x793d
cmpl $0x4, %ebx
jb 0xf039
shrl %ebx
leal -0x1(%rbx), %r14d
movl %ebx, %edi
callq 0x7b1b
movq %rax, %rbx
xorl %r15d, %r15d
pushq $0x3f
popq %rbp
cmpq %r15, %r14
je 0xf040
callq 0x62d0
movq (%rax), %rcx
movzwl 0x22(%rsp,%r15,2), %eax
movzwl (%rcx,%rax,2), %ecx
btl $0xe, %ecx
movl %ebp, %ecx
jae 0xf027
movl %eax, %ecx
movb %cl, (%rbx,%r15)
incq %r15
jmp 0xf006
leaq 0x18a6(%rip), %rbx      # 0x108dd
jmp 0xf040
leaq 0x4e9c(%rip), %rbx      # 0x13edc
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
orq $-0x1, 0x2ec1(%rip)     # 0x4078
callq 0x10a0
callq 0x1080
movl %eax, %ebx
callq 0x1090
cmpl $0x2, %ebx
je 0x11e5
testl %ebx, %ebx
jne 0x1210
leaq 0x2e90(%rip), %rdi      # 0x4068
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x1040
jmp 0x1210
leaq 0xe18(%rip), %rdi       # 0x2004
pushq $0x2
popq %rbp
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
pushq $0x3
popq %rdi
callq 0x1060
leaq 0xe18(%rip), %rdi       # 0x201f
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
leaq 0xe23(%rip), %rdi       # 0x203a
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x123d
leaq 0x2e47(%rip), %rcx      # 0x4078
pushq $0x2
popq %rdi
xorl %esi, %esi
movl %edi, %edx
callq 0x1050
leaq 0xe11(%rip), %rdi       # 0x2055
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
movl 0x2e15(%rip), %edx      # 0x4068
leaq 0xe15(%rip), %rdi       # 0x206f
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
callq 0x1070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7ab(%rip), %xmm0      # 0x3300
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 0x2bd4
leaq 0x20(%rsp), %rsi
movl $0x100000, %edx         # imm = 0x100000
movl %ebp, %edi
callq 0x20d0
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x2bed
leaq 0x20(%rsp), %r14
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x2160
testl %eax, %eax
js 0x2c06
jne 0x2bcf
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2120
incq (%rbx)
jmp 0x2baf
leaq 0x6a0(%rip), %rdi       # 0x327b
leaq 0x6a1(%rip), %rsi       # 0x3283
leaq 0x6a8(%rip), %rcx       # 0x3291
pushq $0x15
jmp 0x2c1d
leaq 0x6d0(%rip), %rdi       # 0x32c4
leaq 0x688(%rip), %rsi       # 0x3283
leaq 0x68f(%rip), %rcx       # 0x3291
pushq $0x16
jmp 0x2c1d
leaq 0x6e2(%rip), %rdi       # 0x32ef
leaq 0x66f(%rip), %rsi       # 0x3283
leaq 0x676(%rip), %rcx       # 0x3291
pushq $0x1a
popq %rdx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %rbx
movslq %esi, %r15
movslq %edx, %r12
xorl %ebp, %ebp
leaq 0x7aab(%rip), %r14      # 0xe004
pushq $0x1
popq %r13
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x6599
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movb (%rax,%r12), %al
cmpb $0x20, %al
je 0x6599
movsbl %al, %esi
movq %r14, %rdi
callq 0xa324
testl %eax, %eax
je 0x65b0
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
cmpb $0x31, (%rax,%r12)
cmovel %r13d, %ebp
incq %r12
jmp 0x655d
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 0x7a55(%rip), %rdi      # 0xe00c
leaq 0x7a54(%rip), %rsi      # 0xe012
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O2/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
movl %edx, %ebx
movq %rdi, %r14
movslq %esi, %r12
xorl %ebp, %ebp
pushq $0x1
popq %r13
testl %ebx, %ebx
js 0x6620
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movl %ebx, %r15d
movb (%rax,%r15), %al
cmpb $0x20, %al
je 0x6620
movsbl %al, %esi
leaq 0x7a01(%rip), %rdi      # 0xe004
callq 0xa324
testl %eax, %eax
je 0x6637
movq (%r14), %rax
movq (%rax,%r12,8), %rax
cmpb $0x31, (%rax,%r15)
cmovel %r13d, %ebp
decl %ebx
jmp 0x65e3
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 0x79ce(%rip), %rdi      # 0xe00c
leaq 0x79cd(%rip), %rsi      # 0xe012
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %rbx
movslq %edx, %r15
movslq %esi, %r12
xorl %ebp, %ebp
leaq 0x7996(%rip), %r14      # 0xe004
pushq $0x1
popq %r13
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jg 0x66ae
movq (%rbx), %rax
movq (%rax,%r12,8), %rax
movb (%rax,%r15), %al
cmpb $0x20, %al
je 0x66ae
movsbl %al, %esi
movq %r14, %rdi
callq 0xa324
testl %eax, %eax
je 0x66c5
movq (%rbx), %rax
movq (%rax,%r12,8), %rax
cmpb $0x31, (%rax,%r15)
cmovel %r13d, %ebp
incq %r12
jmp 0x6672
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 0x7940(%rip), %rdi      # 0xe00c
leaq 0x793f(%rip), %rsi      # 0xe012
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O2/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
movl %esi, %ebx
movq %rdi, %r14
movslq %edx, %r12
xorl %ebp, %ebp
pushq $0x1
popq %r13
testl %ebx, %ebx
js 0x6735
movq (%r14), %rax
movl %ebx, %r15d
movq (%rax,%r15,8), %rax
movb (%rax,%r12), %al
cmpb $0x20, %al
je 0x6735
movsbl %al, %esi
leaq 0x78ec(%rip), %rdi      # 0xe004
callq 0xa324
testl %eax, %eax
je 0x674c
movq (%r14), %rax
movq (%rax,%r15,8), %rax
cmpb $0x31, (%rax,%r12)
cmovel %r13d, %ebp
decl %ebx
jmp 0x66f8
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 0x78b9(%rip), %rdi      # 0xe00c
leaq 0x78b8(%rip), %rsi      # 0xe012
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
nop
// File: /workspace/github_c_makefile_star2_O2/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 0xa588
incl %eax
movslq %eax, %rdi
callq 0x6100
movq %rax, %rbx
testq %rax, %rax
je 0x67c2
xorl %eax, %eax
movb (%r14,%rax), %cl
testb %cl, %cl
je 0x6798
movb %cl, (%rbx,%rax)
incq %rax
jmp 0x6788
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0xa588
cltq
cmpb $0x62, -0x1(%rbx,%rax)
jne 0x67cd
cmpb $0x75, -0x2(%rbx,%rax)
jne 0x67cd
cmpb $0x63, -0x3(%rbx,%rax)
jne 0x67cd
cmpb $0x2e, -0x4(%rbx,%rax)
jne 0x67cd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7838(%rip), %rdi      # 0xe00c
leaq 0x786b(%rip), %rsi      # 0xe046
callq 0xa7d4
movq %rbx, %rdi
callq 0x6170
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O2/florianne1212[P]Cub3D_42/srcs/check_args.c
// Function: check_args
t_args		check_args(t_args argy, int argc, char **argv)
{
	if (argc == 2)
		argy.cub_file = check_cub(argv[1]);
	if (argc == 3)
	{
		if (ft_strcmp("--save", argv[2]) == 0)
		{
			argy.cub_file = check_cub(argv[1]);
			argy.save = 1;
		}
		else
		{
			put_color(RED,
			"\nError\n wrong arguments the first one muse be .cub file");
			exit(0);
		}
	}
	if (argc > 3)
	{
		put_color(RED, "\nError\n too many arguments");
		exit(0);
	}
	return (argy);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
cmpl $0x3, %esi
je 0x6818
cmpl $0x2, %esi
jne 0x6843
movq 0x8(%r15), %rdi
callq 0x6768
movq %rax, 0x10(%r14)
jmp 0x6848
movq 0x10(%r15), %rsi
leaq 0x7833(%rip), %rdi      # 0xe056
callq 0xa2dc
testl %eax, %eax
jne 0x6861
movq 0x8(%r15), %rdi
callq 0x6768
movq %rax, 0x10(%r14)
movl $0x1, 0x6c(%r14)
jmp 0x6848
cmpl $0x4, %esi
jge 0x6871
movl $0x88, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x63e0
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x77a4(%rip), %rdi      # 0xe00c
leaq 0x77ee(%rip), %rsi      # 0xe05d
jmp 0x687f
leaq 0x7794(%rip), %rdi      # 0xe00c
leaq 0x7816(%rip), %rsi      # 0xe095
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O2/florianne1212[P]Cub3D_42/srcs/check_args.c
// Function: valid_file
int			valid_file(t_args args)
{
	int fd;

	fd = open(args.cub_file, O_RDONLY);
	if (fd < 0)
	{
		put_color(RED, "invalid cub file");
		free(args.cub_file);
		exit(0);
	}
	return (fd);
}

// Assembly:
pushq %rbx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x63f0
testl %eax, %eax
js 0x68a3
popq %rbx
retq
leaq 0x7762(%rip), %rdi      # 0xe00c
leaq 0x77ff(%rip), %rsi      # 0xe0b0
callq 0xa7d4
movq %rbx, %rdi
callq 0x6170
xorl %edi, %edi
callq 0x60a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/florianne1212[P]Cub3D_42/srcs/check_map.c
// Function: full_check
t_map					full_check(t_map map, int i, int j)
{
	int x;
	int y;

	x = 0;
	y = 0;
	while (y <= i)
	{
		while (map.mapp[y][x] != '\0')
		{
			if ((ft_strcmp_c("012NSWE", map.mapp[y][x]) == 0 &&
			ft_isspace(map.mapp[y][x]) == 0) && map.mapp[y][x] != 0)
			{
				put_color(RED,
				"\nError\n There is a wrong character in your map");
				exit(0);
			}
			x++;
		}
		x = 0;
		y++;
	}
	map = ft_check_map(&map, i, j);
	return (map);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
leaq 0x70(%rsp), %r14
movl %esi, (%rsp)
movslq %esi, %r13
xorl %ebp, %ebp
leaq 0x76e9(%rip), %r12      # 0xe004
cmpq %r13, %rbp
jg 0x6964
movq (%r14), %r15
xorl %ebx, %ebx
movq (%r15,%rbp,8), %rax
movb (%rax,%rbx), %al
testb %al, %al
je 0x695f
movsbl %al, %esi
movq %r12, %rdi
callq 0xa324
testl %eax, %eax
jne 0x695a
movq (%r15,%rbp,8), %rax
movsbl (%rax,%rbx), %edi
callq 0xa15c
testl %eax, %eax
jne 0x695a
movq (%r15,%rbp,8), %rax
cmpb $0x0, (%rax,%rbx)
jne 0x69c4
incq %rbx
jmp 0x6925
incq %rbp
jmp 0x691b
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl (%rsp), %edx
movl 0x4(%rsp), %ecx
callq 0x8ed4
movq 0x20(%r12), %rax
movq %rax, 0x20(%r14)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq 0x20(%r14), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7641(%rip), %rdi      # 0xe00c
leaq 0x7712(%rip), %rsi      # 0xe0e4
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
// File: /workspace/github_c_makefile_star2_O2/florianne1212[P]Cub3D_42/srcs/check_map.c
// Function: ft_check_borders
void					ft_check_borders(t_map *map, int x, int y)
{
	if (check_above(map, x, y) == 0)
	{
		put_color("\033[31m", "\nError\n wall missing above or wrong element");
		exit(0);
	}
	if (check_below(map, x, y) == 0)
	{
		put_color("\033[31m", "\nError\n wall missing below or wrong element");
		exit(0);
	}
	if (check_left(map, x, y) == 0)
	{
		put_color("\033[31m", "\nError\nwall missing left or wrong element");
		exit(0);
	}
	if (check_right(map, x, y) == 0)
	{
		put_color("\033[31m", "\nError\nwall missing right or wrong element");
		exit(0);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x6651
testl %eax, %eax
je 0x6a27
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x66df
testl %eax, %eax
je 0x6a37
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x65ca
testl %eax, %eax
je 0x6a47
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x653c
testl %eax, %eax
je 0x6a57
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x75de(%rip), %rdi      # 0xe00c
leaq 0x76de(%rip), %rsi      # 0xe113
jmp 0x6a65
leaq 0x75ce(%rip), %rdi      # 0xe00c
leaq 0x76fa(%rip), %rsi      # 0xe13f
jmp 0x6a65
leaq 0x75be(%rip), %rdi      # 0xe00c
leaq 0x7716(%rip), %rsi      # 0xe16b
jmp 0x6a65
leaq 0x75ae(%rip), %rdi      # 0xe00c
leaq 0x7730(%rip), %rsi      # 0xe195
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/florianne1212[P]Cub3D_42/srcs/check_twice.c
// Function: check_twice_north
int			check_twice_north(t_args *args, char *line, int e)
{
	int		i;

	if (args->error_north != -1)
	{
		put_color(RED, "\nError\n north's texture has two path");
		exit(0);
	}
	i = find_i(line, e, 2);
	return (i);
}

// Assembly:
cmpl $-0x1, 0x40(%rdi)
jne 0x6a89
pushq $0x2
popq %rax
movq %rsi, %rdi
movl %edx, %esi
movl %eax, %edx
jmp 0x6e82
pushq %rax
leaq 0x757b(%rip), %rdi      # 0xe00c
leaq 0x7728(%rip), %rsi      # 0xe1c0
callq 0xa7d4
xorl %edi, %edi
callq 0x60a0