LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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(%rbx), %rax
testq %rax, %rax
je 0xa08d
movq (%rax), %rdi
callq 0x3160
jmp 0xa077
leaq 0x2e0(%rbx), %r15
xorl %r12d, %r12d
cmpq %r12, (%r15)
jbe 0xa0e2
movq 0x2d8(%rbx), %rax
movq (%rax,%r12,8), %r14
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0xa0ba
movq %r14, %rsi
callq 0xdfef
jmp 0xa0a7
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
jmp 0xa097
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
pushq $0x10
popq %r15
xorl %r12d, %r12d
cmpq %r12, (%r14)
jbe 0xa14c
movq 0x168(%rbx), %r13
movl -0x10(%r13,%r15), %eax
cmpl $0xc, %eax
je 0xa139
testl %eax, %eax
jne 0xa143
movq (%r13,%r15), %rdi
callq 0x3030
movq -0x8(%r13,%r15), %rdi
callq 0x3030
incq %r12
addq $0x28, %r15
jmp 0xa115
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_O2/cogbee[P]vmir-latest/src/vmir.c
// Function: vmir_create
ir_unit_t *
vmir_create(void *membase, uint32_t memsize,
            uint32_t rsize, uint32_t asize,
            void *opaque)
{
  ir_unit_t *iu = calloc(1, sizeof(ir_unit_t));
  iu->iu_log_level = VMIR_LOG_INFO;
  iu->iu_external_function_resolver = vmir_default_external_function_resolver;

  iu->iu_opaque = opaque;
  iu->iu_mem = membase;
  iu->iu_memsize = memsize;
  iu->iu_rsize = rsize;
  iu->iu_asize = asize;
  iu->iu_text_alloc_memsize = 1024 * 1024;
  iu->iu_text_alloc = malloc(iu->iu_text_alloc_memsize);

  iu->iu_mem_low = iu->iu_mem;
  iu->iu_mem_high = iu->iu_mem + memsize;

  return iu;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
pushq $0x1
popq %rdi
movl $0x638, %esi            # imm = 0x638
callq 0x32f0
movq %rax, %r13
movl $0x2, 0x630(%rax)
leaq -0x2f4(%rip), %rax      # 0x9ee4
movq %rax, (%r13)
movq %rbx, 0x48(%r13)
movq %r12, 0x20(%r13)
movl %r15d, 0xa4(%r13)
movl %r14d, 0x9c(%r13)
movl %ebp, 0xa0(%r13)
movq $0x100000, 0x448(%r13) # imm = 0x100000
movl $0x100000, %edi         # imm = 0x100000
callq 0x3380
movq %rax, 0x438(%r13)
movq %r12, 0x8(%r13)
movl %r15d, %eax
addq %r12, %rax
movq %rax, 0x10(%r13)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %rbx
xorl %eax, %eax
movl $0x8, %r9d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
xorl %edx, %edx
testl %esi, %esi
jle 0xb676
movslq 0xc(%rdi), %rcx
cmpl 0x8(%rdi), %ecx
jge 0xb674
movl 0x10(%rdi), %r11d
testl %r11d, %r11d
je 0xb62f
movb 0x14(%rdi), %bl
jmp 0xb63e
movq (%rdi), %r8
movb (%r8,%rcx), %bl
incl %ecx
movl %ecx, 0xc(%rdi)
movl %r9d, %r11d
cmpl %r11d, %esi
movl %r11d, %r8d
cmovll %esi, %r8d
movl %r10d, %ebp
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, %esi
subl %r8d, %r11d
movl %r11d, 0x10(%rdi)
jmp 0xb614
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xbf2f
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 0x173cf(%rip), %rdx     # 0x2334c
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rcx
movl %ebp, %r8d
movq %r15, %r9
xorl %eax, %eax
callq 0x3fc2
cmpl $0x0, 0x574(%rbx)
jne 0xbfa8
movl $0x1, 0x574(%rbx)
jmp 0xbfb4
leaq 0x173c8(%rip), %rdi     # 0x23377
callq 0x30e0
addq $0x370, %rbx            # imm = 0x370
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_c_makefile_star2_O2/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 0x60(%rip), %rcx        # 0xc046
pushq $0x18
popq %rdx
callq 0x30f0
pushq $0x10
popq %r15
leaq 0x14137(%rip), %r14     # 0x20130
xorl %r12d, %r12d
cmpq %r12, 0x118(%rbx)
jbe 0xc03a
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
jmp 0xbffc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rsp, %r15
movl %ebx, %esi
movq %r15, %rdx
callq 0x40d8
movl %eax, %ebp
movq (%r15), %rdi
testq %rdi, %rdi
je 0xc096
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3360
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x14057(%rip), %rsi     # 0x20143
callq 0x3ad7
testq %rax, %rax
je 0xc19d
movq %rax, %r13
movq %r14, 0x10(%rsp)
leal 0x4(,%r15,4), %esi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x40d8
movl %eax, 0xc(%rsp)
xorl %r14d, %r14d
testl %r15d, %r15d
movl $0x0, %ebp
cmovgl %r15d, %ebp
cmpq %r14, %rbp
je 0xc146
movq (%r12,%r14,8), %rsi
movq %rbx, %rdi
callq 0xc0a3
movq (%rsp), %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
jmp 0xc128
movq %rsp, %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x3bce
movl %eax, %ebp
cmpl $0x1, %eax
jne 0xc16b
movl 0x40(%rbx), %eax
movl %eax, (%rsp)
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0xc17a
movl (%rsp), %eax
movl %eax, (%rcx)
cmpl $0x6, %ebp
ja 0xc1f8
movl %ebp, %eax
leaq 0x12aa4(%rip), %rcx     # 0x1ec2c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl (%rsp), %ecx
leaq 0x13fad(%rip), %rdx     # 0x20148
jmp 0xc1c7
pushq $0x5
popq %rbp
jmp 0xc1f8
leaq 0x13fe2(%rip), %rdx     # 0x2018b
jmp 0xc1eb
leaq 0x13fcb(%rip), %rdx     # 0x2017d
jmp 0xc1eb
leaq 0x13ee9(%rip), %rdx     # 0x200a4
jmp 0xc1eb
movl 0x40(%rbx), %ecx
leaq 0x13fa1(%rip), %rdx     # 0x20168
pushq $0x3
jmp 0xc1d7
movl 0x40(%rbx), %ecx
leaq 0x13fc6(%rip), %rdx     # 0x2019b
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3fc2
jmp 0xc1f8
leaq 0x13ef5(%rip), %rdx     # 0x200e0
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3fc2
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir.c
// Function: addstr
static int __attribute__((warn_unused_result))
addstr(char **dst, const char *str)
{
  int len = strlen(str);
  if(dst != NULL) {
    memcpy(*dst, str, len);
    *dst += len;
  }
  return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x3170
movq %rax, %r14
testq %rbx, %rbx
je 0xc5be
movq (%rbx), %rdi
movslq %r14d, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x3360
addq %r12, (%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movslq %edx, %rax
cmpq %rax, 0x170(%rsi)
jbe 0xc603
imulq $0x28, %rax, %rdx
addq 0x168(%rsi), %rdx
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r14
jmp 0xc284
movl %edx, %ecx
leaq 0x13bfa(%rip), %rdx     # 0x20206
movq %rsp, %r14
movl $0x80, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x31a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc58c
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
leaq 0x13b22(%rip), %rdx     # 0x20238
pushq $0x2
popq %rbp
movl %ebp, %esi
xorl %eax, %eax
callq 0x3fc2
leaq 0x78(%rbx), %r15
leaq 0x13911(%rip), %r14     # 0x2003e
movq (%r15), %r15
testq %r15, %r15
je 0xc752
movq 0x10(%r15), %rax
movq 0x20(%rax), %rcx
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3fc2
addq $0x18, %r15
jmp 0xc72d
leaq 0x13af6(%rip), %rdx     # 0x2024f
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3fc2
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %rdi
callq 0x9f49
testq %rax, %rax
je 0xc837
subl 0x20(%r14), %eax
jmp 0xc839
xorl %eax, %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
movl -0x8(%rsi), %esi
movl -0x4(%rax), %r15d
testq %r15, %r15
je 0xc887
addq 0x20(%r14), %r15
jmp 0xc88a
xorl %r15d, %r15d
xorl %r13d, %r13d
testl %esi, %esi
je 0xc8c6
cmpl $0xa110ced, -0x18(%r15) # imm = 0xA110CED
jne 0xc8fc
movl -0x14(%r15), %ebp
addl $-0x18, %ebp
cmpl %esi, %ebp
jg 0xc8dc
movq %r14, %rdi
callq 0x9f49
testq %rax, %rax
je 0xc8f7
movq %rax, %r12
movslq %ebp, %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3360
jmp 0xc8c9
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rsi
callq 0x9fd1
movq %r12, %r15
testq %r12, %r12
je 0xc8e3
subl 0x20(%r14), %r15d
movl %r15d, %r13d
movl %r13d, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
jmp 0xc8e3
leaq 0x13b88(%rip), %rdi     # 0x2048b
leaq 0x13ba2(%rip), %rsi     # 0x204ac
leaq 0x13bab(%rip), %rcx     # 0x204bc
movl $0xf4, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %rdi
movl %ebp, %esi
callq 0x9f49
testq %rax, %rax
je 0xc953
movq %rax, %r15
movl %ebp, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x3210
subl 0x20(%r14), %r15d
jmp 0xc956
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_O2/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
pushq $0x3
popq %rdx
cmovel %r8d, %edx
movl -0x4(%rsi), %esi
orl %edi, %edx
addq 0x20(%rax), %rsi
movq %rax, %rdi
callq 0xd4b1
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %r8
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movl -0xc(%rsi), %ecx
movl -0x8(%rsi), %edx
addq 0x20(%r8), %rdx
movq %r8, %rdi
movl %eax, %esi
callq 0xd4ea
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %r8
movq %rdi, %rbx
movl -0x4(%rsi), %eax
movq -0xc(%rsi), %rdx
movl -0x10(%rsi), %ecx
movq %r8, %rdi
movl %eax, %esi
callq 0xd572
movq %rax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x9e3a
andl $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd5b4
testq %rax, %rax
je 0xca54
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_O2/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_fdopen
static int
vmir_fdopen(void *ret, const void *rf, ir_unit_t *iu)
{
  uint32_t fd = vmir_vm_arg32(&rf);
  const char *mode = vmir_vm_ptr(&rf, iu);
  vFILE_t *vfile = vFILE_open_fd(iu, fd, 0, mode);
  vmir_vm_retptr(ret, vfile, iu);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movl -0x8(%rsi), %ecx
movl -0x4(%rsi), %esi
addq 0x20(%rdx), %rcx
xorl %ebp, %ebp
movq %rdx, %rdi
xorl %edx, %edx
callq 0xd632
testq %rax, %rax
je 0xca88
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_O2/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 0xcab2
movq 0x20(%rdx), %rcx
movl -0xc(%rsi), %edx
movl -0x8(%rsi), %esi
movq (%rcx,%rax), %rdi
callq 0x33b0
jmp 0xcab5
pushq $-0x1
popq %rax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcae2
movq 0x20(%rdx), %rdi
movq -0xc(%rsi), %rax
movl -0x10(%rsi), %edx
movq (%rdi,%rcx), %rdi
movq %rax, %rsi
callq 0x3420
cltq
jmp 0xcae5
pushq $-0x1
popq %rax
movq %rax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcb1a
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 0xcb1d
pushq $-0x1
popq %rax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcb51
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 0xcb54
pushq $-0x1
popq %rax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcb75
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3350
jmp 0xcb78
pushq $0x1
popq %rax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcb99
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3390
jmp 0xcb9c
pushq $0x1
popq %rax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcbbd
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3330
jmp 0xcbc0
pushq $-0x1
popq %rax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcbfa
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rdi
callq 0x3160
andl $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_puts
static int
vmir_puts(void *ret, const void *rf, ir_unit_t *iu)
{
  const char *str = vmir_vm_ptr(&rf, iu);
  if(iu->iu_stdout != NULL) {
    fwrite(str, strlen(str), 1, iu->iu_stdout->fp);
    fwrite("\n", 1, 1, iu->iu_stdout->fp);    
  }
  vmir_vm_ret32(ret, 0);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb8(%rdx), %r12
testq %r12, %r12
je 0xcc4f
movq %rdx, %r14
movl -0x4(%rsi), %r15d
addq 0x20(%rdx), %r15
movq %r15, %rdi
callq 0x3170
movq (%r12), %rcx
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x34b0
movq 0xb8(%r14), %rax
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x3280
andl $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcc85
movl -0x8(%rsi), %edx
movq (%rcx,%rdx), %rsi
movsbl %al, %ebp
movl %ebp, %edi
callq 0x3280
jmp 0xcc88
movsbl %al, %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0xccc7
movl -0x4(%rsi), %ecx
movq (%rax,%rcx), %rcx
leaq 0x7(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rdx, %rsi
callq 0x3110
cmpq $0x1, %rax
jne 0xccc7
movzbl 0x7(%rsp), %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xccf6
movq (%rcx), %rsi
movsbl %al, %ebp
movl %ebp, %edi
callq 0x3280
jmp 0xccf9
movsbl %al, %ebp
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcd44
movq (%rcx), %rcx
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl %edi, 0x8(%r14)
andl $0x0, 0xc(%r14)
leaq 0xbb9(%rip), %rdi       # 0xd915
movq %r14, %rsi
callq 0xd787
cmpl $0x0, 0x8(%r14)
je 0xcd73
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_O2/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 0xcdb8
movl -0x10(%rcx), %ecx
addq %rcx, %rdi
movq %rdi, %rcx
jmp 0xcdbc
addq $-0xc, %rcx
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movl %esi, 0x8(%r14)
andl $0x0, 0xc(%r14)
leaq 0xb41(%rip), %rdi       # 0xd915
movq %r14, %rsi
callq 0xd787
cmpl $0x0, 0x8(%r14)
je 0xcdeb
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_O2/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 0xce28
movq (%rcx), %rcx
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq $0x7fffffff, 0x8(%r14)  # imm = 0x7FFFFFFF
leaq 0xad6(%rip), %rdi       # 0xd915
movq %r14, %rsi
callq 0xd787
cmpl $0x0, 0x8(%r14)
je 0xce56
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_O2/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 0xcefe
movq (%rcx), %rcx
addq %rax, %rdx
movq 0xb8(%r8), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
andl $0x0, 0x8(%r14)
leaq 0x1059(%rip), %rdi      # 0xdf75
movq %r14, %rsi
callq 0xd787
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcf5a
movl -0x8(%rcx), %ecx
addq %rdx, %rcx
jmp 0xcf5e
addq $-0x4, %rcx
addq %rax, %rdx
movq 0xb8(%r8), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
andl $0x0, 0x8(%r14)
leaq 0xff9(%rip), %rdi       # 0xdf75
movq %r14, %rsi
callq 0xd787
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcfbb
movq (%rcx), %rcx
addq %rdi, %rdx
addq %rdi, %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
andl $0x0, 0x8(%r14)
leaq 0xfa0(%rip), %rdi       # 0xdf75
movq %r14, %rsi
callq 0xd787
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd016
movl -0xc(%rcx), %ecx
addq %rsi, %rcx
jmp 0xd01a
addq $-0x8, %rcx
addq %rsi, %rdx
addq %rsi, %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
andl $0x0, 0x8(%r14)
leaq 0xf41(%rip), %rdi       # 0xdf75
movq %r14, %rsi
callq 0xd787
movl 0x8(%r14), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd0b4
addq %rax, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x3290
leaq (%r14,%rax), %rcx
cmpb $0x0, (%r14,%rax)
je 0xd0a7
movb $0x0, (%rcx)
incq %rcx
movq 0x20(%r15), %r13
subl %r13d, %ecx
movl %ecx, (%r13,%rbp)
subl %r13d, %r14d
jmp 0xd0b7
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_O2/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 0xd0f3
movl -0x4(%rsi), %r15d
addq %r13, %r15
jmp 0xd0fa
movq 0xf8(%r14), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x3260
cmpb $0x0, (%r15,%rax)
je 0xd13b
addq %rax, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x3290
leaq (%r15,%rax), %rcx
cmpb $0x0, (%r15,%rax)
je 0xd12f
movb $0x0, (%rcx)
incq %rcx
movq 0x20(%r14), %r13
movq %rcx, 0xf8(%r14)
subl %r13d, %r15d
jmp 0xd13e
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_O2/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_heap_print
static void
vmir_heap_print0(ir_unit_t *iu)
{
  heap_block_t *hb;
  heap_t *h = iu->iu_heap;
  printf(" --- Heap allocation dump ---\n");
  TAILQ_FOREACH(hb, &h->h_blocks, hb_link) {
    printf("%s 0x%x bytes\n",
           hb->hb_magic == HEAP_MAGIC_ALLOC ? "use " :
           hb->hb_magic == HEAP_MAGIC_FREE  ? "free" :
           "????",
           hb->hb_size);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x90(%rdx), %r14
leaq 0x1621c(%rip), %rdi     # 0x23386
callq 0x30e0
leaq 0x1313e(%rip), %r15     # 0x202b4
leaq 0x133fe(%rip), %r12     # 0x2057b
leaq 0x133f2(%rip), %r13     # 0x20576
leaq 0x133dc(%rip), %rbx     # 0x20567
movq (%r14), %r14
testq %r14, %r14
je 0xd1c0
movl (%r14), %eax
movq %r15, %rsi
cmpl $0xf4eef4ee, %eax       # imm = 0xF4EEF4EE
je 0xd1a3
movq %r12, %rsi
movl 0x4(%r14), %edx
cmpl $0xa110ced, %eax        # imm = 0xA110CED
cmoveq %r13, %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3190
addq $0x8, %r14
jmp 0xd18b
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x78, %rsp
movq %rdx, %r14
movl -0x4(%rsi), %r15d
movslq -0x8(%rsi), %rax
movq %rax, 0x8(%rsp)
leaq 0x1337b(%rip), %rdi     # 0x20598
movl %r15d, %esi
xorl %eax, %eax
callq 0x3190
addq 0x20(%r14), %r15
leaq 0x10(%rsp), %r14
xorl %ebp, %ebp
cmpq 0x8(%rsp), %rbp
jge 0xd369
movq %r14, %rdi
pushq $0x64
popq %rsi
leaq 0x1335f(%rip), %rdx     # 0x205a9
movl %ebp, %ecx
xorl %eax, %eax
callq 0x31a0
movl %eax, %r14d
pushq $0x33
popq %r13
pushq $-0x33
popq %r12
xorl %ebx, %ebx
movslq %r14d, %rcx
cmpq $0xf, %rbx
ja 0xd2bb
leaq (%rbx,%rbp), %rax
cmpq 0x8(%rsp), %rax
jge 0xd2bb
leaq (%rsp,%rcx), %rdi
addq $0x10, %rdi
pushq $0x64
popq %rsi
subq %rcx, %rsi
cmpq $0x8, %rbx
leaq 0x13cf4(%rip), %rcx     # 0x20f81
leaq 0x13ae1(%rip), %rax     # 0x20d75
cmoveq %rax, %rcx
movzbl (%r15,%rbx), %r8d
leaq 0x1330e(%rip), %rdx     # 0x205b2
xorl %eax, %eax
callq 0x31a0
addl %eax, %r14d
incq %rbx
addq $0x3, %r12
addl $-0x3, %r13d
jmp 0xd260
xorl %eax, %eax
cmpq $0x8, %rbx
setb %al
movq %rax, %rdx
subq %r12, %rdx
addq %rsp, %rcx
addq $0x10, %rcx
xorl %esi, %esi
pushq $0x2e
popq %r9
movabsq $0x100000000, %r10      # imm = 0x100000000
cmpq %rdx, %rsi
jae 0xd2ef
movb $0x20, (%rcx,%rsi)
incq %rsi
jmp 0xd2e1
addl %r14d, %eax
addl %r13d, %eax
cltq
leaq (%rsp,%rax), %rcx
addq $0x10, %rcx
shlq $0x20, %rax
xorl %edx, %edx
leaq 0x10(%rsp), %r14
cmpq $0xf, %rdx
ja 0xd33b
leaq (%rdx,%rbp), %rsi
cmpq 0x8(%rsp), %rsi
jge 0xd33b
movzbl (%r15,%rdx), %esi
leal -0x7f(%rsi), %r8d
movl %r9d, %edi
cmpb $-0x5f, %r8b
jb 0xd32f
movl %esi, %edi
movb %dil, (%rcx,%rdx)
incq %rdx
addq %r10, %rax
jmp 0xd30a
sarq $0x20, %rax
movb $0x0, 0x10(%rsp,%rax)
leaq 0x1326f(%rip), %rdi     # 0x205ba
leaq 0x13052(%rip), %rsi     # 0x203a4
movq %r14, %rdx
xorl %eax, %eax
callq 0x3190
addq $0x10, %rbp
addq $0x10, %r15
jmp 0xd232
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %rdi
callq 0x9f49
andq $0x0, (%rax)
andl $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_O2/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 0xd456
pushq %rax
addq %rax, %rsi
movl (%rsi), %eax
movl %eax, 0x74(%rdx)
movq %rdx, %rdi
callq 0x9fd1
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0xd4d4
pushq $-0x1
popq %rax
jmp 0xd4e4
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x9e0f
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1252c(%rip), %r13     # 0x1fb00
cmpq $0x78, %r12
je 0xd621
leaq (%r12,%r13), %rsi
movq %rbx, %rdi
callq 0x3300
addq $0x8, %r12
testl %eax, %eax
jne 0xd5d4
movl -0x4(%r12,%r13), %edx
testl %edx, %edx
je 0xd621
movq %r14, %rdi
movq %r15, %rsi
callq 0xd4b1
cmpl $-0x1, %eax
je 0xd621
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 0xd632
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_O2/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
pushq $0x28
popq %rsi
callq 0x9f49
testq %rax, %rax
je 0xd6c2
movq %rax, %rbx
movq %r14, 0x8(%rax)
movl %ebp, 0x10(%rax)
movups 0x1d339(%rip), %xmm0    # 0x2a9a0
movups %xmm0, 0x10(%rsp)
movups 0x1d31d(%rip), %xmm0    # 0x2a990
movups %xmm0, (%rsp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x30a0
movq %rax, (%rbx)
testq %rax, %rax
je 0xd6ce
testl %r15d, %r15d
je 0xd697
movq %rax, %rdi
callq 0x31f0
movq 0xf0(%r14), %rax
addq $0xf0, %r14
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xd6b9
movq %rbx, %rcx
addq $0x18, %rcx
movq %rcx, 0x20(%rax)
movq %rbx, (%r14)
movq %r14, 0x20(%rbx)
jmp 0xd6e5
movq %r14, %rdi
movl %ebp, %esi
callq 0x9e3a
jmp 0xd6e3
movq %r14, %rdi
movl %ebp, %esi
callq 0x9e3a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9fd1
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_O2/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 0x9e3a
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
testq %rax, %rax
je 0xd76f
movq %rcx, 0x20(%rax)
movq %rax, (%rcx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9fd1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq