LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_heap_free
static void
vmir_heap_free(ir_unit_t *iu, void *ptr)
{
  if(ptr == NULL)
    return;
  heap_t *h = iu->iu_heap;
  heap_block_t *hb = ptr;
  hb--;
  assert(hb->hb_magic == HEAP_MAGIC_ALLOC);
  hb->hb_magic = HEAP_MAGIC_FREE;

  vmir_heap_merge_next(h, hb);
  heap_block_t *prev = TAILQ_PREV(hb, heap_block_queue, hb_link);
  if(prev != NULL) {
    assert(prev < hb);
    vmir_heap_merge_next(h, prev);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0xa1a7
movq %rsi, %r14
cmpl $0xa110ced, -0x18(%rsi) # imm = 0xA110CED
jne 0xa1ad
movq 0x90(%rdi), %rbx
leaq -0x18(%r14), %r15
movl $0xf4eef4ee, -0x18(%r14) # imm = 0xF4EEF4EE
movq %rbx, %rdi
movq %r15, %rsi
callq 0xee73
movq -0x8(%r14), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0xa1a7
cmpq %r15, %rsi
jae 0xa1cc
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xee73
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1b1a1(%rip), %rdi     # 0x25355
leaq 0x1b1bb(%rip), %rsi     # 0x25376
leaq 0x1b317(%rip), %rcx     # 0x254d9
movl $0xe4, %edx
callq 0x31e0
leaq 0x1b32f(%rip), %rdi     # 0x25502
leaq 0x1b19c(%rip), %rsi     # 0x25376
leaq 0x1b2f8(%rip), %rcx     # 0x254d9
movl $0xea, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir.c
// Function: vmir_destroy
void
vmir_destroy(ir_unit_t *iu)
{
  libc_terminate(iu);

  for(int i = 0; i < VECTOR_LEN(&iu->iu_functions); i++) {
    function_destroy(VECTOR_ITEM(&iu->iu_functions, i));
  }

  free(iu->iu_vm_funcs);
  free(iu->iu_function_table);
  VECTOR_CLEAR(&iu->iu_functions);

  for(int i = 0; i < VECTOR_LEN(&iu->iu_types); i++) {
    ir_type_t *it = &VECTOR_ITEM(&iu->iu_types, i);
    type_clean(it);
  }

  VECTOR_CLEAR(&iu->iu_types);

  free(iu->iu_triple);
  free(iu->iu_debugged_function);

  VECTOR_CLEAR(&iu->iu_vfds);
  free(iu);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0xf0(%rdi), %rax
testq %rax, %rax
je 0xa214
movq (%rax), %rdi
callq 0x3160
movq 0xf0(%rbx), %rax
jmp 0xa1fe
leaq 0x2e0(%rbx), %r15
cmpq $0x0, 0x2e0(%rbx)
je 0xa271
xorl %r12d, %r12d
movq 0x2d8(%rbx), %rax
movq (%rax,%r12,8), %r14
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0xa246
movq %r14, %rsi
callq 0xeecd
jmp 0xa233
movq 0x20(%r14), %rdi
callq 0x3030
movq 0x60(%r14), %rdi
callq 0x3030
movq 0x78(%r14), %rdi
callq 0x3030
movq %r14, %rdi
callq 0x3030
incq %r12
cmpq %r12, (%r15)
ja 0xa228
movq 0x28(%rbx), %rdi
callq 0x3030
movq 0x30(%rbx), %rdi
callq 0x3030
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq 0x2d8(%rbx), %rdi
callq 0x3030
leaq 0x170(%rbx), %r14
movq 0x170(%rbx), %rax
testq %rax, %rax
je 0xa2ea
movl $0x10, %r15d
xorl %r12d, %r12d
movq 0x168(%rbx), %r13
movl -0x10(%r13,%r15), %ecx
cmpl $0xc, %ecx
je 0xa2d1
testl %ecx, %ecx
jne 0xa2de
movq (%r13,%r15), %rdi
callq 0x3030
movq -0x8(%r13,%r15), %rdi
callq 0x3030
movq (%r14), %rax
incq %r12
addq $0x28, %r15
cmpq %r12, %rax
ja 0xa2b2
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq 0x168(%rbx), %rdi
callq 0x3030
movq 0x128(%rbx), %rdi
callq 0x3030
movq 0x108(%rbx), %rdi
callq 0x3030
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rbx)
movq 0xd0(%rbx), %rdi
callq 0x3030
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3030
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_bitstream.c
// Function: read_bits
static uint32_t
read_bits(bcbitstream_t *bs, int num)
{
  int r = 0;
  int off = 0;
  // printf("bs->bytes_offset=%d\n", bs->bytes_offset);

  while(num > 0) {
    if(bs->bytes_offset >= bs->bytes_length)
      return 0;

    if(bs->remain == 0) {
      bs->tmp = bs->rdata[bs->bytes_offset];
      bs->bytes_offset++;
      bs->remain = 8;
    }

    int pick = VMIR_MIN(num, bs->remain);
    r |= (bs->tmp & ((1 << pick) - 1)) << off;
    bs->tmp = bs->tmp >> pick;
    off += pick;
    num -= pick;
    bs->remain -= pick;
  }
  return r;
}

// Assembly:
testl %esi, %esi
jle 0xc18a
pushq %rbp
pushq %rbx
movl 0x8(%rdi), %r9d
movl 0xc(%rdi), %r10d
xorl %edx, %edx
xorl %eax, %eax
cmpl %r9d, %r10d
jge 0xc18d
movl 0x10(%rdi), %r11d
testl %r11d, %r11d
je 0xc139
movb 0x14(%rdi), %bl
jmp 0xc150
movq (%rdi), %rcx
movslq %r10d, %r8
movb (%rcx,%r8), %bl
incl %r10d
movl %r10d, 0xc(%rdi)
movl $0x8, %r11d
cmpl %r11d, %esi
movl %r11d, %r8d
cmovll %esi, %r8d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %r8d, %ecx
shll %cl, %ebp
movzbl %bl, %ebx
notl %ebp
andl %ebx, %ebp
movl %edx, %ecx
shll %cl, %ebp
orl %ebp, %eax
movl %r8d, %ecx
shrl %cl, %ebx
movb %bl, 0x14(%rdi)
addl %r8d, %edx
subl %r8d, %r11d
movl %r11d, 0x10(%rdi)
subl %r8d, %esi
jg 0xc126
jmp 0xc18f
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir.c
// Function: parser_error0
static void __attribute__((noreturn))
parser_error0(ir_unit_t *iu, const char *file, int line,
              const char *fmt, ...)
{
  va_list ap;
  va_start(ap, fmt);
  vsnprintf(iu->iu_err_buf, sizeof(iu->iu_err_buf), fmt, ap);
  va_end(ap);
  iu->iu_err_file = file;
  iu->iu_err_line = line;

  vmir_log(iu, VMIR_LOG_ERROR, "Parser error: %s:%d : %s",
           file, line, iu->iu_err_buf);

  if(iu->iu_failed) {
    printf("Double failure\n");
  } else {
    iu->iu_failed = 1;
  }

  longjmp(iu->iu_parser_jmp, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rdx
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0xcaf5
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rax
movq %rdx, 0x10(%rax)
leaq 0x100(%rsp), %rdx
movq %rdx, 0x8(%rax)
movabsq $0x3000000020, %rdx     # imm = 0x3000000020
movq %rdx, (%rax)
leaq 0x468(%rdi), %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x3120
movq %r14, 0x568(%rbx)
movl %ebp, 0x570(%rbx)
leaq 0x1b69e(%rip), %rdx     # 0x281e1
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rcx
movl %ebp, %r8d
movq %r15, %r9
xorl %eax, %eax
callq 0x4091
cmpl $0x0, 0x574(%rbx)
jne 0xcb70
movl $0x1, 0x574(%rbx)
jmp 0xcb7c
leaq 0x1b695(%rip), %rdi     # 0x2820c
callq 0x30e0
addq $0x370, %rbx            # imm = 0x370
movq %rbx, %rdi
movl $0x1, %esi
callq 0x33e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir.c
// Function: vmir_instrumentation_dump
void
vmir_instrumentation_dump(ir_unit_t *iu)
{
  VECTOR_SORT(&iu->iu_instrumentation, instrumentation_cmp);
  for(int i = 0; i < VECTOR_LEN(&iu->iu_instrumentation); i++) {
    const ir_instrumentation_t *ii = &VECTOR_ITEM(&iu->iu_instrumentation, i);
    printf("%10"PRId64" %10"PRId64" %s.%d\n",
           ii->ii_count,
           ii->ii_count * ii->ii_instructions,
           ii->ii_func->if_name, ii->ii_bb);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x110(%rdi), %rdi
movq 0x118(%rbx), %rsi
leaq 0x6c(%rip), %rcx        # 0xcc1c
movl $0x18, %edx
callq 0x30f0
cmpq $0x0, 0x118(%rbx)
je 0xcc10
movl $0x10, %r15d
leaq 0x1842f(%rip), %r14     # 0x25000
xorl %r12d, %r12d
movq 0x110(%rbx), %rax
movq (%rax,%r15), %rsi
movslq -0x4(%rax,%r15), %rdx
imulq %rsi, %rdx
movq -0x10(%rax,%r15), %rcx
movq 0x20(%rcx), %rcx
movl -0x8(%rax,%r15), %r8d
movq %r14, %rdi
xorl %eax, %eax
callq 0x3190
incq %r12
addq $0x18, %r15
cmpq %r12, 0x118(%rbx)
ja 0xcbd4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir.c
// Function: vmir_mem_copy
uint32_t
vmir_mem_copy(ir_unit_t *iu, const void *data, size_t len)
{
  void *hostaddr;
  uint32_t addr = vmir_mem_alloc(iu, len, &hostaddr);
  if(hostaddr != NULL)
    memcpy(hostaddr, data, len);

  return addr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x90(%rdi), %rdi
movl %ebx, %esi
callq 0xa0d0
testq %rax, %rax
je 0xcc7a
movl 0x20(%r15), %ecx
movl %eax, %ebp
subl %ecx, %ebp
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3360
jmp 0xcc7c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir.c
// Function: vmir_run
int
vmir_run(ir_unit_t *iu, int *retptr, int argc, char **argv)
{
  ir_function_t *f;
  f = vmir_find_function(iu, "main");
  if(f == NULL) {
    return VM_STOP_BAD_FUNCTION;
  }

  int vm_argv = vmir_argv_copy(iu, argc, argv);

  union {
    uint32_t u32;
    uint64_t u64;
  } ret;

  int r = vmir_vm_function_call(iu, f, &ret, argc, vm_argv);


  if(r == VM_STOP_EXIT)
    ret.u32 = iu->iu_exit_code;

  if(retptr != NULL)
    *retptr = ret.u32;

  switch(r) {
  case 0:
    vmir_log(iu, VMIR_LOG_DEBUG, "Program returned normally: 0x%x", ret.u32);
    break;
  case VM_STOP_EXIT:
    vmir_log(iu, VMIR_LOG_DEBUG, "Program exit(): 0x%x", iu->iu_exit_code);
    break;
  case VM_STOP_ABORT:
    vmir_log(iu, VMIR_LOG_ERROR, "Program abort");
    break;
  case VM_STOP_UNREACHABLE:
    vmir_log(iu, VMIR_LOG_ERROR, "Unreachable instruction");
    break;
  case VM_STOP_BAD_INSTRUCTION:
    vmir_log(iu, VMIR_LOG_ERROR, "Bad instruction");
    break;
  case VM_STOP_BAD_FUNCTION:
    vmir_log(iu, VMIR_LOG_ERROR, "Bad function %d", iu->iu_exit_code);
    break;
  case VM_STOP_UNCAUGHT_EXCEPTION:
    vmir_log(iu, VMIR_LOG_ERROR, "Uncaught exception");
    break;
  }
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18313(%rip), %rsi     # 0x25013
callq 0x3b87
testq %rax, %rax
je 0xcd3e
movq %rax, 0x18(%rsp)
movq %r14, 0x20(%rsp)
leal 0x4(,%r15,4), %esi
movq 0x90(%rbx), %rdi
callq 0xa0d0
movq %rax, %r14
testq %rax, %rax
je 0xcd48
movl 0x20(%rbx), %eax
movl %r14d, %ecx
subl %eax, %ecx
movl %ecx, 0xc(%rsp)
jmp 0xcd50
movl $0x5, %ebp
jmp 0xce31
movl $0x0, 0xc(%rsp)
testl %r15d, %r15d
jle 0xcd73
movl %r15d, %ebp
xorl %r13d, %r13d
movq (%r12,%r13,8), %rsi
movq %rbx, %rdi
callq 0xcc89
movl %eax, (%r14,%r13,4)
incq %r13
cmpq %r13, %rbp
jne 0xcd5b
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movl %r15d, %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x3c7e
movl %eax, %ebp
cmpl $0x1, %eax
jne 0xcd9d
movl 0x40(%rbx), %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
je 0xcdad
movl 0x10(%rsp), %eax
movl %eax, (%rcx)
cmpl $0x6, %ebp
ja 0xce31
movl %ebp, %eax
leaq 0x16e85(%rip), %rcx     # 0x23c40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x10(%rsp), %ecx
leaq 0x18249(%rip), %rdx     # 0x25018
jmp 0xcdf6
leaq 0x18283(%rip), %rdx     # 0x2505b
jmp 0xce22
leaq 0x1826c(%rip), %rdx     # 0x2504d
jmp 0xce22
leaq 0x1818a(%rip), %rdx     # 0x24f74
jmp 0xce22
movl 0x40(%rbx), %ecx
leaq 0x18242(%rip), %rdx     # 0x25038
movq %rbx, %rdi
movl $0x3, %esi
jmp 0xce12
movl 0x40(%rbx), %ecx
leaq 0x18261(%rip), %rdx     # 0x2506b
movq %rbx, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x4091
jmp 0xce31
leaq 0x1818e(%rip), %rdx     # 0x24fb0
movq %rbx, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x4091
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_type.c
// Function: type_print_id
static int
type_print_id(char **dstp, const ir_unit_t *iu, int id)
{
  char tmpbuf[128];

  if(id < VECTOR_LEN(&iu->iu_types))
    return type_print(dstp, iu, &VECTOR_ITEM(&iu->iu_types, id));

  snprintf(tmpbuf, sizeof(tmpbuf), "[TypeId-%d]", id);
  return addstr(dstp, tmpbuf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movslq %edx, %rax
cmpq %rax, 0x170(%rsi)
jbe 0xd323
leaq (%rax,%rax,4), %rdx
shlq $0x3, %rdx
addq 0x168(%rsi), %rdx
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcebd
movl %edx, %ecx
leaq 0x17da4(%rip), %rdx     # 0x250d0
movq %rsp, %r14
movl $0x80, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x31a0
movq %r14, %rdi
callq 0x3170
movq %rax, %r14
testq %rbx, %rbx
je 0xd362
movq (%rbx), %rdi
movslq %r14d, %r15
movq %rsp, %rsi
movq %r15, %rdx
callq 0x3360
addq %r15, (%rbx)
movl %r14d, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: vmir_traceback
static void
vmir_traceback(struct ir_unit *iu, const char *info)
{
  const vm_frame_t *f;

  vmir_log(iu, VMIR_LOG_INFO, "--- Traceback (%s) ---", info);
  for(f = iu->iu_current_frame; f != NULL; f = f->prev) {
    vmir_log(iu, VMIR_LOG_INFO, "%s()", f->func->if_name);
  }
  vmir_log(iu, VMIR_LOG_INFO, "--- Traceback end ---");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rcx
movq %rdi, %rbx
leaq 0x17cc7(%rip), %rdx     # 0x25102
movl $0x2, %esi
xorl %eax, %eax
callq 0x4091
movq 0x78(%rbx), %r15
testq %r15, %r15
je 0xd47a
leaq 0x17ab7(%rip), %r14     # 0x24f0e
movq 0x10(%r15), %rax
movq 0x20(%rax), %rcx
movq %rbx, %rdi
movl $0x2, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4091
movq 0x18(%r15), %r15
testq %r15, %r15
jne 0xd457
leaq 0x17c98(%rip), %rdx     # 0x25119
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x4091
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_malloc
static int
vmir_malloc(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t size = vmir_vm_arg32(&rf);
  MEMTRACE("malloc(%d) = ...\n", size);
  void *p = vmir_heap_malloc(iu, size);
  vmir_vm_retptr(ret, p, iu);
  MEMTRACE("malloc(%d) = 0x%x\n", size, *(uint32_t *)ret);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movl -0x4(%rsi), %esi
movq 0x90(%rdx), %rdi
callq 0xa0d0
testq %rax, %rax
je 0xd564
subl 0x20(%r14), %eax
jmp 0xd566
xorl %eax, %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_realloc
static int
vmir_realloc(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t ptr = vmir_vm_arg32(&rf);
  uint32_t size = vmir_vm_arg32(&rf);

  MEMTRACE("realloc(0x%x, %d) = ...\n", ptr, size);
  void *p = vmir_heap_realloc(iu, ptr ? iu->iu_mem + ptr : NULL, size);
  vmir_vm_retptr(ret, p, iu);
  MEMTRACE("realloc(0x%x, %d) = 0x%x\n", ptr, size, *(uint32_t *)ret);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %rbx
movl -0x8(%rsi), %esi
movl -0x4(%rax), %r14d
testq %r14, %r14
je 0xd5b1
addq 0x20(%r15), %r14
jmp 0xd5b4
xorl %r14d, %r14d
testl %esi, %esi
je 0xd603
cmpl $0xa110ced, -0x18(%r14) # imm = 0xA110CED
jne 0xd61f
movl -0x14(%r14), %ebp
addl $-0x18, %ebp
cmpl %esi, %ebp
jg 0xd5fd
movq 0x90(%r15), %rdi
callq 0xa0d0
testq %rax, %rax
je 0xd60e
movq %rax, %r12
movslq %ebp, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3360
movq %r15, %rdi
movq %r14, %rsi
callq 0xa151
movq %r12, %r14
subl 0x20(%r15), %r14d
jmp 0xd611
movq %r15, %rdi
movq %r14, %rsi
callq 0xa151
xorl %r14d, %r14d
movl %r14d, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17d2f(%rip), %rdi     # 0x25355
leaq 0x17d49(%rip), %rsi     # 0x25376
leaq 0x17d52(%rip), %rcx     # 0x25386
movl $0xf4, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_calloc
static int
vmir_calloc(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t nmemb = vmir_vm_arg32(&rf);
  uint32_t size = vmir_vm_arg32(&rf);
  MEMTRACE("calloc(%d, %d) = ...\n", nmemb, size);
  void *p = vmir_heap_malloc(iu, size * nmemb);
  if(p != NULL)
    memset(p, 0, size * nmemb);
  vmir_vm_retptr(ret, p, iu);
  MEMTRACE("calloc(%d, %d) = 0x%x\n", nmemb, size, *(uint32_t *)ret);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movl -0x8(%rsi), %ebp
imull -0x4(%rsi), %ebp
movq 0x90(%rdx), %rdi
movl %ebp, %esi
callq 0xa0d0
testq %rax, %rax
je 0xd67a
movq %rax, %r15
movl %ebp, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x3210
subl 0x20(%r14), %r15d
jmp 0xd67d
xorl %r15d, %r15d
movl %r15d, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_open
static int
vmir_open(void *ret, const void *rf, ir_unit_t *iu)
{
  const char *path = vmir_vm_ptr(&rf, iu);
  uint32_t flags = vmir_vm_arg32(&rf);

  uint32_t vmir_flags = 0;
  if(flags & 0100) // O_CREAT
    vmir_flags |= VMIR_FS_OPEN_CREATE;

  if(flags & 2)
    vmir_flags |= VMIR_FS_OPEN_RW;
  else if(flags & 1)
    vmir_flags |= VMIR_FS_OPEN_WRITE;
  else
    vmir_flags |= VMIR_FS_OPEN_READ;

  int fd = vfd_open(iu, path, vmir_flags);
  vmir_vm_ret32(ret, fd);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdx, %rax
movq %rdi, %rbx
movl -0x8(%rsi), %ecx
movl %ecx, %edi
shrl $0x4, %edi
andl $0x4, %edi
movl %ecx, %r8d
andl $0x1, %r8d
incl %r8d
testb $0x2, %cl
movl $0x3, %edx
cmovel %r8d, %edx
movl -0x4(%rsi), %esi
orl %edi, %edx
addq 0x20(%rax), %rsi
movq %rax, %rdi
callq 0xe325
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_read
static int
vmir_read(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t fd = vmir_vm_arg32(&rf);
  void *buf = vmir_vm_ptr(&rf, iu);
  uint32_t nbyte = vmir_vm_arg32(&rf);
  vmir_vm_ret32(ret, vfd_read(iu, fd, buf, nbyte));
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rsi), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, 0xd8(%rdx)
jbe 0xd717
movq 0xd0(%rdx), %rdi
leaq (%rcx,%rcx,2), %r8
cmpb $0x1, 0x10(%rdi,%r8,8)
jne 0xd717
movl -0xc(%rsi), %ecx
movl -0x8(%rsi), %eax
addq 0x20(%rdx), %rax
leaq (%rdi,%r8,8), %rsi
movq 0x48(%rdx), %rdi
movq 0xc8(%rdx), %r8
movq (%rsi), %rsi
movq %rax, %rdx
callq *0x10(%r8)
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_write
static int
vmir_write(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t fd = vmir_vm_arg32(&rf);
  const void *buf = vmir_vm_ptr(&rf, iu);
  uint32_t nbyte = vmir_vm_arg32(&rf);
  vmir_vm_ret32(ret, vfd_write(iu, fd, buf, nbyte));
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rsi), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, 0xd8(%rdx)
jbe 0xd768
movq 0xd0(%rdx), %rdi
leaq (%rcx,%rcx,2), %r8
cmpb $0x1, 0x10(%rdi,%r8,8)
jne 0xd768
movl -0xc(%rsi), %ecx
movl -0x8(%rsi), %eax
addq 0x20(%rdx), %rax
leaq (%rdi,%r8,8), %rsi
movq 0x48(%rdx), %rdi
movq 0xc8(%rdx), %r8
movq (%rsi), %rsi
movq %rax, %rdx
callq *0x18(%r8)
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_lseek
static int
vmir_lseek(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t fd = vmir_vm_arg32(&rf);
  int64_t offset = vmir_vm_arg64(&rf);
  uint32_t whence = vmir_vm_arg32(&rf);
  vmir_vm_ret64(ret, vfd_seek(iu, fd, offset, whence));
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rsi), %ecx
movq $-0x1, %rax
cmpq %rcx, 0xd8(%rdx)
jbe 0xd7b8
movq 0xd0(%rdx), %rdi
leaq (%rcx,%rcx,2), %r8
cmpb $0x1, 0x10(%rdi,%r8,8)
jne 0xd7b8
movq -0xc(%rsi), %rax
movl -0x10(%rsi), %ecx
leaq (%rdi,%r8,8), %rsi
movq 0x48(%rdx), %rdi
movq 0xc8(%rdx), %r8
movq (%rsi), %rsi
movq %rax, %rdx
callq *0x20(%r8)
movq %rax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_close
static int
vmir_close(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t fd = vmir_vm_arg32(&rf);
  vmir_fd_close(iu, fd);
  vmir_vm_ret32(ret, 0);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rsi), %esi
movq %rdx, %rdi
callq 0x9f79
movl $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fopen
static int
vmir_fopen(void *ret, const void *rf, ir_unit_t *iu)
{
  const char *path = vmir_vm_ptr(&rf, iu);
  const char *mode = vmir_vm_ptr(&rf, iu);
  vFILE_t *vfile = vFILE_open(iu, path, mode, 0);
  vmir_vm_retptr(ret, vfile, iu);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movl -0x8(%rsi), %edx
movl -0x4(%rsi), %esi
movq 0x20(%r14), %rax
addq %rax, %rsi
addq %rax, %rdx
xorl %ebp, %ebp
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xe369
testq %rax, %rax
je 0xd809
subl 0x20(%r14), %eax
movl %eax, %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fseek
static int
vmir_fseek(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr_nullchk(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret32(ret, -1);
    return 0;
  }
  uint32_t offset = vmir_vm_arg32(&rf);
  uint32_t whence = vmir_vm_arg32(&rf);
  int r = fseek(vfile->fp, offset, whence);
  vmir_vm_ret32(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rsi), %eax
testq %rax, %rax
je 0xd867
movq 0x20(%rdx), %rcx
movl -0xc(%rsi), %edx
movl -0x8(%rsi), %esi
movq (%rcx,%rax), %rdi
callq 0x33b0
jmp 0xd86c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fseeko
static int
vmir_fseeko(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr_nullchk(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret64(ret, -1);
    return 0;
  }
  uint64_t offset = vmir_vm_arg64(&rf);
  uint32_t whence = vmir_vm_arg32(&rf);
  int64_t r = fseeko(vfile->fp, offset, whence);
  vmir_vm_ret64(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rsi), %ecx
testq %rcx, %rcx
je 0xd899
movq 0x20(%rdx), %rdi
movq -0xc(%rsi), %rax
movl -0x10(%rsi), %edx
movq (%rdi,%rcx), %rdi
movq %rax, %rsi
callq 0x3420
cltq
jmp 0xd8a0
movq $-0x1, %rax
movq %rax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fread
static int
vmir_fread(void *ret, const void *rf, ir_unit_t *iu)
{
  void *buf = vmir_vm_ptr(&rf, iu);
  uint32_t size = vmir_vm_arg32(&rf);
  uint32_t nmemb = vmir_vm_arg32(&rf);
  vFILE_t *vfile = vmir_vm_ptr_nullchk(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret32(ret, -1);
    return 0;
  }
  int r = fread(buf, size, nmemb, vfile->fp);
  vmir_vm_ret32(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x10(%rsi), %ecx
testq %rcx, %rcx
je 0xd8d5
movl -0xc(%rsi), %eax
movl -0x8(%rsi), %r8d
movq 0x20(%rdx), %rdx
movl -0x4(%rsi), %edi
addq %rdx, %rdi
movq (%rdx,%rcx), %rcx
movq %r8, %rsi
movq %rax, %rdx
callq 0x3110
jmp 0xd8da
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fwrite
static int
vmir_fwrite(void *ret, const void *rf, ir_unit_t *iu)
{
  void *buf = vmir_vm_ptr(&rf, iu);
  uint32_t size = vmir_vm_arg32(&rf);
  uint32_t nmemb = vmir_vm_arg32(&rf);
  vFILE_t *vfile = vmir_vm_ptr_nullchk(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret32(ret, -1);
    return 0;
  }
  int r = fwrite(buf, size, nmemb, vfile->fp);
  vmir_vm_ret32(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x10(%rsi), %ecx
testq %rcx, %rcx
je 0xd90e
movl -0xc(%rsi), %eax
movl -0x8(%rsi), %r8d
movq 0x20(%rdx), %rdx
movl -0x4(%rsi), %edi
addq %rdx, %rdi
movq (%rdx,%rcx), %rcx
movq %r8, %rsi
movq %rax, %rdx
callq 0x34b0
jmp 0xd913
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_feof
static int
vmir_feof(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret32(ret, 1);
    return 0;
  }
  int r = feof(vfile->fp);
  vmir_vm_ret32(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdx), %rax
testq %rax, %rax
je 0xd934
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3350
jmp 0xd939
movl $0x1, %eax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fflush
static int
vmir_fflush(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret32(ret, 1);
    return 0;
  }
  int r = fflush(vfile->fp);
  vmir_vm_ret32(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdx), %rax
testq %rax, %rax
je 0xd95a
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3390
jmp 0xd95f
movl $0x1, %eax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_ftell
static int
vmir_ftell(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  if(vfile == NULL) {
    vmir_vm_ret32(ret, -1);
    return 0;
  }
  int r = ftell(vfile->fp);
  vmir_vm_ret32(ret, r);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdx), %rax
testq %rax, %rax
je 0xd980
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3330
jmp 0xd985
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fclose
static int
vmir_fclose(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  if(vfile != NULL)
    fclose(vfile->fp);
  vmir_vm_ret32(ret, 0);
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdx), %rax
testq %rax, %rax
je 0xd9bf
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3160
movl $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fputc
static int
vmir_fputc(void *ret, const void *rf, ir_unit_t *iu)
{
  char c = vmir_vm_arg32(&rf);
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  if(vfile != NULL)
    fwrite(&c, 1, 1, vfile->fp);
  vmir_vm_ret32(ret, c);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %rcx
testq %rcx, %rcx
je 0xda54
movl -0x8(%rsi), %edx
movq (%rcx,%rdx), %rsi
movsbl %al, %ebp
movl %ebp, %edi
callq 0x3280
jmp 0xda57
movsbl %al, %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fgetc
static int
vmir_fgetc(void *ret, const void *rf, ir_unit_t *iu)
{
  uint8_t c;
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  if(vfile == NULL || fread(&c, 1, 1, vfile->fp) != 1) {
    vmir_vm_ret32(ret, -1);
    return 0;
  }
  vmir_vm_ret32(ret, c);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdx), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xda9c
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rcx
leaq 0x7(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x3110
cmpq $0x1, %rax
jne 0xda9c
movzbl 0x7(%rsp), %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_putchar
static int
vmir_putchar(void *ret, const void *rf, ir_unit_t *iu)
{
  char c = vmir_vm_arg32(&rf);
  if(iu->iu_stdout != NULL)
    fwrite(&c, 1, 1, iu->iu_stdout->fp);
  vmir_vm_ret32(ret, c);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0xb8(%rdx), %rcx
testq %rcx, %rcx
je 0xdacb
movq (%rcx), %rsi
movsbl %al, %ebp
movl %ebp, %edi
callq 0x3280
jmp 0xdace
movsbl %al, %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_vsnprintf
static int
vmir_vsnprintf(void *ret, const void *rf, ir_unit_t *iu)
{
  char *dst = vmir_vm_ptr(&rf, iu);
  int dstlen = vmir_vm_arg32(&rf);
  const char *fmt = vmir_vm_ptr(&rf, iu);
  const void *va_rf = vmir_valist(&rf, iu);

  fmt_sn_aux_t aux;
  aux.dst = dst;
  aux.remain = dstlen;
  aux.total = 0;
  dofmt(fmt_sn, &aux, fmt, va_rf, iu);
  // Nul termination
  if(aux.remain)
    *aux.dst = 0;
  vmir_vm_ret32(ret, aux.total);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %r9
addq %r9, %rax
movl -0x8(%rsi), %edi
movl -0x10(%rsi), %ecx
movl -0xc(%rsi), %edx
addq %r9, %rdx
addq %r9, %rcx
cmpl $0x1, 0x64(%r8)
je 0xdb19
movq (%rcx), %rcx
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl %edi, 0x8(%r14)
movl $0x0, 0xc(%r14)
leaq 0xcbb(%rip), %rdi       # 0xe7ef
movq %r14, %rsi
callq 0xe5e0
cmpl $0x0, 0x8(%r14)
je 0xdb4b
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movl 0x14(%rsp), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_snprintf
static int
vmir_snprintf(void *ret, const void *rf, ir_unit_t *iu)
{
  char *dst = vmir_vm_ptr(&rf, iu);
  int dstlen = vmir_vm_arg32(&rf);
  const char *fmt = vmir_vm_ptr(&rf, iu);

  if(iu->iu_mode == VMIR_WASM)
    rf = (const void *)vmir_vm_ptr(&rf, iu);

  fmt_sn_aux_t aux;
  aux.dst = dst;
  aux.remain = dstlen;
  aux.total = 0;

  dofmt(fmt_sn, &aux, fmt, rf, iu);

  // Nul termination
  if(aux.remain)
    *aux.dst = 0;
  vmir_vm_ret32(ret, aux.total);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %rdi
addq %rdi, %rax
movl -0xc(%rsi), %edx
movl -0x8(%rsi), %esi
addq %rdi, %rdx
cmpl $0x1, 0x64(%r8)
jne 0xdb90
movl -0x10(%rcx), %ecx
addq %rcx, %rdi
movq %rdi, %rcx
jmp 0xdb94
addq $-0xc, %rcx
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl %esi, 0x8(%r14)
movl $0x0, 0xc(%r14)
leaq 0xc40(%rip), %rdi       # 0xe7ef
movq %r14, %rsi
callq 0xe5e0
cmpl $0x0, 0x8(%r14)
je 0xdbc6
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movl 0x14(%rsp), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_vsprintf
static int
vmir_vsprintf(void *ret, const void *rf, ir_unit_t *iu)
{
  char *dst = vmir_vm_ptr(&rf, iu);
  const char *fmt = vmir_vm_ptr(&rf, iu);
  const void *va_rf = vmir_valist(&rf, iu);

  fmt_sn_aux_t aux;
  aux.dst = dst;
  aux.remain = INT32_MAX;
  aux.total = 0;
  dofmt(fmt_sn, &aux, fmt, va_rf, iu);

  // Nul termination
  if(aux.remain)
    *aux.dst = 0;
  vmir_vm_ret32(ret, aux.total);
  return 0;

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %rdi
addq %rdi, %rax
movl -0xc(%rsi), %ecx
movl -0x8(%rsi), %edx
addq %rdi, %rdx
addq %rdi, %rcx
cmpl $0x1, 0x64(%r8)
je 0xdc03
movq (%rcx), %rcx
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq $0x7fffffff, 0x8(%r14)  # imm = 0x7FFFFFFF
leaq 0xbd5(%rip), %rdi       # 0xe7ef
movq %r14, %rsi
callq 0xe5e0
cmpl $0x0, 0x8(%r14)
je 0xdc31
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movl 0x14(%rsp), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_vprintf
static int
vmir_vprintf(void *ret, const void *rf, ir_unit_t *iu)
{
  const char *fmt = vmir_vm_ptr(&rf, iu);
  const void *va_rf = vmir_valist(&rf, iu);

  fmt_file_aux_t aux;
  aux.vfile = iu->iu_stdout;
  aux.total = 0;
  dofmt(fmt_file, &aux, fmt, va_rf, iu);

  vmir_vm_ret32(ret, aux.total);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rdi, %rbx
movl -0x8(%rsi), %ecx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %rdx
addq %rdx, %rcx
cmpl $0x1, 0x64(%r8)
je 0xdcd9
movq (%rcx), %rcx
addq %rax, %rdx
movq 0xb8(%r8), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
leaq 0x1157(%rip), %rdi      # 0xee51
movq %r14, %rsi
callq 0xe5e0
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_printf
static int
vmir_printf(void *ret, const void *rf, ir_unit_t *iu)
{
  const char *fmt = vmir_vm_ptr(&rf, iu);

  if(iu->iu_mode == VMIR_WASM)
    rf = (const void *)vmir_vm_ptr(&rf, iu);

  fmt_file_aux_t aux;
  aux.vfile = iu->iu_stdout;
  aux.total = 0;
  dofmt(fmt_file, &aux, fmt, rf, iu);

  vmir_vm_ret32(ret, aux.total);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %rdx
cmpl $0x1, 0x64(%r8)
jne 0xdd38
movl -0x8(%rcx), %ecx
addq %rdx, %rcx
jmp 0xdd3c
addq $-0x4, %rcx
addq %rax, %rdx
movq 0xb8(%r8), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
leaq 0x10f4(%rip), %rdi      # 0xee51
movq %r14, %rsi
callq 0xe5e0
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_vfprintf
static int
vmir_vfprintf(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  const char *fmt = vmir_vm_ptr(&rf, iu);
  const void *va_rf = vmir_valist(&rf, iu);

  fmt_file_aux_t aux;
  aux.vfile = vfile;
  aux.total = 0;
  dofmt(fmt_file, &aux, fmt, va_rf, iu);

  vmir_vm_ret32(ret, aux.total);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq 0x20(%rdx), %rdi
movl -0xc(%rsi), %ecx
movl -0x8(%rsi), %edx
addq %rdi, %rcx
cmpl $0x1, 0x64(%r8)
je 0xdd9c
movq (%rcx), %rcx
addq %rdi, %rdx
addq %rdi, %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
leaq 0x1098(%rip), %rdi      # 0xee51
movq %r14, %rsi
callq 0xe5e0
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fprintf
static int
vmir_fprintf(void *ret, const void *rf, ir_unit_t *iu)
{
  vFILE_t *vfile = vmir_vm_ptr(&rf, iu);
  const char *fmt = vmir_vm_ptr(&rf, iu);

  if(iu->iu_mode == VMIR_WASM)
    rf = (const void *)vmir_vm_ptr(&rf, iu);

  fmt_file_aux_t aux;
  aux.vfile = vfile;
  aux.total = 0;
  dofmt(fmt_file, &aux, fmt, rf, iu);

  vmir_vm_ret32(ret, aux.total);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
movl -0x8(%rsi), %edx
movl -0x4(%rsi), %eax
movq 0x20(%r8), %rsi
cmpl $0x1, 0x64(%r8)
jne 0xddfa
movl -0xc(%rcx), %ecx
addq %rsi, %rcx
jmp 0xddfe
addq $-0x8, %rcx
addq %rsi, %rdx
addq %rsi, %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
leaq 0x1036(%rip), %rdi      # 0xee51
movq %r14, %rsi
callq 0xe5e0
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_strtok_r
static int
vmir_strtok_r(void *retreg, const void *rf, ir_unit_t *iu)
{
  char *str         = vmir_vm_ptr(&rf, iu);
  const char *delim = vmir_vm_ptr(&rf, iu);
  uint32_t nextp = vmir_vm_arg32(&rf);

  if(str == NULL)
    str = mem_rdptr(iu, nextp);

  str += strspn(str, delim);

  if(*str == '\0') {
    vmir_vm_ret32(retreg, 0);
    return 0;
  }

  char *ret = str;
  str += strcspn(str, delim);
  if(*str)
    *str++ = '\0';

  mem_wrptr(iu, nextp, str);

  vmir_vm_retptr(retreg, ret, iu);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
movl -0x4(%rsi), %r14d
movq 0x20(%rdx), %r13
addq %r13, %r14
movl -0xc(%rsi), %ebp
movl -0x8(%rsi), %r12d
addq %r13, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3260
cmpb $0x0, (%rax,%r14)
je 0xde9b
addq %rax, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x3290
leaq (%r14,%rax), %rcx
cmpb $0x0, (%r14,%rax)
je 0xde8e
movb $0x0, (%rcx)
incq %rcx
movq 0x20(%r15), %r13
subl %r13d, %ecx
movl %ecx, (%r13,%rbp)
subl %r13d, %r14d
jmp 0xde9e
xorl %r14d, %r14d
movl %r14d, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_strtok
static int
vmir_strtok(void *retreg, const void *rf, ir_unit_t *iu)
{
  char *str         = vmir_vm_ptr(&rf, iu);
  const char *delim = vmir_vm_ptr(&rf, iu);

  if(str == NULL)
    str = iu->iu_strtok_tmp;

  str += strspn(str, delim);

  if(*str == '\0') {
    vmir_vm_ret32(retreg, 0);
    return 0;
  }

  char *ret = str;
  str += strcspn(str, delim);
  if(*str)
    *str++ = '\0';

  iu->iu_strtok_tmp = str;

  vmir_vm_retptr(retreg, ret, iu);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movl -0x8(%rsi), %r12d
movq 0x20(%rdx), %r13
addq %r13, %r12
testq %r13, %r13
je 0xdeda
movl -0x4(%rsi), %r15d
addq %r13, %r15
jmp 0xdee1
movq 0xf8(%r14), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x3260
cmpb $0x0, (%r15,%rax)
je 0xdf22
addq %rax, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x3290
leaq (%r15,%rax), %rcx
cmpb $0x0, (%r15,%rax)
je 0xdf16
movb $0x0, (%rcx)
incq %rcx
movq 0x20(%r14), %r13
movq %rcx, 0xf8(%r14)
subl %r13d, %r15d
jmp 0xdf25
xorl %r15d, %r15d
movl %r15d, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_libc_hexdump
static int
vmir_libc_hexdump(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t addr = vmir_vm_arg32(&rf);
  uint32_t size = vmir_vm_arg32(&rf);
  printf("Hexdump of 0x%x\n", addr);
  vmir_hexdump("hexdump", iu->iu_mem + addr, size);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r15
movl -0x4(%rsi), %ebx
movslq -0x8(%rsi), %r14
leaq 0x1745b(%rip), %rdi     # 0x25462
movl %ebx, %esi
xorl %eax, %eax
callq 0x3190
testq %r14, %r14
jle 0xe1c8
addq 0x20(%r15), %rbx
movl $0x1, %r12d
movl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
leaq 0x30(%rsp), %r13
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %rcx, %rax
orq $0x1, %rax
cmpq %r14, %rax
cmovbeq %r14, %rax
movq %rdx, 0x28(%rsp)
shlq $0x4, %rdx
notq %rdx
addq %rax, %rdx
cmpq $0xf, %rdx
movl $0xf, %eax
cmovaeq %rax, %rdx
imull %r15d, %edx
addl $0x30, %edx
movq %rdx, 0x18(%rsp)
movl $0x64, %esi
movq %r13, %rdi
leaq 0x173f2(%rip), %rdx     # 0x25473
movq %rcx, 0x20(%rsp)
xorl %eax, %eax
callq 0x31a0
movl %eax, %ebp
movl $0x33, %r13d
xorl %ebx, %ebx
movl %ebp, %r14d
movslq %ebp, %rbp
leaq (%rsp,%rbp), %rdi
addq $0x30, %rdi
movl $0x64, %esi
subq %rbp, %rsi
cmpq $0x8, %rbx
leaq 0x17d8e(%rip), %rcx     # 0x25e46
leaq 0x17b7b(%rip), %rax     # 0x25c3a
cmoveq %rax, %rcx
movq 0x10(%rsp), %rax
movzbl (%rax,%rbx), %r8d
leaq 0x173a8(%rip), %rdx     # 0x2547c
xorl %eax, %eax
callq 0x31a0
movl %eax, %r15d
addl %eax, %ebp
leaq 0x1(%rbx), %rax
addl $-0x3, %r13d
cmpq $0xe, %rbx
ja 0xe0fb
addq %r12, %rbx
cmpq 0x8(%rsp), %rbx
movq %rax, %rbx
jb 0xe097
decq %rax
xorl %ebx, %ebx
cmpq $0x7, %rax
setb %bl
movslq %ebp, %rax
leaq (%rsp,%rax), %rdi
addq $0x30, %rdi
movq 0x18(%rsp), %rdx
addq %rbx, %rdx
movl $0x20, %esi
callq 0x3210
addl %ebx, %r14d
addl %r15d, %r14d
addl %r13d, %r14d
movslq %r14d, %rax
leaq (%rsp,%rax), %rcx
addq $0x30, %rcx
shlq $0x20, %rax
xorl %edx, %edx
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r14
movl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
leaq 0x30(%rsp), %r13
movzbl (%rbx,%rdx), %esi
leal -0x7f(%rsi), %r8d
movl $0x2e, %edi
cmpb $-0x5f, %r8b
jb 0xe168
movl %esi, %edi
movb %dil, (%rcx,%rdx)
addq %r15, %rax
addq $0x3, %rax
cmpq $0xe, %rdx
ja 0xe185
leaq (%r12,%rdx), %rsi
incq %rdx
cmpq %r14, %rsi
jb 0xe153
sarq $0x20, %rax
movb $0x0, 0x30(%rsp,%rax)
leaq 0x172ef(%rip), %rdi     # 0x25484
leaq 0x170d2(%rip), %rsi     # 0x2526e
movq %r13, %rdx
xorl %eax, %eax
callq 0x3190
movq 0x20(%rsp), %rcx
addq $0x10, %rcx
movq 0x28(%rsp), %rdx
incq %rdx
addq $0x10, %r12
addq $0x10, %rbx
cmpl %ecx, %r14d
jg 0xe037
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir___cxa_allocate_exception
static int
vmir___cxa_allocate_exception(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t size = vmir_vm_arg32(&rf);
  void *p = vmir_heap_malloc(iu, size + sizeof(vmir_cxx_exception_t));
  memset(p, 0, sizeof(vmir_cxx_exception_t));
  vmir_vm_retptr(ret, p + sizeof(vmir_cxx_exception_t), iu);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl -0x4(%rsi), %esi
addl $0xc, %esi
movq 0x90(%rdx), %rdi
callq 0xa0d0
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
subl 0x20(%rbx), %eax
addl $0xc, %eax
movl %eax, (%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir___cxa_end_catch
static int
vmir___cxa_end_catch(void *ret, const void *rf, ir_unit_t *iu)
{
  vmir_cxx_exception_t *exc = iu->iu_mem + iu->iu_exception.caught;

  if(--exc->handlers == 0) {
    iu->iu_exception.caught = exc->next;
    vmir_heap_free(iu, exc);
  }
  return 0;
}

// Assembly:
movq 0x20(%rdx), %rsi
movl 0x74(%rdx), %eax
decl 0x4(%rsi,%rax)
jne 0xe2c6
pushq %rax
addq %rax, %rsi
movl (%rsi), %eax
movl %eax, 0x74(%rdx)
movq %rdx, %rdi
callq 0xa151
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vfd_open
static int
vfd_open(ir_unit_t *iu, const char *path, vmir_openflags_t flags)
{
  intptr_t fh;
  vmir_errcode_t err = iu->iu_fsops->open(iu->iu_opaque, path, flags, &fh);
  if(err)
    return -1;
  return vmir_fd_create_fh(iu, fh, 1);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
movq 0xc8(%rbx), %rax
leaq 0x8(%rsp), %rcx
callq *(%rax)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xe363
movq 0x8(%rsp), %rsi
leaq -0x43f1(%rip), %rcx     # 0x9f65
movq %rbx, %rdi
movl $0x1, %edx
callq 0x9e75
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vFILE_open
static vFILE_t *
vFILE_open(ir_unit_t *iu, const char *path, const char *mode,
           int line_buffered)
{
  vmir_openflags_t flags = 0;
  for(int i = 0; i < VMIR_ARRAYSIZE(modetable); i++) {
    if(!strcmp(mode, modetable[i].mode)) {
      flags = modetable[i].flags;
      break;
    }
  }
  if(flags == 0)
    return NULL;

  int fd = vfd_open(iu, path, flags);
  if(fd == -1)
    return NULL;
  return vFILE_open_fd(iu, fd, line_buffered, mode);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0x16607(%rip), %r13     # 0x24990
leaq (%r12,%r13), %rsi
movq %rbx, %rdi
callq 0x3300
testl %eax, %eax
je 0xe3a5
addq $0x8, %r12
cmpq $0x78, %r12
jne 0xe389
jmp 0xe3d8
movl 0x4(%r12,%r13), %edx
testl %edx, %edx
je 0xe3d8
movq %r14, %rdi
movq %r15, %rsi
callq 0xe325
cmpl $-0x1, %eax
je 0xe3d8
movq %r14, %rdi
movl %eax, %esi
movl %ebp, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe3e9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vFILE_open_fd
static void *
vFILE_open_fd(ir_unit_t *iu, int fd, int line_buffered, const char *mode)
{
  vFILE_t *vfile = vmir_heap_malloc(iu, sizeof(vFILE_t));
  if(vfile == NULL) {
    vmir_fd_close(iu, fd);
    return NULL;
  }
  vfile->iu = iu;
  vfile->fd = fd;

#if USE_FUNOPEN
  vfile->fp = funopen(vfile, fun_read, fun_write, fun_seek, vFILE_close);
#else
  vfile->fp = fopencookie(vfile, mode, cookiefuncs);
#endif
  if(vfile->fp == NULL) {
    vmir_fd_close(iu, fd);
    vmir_heap_free(iu, vfile);
    return NULL;
  }
  if(line_buffered)
    setlinebuf(vfile->fp);
  LIST_INSERT_HEAD(&iu->iu_vfiles, vfile, link);
  return vfile;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r12
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r14
movq 0x90(%rdi), %rdi
movl $0x28, %esi
callq 0xa0d0
testq %rax, %rax
je 0xe482
movq %rax, %rbx
movq %r14, 0x8(%rax)
movl %ebp, 0x10(%rax)
movups 0x1f579(%rip), %xmm0    # 0x2d9a0
movups %xmm0, 0x10(%rsp)
movups 0x1f55d(%rip), %xmm0    # 0x2d990
movups %xmm0, (%rsp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x30a0
movq %rax, (%rbx)
testq %rax, %rax
je 0xe48e
testl %r15d, %r15d
je 0xe457
movq %rax, %rdi
callq 0x31f0
movq 0xf0(%r14), %rax
addq $0xf0, %r14
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xe479
movq %rbx, %rcx
addq $0x18, %rcx
movq %rcx, 0x20(%rax)
movq %rbx, (%r14)
movq %r14, 0x20(%rbx)
jmp 0xe4a5
movq %r14, %rdi
movl %ebp, %esi
callq 0x9f79
jmp 0xe4a3
movq %r14, %rdi
movl %ebp, %esi
callq 0x9f79
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa151
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: cookie_seek
static int
cookie_seek(void *fh, int64_t *offsetp, int whence)
{
  vFILE_t *vf = fh;
  int64_t r = vfd_seek(vf->iu, vf->fd, *offsetp, whence);
  if(r < 0)
    return -1;
  *offsetp = r;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ecx
movq 0x8(%rdi), %rax
movl 0x10(%rdi), %edx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq %rdx, 0xd8(%rax)
jbe 0xe597
movq %rsi, %r14
movq 0xd0(%rax), %rsi
leaq (%rdx,%rdx,2), %rdi
cmpb $0x1, 0x10(%rsi,%rdi,8)
jne 0xe597
movq (%r14), %rdx
leaq (%rsi,%rdi,8), %rsi
movq 0x48(%rax), %rdi
movq 0xc8(%rax), %rax
movq (%rsi), %rsi
callq *0x20(%rax)
testq %rax, %rax
js 0xe597
movq %rax, (%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vFILE_close
static int
vFILE_close(void *fh)
{
  vFILE_t *vf = fh;
  ir_unit_t *iu = vf->iu;
  vmir_fd_close(vf->iu, vf->fd);
  LIST_REMOVE(vf, link);
  vmir_heap_free(iu, vf);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movl 0x10(%rdi), %esi
movq %r14, %rdi
callq 0x9f79
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
testq %rax, %rax
je 0xe5c8
movq %rcx, 0x20(%rax)
movq %rax, (%rcx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa151
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: fmt_sn
static void
fmt_sn(void *opaque, const char *str, int len)
{
  fmt_sn_aux_t *aux = opaque;
  aux->total += len;
  if(aux->remain == 0)
    return;

  // Figure out how much to copy, we always reserve one byte for trailing 0
  int to_copy = VMIR_MIN(aux->remain - 1, len);

  memcpy(aux->dst, str, to_copy);
  aux->dst += to_copy;
  aux->remain -= to_copy;
}

// Assembly:
addl %edx, 0xc(%rdi)
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0xe823
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
decl %eax
cmpl %edx, %eax
cmovael %edx, %eax
movq (%rdi), %rdi
movslq %eax, %r14
movq %r14, %rdx
callq 0x3360
addq %r14, (%rbx)
subl %r14d, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq