LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rcx), %rbp
movl $0x1, %edi
movl $0x60, %esi
callq 0x32f0
movq %rax, %r13
movl $0x15, 0x28(%rax)
movq %rbp, 0x10(%rax)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r13)
movq %rbx, (%r13)
movq %r13, (%rax)
movq %r13, 0x8(%rbx)
movq %r15, 0x2c(%r13)
movq %r14, 0x58(%r13)
movq %r12, %rdi
movq %r13, %rsi
callq 0x11d54
movq 0x58(%r13), %rsi
movq %r12, %rdi
movq %r13, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16c71
// File: /workspace/github_c_makefile_star2_O3/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 0x168(%rdi), %rax
movq 0x170(%rdi), %rbx
testq %rbx, %rbx
je 0x17707
xorl %ecx, %ecx
movq %rax, %rdx
cmpl %ebp, (%rdx)
je 0x17754
incq %rcx
addq $0x28, %rdx
cmpq %rcx, %rbx
jne 0x176f7
movl $0x1, 0x368(%r14)
leaq 0x1(%rbx), %r15
cmpq 0x178(%r14), %rbx
jb 0x17744
leaq (%r15,%r15), %rcx
movq %rcx, 0x178(%r14)
movq %r15, %rcx
shlq $0x4, %rcx
leaq (%rcx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x33c0
movq %rax, 0x168(%r14)
movq %r15, 0x170(%r14)
leaq (%rbx,%rbx,4), %rcx
movl %ebp, (%rax,%rcx,8)
jmp 0x17757
movq %rcx, %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_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
movl %esi, %eax
cmpq %rax, 0x170(%rdi)
jbe 0x1779b
movq 0x168(%rbx), %rcx
leaq (%rax,%rax,4), %rax
cmpl $0xb, (%rcx,%rax,8)
jne 0x177bb
leaq (%rcx,%rax,8), %rax
movl 0x8(%rax), %eax
cmpl $-0x1, %eax
je 0x177e8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xe31a(%rip), %rsi      # 0x25abc
leaq 0xe34c(%rip), %rcx      # 0x25af5
movq %rbx, %rdi
movl $0x7c, %edx
movl %ebp, %r8d
xorl %eax, %eax
callq 0xca98
movq %rbx, %rdi
movl %ebp, %esi
callq 0x120fa
leaq 0xe2f0(%rip), %rsi      # 0x25abc
leaq 0xf158(%rip), %rcx      # 0x2692b
movq %rbx, %rdi
movl $0x8a, %edx
movq %rax, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0xca98
leaq 0xe2cd(%rip), %rsi      # 0x25abc
leaq 0xf15b(%rip), %rcx      # 0x26951
movq %rbx, %rdi
movl $0x8c, %edx
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
cmpb $-0x1, 0x74(%rsi)
jne 0x178de
movq %rcx, %r13
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
movq 0x10(%rcx), %r15
movl $0x1, %edi
movl $0x78, %esi
callq 0x32f0
movq %rax, %r14
movl $0x4, 0x28(%rax)
movq %r15, 0x10(%rax)
movq (%r13), %rax
movq %rax, (%r14)
addq $0x18, %r15
leaq 0x8(%rax), %rcx
testq %rax, %rax
cmoveq %r15, %rcx
movq %r14, (%rcx)
movq %r14, (%r13)
movq %r13, 0x8(%r14)
addl 0x60(%r12), %ebp
movl %ebp, 0x60(%r14)
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 (%rsp), %rax
movq %rax, 0x2c(%r14)
movb $-0x1, 0x74(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11d54
movq 0x58(%r14), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x16c71
cmpl $0x0, 0x64(%r14)
js 0x178cc
movq 0x64(%r14), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x16c71
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf093(%rip), %rdi      # 0x26978
leaq 0xe872(%rip), %rsi      # 0x2615e
leaq 0xf096(%rip), %rcx      # 0x26989
movl $0xb05, %edx            # imm = 0xB05
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/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
testq %rsi, %rsi
je 0x17983
movq %rsi, %r14
movq %rdi, %rbx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0x408c00, %ebp         # imm = 0x408C00
movq %r14, %rdi
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq (%rax), %r14
movl 0x2c(%rdi), %r8d
cmpq %r15, %r8
je 0x1793f
movl 0x28(%rdi), %eax
cmpl $0x16, %eax
ja 0x17946
btl %eax, %ebp
jae 0x17946
testq %r14, %r14
jne 0x1791b
jmp 0x17983
testl %r8d, %r8d
jle 0x1793f
cmpq %r8, 0x188(%rbx)
jbe 0x1798c
movq 0x180(%rbx), %rax
movq (%rax,%r8,8), %r12
leaq 0x8(%r12), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x17974
cmpl $0x0, 0x30(%rax)
jne 0x17964
jmp 0x1793f
callq 0xef31
movl $0xc, (%r12)
jmp 0x1793f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdbdd(%rip), %rsi      # 0x25570
leaq 0xe38a(%rip), %rcx      # 0x25d24
movq %rbx, %rdi
movl $0x143, %edx            # imm = 0x143
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 0x17cec
subl 0x19c(%rsi), %edx
js 0x17ced
movl $0x1, %eax
movl %edx, %ecx
shll %cl, %eax
shrl $0x5, %edx
orl %eax, (%rdi,%rdx,4)
retq
pushq %rax
leaq 0xed8e(%rip), %rdi      # 0x26a83
leaq 0xe462(%rip), %rsi      # 0x2615e
leaq 0xed8b(%rip), %rcx      # 0x26a8e
movl $0x537, %edx            # imm = 0x537
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
cmpl $0x3, (%rsi)
jne 0x1d82e
movq %rdi, %rbx
movl 0x24(%rsi), %r8d
cmpq %r8, 0x170(%rdi)
jbe 0x1d84d
movq 0x168(%rbx), %rax
leaq (%r8,%r8,4), %rcx
movl (%rax,%rcx,8), %edx
cmpl $0xb, %edx
ja 0x1d86a
movl $0x838, %edi            # imm = 0x838
btl %edx, %edi
jb 0x1d819
movl $0x2c0, %edi            # imm = 0x2C0
btl %edx, %edi
jae 0x1d81e
movq 0x30(%rsi), %rax
jmp 0x1d81c
movl 0x30(%rsi), %eax
popq %rbx
retq
cmpl $0x2, %edx
jne 0x1d86a
xorl %eax, %eax
cmpl $0x0, 0x30(%rsi)
setne %al
jmp 0x1d81c
leaq 0x95c7(%rip), %rdi      # 0x26dfc
leaq 0x7d34(%rip), %rsi      # 0x25570
leaq 0x95d8(%rip), %rcx      # 0x26e1b
movl $0x207, %edx            # imm = 0x207
callq 0x31e0
leaq 0x8268(%rip), %rsi      # 0x25abc
leaq 0x829a(%rip), %rcx      # 0x25af5
movq %rbx, %rdi
movl $0x7c, %edx
xorl %eax, %eax
callq 0xca98
leaq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x415e
leaq 0x7cf3(%rip), %rsi      # 0x25570
leaq 0x95d3(%rip), %rcx      # 0x26e57
movq %rbx, %rdi
movl $0x218, %edx            # imm = 0x218
movq %rax, %r8
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %rbx
leaq 0x6(%rsp), %rdi
movw %si, (%rdi)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x41e6
movq 0x438(%rbx), %rdx
movq 0x440(%rbx), %rcx
leaq 0x2(%rcx), %rsi
addq 0x448(%rbx), %rdx
cmpq %rdx, %rsi
jae 0x1d92c
movw %ax, (%rcx)
movq %rsi, 0x440(%rbx)
leaq 0x4(%rcx), %rax
cmpq %rdx, %rax
jae 0x1d92c
movw %r15w, 0x2(%rcx)
movq %rax, 0x440(%rbx)
leaq 0x6(%rcx), %rax
cmpq %rdx, %rax
jae 0x1d92c
movw %r14w, 0x4(%rcx)
movq %rax, 0x440(%rbx)
addq $0x8, %rcx
cmpq %rdx, %rcx
jae 0x1d92c
movw %bp, (%rax)
movq %rcx, 0x440(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x935d(%rip), %rsi      # 0x26c90
leaq 0x9398(%rip), %rcx      # 0x26cd2
movq %rbx, %rdi
movl $0x926, %edx            # imm = 0x926
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 0x1da0c
movb %sil, (%rax)
addq $0x2, 0x440(%rdi)
retq
pushq %rax
leaq 0x927c(%rip), %rsi      # 0x26c90
leaq 0x92b7(%rip), %rcx      # 0x26cd2
movl $0x93f, %edx            # imm = 0x93F
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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
subq $0x10, %rsp
movl %r9d, %ebp
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %rbx
leaq 0xe(%rsp), %rdi
movw %si, (%rdi)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x41e6
movq 0x438(%rbx), %rdx
movq 0x440(%rbx), %rcx
leaq 0x2(%rcx), %rsi
addq 0x448(%rbx), %rdx
cmpq %rdx, %rsi
jae 0x1db65
movw %ax, (%rcx)
movq %rsi, 0x440(%rbx)
leaq 0x4(%rcx), %rax
cmpq %rdx, %rax
jae 0x1db65
movw %r12w, 0x2(%rcx)
movq %rax, 0x440(%rbx)
leaq 0x6(%rcx), %rax
cmpq %rdx, %rax
jae 0x1db65
movw %r15w, 0x4(%rcx)
movq %rax, 0x440(%rbx)
leaq 0x8(%rcx), %rax
cmpq %rdx, %rax
jae 0x1db65
movw %r14w, 0x6(%rcx)
movq %rax, 0x440(%rbx)
addq $0xa, %rcx
cmpq %rdx, %rcx
jae 0x1db65
movw %bp, (%rax)
movq %rcx, 0x440(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9124(%rip), %rsi      # 0x26c90
leaq 0x915f(%rip), %rcx      # 0x26cd2
movq %rbx, %rdi
movl $0x926, %edx            # imm = 0x926
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 0x1dbc0
leaq 0x6b4e(%rip), %rcx      # 0x246e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
retq
movl $0x20, %eax
retq
movl $0x8, %eax
retq
movl $0x10, %eax
retq
movl $0x1, %eax
retq
movl $0x40, %eax
retq
movl 0x8(%rsi), %eax
retq
pushq %rbx
movq %rdi, %rbx
callq 0x415e
leaq 0x7eec(%rip), %rsi      # 0x25abc
leaq 0x96b5(%rip), %rcx      # 0x2728c
movq %rbx, %rdi
movl $0x1b5, %edx            # imm = 0x1B5
movq %rax, %r8
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 %rax
movl %edx, %r8d
leaq 0x48(%rsi), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x1dc17
cmpl %r8d, 0x28(%rax)
jne 0x1dbf1
movl 0x20(%rax), %eax
subl %ecx, %eax
addl $-0x2, %eax
cmpl $0xffff7fff, %eax       # imm = 0xFFFF7FFF
jle 0x1dc30
cmpl $0x8000, %eax           # imm = 0x8000
jge 0x1dc4f
popq %rcx
retq
movq 0x20(%rsi), %rcx
leaq 0x9917(%rip), %rdx      # 0x27539
xorl %esi, %esi
xorl %eax, %eax
callq 0x4091
callq 0x3060
leaq 0x992d(%rip), %rdi      # 0x27564
leaq 0x9052(%rip), %rsi      # 0x26c90
leaq 0x992e(%rip), %rcx      # 0x27573
movl $0x1258, %edx           # imm = 0x1258
callq 0x31e0
leaq 0x9960(%rip), %rdi      # 0x275b6
leaq 0x9033(%rip), %rsi      # 0x26c90
leaq 0x990f(%rip), %rcx      # 0x27573
movl $0x1259, %edx           # imm = 0x1259
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/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 0x1dcf2
movl %esi, %ebx
leal -0x1(%rbx), %ebp
movl $0x1, %r12d
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 0xc114
movl %eax, %edx
andl %r13d, %eax
movl %r15d, %ecx
shll %cl, %eax
orl %r14d, %eax
testl %r12d, %edx
je 0x1dce3
addl %ebp, %r15d
cmpl $0x20, %r15d
jl 0x1dc9b
leaq 0x9a0a(%rip), %rdi      # 0x276d5
leaq 0x99c6(%rip), %rsi      # 0x27698
leaq 0x99d4(%rip), %rcx      # 0x276ad
movl $0x5c, %edx
callq 0x31e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9995(%rip), %rdi      # 0x2768e
leaq 0x9998(%rip), %rsi      # 0x27698
leaq 0x99a6(%rip), %rcx      # 0x276ad
movl $0x50, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/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 0x1dd32
cmpl %ebp, 0x10(%rax)
jne 0x1dd23
jmp 0x1dd65
movl $0x1, %edi
movl $0x28, %esi
callq 0x32f0
movl %ebp, 0x10(%rax)
movq (%rbx), %rcx
movq %rcx, (%rax)
testq %rcx, %rcx
je 0x1dd53
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_O3/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 0x1dd8c
movl %edx, %r8d
cmpl $0x1, %edx
jne 0x1dd8e
movq 0x140(%rdi), %rbx
movl (%rcx), %esi
callq 0x1dd11
movq %rax, 0x20(%rbx)
popq %rbx
retq
leaq 0x9840(%rip), %rsi      # 0x275d5
leaq 0x9945(%rip), %rcx      # 0x276e1
movl $0x60, %edx
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 0x1e251
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 0x1e1bf
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)
testl %ebp, %ebp
je 0x1e218
leaq 0x148(%rbx), %rcx
xorl %eax, %eax
movq %rcx, %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x1e227
movl 0x10(%rdx), %esi
cmpq %rsi, (%r14,%rax,8)
jne 0x1e1f6
movq 0x8(%r15,%r12), %rsi
movq %rdx, (%rsi,%rax,8)
incq %rax
cmpq %r13, %rax
jne 0x1e1f3
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 0x93a1(%rip), %rsi      # 0x275d5
leaq 0x9542(%rip), %rcx      # 0x2777d
leaq 0x9563(%rip), %r8       # 0x277a5
movq %rbx, %rdi
movl $0x16b, %edx            # imm = 0x16B
xorl %eax, %eax
callq 0xca98
movl %esi, %r8d
leaq 0x937a(%rip), %rsi      # 0x275d5
leaq 0x9532(%rip), %rcx      # 0x27794
movq %rbx, %rdi
movl $0x172, %edx            # imm = 0x172
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movl %edx, %r12d
movq %rdi, %rbx
cmpl $0x3, %esi
je 0x1fb5c
movl %esi, %r8d
cmpl $0x2, %esi
je 0x1fb62
cmpl $0x1, %r8d
jne 0x1fbad
cmpl $0x1, %r12d
jbe 0x1fbca
movq (%r14), %r15
movl %r12d, %edi
decl %r12d
callq 0x3380
movb $0x0, (%rax,%r12)
xorl %ecx, %ecx
movb 0x8(%r14,%rcx,8), %dl
movb %dl, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r12
jne 0x1fb4a
jmp 0x1fb96
cmpl $0x3, %r12d
jae 0x1fb6c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%r14), %r15
leal -0x2(%r12), %r13d
decl %r12d
movq %r12, %rdi
callq 0x3380
movb $0x0, (%rax,%r13)
xorl %ecx, %ecx
movb 0x10(%r14,%rcx,8), %dl
movb %dl, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r13
jne 0x1fb86
movq %rbx, %rdi
movl %r15d, %esi
movq %rax, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x20d45
leaq 0x7a21(%rip), %rsi      # 0x275d5
leaq 0x810b(%rip), %rcx      # 0x27cc6
movq %rbx, %rdi
movl $0x1ec, %edx            # imm = 0x1EC
xorl %eax, %eax
callq 0xca98
leaq 0x7a04(%rip), %rsi      # 0x275d5
leaq 0x80d3(%rip), %rcx      # 0x27cab
movq %rbx, %rdi
movl $0x1d6, %edx            # imm = 0x1D6
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdi, %r14
cmpq $0x0, 0x2e0(%rdi)
je 0x2004c
xorl %r12d, %r12d
movq 0x2d8(%r14), %rax
movq (%rax,%r12,8), %r15
movslq 0x14(%r15), %rbp
movl 0x18(%r15), %r13d
leal 0x1(%r13), %edi
callq 0x3380
movb $0x0, (%rax,%r13)
testq %r13, %r13
je 0x2001a
movq (%rsp), %rcx
leaq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movb (%rcx,%rdx,8), %sil
movb %sil, (%rax,%rdx)
incq %rdx
cmpq %rdx, %r13
jne 0x2000a
movq %rax, 0x20(%r15)
cmpq $0x0, 0x70(%r15)
jne 0x20040
movq %r15, %rdi
callq 0xf214
testl %eax, %eax
jne 0x20040
movq 0x20(%r15), %rdi
movq 0x48(%r14), %rsi
callq *(%r14)
movq %rax, 0x70(%r15)
incq %r12
cmpq %r12, 0x2e0(%r14)
ja 0x1ffda
movq 0x188(%r14), %r15
testq %r15, %r15
je 0x200b8
movq 0x180(%r14), %r14
xorl %r12d, %r12d
movq (%r14,%r12,8), %r13
testq %r13, %r13
je 0x200b0
cmpl $0x2, (%r13)
jne 0x200b0
movq 0x30(%r13), %rax
movl 0x18(%rax), %ebp
movslq 0x14(%rax), %rbx
leal 0x1(%rbp), %edi
callq 0x3380
movb $0x0, (%rax,%rbp)
testq %rbp, %rbp
je 0x200a8
movq (%rsp), %rcx
leaq (%rcx,%rbx,8), %rcx
xorl %edx, %edx
movb (%rcx,%rdx,8), %sil
movb %sil, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rbp
jne 0x20098
movq 0x30(%r13), %rcx
movq %rax, 0x20(%rcx)
incq %r12
cmpq %r15, %r12
jne 0x20062
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_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, %r14
movl %esi, 0x4(%rsp)
movl %esi, %r12d
movb $0x1, %bpl
movl $0x2e, %r13d
leaq 0x7688(%rip), %r15      # 0x27775
cmpl $0x0, 0x4(%rsp)
je 0x20129
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rsi
testb $0x1, %bpl
je 0x20117
leaq -0x20(%rsi), %rax
cmpq $0x60, %rax
movsbl %sil, %edi
cmovael %r13d, %edi
callq 0x3040
jmp 0x20121
movq %r15, %rdi
xorl %eax, %eax
callq 0x3190
incq %rbx
cmpq %rbx, %r12
jne 0x200f6
movl $0xa, %edi
callq 0x3040
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x200ed
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_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 %rdi, %rbx
movq (%rsi), %r15
movslq (%rdi), %r12
testq %r12, %r12
jle 0x2017f
xorl %eax, %eax
xorl %r13d, %r13d
cmpq $0x0, (%r15,%r13,8)
je 0x20182
incq %r13
cmpq %r13, %r12
jne 0x2016e
jmp 0x201cd
xorl %r13d, %r13d
cmpl %r12d, %r13d
jne 0x2018b
xorl %eax, %eax
jmp 0x201cd
movl %r13d, %ebp
leaq 0x1(%rbp), %rdi
callq 0x3380
notl %r13d
addl %r12d, %r13d
leaq (%r15,%rbp,8), %rcx
addq $0x8, %rcx
movq %rcx, (%r14)
movl %r13d, (%rbx)
testl %r12d, %r12d
jle 0x201cd
decq %r12
xorl %ecx, %ecx
movq (%r15,%rcx,8), %rdx
movb %dl, (%rax,%rcx)
testq %rdx, %rdx
je 0x201cd
leaq 0x1(%rcx), %rdx
cmpq %rcx, %r12
movq %rdx, %rcx
jne 0x201b5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/src/vmir_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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %r15
movl %esi, (%r15)
leaq 0x10(%rsp), %r12
movq %rdx, (%r12)
movq 0x1c8(%rdi), %r13
movl $0x1, %edi
movl $0x70, %esi
callq 0x32f0
movq %rax, %r14
movabsq $-0xfffffffb, %rax      # imm = 0xFFFFFFFF00000005
movq %rax, 0x28(%r14)
movl $0xffffffff, 0x30(%r14) # imm = 0xFFFFFFFF
movq %r13, 0x10(%r14)
movq 0x18(%r13), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rax)
movq %r14, 0x18(%r13)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x20bc1
movq %rax, 0x58(%r14)
testl %ebp, %ebp
je 0x20287
shrq $0x20, %rax
movq %rbx, %rdi
movl %eax, %esi
callq 0x17764
cmpl $0x0, 0xc(%rsp)
jle 0x202ac
movq 0x10(%rsp), %rcx
movl 0x198(%rbx), %edx
subl (%rcx), %edx
shlq $0x20, %rax
orq %rax, %rdx
movq %rdx, 0x60(%r14)
jmp 0x2029d
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x20bc1
movq %rax, 0x60(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7766(%rip), %rsi      # 0x27a19
leaq 0x77fc(%rip), %rcx      # 0x27ab6
movq %rbx, %rdi
movl $0x3c, %edx
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %rbx
testl %esi, %esi
jle 0x20bae
movl %esi, %r14d
movq 0x1c8(%rbx), %r12
leaq 0x8(%rdx), %rax
movq %rax, 0x10(%rsp)
decl %r14d
movl %r14d, 0xc(%rsp)
movl (%rdx), %ebp
testl %ecx, %ecx
je 0x20acb
leaq 0xc(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20bc1
movl (%r14), %r14d
testl %r14d, %r14d
jle 0x20bae
movq %rbx, (%rsp)
cmpl $0x1, %r14d
je 0x20b90
movq 0x10(%rsp), %r15
movl (%r15), %ebx
movq 0x8(%r15), %r13
movl %r13d, %eax
leaq 0x68(,%rax,8), %rsi
movl $0x1, %edi
callq 0x32f0
movabsq $-0xffffffee, %rcx      # imm = 0xFFFFFFFF00000012
movq %rcx, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movq %r12, 0x10(%rax)
movq 0x18(%r12), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq %rax, 0x18(%r12)
movl %ebp, 0x58(%rax)
movl %ebx, 0x60(%rax)
movl %r13d, 0x64(%rax)
testl %r13d, %r13d
je 0x20b74
movl %r13d, %ecx
addq %rcx, %rcx
movl %r14d, %edx
leaq -0x2(%rdx), %rsi
addq $-0x3, %rdx
xorl %edi, %edi
cmpl %edi, %esi
je 0x20b90
movl 0x10(%r15,%rdi,8), %r8d
movl %r8d, 0x6c(%rax,%rdi,4)
cmpl %edi, %edx
je 0x20b90
movl 0x18(%r15,%rdi,8), %r8d
movl %r8d, 0x68(%rax,%rdi,4)
addq $0x2, %rdi
cmpq %rdi, %rcx
jne 0x20b4f
movq (%rsp), %rdi
movl %ebp, %esi
movq %rax, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12027
leaq 0x6e82(%rip), %rsi      # 0x27a19
leaq 0x6f2b(%rip), %rcx      # 0x27ac9
movq (%rsp), %rdi
movl $0x69, %edx
xorl %eax, %eax
callq 0xca98
leaq 0x6e64(%rip), %rsi      # 0x27a19
leaq 0x6f0d(%rip), %rcx      # 0x27ac9
movq %rbx, %rdi
jmp 0x20ba2
// File: /workspace/github_c_makefile_star2_O3/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 0x20d0a
movq (%rdx), %rbx
movl 0x198(%r12), %ecx
movl %ecx, %r14d
subl (%rbx), %r14d
leaq 0x8(%rbx), %rax
cmpl %ecx, %r14d
jae 0x20c15
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 0x20cf1
movl (%rax), %r15d
movl %r14d, %r13d
movq 0x188(%r12), %rax
cmpq %r13, %rax
ja 0x20cad
leal 0x1(%r14), %ecx
cmpq %rcx, 0x190(%r12)
jae 0x20c86
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)
cmpl %eax, %r14d
jb 0x20cad
cltq
movq 0x180(%r12), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpl %eax, %r14d
jae 0x20c95
movq 0x180(%r12), %r14
movq (%r14,%r13,8), %rax
testq %rax, %rax
jne 0x20ce1
movl $0x1, %edi
movq %rsi, 0x8(%rsp)
movl $0x48, %esi
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
leaq 0x6d08(%rip), %rsi      # 0x27a19
leaq 0x6d9e(%rip), %rcx      # 0x27ab6
movq %r12, %rdi
movl $0xc, %edx
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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
movb 0x24(%rsi), %al
movb %al, 0xf(%rsp)
cmpl $0x0, 0x18(%rsi)
jle 0x214de
movq %rdi, %r14
movl $0x1, %eax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x8(%rbx), %rax
movl (%rax,%rbp,8), %r8d
cmpq %r8, 0x170(%r14)
jbe 0x2151e
movq 0x168(%r14), %rax
leaq (%r8,%r8,4), %rcx
leaq (%rax,%rcx,8), %r12
cmpl $0x0, (%r12)
jne 0x2147f
cmpb $0x0, 0x25(%r12)
jne 0x2147f
movq %r14, %rdi
movq %r12, %rsi
callq 0x2140d
movq %r14, %rdi
movq %r12, %rsi
callq 0xf6bb
movl %eax, %r15d
cmpb $0x0, 0xf(%rsp)
jne 0x214bd
movq %r14, %rdi
movq %r12, %rsi
callq 0xf62d
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,%rbp,8)
addl %r13d, %r15d
incq %rbp
movslq 0x18(%rbx), %rax
movl %r15d, %r13d
cmpq %rax, %rbp
jl 0x21441
jmp 0x214eb
xorl %r15d, %r15d
movl $0x1, %eax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdx
leal (%r15,%rdx), %eax
decl %eax
movl %edx, %ecx
negl %ecx
andl %eax, %ecx
cmpb $0x0, 0xf(%rsp)
cmovnel %r15d, %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
leaq 0x4597(%rip), %rsi      # 0x25abc
leaq 0x45c9(%rip), %rcx      # 0x25af5
movq %r14, %rdi
movl $0x7c, %edx
xorl %eax, %eax
callq 0xca98
// File: /workspace/github_c_makefile_star2_O3/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 0x215c0
movl %esi, %ebx
leal -0x1(%rbx), %r15d
movl $0x1, %r13d
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 0xc114
movl %eax, %edx
andl %ebp, %eax
movl %r12d, %ecx
shlq %cl, %rax
orq %r14, %rax
testl %r13d, %edx
je 0x215b1
addq %r15, %r12
cmpl $0x40, %r12d
jl 0x21569
leaq 0x69f0(%rip), %rdi      # 0x27f89
leaq 0x60f8(%rip), %rsi      # 0x27698
leaq 0x69b8(%rip), %rcx      # 0x27f5f
movl $0x77, %edx
callq 0x31e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60c7(%rip), %rdi      # 0x2768e
leaq 0x60ca(%rip), %rsi      # 0x27698
leaq 0x698a(%rip), %rcx      # 0x27f5f
movl $0x6b, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/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 0x21919
orl $0x80002, %eax          # imm = 0x80002
jmp 0x21934
testb $0x1, %dl
jne 0x2192f
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
testb $0x2, %dl
je 0x21958
orl $0x80001, %eax          # imm = 0x80001
jmp 0x21934
orl $0x80000, %eax          # imm = 0x80000
xorl %ebp, %ebp
movq %rsi, %rdi
movl %eax, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x3410
cmpl $-0x1, %eax
je 0x21953
cltq
movq %rax, (%rbx)
jmp 0x21958
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
testq %rsi, %rsi
leaq 0x110(%rip), %r12       # 0x21d81
cmovneq %rsi, %r12
addq $0x1980, %r14           # imm = 0x1980
je 0x21cbe
movq %rdx, %rbx
movq 0x8(%r14), %rdx
cmpq $0x4, %rdx
jb 0x21cbe
leaq 0x10(%r14), %r15
movq %rdx, %rsi
andq $-0x4, %rsi
notl %edx
andl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq *%r12
movq 0x8(%r14), %rax
cmpq $0x3, %rax
jbe 0x21cca
andq $-0x4, %rax
addq %rax, %r15
addq $-0x8, %r15
movq %r15, %r14
jne 0x21c81
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x6920(%rip), %rdi      # 0x285f1
leaq 0x658c(%rip), %rsi      # 0x28264
leaq 0x6928(%rip), %rcx      # 0x28607
movl $0xf8, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: integrity_walker
static void integrity_walker(void* ptr, size_t size, int used, void* user)
{
	block_header_t* block = block_from_ptr(ptr);
	integrity_t* integ = tlsf_cast(integrity_t*, user);
	const int this_prev_status = block_is_prev_free(block) ? 1 : 0;
	const int this_status = block_is_free(block) ? 1 : 0;
	const size_t this_block_size = block_size(block);

	int status = 0;

	if(integ->prev_status != this_prev_status) {
		fprintf(stderr, "%p ps %d != %d\n", ptr,
		    integ->prev_status, this_prev_status);
		fail(ptr);
	}

	if(size != this_block_size) {
		fprintf(stderr, "%p size %d != %d\n", ptr,
		    integ->prev_status, this_prev_status);
		fail(ptr);
	}

	tlsf_insist(integ->prev_status == this_prev_status && "prev status incorrect");
	tlsf_insist(size == this_block_size && "block size incorrect");

	integ->prev_status = this_status;
	integ->status += status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq -0x8(%rdi), %r12
movl %r12d, %ebp
shrl %ebp
andl $0x1, %ebp
movq %r12, %r13
andq $-0x4, %r13
movl (%rcx), %ecx
cmpl %ebp, %ecx
jne 0x21d35
cmpq %r15, %r13
jne 0x21d55
cmpl %ebp, (%rbx)
jne 0x21d62
andl $0x1, %r12d
movl %r12d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc2b4(%rip), %rax      # 0x2dff0
movq (%rax), %rdi
leaq 0x67e2(%rip), %rsi      # 0x28528
movq %r14, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3320
jmp 0x21d16
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x357f
leaq 0x67e1(%rip), %rdi      # 0x2854a
leaq 0x64f4(%rip), %rsi      # 0x28264
leaq 0x6815(%rip), %rcx      # 0x2858c
movl $0x287, %edx            # imm = 0x287
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_link_next
static block_header_t* block_next(const block_header_t* block)
{
	block_header_t* next = offset_to_block(block_to_ptr(block),
		block_size(block) - block_header_overhead);
	tlsf_assert(!block_is_last(block));
	return next;
}

// Assembly:
movq 0x8(%rdi), %rax
cmpq $0x3, %rax
jbe 0x21f8a
andq $-0x4, %rax
addq %rdi, %rax
addq $0x8, %rax
movq %rdi, (%rax)
retq
pushq %rax
leaq 0x665f(%rip), %rdi      # 0x285f1
leaq 0x62cb(%rip), %rsi      # 0x28264
leaq 0x6667(%rip), %rcx      # 0x28607
movl $0xf8, %edx
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: tlsf_malloc
void* tlsf_malloc(tlsf_pool tlsf, size_t size)
{
	pool_t* pool = tlsf_cast(pool_t*, tlsf);
	const size_t adjust = adjust_request_size(size, ALIGN_SIZE);
	block_header_t* block = block_locate_free(pool, adjust);
	return block_prepare_used(pool, block, adjust);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x1(%rsi), %rax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmpq %rcx, %rax
ja 0x21fe1
addq $0x7, %rsi
movabsq $0x1fffffff8, %rax      # imm = 0x1FFFFFFF8
andq %rsi, %rax
cmpq $0x19, %rax
movl $0x18, %r14d
cmovaeq %rax, %r14
jmp 0x21fe4
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22054
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22173
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: adjust_request_size
static size_t adjust_request_size(size_t size, size_t align)
{
	size_t adjust = 0;
	if (size && size < block_size_max)
	{
		const size_t aligned = align_up(size, align);
		adjust = tlsf_max(aligned, block_size_min);
	}
	return adjust;
}

// Assembly:
decq %rdi
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq %rax, %rdi
ja 0x22031
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x22034
addq %rsi, %rdi
negq %rsi
andq %rdi, %rsi
cmpq $0x19, %rsi
movl $0x18, %eax
cmovaeq %rsi, %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x6619(%rip), %rdi      # 0x28655
leaq 0x6221(%rip), %rsi      # 0x28264
leaq 0x6717(%rip), %rcx      # 0x28761
movl $0x115, %edx            # imm = 0x115
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O3/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_locate_free
static block_header_t* block_locate_free(pool_t* pool, size_t size)
{
	int fl = 0, sl = 0;
	block_header_t* block = 0;

	if (size)
	{
		mapping_search(size, &fl, &sl);
		block = search_suitable_block(pool, &fl, &sl);
	}

	if (block)
	{
		tlsf_assert(block_size(block) >= size);
		remove_free_block(pool, block, fl, sl);
	}

	return block;
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x2212e
movq %rsi, %rax
cmpq $0x20, %rsi
jb 0x2209b
xorl %eax, %eax
movq %rsi, %rcx
shrq $0x20, %rcx
cmovel %esi, %ecx
setne %al
shll $0x5, %eax
orl $0x1f, %eax
bsrl %ecx, %ecx
xorl %eax, %ecx
xorl $0x1f, %ecx
addb $-0x5, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
notl %eax
addq %rsi, %rax
cmpq $0xff, %rax
ja 0x220a2
shrl $0x3, %eax
xorl %edx, %edx
jmp 0x220cb
xorl %ecx, %ecx
movq %rax, %rdx
shrq $0x20, %rdx
setne %cl
cmovel %eax, %edx
shll $0x5, %ecx
orl $0x1f, %ecx
bsrl %edx, %edx
xorl %ecx, %edx
xorl $0x1f, %edx
leal -0x5(%rdx), %ecx
shrq %cl, %rax
xorl $0x20, %eax
addl $-0x7, %edx
movslq %edx, %r8
movl 0x24(%rdi,%r8,4), %r9d
movl %eax, %ecx
shrl %cl, %r9d
shll %cl, %r9d
testl %r9d, %r9d
jne 0x220ff
movl 0x20(%rdi), %eax
incb %dl
movl %edx, %ecx
shrl %cl, %eax
shll %cl, %eax
testl %eax, %eax
je 0x2212e
bsfl %eax, %edx
movl 0x24(%rdi,%rdx,4), %r9d
movq %rdx, %r8
testl %r9d, %r9d
je 0x22154
bsfl %r9d, %ecx
shlq $0x8, %r8
addq %rdi, %r8
movq 0x88(%r8,%rcx,8), %rbx
testq %rbx, %rbx
je 0x2212e
movq 0x8(%rbx), %rax
andq $-0x4, %rax
cmpq %rsi, %rax
jb 0x22135
movq %rbx, %rsi
callq 0x22675
jmp 0x22130
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
leaq 0x6645(%rip), %rdi      # 0x28781
leaq 0x6121(%rip), %rsi      # 0x28264
leaq 0x6651(%rip), %rcx      # 0x2879b
movl $0x238, %edx            # imm = 0x238
callq 0x31e0
leaq 0x6674(%rip), %rdi      # 0x287cf
leaq 0x6102(%rip), %rsi      # 0x28264
leaq 0x669f(%rip), %rcx      # 0x28808
movl $0x171, %edx            # imm = 0x171
callq 0x31e0