LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_instr.c
// Function: instr_add_after
static void *
instr_add_after(size_t size, instr_class_t ic, ir_instr_t *after)
{
  ir_bb_t *ib = after->ii_bb;
  ir_instr_t *ii = instr_create(size, ic);
  ii->ii_bb = ib;
  TAILQ_INSERT_AFTER(&ib->ib_instrs,  after, ii, ii_link);
  return ii;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x10(%rdx), %r14
callq 0x10277
movq %r14, 0x10(%rax)
movq (%rbx), %rcx
movq %rcx, (%rax)
addq $0x18, %r14
leaq 0x8(%rcx), %rdx
testq %rcx, %rcx
cmoveq %r14, %rdx
movq %rax, (%rdx)
movq %rax, (%rbx)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: instr_bind_input
static void
instr_bind_input(ir_unit_t *iu, ir_valuetype_t vt, ir_instr_t *ii)
{
  if(vt.value == -1)
    return;
  ir_value_t *iv = value_get(iu, vt.value);
  if(iv->iv_class != IR_VC_TEMPORARY)
    return;
  value_bind_instr(iv, ii, IVI_INPUT);
}

// Assembly:
pushq %rbx
cmpl $-0x1, %esi
je 0x1422c
movq %rdx, %rbx
callq 0x102f1
cmpl $0x4, (%rax)
jne 0x1422c
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
popq %rbx
jmp 0x1028f
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: cfg_add_edge
static void
cfg_add_edge(ir_function_t *f, ir_bb_t *from, int bb, int mark)
{
  ir_bb_t *to = bb_find(f, bb);
  if(mark) {
    if(to->ib_mark)
      return;
    to->ib_mark = 1;
  }
  cfg_create_edge(f, from, to);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x142d5
movq %rax, %rbx
movq %rax, %r12
testl %ebp, %ebp
je 0x1425d
cmpb $0x0, 0x2c(%r12)
jne 0x142cc
movb $0x1, 0x2c(%r12)
pushq $0x40
popq %rdi
callq 0x3380
movq 0x58(%r15), %rcx
addq $0x58, %r15
movq %rcx, 0x20(%rax)
testq %rcx, %rcx
je 0x1427e
leaq 0x20(%rax), %rdx
movq %rdx, 0x28(%rcx)
movq %rax, (%r15)
movq %r15, 0x28(%rax)
movq %r14, 0x30(%rax)
movq 0x38(%r14), %rcx
addq $0x38, %r14
movq %rcx, (%rax)
testq %rcx, %rcx
je 0x1429d
movq %rax, 0x8(%rcx)
movq %rax, (%r14)
movq %r14, 0x8(%rax)
movq %r12, 0x38(%rax)
addq $0x30, %rbx
movq 0x30(%r12), %rcx
movq %rcx, 0x10(%rax)
testq %rcx, %rcx
je 0x142c5
movq %rax, %rdx
addq $0x10, %rdx
movq %rdx, 0x18(%rcx)
movq %rax, (%rbx)
movq %rbx, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: bb_change_branch
static void
bb_change_branch(ir_bb_t *from, ir_bb_t *to, ir_bb_t *nb, ir_function_t *f)
{
  ir_instr_t *ii;

  ii = TAILQ_LAST(&from->ib_instrs, ir_instr_queue);
  switch(ii->ii_class) {
  case IR_IC_BR:
    {
      ir_instr_br_t *b = (ir_instr_br_t *)ii;
      if(b->true_branch == to->ib_id)
        b->true_branch = nb->ib_id;

      if(b->condition.value != -1) {
        if(b->false_branch == to->ib_id)
          b->false_branch = nb->ib_id;
      }
    }
    break;
  case IR_IC_CMP_BRANCH:
    {
      ir_instr_cmp_branch_t *icb = (ir_instr_cmp_branch_t *)ii;
      if(icb->true_branch == to->ib_id)
        icb->true_branch = nb->ib_id;

      if(icb->false_branch == to->ib_id)
        icb->false_branch = nb->ib_id;
    }
    break;
  case IR_IC_SWITCH:
    {
      ir_instr_switch_t *s = (ir_instr_switch_t *)ii;
      if(s->defblock == to->ib_id)
        s->defblock = nb->ib_id;

      for(int i = 0; i < s->num_paths; i++)
        if(s->paths[i].block == to->ib_id)
          s->paths[i].block = nb->ib_id;
    }
    break;
  case IR_IC_INVOKE:
    {
      ir_instr_invoke_t *s = (ir_instr_invoke_t *)ii;
      if(s->normal_dest == to->ib_id)
        s->normal_dest = nb->ib_id;

      if(s->unwind_dest == to->ib_id)
        s->unwind_dest = nb->ib_id;
    }
    break;
  case IR_IC_RET:
    break;
  default:
    printf("Unable to transform branch for instruction class %d\n",
           ii->ii_class);
    abort();
  }

  if(ii->ii_succ != NULL) {
    free(ii->ii_succ);
    liveness_set_succ(f, ii);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq 0x18(%rdi), %rax
movq 0x8(%rax), %rax
movq (%rax), %r14
movl 0x28(%r14), %eax
cmpl $0x1, %eax
je 0x14383
cmpl $0x19, %eax
je 0x14347
cmpl $0xb, %eax
je 0x14366
cmpl $0xc, %eax
je 0x143a8
cmpl $0x8, %eax
jne 0x143e1
movl 0x28(%rsi), %eax
cmpl %eax, 0x60(%r14)
jne 0x14331
movl 0x28(%rdx), %ecx
movl %ecx, 0x60(%r14)
cmpl $-0x1, 0x58(%r14)
je 0x14383
cmpl %eax, 0x64(%r14)
jne 0x14383
movl 0x28(%rdx), %eax
movl %eax, 0x64(%r14)
jmp 0x14383
movl 0x28(%rsi), %eax
cmpl %eax, 0x6c(%r14)
jne 0x14357
movl 0x28(%rdx), %ecx
movl %ecx, 0x6c(%r14)
cmpl %eax, 0x70(%r14)
jne 0x14383
movl 0x28(%rdx), %eax
movl %eax, 0x70(%r14)
jmp 0x14383
movl 0x28(%rsi), %eax
cmpl %eax, 0x64(%r14)
jne 0x14376
movl 0x28(%rdx), %ecx
movl %ecx, 0x64(%r14)
cmpl %eax, 0x68(%r14)
jne 0x14383
movl 0x28(%rdx), %eax
movl %eax, 0x68(%r14)
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x143a0
callq 0x3030
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x143f6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl 0x28(%rsi), %eax
cmpl %eax, 0x60(%r14)
jne 0x143b8
movl 0x28(%rdx), %ecx
movl %ecx, 0x60(%r14)
movl 0x64(%r14), %ecx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
shlq $0x4, %rcx
cmpq %rsi, %rcx
je 0x14383
cmpl %eax, 0x70(%r14,%rsi)
jne 0x143db
movl 0x28(%rdx), %edi
movl %edi, 0x70(%r14,%rsi)
addq $0x10, %rsi
jmp 0x143c7
leaq 0xd161(%rip), %rdi      # 0x21549
movl %eax, %esi
xorl %eax, %eax
callq 0x3190
callq 0x3060
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: insert_move
static void
insert_move(ir_unit_t *iu, ir_valuetype_t to, ir_valuetype_t from,
            ir_instr_t *before)
{
  ir_instr_move_t *m =
    instr_add_before(sizeof(ir_instr_move_t), IR_IC_MOVE, before);
  m->super.ii_ret = to;
  m->value = from;
  value_bind_return_value(iu, &m->super);
  instr_bind_input(iu, m->value, &m->super);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x60
popq %rdi
pushq $0x15
popq %rsi
movq %rcx, %rdx
callq 0x14091
movq %rax, %r12
movq %r14, 0x2c(%rax)
movq %rbx, 0x58(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x10225
movq 0x58(%r12), %rsi
movq %r15, %rdi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1420b
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_type.c
// Function: type_make
static int
type_make(ir_unit_t *iu, int code)
{
  for(int i = 0; i < VECTOR_LEN(&iu->iu_types); i++) {
    ir_type_t *it = &VECTOR_ITEM(&iu->iu_types, i);
    if(it->it_code == code)
      return i;
  }

  iu->iu_types_created = 1;

  ir_type_t it;
  int r = VECTOR_LEN(&iu->iu_types);
  it.it_code = code;
  VECTOR_PUSH_BACK(&iu->iu_types, it);
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movq 0x170(%rdi), %rbx
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x14b11
movq 0x168(%r14), %rdx
cmpl %ebp, (%rdx,%rax)
je 0x14b5e
incq %rcx
addq $0x28, %rax
jmp 0x14af7
movl $0x1, 0x368(%r14)
leaq 0x1(%rbx), %r15
movq 0x168(%r14), %rax
cmpq 0x178(%r14), %rbx
jb 0x14b4e
leaq (%r15,%r15), %rcx
movq %rcx, 0x178(%r14)
imulq $0x50, %r15, %rsi
movq %rax, %rdi
callq 0x33c0
movq %rax, 0x168(%r14)
movq %r15, 0x170(%r14)
imulq $0x28, %rbx, %rcx
movl %ebp, (%rax,%rcx)
jmp 0x14b61
movq %rcx, %rbx
movl %ebx, %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_type.c
// Function: type_get_pointee
static unsigned int
type_get_pointee(ir_unit_t *iu, unsigned int id)
{
  ir_type_t *it = type_get(iu, id);
  if(it->it_code != IR_TYPE_POINTER)
    parser_error(iu, "Type (%s) (index:%d) is not a pointer",
                 type_str_index(iu, id), id);
  if(it->it_pointer.pointee == -1)
    parser_error(iu, "Attempting to dereference void pointer");
  return it->it_pointer.pointee;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0xe719
cmpl $0xb, (%rax)
jne 0x14b8f
movl 0x8(%rax), %eax
cmpl $-0x1, %eax
je 0x14bbc
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
movl %ebp, %esi
callq 0x105cd
leaq 0xc052(%rip), %rsi      # 0x20bf2
leaq 0xceef(%rip), %rcx      # 0x21a96
movq %rbx, %rdi
movl $0x8a, %edx
movq %rax, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0xbed2
leaq 0xc02f(%rip), %rsi      # 0x20bf2
leaq 0xcef2(%rip), %rcx      # 0x21abc
movq %rbx, %rdi
movl $0x8c, %edx
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: emit_partial_load
static ir_instr_t *
emit_partial_load(ir_unit_t *iu, ir_instr_load_t *orig, int offset,
                  ir_instr_t *after, ir_valuetype_t ret)
{
  assert(orig->cast == -1);

  ir_instr_load_t *n =
    instr_add_after(sizeof(ir_instr_load_t), IR_IC_LOAD, after);
  n->immediate_offset = orig->immediate_offset + offset;
  n->ptr = orig->ptr;
  n->value_offset = orig->value_offset;
  n->value_offset_multiply = orig->value_offset_multiply;
  n->super.ii_ret = ret;
  n->cast = -1;

  value_bind_return_value(iu, &n->super);

  instr_bind_input(iu, n->ptr, &n->super);
  if(n->value_offset.value >= 0)
    instr_bind_input(iu, n->value_offset, &n->super);
  return &n->super;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $-0x1, 0x74(%rsi)
jne 0x14c6f
movq %r8, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x78
popq %rdi
pushq $0x4
popq %rsi
movq %rcx, %rdx
callq 0x141bb
movq %rax, %r14
addl 0x60(%r12), %ebp
movl %ebp, 0x60(%rax)
movq 0x58(%r12), %rax
movq %rax, 0x58(%r14)
movq 0x64(%r12), %rax
movq %rax, 0x64(%r14)
movl 0x6c(%r12), %eax
movl %eax, 0x6c(%r14)
movq %r15, 0x2c(%r14)
movb $-0x1, 0x74(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10225
movq 0x58(%r14), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1420b
cmpl $0x0, 0x64(%r14)
js 0x14c63
movq 0x64(%r14), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1420b
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xce6d(%rip), %rdi      # 0x21ae3
leaq 0xc64c(%rip), %rsi      # 0x212c9
leaq 0xce70(%rip), %rcx      # 0x21af4
movl $0xb05, %edx            # imm = 0xB05
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: eliminate_dead_code_in_bb
static void
eliminate_dead_code_in_bb(ir_unit_t *iu, ir_function_t *f, ir_bb_t *ib)
{
  ir_instr_t *ii, *iip;
  ir_value_instr_t *ivi;
  for(ii = TAILQ_LAST(&ib->ib_instrs, ir_instr_queue); ii != NULL; ii = iip) {
    iip = TAILQ_PREV(ii, ir_instr_queue, ii_link);
    if(ii->ii_ret.value == -1 ||
       ii->ii_class == IR_IC_VMOP ||
       ii->ii_class == IR_IC_VAARG ||
       ii->ii_class == IR_IC_CALL ||
       ii->ii_class == IR_IC_INVOKE)
      continue;

    if(ii->ii_ret.value < 1)
      continue; // Maybe need to deal with multiple ret values in the future?

    ir_value_t *output = value_get(iu, ii->ii_ret.value);

    LIST_FOREACH(ivi, &output->iv_instructions, ivi_value_link) {
      if(ivi->ivi_relation == IVI_INPUT)
        break; // Someone is using our output for input ->
    }
    if(ivi != NULL)
      continue; // -> thus continue

    instr_destroy(ii);
    output->iv_class = IR_VC_DEAD;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rsi), %rax
movq 0x8(%rax), %rax
movq (%rax), %r12
movl $0x408c00, %ebp         # imm = 0x408C00
testq %r12, %r12
je 0x14d08
movq %r12, %r14
movq 0x8(%r12), %rax
movq 0x8(%rax), %rax
movq (%rax), %r12
movl 0x2c(%r14), %esi
cmpl $-0x1, %esi
je 0x14ca9
movl 0x28(%r14), %eax
cmpl $0x16, %eax
ja 0x14cd4
btl %eax, %ebp
jb 0x14ca9
testl %esi, %esi
jle 0x14ca9
movq %rbx, %rdi
callq 0x102f1
movq %rax, %r15
addq $0x8, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x14cf7
cmpl $0x0, 0x30(%rax)
jne 0x14ce7
jmp 0x14ca9
movq %r14, %rdi
callq 0xe058
movl $0xc, (%r15)
jmp 0x14ca9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: liveness_set_value
static void
liveness_set_value(uint32_t *bs, ir_unit_t *iu, ir_valuetype_t vt)
{
  int value = vt.value;
  ir_value_t *iv = VECTOR_ITEM(&iu->iu_values, value);
  if(iv->iv_class != IR_VC_TEMPORARY)
    return;

  value -= iu->iu_first_func_value;
  assert(value >= 0);

  bitset(bs, value);
}

// Assembly:
movq 0x180(%rsi), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x4, (%rax)
jne 0x14ffe
subl 0x19c(%rsi), %edx
js 0x14fff
pushq $0x1
popq %rax
movl %edx, %ecx
shll %cl, %eax
shrl $0x5, %edx
orl %eax, (%rdi,%rdx,4)
retq
pushq %rax
leaq 0xcbe7(%rip), %rdi      # 0x21bee
leaq 0xc2bb(%rip), %rsi      # 0x212c9
leaq 0xcbe4(%rip), %rcx      # 0x21bf9
movl $0x537, %edx            # imm = 0x537
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: emit_i32
static void
emit_i32(ir_unit_t *iu, uint32_t i32)
{
  if(iu->iu_text_ptr + 4 >= iu->iu_text_alloc + iu->iu_text_alloc_memsize)
    parser_error(iu, "Function too big");
  *(uint32_t *)iu->iu_text_ptr = i32;
  iu->iu_text_ptr += 4;
}

// Assembly:
movq 0x438(%rdi), %rdx
movq 0x440(%rdi), %rax
leaq 0x4(%rax), %rcx
addq 0x448(%rdi), %rdx
cmpq %rdx, %rcx
jae 0x150d4
movl %esi, (%rax)
movq %rcx, 0x440(%rdi)
retq
pushq %rax
leaq 0xcd1f(%rip), %rsi      # 0x21dfb
leaq 0xcd5a(%rip), %rcx      # 0x21e3d
movl $0x94b, %edx            # imm = 0x94B
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: emit_i16
static void
emit_i16(ir_unit_t *iu, uint16_t i16)
{
  if(iu->iu_text_ptr + 2 >= iu->iu_text_alloc + iu->iu_text_alloc_memsize)
    parser_error(iu, "Function too big");
  *(uint16_t *)iu->iu_text_ptr = i16;
  iu->iu_text_ptr += 2;
}

// Assembly:
movq 0x438(%rdi), %rdx
movq 0x440(%rdi), %rax
leaq 0x2(%rax), %rcx
addq 0x448(%rdi), %rdx
cmpq %rdx, %rcx
jae 0x19575
movw %si, (%rax)
movq %rcx, 0x440(%rdi)
retq
pushq %rax
leaq 0x887e(%rip), %rsi      # 0x21dfb
leaq 0x88b9(%rip), %rcx      # 0x21e3d
movl $0x926, %edx            # imm = 0x926
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: emit_i64
static void
emit_i64(ir_unit_t *iu, uint64_t i64)
{
  if(iu->iu_text_ptr + 8 >= iu->iu_text_alloc + iu->iu_text_alloc_memsize)
    parser_error(iu, "Function too big");
  *(uint64_t *)iu->iu_text_ptr = i64;
  iu->iu_text_ptr += 8;
}

// Assembly:
movq 0x438(%rdi), %rdx
movq 0x440(%rdi), %rax
leaq 0x8(%rax), %rcx
addq 0x448(%rdi), %rdx
cmpq %rdx, %rcx
jae 0x19626
movq %rsi, (%rax)
movq %rcx, 0x440(%rdi)
retq
pushq %rax
leaq 0x87cd(%rip), %rsi      # 0x21dfb
leaq 0x8808(%rip), %rcx      # 0x21e3d
movl $0x957, %edx            # imm = 0x957
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_value.c
// Function: value_get_const64
static uint64_t __attribute__((unused))
value_get_const64(ir_unit_t *iu, const ir_value_t *iv)
{
  assert(iv->iv_class == IR_VC_CONSTANT);

  ir_type_t *it = type_get(iu, iv->iv_type);
  switch(it->it_code) {
  case IR_TYPE_INT1:
    return !!iv->iv_u32;
  case IR_TYPE_INT8:
  case IR_TYPE_INT16:
  case IR_TYPE_INT32:
  case IR_TYPE_POINTER:
    return iv->iv_u32;
  case IR_TYPE_INTx:
  case IR_TYPE_INT64:
  case IR_TYPE_DOUBLE:
    return iv->iv_u64;
  default:
    parser_error(iu, "Unable to get_constant for type %s",
                 type_str(iu, it));
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x3, (%rsi)
jne 0x19696
movq %rsi, %r14
movq %rdi, %rbx
movl 0x24(%rsi), %esi
callq 0xe719
movl (%rax), %ecx
cmpl $0xb, %ecx
ja 0x196b5
movl $0x838, %edx            # imm = 0x838
btl %ecx, %edx
jb 0x19679
movl $0x2c0, %edx            # imm = 0x2C0
btl %ecx, %edx
jae 0x19685
movq 0x30(%r14), %rax
jmp 0x1967d
movl 0x30(%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x2, %ecx
jne 0x196b5
xorl %eax, %eax
cmpl $0x0, 0x30(%r14)
setne %al
jmp 0x1967d
leaq 0x88ca(%rip), %rdi      # 0x21f67
leaq 0x7002(%rip), %rsi      # 0x206a6
leaq 0x88db(%rip), %rcx      # 0x21f86
movl $0x207, %edx            # imm = 0x207
callq 0x31e0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x408f
leaq 0x6fdf(%rip), %rsi      # 0x206a6
leaq 0x88f4(%rip), %rcx      # 0x21fc2
movq %rbx, %rdi
movl $0x218, %edx            # imm = 0x218
movq %rax, %r8
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: emit_op3
static void
emit_op3(ir_unit_t *iu, vm_op_t op,
         uint16_t a1, uint16_t a2, uint16_t a3)
{
  emit_i16(iu, vm_resolve(op));
  emit_i16(iu, a1);
  emit_i16(iu, a2);
  emit_i16(iu, a3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %r15
movzwl %si, %edi
callq 0xc650
movzwl %ax, %esi
movq %r15, %rdi
callq 0x1954c
movq %r15, %rdi
movl %r14d, %esi
callq 0x1954c
movq %r15, %rdi
movl %ebp, %esi
callq 0x1954c
movq %r15, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1954c
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: emit_i8
static void
emit_i8(ir_unit_t *iu, uint8_t i8)
{
  if(iu->iu_text_ptr + 2 >= iu->iu_text_alloc + iu->iu_text_alloc_memsize)
    parser_error(iu, "Function too big");
  *(uint8_t *)iu->iu_text_ptr = i8;
  iu->iu_text_ptr += 2; // We always align to 16 bits
}

// Assembly:
movq 0x438(%rdi), %rcx
movq 0x440(%rdi), %rax
leaq 0x2(%rax), %rdx
addq 0x448(%rdi), %rcx
cmpq %rcx, %rdx
jae 0x197bb
movb %sil, (%rax)
addq $0x2, 0x440(%rdi)
retq
pushq %rax
leaq 0x8638(%rip), %rsi      # 0x21dfb
leaq 0x8673(%rip), %rcx      # 0x21e3d
movl $0x93f, %edx            # imm = 0x93F
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: emit_op4
static void
emit_op4(ir_unit_t *iu, vm_op_t op,
         uint16_t a1, uint16_t a2, uint16_t a3, uint16_t a4)
{
  emit_i16(iu, vm_resolve(op));
  emit_i16(iu, a1);
  emit_i16(iu, a2);
  emit_i16(iu, a3);
  emit_i16(iu, a4);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %r12
movzwl %si, %edi
callq 0xc650
movzwl %ax, %esi
movq %r12, %rdi
callq 0x1954c
movq %r12, %rdi
movl %r15d, %esi
callq 0x1954c
movq %r12, %rdi
movl %r14d, %esi
callq 0x1954c
movq %r12, %rdi
movl %ebp, %esi
callq 0x1954c
movq %r12, %rdi
movl %ebx, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1954c
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_type.c
// Function: type_bitwidth
static unsigned int
type_bitwidth(ir_unit_t *iu, const ir_type_t *it)
{
  switch(it->it_code) {
  case IR_TYPE_VOID:
    return 0;
  case IR_TYPE_INT1:
    return 1;
  case IR_TYPE_INT8:
    return 8;
  case IR_TYPE_INT16:
    return 16;
  case IR_TYPE_INT32:
    return 32;
  case IR_TYPE_INT64:
    return 64;
  case IR_TYPE_INTx:
    return it->it_bits;

  default:
    parser_error(iu, "Unable to compute bitwidth of type %s\n",
                 type_str(iu, it));
  }
}

// Assembly:
movl (%rsi), %eax
decl %eax
cmpl $0x6, %eax
ja 0x198b8
leaq 0x5fc0(%rip), %rcx      # 0x1f854
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
retq
pushq $0x20
jmp 0x198b2
pushq $0x8
jmp 0x198b2
pushq $0x10
jmp 0x198b2
pushq $0x1
jmp 0x198b2
pushq $0x40
popq %rax
retq
movl 0x8(%rsi), %eax
retq
pushq %rbx
movq %rdi, %rbx
callq 0x408f
leaq 0x732a(%rip), %rsi      # 0x20bf2
leaq 0x8b28(%rip), %rcx      # 0x223f7
movq %rbx, %rdi
movl $0x1b5, %edx            # imm = 0x1B5
movq %rax, %r8
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_vm.c
// Function: bb_to_offset_delta
static int16_t
bb_to_offset_delta(ir_unit_t *iu, ir_function_t *f, int bbi, int off)
{
  ir_bb_t *bb = bb_find(f, bbi);
  if(bb == NULL) {
    vmir_log(iu, VMIR_LOG_FAIL, "%s() basic block %d not found during fixup",
             f->if_name, bbi);
    abort();
  }
  // The 2 is here because we need to compensate that the instruction
  // stream is past the opcode when the branch is executed
  int o = bb->ib_text_offset - (off + 2);

  assert(o >= INT16_MIN);
  assert(o <= INT16_MAX);
  return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movl %edx, %esi
callq 0x142d5
testq %rax, %rax
je 0x19922
movl 0x20(%rax), %eax
subl %ebp, %eax
addl $-0x2, %eax
cmpl $0xffff7fff, %eax       # imm = 0xFFFF7FFF
jle 0x19941
cmpl $0x8000, %eax           # imm = 0x8000
jge 0x19960
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r15), %rcx
leaq 0x8d77(%rip), %rdx      # 0x226a4
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %r8d
xorl %eax, %eax
callq 0x3fc2
callq 0x3060
leaq 0x8d87(%rip), %rdi      # 0x226cf
leaq 0x84ac(%rip), %rsi      # 0x21dfb
leaq 0x8d88(%rip), %rcx      # 0x226de
movl $0x1258, %edx           # imm = 0x1258
callq 0x31e0
leaq 0x8dba(%rip), %rdi      # 0x22721
leaq 0x848d(%rip), %rsi      # 0x21dfb
leaq 0x8d69(%rip), %rcx      # 0x226de
movl $0x1259, %edx           # imm = 0x1259
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitstream.c
// Function: read_vbr
static uint32_t
read_vbr(bcbitstream_t *bs, int width)
{
  assert(width > 0);

  uint32_t ret = 0;
  const uint32_t cont = (1 << (width - 1));
  const uint32_t mask = cont - 1;
  int stride = 0;

  while(1) {
    uint32_t x = read_bits(bs, width);
    ret |= (x & mask) << stride;
    if(cont & x) {
      stride += width - 1;
      assert(stride < 32);
    } else {
      break;
    }
  }
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
testl %esi, %esi
jle 0x199ff
movl %esi, %ebx
leal -0x1(%rbx), %ebp
pushq $0x1
popq %r12
movl %ebp, %ecx
shll %cl, %r12d
leal -0x1(%r12), %r13d
xorl %r15d, %r15d
xorl %eax, %eax
movl %eax, %r14d
movq (%rsp), %rdi
movl %ebx, %esi
callq 0xb602
movl %eax, %edx
andl %r13d, %eax
movl %r15d, %ecx
shll %cl, %eax
orl %r14d, %eax
testl %r12d, %edx
je 0x199f0
addl %ebp, %r15d
cmpl $0x20, %r15d
jl 0x199aa
leaq 0x8e66(%rip), %rdi      # 0x22840
leaq 0x8e22(%rip), %rsi      # 0x22803
leaq 0x8e30(%rip), %rcx      # 0x22818
pushq $0x5c
popq %rdx
callq 0x31e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8df3(%rip), %rdi      # 0x227f9
leaq 0x8df6(%rip), %rsi      # 0x22803
leaq 0x8e04(%rip), %rcx      # 0x22818
pushq $0x50
jmp 0x199ea
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_parser.c
// Function: blockinfo_find
static ir_blockinfo_t *
blockinfo_find(ir_unit_t *iu, int id)
{
  ir_blockinfo_t *ib;
  LIST_FOREACH(ib, &iu->iu_blockinfos, ib_link) {
    if(ib->ib_id == id)
      return ib;
  }
  ib = calloc(1, sizeof(ir_blockinfo_t));
  ib->ib_id = id;
  LIST_INSERT_HEAD(&iu->iu_blockinfos, ib, ib_link);
  TAILQ_INIT(&ib->ib_abbrevs);
  return ib;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
addq $0x138, %rbx            # imm = 0x138
movq %rbx, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x19a39
cmpl %ebp, 0x10(%rax)
jne 0x19a2a
jmp 0x19a68
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x32f0
movl %ebp, 0x10(%rax)
movq (%rbx), %rcx
movq %rcx, (%rax)
testq %rcx, %rcx
je 0x19a56
movq %rax, 0x8(%rcx)
movq %rax, (%rbx)
movq %rbx, 0x8(%rax)
movq %rax, %rcx
addq $0x18, %rcx
movq %rcx, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_parser.c
// Function: blockinfo_rec_handler
static void
blockinfo_rec_handler(ir_unit_t *iu, int op,
                      unsigned int argc, const int64_t *argv)
{
  ir_block_t *ib = LIST_FIRST(&iu->iu_blocks);
  switch(op) {

  case 1: // SETBID
    if(argc != 1)
      parser_error(iu, "Bad number of args (%d) for SETBID", argc);

    ib->ib_blockinfo = blockinfo_find(iu, argv[0]);
    break;
  }
}

// Assembly:
pushq %rbx
cmpl $0x1, %esi
jne 0x19a8f
movl %edx, %r8d
cmpl $0x1, %edx
jne 0x19a91
movq 0x140(%rdi), %rbx
movl (%rcx), %esi
callq 0x19a18
movq %rax, 0x20(%rbx)
popq %rbx
retq
leaq 0x8ca8(%rip), %rsi      # 0x22740
leaq 0x8dad(%rip), %rcx      # 0x2284c
pushq $0x60
popq %rdx
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_parser.c
// Function: paramattr_rec_handler
static void
paramattr_rec_handler(ir_unit_t *iu, int op,
                      unsigned int argc, const int64_t *argv)
{
  int off;
  const char *ctx = "paramattr";

  switch(op) {
  case 2:
    off = VECTOR_LEN(&iu->iu_attrsets);
    VECTOR_RESIZE(&iu->iu_attrsets, off + 1);
    ir_attrset_t *ias = &VECTOR_ITEM(&iu->iu_attrsets, off);
    ias->ias_list = malloc(argc * sizeof(const ir_attr_t *));
    ias->ias_size = argc;
    for(int i = 0; i < argc; i++) {
      const ir_attr_t *ia;
      LIST_FOREACH(ia, &iu->iu_attribute_groups, ia_link) {
        if(ia->ia_group_id == argv[i])
          break;
      }

      if(ia == NULL)
        parser_error(iu, "%s: Group %d not found",
                            ctx, (int)argv[i]);

      ias->ias_list[i] = ia;
    }
    break;

  default:
    parser_error(iu, "Unknown op %d in paramattr", op);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x2, %esi
jne 0x19e92
movq %rcx, %r14
movl %edx, %ebp
movq 0x150(%rbx), %r15
movq 0x158(%rbx), %r12
leal 0x1(%r12), %eax
movslq %eax, %r13
cmpq %r13, 0x160(%rbx)
jae 0x19e02
addl %eax, %eax
movslq %eax, %rsi
movq %rsi, 0x160(%rbx)
shlq $0x4, %rsi
movq %r15, %rdi
callq 0x33c0
movq %rax, %r15
movq %rax, 0x150(%rbx)
movq %r13, 0x158(%rbx)
movslq %r12d, %r12
shlq $0x4, %r12
movl %ebp, %r13d
leaq (,%r13,8), %rdi
callq 0x3380
movq %rax, 0x8(%r15,%r12)
movl %ebp, (%r15,%r12)
leaq 0x148(%rbx), %rcx
xorl %eax, %eax
cmpq %r13, %rax
je 0x19e59
movq %rcx, %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x19e68
movl 0x10(%rdx), %esi
cmpq %rsi, (%r14,%rax,8)
jne 0x19e3a
movq 0x8(%r15,%r12), %rsi
movq %rdx, (%rsi,%rax,8)
incq %rax
jmp 0x19e32
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %eax
movl (%r14,%rax,8), %r9d
leaq 0x88cb(%rip), %rsi      # 0x22740
leaq 0x8a6c(%rip), %rcx      # 0x228e8
leaq 0x8a8d(%rip), %r8       # 0x22910
movq %rbx, %rdi
movl $0x16b, %edx            # imm = 0x16B
xorl %eax, %eax
callq 0xbed2
movl %esi, %r8d
leaq 0x88a4(%rip), %rsi      # 0x22740
leaq 0x8a5c(%rip), %rcx      # 0x228ff
movq %rbx, %rdi
movl $0x172, %edx            # imm = 0x172
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_parser.c
// Function: value_symtab_rec_handler
static void
value_symtab_rec_handler(ir_unit_t *iu, int op,
                         unsigned int argc, const int64_t *argv)
{
  unsigned int vid;
  char *str;
  switch(op) {
  case 1: // VST_CODE_ENTRY
    if(argc < 2)
      parser_error(iu, "Bad args to VST_CODE_ENTRY");

    vid = argv[0];
    str = read_str_from_argv(argc - 1, argv + 1);
    set_value_name(iu, vid, str);
    break;

  case 2: // VST_CODE_BBENTRY
    break;

  case 3: // VST_CODE_FNENTRY
    if(argc < 3)
      break;
    // cogbee
      // parser_error(iu, "Bad args to VST_CODE_FNENTRY");

    vid = argv[0];
    str = read_str_from_argv(argc - 2, argv + 2);
    set_value_name(iu, vid, str);
    break;

  default:
    parser_error(iu, "Unknown op %d in symtab\n", op);
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, %esi
je 0x1b0e2
movl %esi, %r8d
cmpl $0x2, %esi
je 0x1b0e7
cmpl $0x1, %r8d
jne 0x1b113
cmpl $0x1, %edx
jbe 0x1b130
pushq $0x8
popq %rsi
pushq $-0x1
jmp 0x1b0f3
cmpl $0x3, %edx
jae 0x1b0ee
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x10
popq %rsi
pushq $-0x2
popq %rdi
movl (%rcx), %ebp
addl %edx, %edi
addq %rcx, %rsi
callq 0x1b56c
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1c044
leaq 0x7626(%rip), %rsi      # 0x22740
leaq 0x7d10(%rip), %rcx      # 0x22e31
movq %rbx, %rdi
movl $0x1ec, %edx            # imm = 0x1EC
xorl %eax, %eax
callq 0xbed2
leaq 0x7609(%rip), %rsi      # 0x22740
leaq 0x7cd8(%rip), %rcx      # 0x22e16
movq %rbx, %rdi
movl $0x1d6, %edx            # imm = 0x1D6
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_parser.c
// Function: strtab_rec_handler
static void strtab_rec_handler(ir_unit_t *iu, int op, 
                  unsigned int argc, const int64_t *argv) {

  // Set Function name.
  for(int i = 0; i < VECTOR_LEN(&iu->iu_functions); i++) {
    ir_function_t *f = VECTOR_ITEM(&iu->iu_functions, i);
    int str_offset = f->str_offset;
    int str_size = f->str_size;
    f->if_name = read_str_from_argv(str_size, argv + str_offset);
    // printf("f->f_name=%s\n", f->if_name);

    if(f->if_ext_func == NULL) {
      if(!vmop_resolve(f)) {
        f->if_ext_func =
          (void *)iu->iu_external_function_resolver(f->if_name, iu->iu_opaque);
      }
    }
  }

  // Set global variable name.
  for(int i = 0; i < VECTOR_LEN(&iu->iu_values); i++) {
    ir_value_t *iv = VECTOR_ITEM(&iu->iu_values, i);
    if(iv == NULL)
      continue;
    if (iv->iv_class == IR_VC_GLOBALVAR) {
      iv->iv_gvar->ig_name = read_str_from_argv(iv->iv_gvar->str_size, argv + iv->iv_gvar->str_offset);
      // printf("iv->iv_gvar->ig_name=%s\n", iv->iv_gvar->ig_name);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
cmpq %r12, 0x2e0(%r14)
jbe 0x1b519
movq 0x2d8(%r14), %rax
movq (%rax,%r12,8), %r15
movslq 0x14(%r15), %rax
movl 0x18(%r15), %edi
leaq (%rbx,%rax,8), %rsi
callq 0x1b56c
movq %rax, 0x20(%r15)
cmpq $0x0, 0x70(%r15)
jne 0x1b514
movq %r15, %rdi
callq 0xe325
testl %eax, %eax
jne 0x1b514
movq 0x20(%r15), %rdi
movq 0x48(%r14), %rsi
callq *(%r14)
movq %rax, 0x70(%r15)
incq %r12
jmp 0x1b4c9
xorl %r15d, %r15d
cmpq %r15, 0x188(%r14)
jbe 0x1b55f
movq 0x180(%r14), %rax
movq (%rax,%r15,8), %r12
testq %r12, %r12
je 0x1b55a
cmpl $0x2, (%r12)
jne 0x1b55a
movq 0x30(%r12), %rax
movl 0x18(%rax), %edi
movslq 0x14(%rax), %rax
leaq (%rbx,%rax,8), %rsi
callq 0x1b56c
movq 0x30(%r12), %rcx
movq %rax, 0x20(%rcx)
incq %r15
jmp 0x1b51c
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_bitstream.c
// Function: read_str_from_argv
static char *
read_str_from_argv(unsigned int argc, const int64_t *argv)
{
  char *r = malloc(argc + 1);
  r[argc] = 0;
  for(int i = 0; i < argc; i++)
    r[i] = argv[i];
  return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
leal 0x1(%r14), %edi
callq 0x3380
movl %r14d, %ecx
movb $0x0, (%rax,%rcx)
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x1b59a
movb (%rbx,%rdx,8), %sil
movb %sil, (%rax,%rdx)
incq %rdx
jmp 0x1b588
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitstream.c
// Function: printargs
static void
printargs(const int64_t *argv, unsigned int argc)
{
  int i, x;
  int64_t v;
  for(x = 0; x < 2; x++) {
    for(i = 0; i < argc; i++) {
      v = argv[i];
      if(x == 0) {
        printf("%c", (v >= ' ' && v <= 0x7f) ? (char)v : '.');
      } else {
        printf("<0x%" PRIx64 ">", v);
      }
    }
    printf("\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r15d
pushq $0x2e
popq %r12
leaq 0x7322(%rip), %r14      # 0x228e0
xorl %r13d, %r13d
cmpl $0x2, %r13d
je 0x1b60a
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x1b5fd
movq (%rbx,%rbp,8), %rsi
testl %r13d, %r13d
je 0x1b5e3
movq %r14, %rdi
xorl %eax, %eax
callq 0x3190
jmp 0x1b5f8
leaq -0x20(%rsi), %rax
cmpq $0x60, %rax
movsbl %sil, %edi
cmovael %r12d, %edi
callq 0x3040
incq %rbp
jmp 0x1b5c9
pushq $0xa
popq %rdi
callq 0x3040
incl %r13d
jmp 0x1b5c1
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_zstr_from_argv
static char *
read_zstr_from_argv(unsigned int *argcp, const int64_t **argvp)
{
  int len = 0;
  const int64_t *argv = *argvp;
  int argc = *argcp;
  for(len = 0; len < argc; len++) {
    if(argv[len] == 0)
      break;
  }
  if(len == argc)
    return NULL;
  len++;
  char *s = malloc(len);

  *argvp = argv + len;
  *argcp = argc - len;


  for(len = 0; len < argc; len++) {
    s[len] = argv[len];
    if(argv[len] == 0)
      break;
  }
  return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq (%rsi), %r15
movl (%rdi), %ebp
xorl %eax, %eax
testl %ebp, %ebp
movl $0x0, %r13d
cmovgl %ebp, %r13d
movl %r13d, %r12d
cmpq %rax, %r12
je 0x1b651
cmpq $0x0, (%r15,%rax,8)
je 0x1b64e
incq %rax
jmp 0x1b63d
movl %eax, %r13d
cmpl %ebp, %r13d
jne 0x1b65a
xorl %eax, %eax
jmp 0x1b698
movl %r13d, %ebx
movq %rdi, (%rsp)
leaq 0x1(%rbx), %rdi
callq 0x3380
leaq (%r15,%rbx,8), %rcx
addq $0x8, %rcx
movq %rcx, (%r14)
notl %r13d
addl %ebp, %r13d
movq (%rsp), %rcx
movl %r13d, (%rcx)
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x1b698
movq (%r15,%rcx,8), %rdx
movb %dl, (%rax,%rcx)
incq %rcx
testq %rdx, %rdx
jne 0x1b684
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_sign_rotated
static int64_t
read_sign_rotated(const int64_t *argv)
{
  uint64_t u64 = *argv;
  if((u64 & 1) == 0)
    return u64 >> 1;
  if(u64 != 1)
    return -(u64 >> 1);
  return 1ULL << 63;
}

// Assembly:
movq (%rdi), %rax
testb $0x1, %al
jne 0x1b6b2
shrq %rax
retq
cmpq $0x1, %rax
jne 0x1b6c3
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
retq
shrq %rax
negq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_instr.c
// Function: parse_store
static void
parse_store(ir_unit_t *iu, unsigned int argc, const int64_t *argv,
            int old)
{
  ir_bb_t *ib = iu->iu_current_bb;

  ir_instr_store_t *i = instr_add(ib, sizeof(ir_instr_store_t), IR_IC_STORE);
  i->immediate_offset = 0;
  i->ptr   = instr_get_vtp(iu, &argc, &argv);
  if(old)
    i->value = instr_get_value(iu, &argc, &argv,
                               type_get_pointee(iu, i->ptr.type));
  else
    i->value = instr_get_vtp(iu, &argc, &argv);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdi, %r14
leaq 0x4(%rsp), %r15
movl %esi, (%r15)
leaq 0x8(%rsp), %r12
movq %rdx, (%r12)
movq 0x1c8(%rdi), %rdi
pushq $0x70
popq %rsi
pushq $0x5
popq %rdx
callq 0x101c5
movq %rax, %rbx
andl $0x0, 0x68(%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1be63
movq %rax, 0x58(%rbx)
testl %ebp, %ebp
je 0x1b73f
shrq $0x20, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x14b6e
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %eax, %ecx
callq 0x1bfba
jmp 0x1b751
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x1be63
movq %rax, 0x60(%rbx)
addq $0x10, %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_bitcode_instr.c
// Function: parse_landingpad
static void
parse_landingpad(ir_unit_t *iu, unsigned int argc, const int64_t *argv,
                 int old)
{
  ir_bb_t *ib = iu->iu_current_bb;

  unsigned int type = instr_get_uint(iu, &argc, &argv);

  if(old) {
    instr_get_vtp(iu, &argc, &argv);
  }
  unsigned int is_clean_up = instr_get_uint(iu, &argc, &argv);
  unsigned int num_clauses = instr_get_uint(iu, &argc, &argv);

  ir_instr_landingpad_t *i =
    instr_add(ib, sizeof(ir_instr_landingpad_t) +
              sizeof(ir_instr_landingpad_clause_t) * num_clauses,
              IR_IC_LANDINGPAD);

  i->type = type;
  //  i->personality = personality;
  i->is_clean_up = is_clean_up;
  i->num_clauses = num_clauses;

  for(int j = 0; j < num_clauses; j++) {
    i->clauses[j].clause = instr_get_uint(iu, &argc, &argv);
    i->clauses[j].is_catch = instr_get_uint(iu, &argc, &argv);
  }

  value_alloc_instr_ret(iu, i->type, &i->super);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
movq %rdi, %rbx
leaq 0x4(%rsp), %rax
movl %esi, (%rax)
leaq 0x10(%rsp), %rcx
movq %rdx, (%rcx)
movq 0x1c8(%rdi), %r12
movq %rax, %rsi
movq %rcx, %rdx
callq 0x1bff8
movl %eax, 0xc(%rsp)
testl %r14d, %r14d
je 0x1bdb7
leaq 0x4(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x1be63
leaq 0x4(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bff8
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bff8
movl %eax, %ebp
movl %eax, %r13d
leaq 0x68(,%r13,8), %rsi
pushq $0x12
popq %rdx
movq %r12, %rdi
callq 0x101c5
movq %rax, %r12
movl 0xc(%rsp), %eax
movl %eax, 0x58(%r12)
movl 0x8(%rsp), %eax
movl %eax, 0x60(%r12)
movl %ebp, 0x64(%r12)
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x1be45
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bff8
movl %eax, 0x6c(%r12,%rbp,8)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bff8
movl %eax, 0x68(%r12,%rbp,8)
incq %rbp
jmp 0x1be15
movl 0x58(%r12), %esi
movq %rbx, %rdi
movq %r12, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10532
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_instr.c
// Function: instr_get_vtp
static ir_valuetype_t
instr_get_vtp(ir_unit_t *iu, unsigned int *argcp, const int64_t **argvp)
{
  const int64_t *argv = *argvp;
  int argc = *argcp;
  if(argc < 1)
    parser_error(iu, "Missing value code");

  unsigned int val = iu->iu_next_value - argv[0];
  int type;

  if(val < iu->iu_next_value) {
    *argvp = argv + 1;
    *argcp = argc - 1;
    type = VECTOR_ITEM(&iu->iu_values, val)->iv_type;
  } else {

    type = argv[1];

    if(val >= VECTOR_LEN(&iu->iu_values)) {
      size_t prevsize = VECTOR_LEN(&iu->iu_values);
      VECTOR_RESIZE(&iu->iu_values, val + 1);
      for(int i = prevsize; i <= val; i++) {
        VECTOR_ITEM(&iu->iu_values, i) = NULL;
      }
    }
    ir_value_t *iv = VECTOR_ITEM(&iu->iu_values, val);

    if(iv == NULL) {
      iv = calloc(1, sizeof(ir_value_t));
      VECTOR_ITEM(&iu->iu_values, val) = iv;
      iv->iv_class = IR_VC_UNDEF;
    }
    iv->iv_type = type;

    *argvp = argv + 2;
    *argcp = argc - 2;
  }
  ir_valuetype_t r = {.type = type, .value = val};
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r12
movl (%rsi), %ebp
testl %ebp, %ebp
jle 0x1bf9f
movq (%rdx), %rbx
movl 0x198(%r12), %ecx
movl %ecx, %r14d
subl (%rbx), %r14d
leaq 0x8(%rbx), %rax
cmpl %ecx, %r14d
jae 0x1beb4
movq %rax, (%rdx)
decl %ebp
movl %ebp, (%rsi)
movq 0x180(%r12), %rax
movl %r14d, %r13d
movq (%rax,%r13,8), %rax
movl 0x24(%rax), %r15d
jmp 0x1bf07
movl (%rax), %r15d
movl %r14d, %r13d
movq 0x188(%r12), %rax
cmpq %r13, %rax
jbe 0x1bf20
movq 0x180(%r12), %r14
movq (%r14,%r13,8), %rax
testq %rax, %rax
jne 0x1bef7
pushq $0x1
popq %rdi
movq %rsi, 0x8(%rsp)
pushq $0x48
popq %rsi
movq %rdx, %r12
callq 0x32f0
movq %r12, %rdx
movq 0x8(%rsp), %rsi
movq %rax, (%r14,%r13,8)
movl %r15d, 0x24(%rax)
addq $0x10, %rbx
movq %rbx, (%rdx)
addl $-0x2, %ebp
movl %ebp, (%rsi)
shlq $0x20, %r15
orq %r13, %r15
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal 0x1(%r14), %ecx
cmpq %rcx, 0x190(%r12)
jae 0x1bf7a
movq %rsi, 0x8(%rsp)
leal (%rcx,%rcx), %esi
movq %rsi, 0x190(%r12)
shlq $0x3, %rsi
movq 0x180(%r12), %rdi
movq %rdx, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
callq 0x33c0
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq %rax, 0x180(%r12)
movq 0x18(%rsp), %rax
movq %rcx, 0x188(%r12)
cltq
cmpl %eax, %r14d
jb 0x1bec7
movq 0x180(%r12), %rcx
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0x1bf84
leaq 0x6bde(%rip), %rsi      # 0x22b84
leaq 0x6c74(%rip), %rcx      # 0x22c21
pushq $0xc
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_instr.c
// Function: instr_get_value
static ir_valuetype_t
instr_get_value(ir_unit_t *iu, unsigned int *argcp, const int64_t **argvp,
                int type)
{
  const int64_t *argv = *argvp;
  int argc = *argcp;

  if(argc < 1)
    parser_error(iu, "Missing value code");

  *argvp = argv + 1;
  *argcp = argc - 1;

  int val = iu->iu_next_value - argv[0];
  ir_valuetype_t r = {.type = type, .value = val};
  return r;
}

// Assembly:
movl (%rsi), %eax
testl %eax, %eax
jle 0x1bfdf
movq (%rdx), %r8
leaq 0x8(%r8), %r9
movq %r9, (%rdx)
decl %eax
movl %eax, (%rsi)
movl 0x198(%rdi), %eax
subl (%r8), %eax
shlq $0x20, %rcx
orq %rcx, %rax
retq
pushq %rax
leaq 0x6b9d(%rip), %rsi      # 0x22b84
leaq 0x6c33(%rip), %rcx      # 0x22c21
pushq $0x3c
popq %rdx
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_bitcode_instr.c
// Function: instr_get_uint
static unsigned int
instr_get_uint(ir_unit_t *iu, unsigned int *argcp, const int64_t **argvp)
{
  const int64_t *argv = *argvp;
  int argc = *argcp;

  if(argc < 1)
    parser_error(iu, "Missing argument");

  *argvp = argv + 1;
  *argcp = argc - 1;
  return argv[0];
}

// Assembly:
movl (%rsi), %eax
testl %eax, %eax
jle 0x1c00f
movq (%rdx), %rcx
leaq 0x8(%rcx), %rdi
movq %rdi, (%rdx)
decl %eax
movl %eax, (%rsi)
movl (%rcx), %eax
retq
pushq %rax
leaq 0x6b6d(%rip), %rsi      # 0x22b84
leaq 0x6c16(%rip), %rcx      # 0x22c34
pushq $0x69
popq %rdx
xorl %eax, %eax
callq 0xbed2
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_type.c
// Function: type_struct_layout
static void
type_struct_layout(ir_unit_t *iu, ir_type_t *it)
{
  int offset = 0;
  int ba = 1; // Biggest alignment
  const int packed = it->it_struct.packed;

  for(int i = 0; i < it->it_struct.num_elements; i++) {
    ir_type_t *ty = type_get(iu, it->it_struct.elements[i].type);

    if(ty->it_code == IR_TYPE_STRUCT && !ty->it_struct.computed)
      type_struct_layout(iu, ty);

    int s = type_sizeof_ptr(iu, ty);

    if(!packed) {
      int a = type_alignment_ptr(iu, ty);
      offset = VMIR_ALIGN(offset, a);
      ba = VMIR_MAX(ba, a);
    }
    it->it_struct.elements[i].offset = offset;
    offset += s;
  }
  it->it_struct.size = packed ? offset : VMIR_ALIGN(offset, ba);
  it->it_struct.alignment = ba;
  it->it_struct.computed = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movb 0x24(%rsi), %al
movb %al, 0xf(%rsp)
xorl %r12d, %r12d
pushq $0x1
popq %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
movslq 0x18(%rbx), %rax
cmpq %rax, %r12
jge 0x1c661
movq 0x8(%rbx), %rax
movl (%rax,%r12,8), %esi
movq %r14, %rdi
callq 0xe719
movq %rax, %r15
cmpl $0x0, (%rax)
jne 0x1c610
cmpb $0x0, 0x25(%r15)
jne 0x1c610
movq %r14, %rdi
movq %r15, %rsi
callq 0x1c5b4
movq %r14, %rdi
movq %r15, %rsi
callq 0xe74c
movl %eax, %ebp
cmpb $0x0, 0xf(%rsp)
jne 0x1c64d
movq %r14, %rdi
movq %r15, %rsi
callq 0xe6a2
leal (%rax,%r13), %ecx
decl %ecx
movl %eax, %r13d
negl %r13d
andl %ecx, %r13d
movq 0x10(%rsp), %rcx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq %rax, 0x10(%rsp)
movq 0x8(%rbx), %rax
movl %r13d, 0x4(%rax,%r12,8)
addl %ebp, %r13d
incq %r12
jmp 0x1c5dd
movq 0x10(%rsp), %rdx
leal (%rdx,%r13), %eax
decl %eax
movl %edx, %ecx
negl %ecx
andl %eax, %ecx
cmpb $0x0, 0xf(%rsp)
cmovnel %r13d, %ecx
movl %ecx, 0x1c(%rbx)
movl %edx, 0x20(%rbx)
movb $0x1, 0x25(%rbx)
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_bitstream.c
// Function: read_vbr64
static uint64_t
read_vbr64(bcbitstream_t *bs, int width)
{
  assert(width > 0);

  uint64_t ret = 0;
  const uint32_t cont = (1 << (width - 1));
  const uint32_t mask = cont - 1;
  int stride = 0;

  while(1) {
    uint32_t x = read_bits(bs, width);
    ret |= (uint64_t)(x & mask) << stride;
    if(cont & x) {
      stride += width - 1;
      assert(stride < 64);
    } else {
      break;
    }
  }
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
testl %esi, %esi
jle 0x1c715
movl %esi, %ebx
leal -0x1(%rbx), %r15d
pushq $0x1
popq %r13
movl %r15d, %ecx
shll %cl, %r13d
leal -0x1(%r13), %ebp
xorl %r12d, %r12d
xorl %eax, %eax
movq %rax, %r14
movq (%rsp), %rdi
movl %ebx, %esi
callq 0xb602
movl %eax, %edx
andl %ebp, %eax
movl %r12d, %ecx
shlq %cl, %rax
orq %r14, %rax
testl %r13d, %edx
je 0x1c706
addq %r15, %r12
cmpl $0x40, %r12d
jl 0x1c6c0
leaq 0x6a04(%rip), %rdi      # 0x230f4
leaq 0x610c(%rip), %rsi      # 0x22803
leaq 0x69cc(%rip), %rcx      # 0x230ca
pushq $0x77
popq %rdx
callq 0x31e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60dd(%rip), %rdi      # 0x227f9
leaq 0x60e0(%rip), %rsi      # 0x22803
leaq 0x69a0(%rip), %rcx      # 0x230ca
pushq $0x6b
jmp 0x1c700
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/src/vmir_libc.c
// Function: vmir_sysio_open
static vmir_errcode_t
vmir_sysio_open(void *opaque, const char *path, vmir_openflags_t flags,
                intptr_t *fh)
{
  int fs = O_CLOEXEC;
  fs |= flags & VMIR_FS_OPEN_CREATE ? O_CREAT  : 0;
  fs |= flags & VMIR_FS_OPEN_TRUNC  ? O_TRUNC  : 0;
  fs |= flags & VMIR_FS_OPEN_APPEND ? O_APPEND : 0;

  if((flags & (VMIR_FS_OPEN_READ | VMIR_FS_OPEN_WRITE)) ==
     (VMIR_FS_OPEN_READ | VMIR_FS_OPEN_WRITE))
    fs |= O_RDWR;
  else if(flags & VMIR_FS_OPEN_READ)
    fs |= O_RDONLY;
  else if(flags & VMIR_FS_OPEN_WRITE)
    fs |= O_WRONLY;
  else
    return VMIR_ERR_INVALID_ARGS;

  int fd = open(path, fs, 0644);
  if(fd == -1) {
    return VMIR_ERR_FS_ERROR;
  }
  *fh = fd;
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ecx
shll $0x4, %ecx
andl $0x40, %ecx
movl %edx, %eax
andl $0x18, %eax
shll $0x6, %eax
orl %ecx, %eax
movl %edx, %ecx
notl %ecx
testb $0x3, %cl
jne 0x1c9ff
orl $0x80002, %eax          # imm = 0x80002
jmp 0x1ca19
testb $0x1, %dl
jne 0x1ca0d
testb $0x2, %dl
jne 0x1ca14
pushq $-0x3
jmp 0x1ca3a
orl $0x80000, %eax          # imm = 0x80000
jmp 0x1ca19
orl $0x80001, %eax          # imm = 0x80001
xorl %ebp, %ebp
movq %rsi, %rdi
movl %eax, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x3410
cmpl $-0x1, %eax
je 0x1ca38
cltq
movq %rax, (%rbx)
jmp 0x1ca3b
pushq $-0x4
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: tlsf_walk_heap
void tlsf_walk_heap(tlsf_pool pool, tlsf_walker walker, void* user)
{
	tlsf_walker heap_walker = walker ? walker : default_walker;
	block_header_t* block =
		offset_to_block(pool, sizeof(pool_t) - block_header_overhead);

	while (block && !block_is_last(block))
	{
		heap_walker(
			block_to_ptr(block),
			block_size(block),
			!block_is_free(block),
			user);
		block = block_next(block);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
testq %rsi, %rsi
leaq 0x187(%rip), %r15       # 0x1ced0
cmovneq %rsi, %r15
addq $0x1980, %r14           # imm = 0x1980
testq %r14, %r14
je 0x1cd86
movq 0x8(%r14), %rdx
cmpq $0x4, %rdx
jb 0x1cd86
leaq 0x10(%r14), %rdi
movq %rdx, %rsi
andq $-0x4, %rsi
notl %edx
andl $0x1, %edx
movq %rbx, %rcx
callq *%r15
movq %r14, %rdi
callq 0x1ce5a
movq %rax, %r14
jmp 0x1cd54
popq %rbx
popq %r14
popq %r15
retq