LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: two_reg
int two_reg(int op)
{
  int reg1,reg2;
  if ( GetRegisterOrPC( &reg1 )) return 1;
  if ( !TestAtom(',') )return Error(SYNTAX_ERR,"");
  if ( GetRegister( &reg2 )) return 1;

  if ( reg1 == 64 && op == 34){ // special case: mov pc,rn
    op = 51;
    reg1 = 0;
  }

  if ( reg1 > 31 ) return Error(REG_ERR,"");

  op = ( op << 10 ) | ( reg1 << 5 ) | reg2;

  writeOp( op );
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
leaq 0x4(%rsp), %rdi
callq 0x9dac
pushq $0x1
popq %rbx
testl %eax, %eax
je 0xa1a5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa1d8
movq %rsp, %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa19c
movl 0x4(%rsp), %eax
movl %eax, %ecx
xorl $0x40, %ecx
movl %ebp, %edx
xorl $0x22, %edx
xorl %ebx, %ebx
orl %ecx, %edx
jne 0xa1ed
pushq $0x33
popq %rbp
xorl %eax, %eax
jmp 0xa1fd
leaq 0x1db3(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x96cc
cmpl $0x20, %eax
jl 0xa1fd
leaq 0x1d99(%rip), %rsi      # 0xbf92
pushq $0x2c
jmp 0xa1e1
shll $0xa, %ebp
shll $0x5, %eax
orl %ebp, %eax
orl (%rsp), %eax
movswl %ax, %edi
callq 0x9d8c
jmp 0xa19c
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: imm_reg
int imm_reg(int op)
{
  int32_t imm;
  int reg;
  int err;

  if ( !TestAtom('#') ) return Error(SYNTAX_ERR,"");

  if ( (err = Expression( &imm )) == EXPR_ERR ) return 1;

  if ( err == EXPR_UNSOLVED ) {
    saveCurrentLine();
    imm = 1;
  }

  if ( imm < 1 || imm > 32 ) Error(IMM_ERR,"1<=x<=32");

  if ( op == 24 ) imm = 32-imm; // shlq

  if ( imm == 32 ) imm = 0;

  if ( !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister( &reg ) ) return 1;

  op = ( op << 10 ) | ( imm << 5) | reg;

  writeOp( op );

  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x23
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa24c
movq %rsp, %rdi
callq 0x929a
pushq $0x1
popq %rbp
cmpl $0x11, %eax
je 0xa2e7
cmpl $0x2, %eax
jne 0xa261
xorl %eax, %eax
callq 0x960c
movl $0x1, (%rsp)
jmp 0xa27b
leaq 0x1d3f(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x96cc
movl (%rsp), %eax
addl $-0x21, %eax
cmpl $-0x21, %eax
ja 0xa27b
leaq 0x28d3(%rip), %rsi      # 0xcb46
pushq $0x2b
popq %rdi
callq 0x96cc
movl (%rsp), %ecx
pushq $0x20
popq %rax
subl %ecx, %eax
cmpl $0x18, %ebx
cmovnel %ecx, %eax
setne %cl
cmpl $0x20, %eax
setne %dl
testb %dl, %cl
jne 0xa2a1
xorl %ecx, %ecx
cmpl $0x20, %eax
cmovnel %eax, %ecx
movl %ecx, (%rsp)
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa2d6
leaq 0x4(%rsp), %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa2e7
shll $0xa, %ebx
movl (%rsp), %eax
shll $0x5, %eax
orl %ebx, %eax
orl 0x4(%rsp), %eax
movswl %ax, %edi
callq 0x9d8c
xorl %ebp, %ebp
jmp 0xa2e7
leaq 0x1cb5(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
callq 0x96cc
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: imm2_reg
int imm2_reg(int op)
{
  int32_t imm;
  int reg;
  int err;

  if ( !TestAtom('#') ) return Error(SYNTAX_ERR,"");

  if ( (err = Expression( &imm )) == EXPR_ERR ) return 1;

  if ( err == EXPR_UNSOLVED ) saveCurrentLine();

  if ( imm < 0 || imm > 31 ) Error(IMM_ERR,"0<=n<=31");

  if ( !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister( &reg ) ) return 1;

  op = ( op << 10 ) | ( imm << 5) | reg;

  writeOp( op );

  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x23
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa367
movq %rsp, %rdi
callq 0x929a
pushq $0x1
popq %rbp
cmpl $0x11, %eax
je 0xa38d
cmpl $0x2, %eax
jne 0xa31d
xorl %eax, %eax
callq 0x960c
cmpl $0x20, (%rsp)
jb 0xa332
leaq 0x2825(%rip), %rsi      # 0xcb4f
pushq $0x2b
popq %rdi
callq 0x96cc
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa37c
leaq 0x4(%rsp), %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa38d
shll $0xa, %ebx
movl (%rsp), %eax
shll $0x5, %eax
orl %ebx, %eax
orl 0x4(%rsp), %eax
movswl %ax, %edi
callq 0x9d8c
xorl %ebp, %ebp
jmp 0xa38d
leaq 0x1c24(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x96cc
leaq 0x1c0f(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
callq 0x96cc
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: imm3_reg
int imm3_reg(int op)
{
  int32_t imm;
  int reg;
  int err;

  if ( !TestAtom('#') ) return Error(SYNTAX_ERR,"");

  if ( (err = Expression( &imm )) == EXPR_ERR ) return 1;

  if ( err == EXPR_UNSOLVED ) saveCurrentLine();

  if ( imm < -16 || imm > 15 ) Error(IMM_ERR,"-16<=n<=15");

  imm &= 31;

  if ( !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister( &reg ) ) return 1;

  op = ( op << 10 ) | ( imm << 5) | reg;

  writeOp( op );

  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x23
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa41f
movq %rsp, %rdi
callq 0x929a
pushq $0x1
popq %rbp
cmpl $0x11, %eax
je 0xa445
cmpl $0x2, %eax
jne 0xa3c7
xorl %eax, %eax
callq 0x960c
movl (%rsp), %eax
leal -0x10(%rax), %ecx
cmpl $-0x21, %ecx
ja 0xa3e4
leaq 0x277f(%rip), %rsi      # 0xcb58
pushq $0x2b
popq %rdi
callq 0x96cc
movl (%rsp), %eax
andl $0x1f, %eax
movl %eax, (%rsp)
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa434
leaq 0x4(%rsp), %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa445
shll $0xa, %ebx
movl (%rsp), %eax
shll $0x5, %eax
orl %ebx, %eax
orl 0x4(%rsp), %eax
movswl %ax, %edi
callq 0x9d8c
xorl %ebp, %ebp
jmp 0xa445
leaq 0x1b6c(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x96cc
leaq 0x1b57(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
callq 0x96cc
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: imm4_reg
int imm4_reg(int op)
{
  int32_t imm;
  int reg;
  int err;

  if ( !TestAtom('#') ) return Error(SYNTAX_ERR,"");

  if ( (err = Expression( &imm )) == EXPR_ERR ) return 1;

  if ( !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister( &reg ) ) return 1;

  if ( err == EXPR_UNSOLVED ) saveCurrentLine();

  if ( (last_op == 52 || last_op == 53) && last_pc == (Global.pc-2) ){
    Warning("MOVEI after JR/JUMP is unpredictable!");
  }

  op = ( op << 10 ) | reg;

  writeOp( op );
  writeWordBig( imm & 0xffff);
  writeWordBig( imm >> 16 );

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
pushq $0x23
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa505
leaq 0x8(%rsp), %rdi
callq 0x929a
pushq $0x1
popq %rbp
cmpl $0x11, %eax
je 0xa52d
movl %eax, %r14d
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa51c
leaq 0xc(%rsp), %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa52d
cmpl $0x2, %r14d
jne 0xa4b0
xorl %eax, %eax
callq 0x960c
movl 0x9c6a(%rip), %eax      # 0x14120
andl $-0x2, %eax
cmpl $0x34, %eax
jne 0xa4de
leaq 0x9eeb(%rip), %rax      # 0x143b0
movl (%rax), %eax
addl $-0x2, %eax
cmpl %eax, 0x9c54(%rip)      # 0x14124
jne 0xa4de
leaq 0x268a(%rip), %rdi      # 0xcb63
callq 0x9cd8
shll $0xa, %ebx
orl 0xc(%rsp), %ebx
movswl %bx, %edi
callq 0x9d8c
movswl 0x8(%rsp), %edi
callq 0x3568
movswl 0xa(%rsp), %edi
callq 0x3568
xorl %ebp, %ebp
jmp 0xa52d
leaq 0x1a86(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x96cc
leaq 0x1a6f(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
callq 0x96cc
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: GetCondition
int GetCondition(int *cond)
{
  label_t condition;
  label_t *l;
  int32_t solved;
  int i;
  char *save_srcLinePtr = srcLinePtr-1;

  *cond = 0;
  if ( GetLabel(&condition) ) return 0;

  if ( condition.type != (UNSURE|NORMAL) ){
    srcLinePtr = save_srcLinePtr;
    atom = *srcLinePtr++;
    return 0;
  }

//->  printf("Cond:%s\n",condition.name);

  if ( atom != ',' || (l = FindLabel(&condition, &solved) ) != NULL ){
    srcLinePtr = save_srcLinePtr;
    atom = *srcLinePtr++;
    return 0;
  }

  if ( condition.len > 5 )  return Error(SYNTAX_ERR,"");

  for( i = 0 ; conditions[i].cond ; ++i ){
    if ( !strcasecmp(conditions[i].ascCond,condition.name) ){
      *cond = conditions[i].cond;
      return 0;
    }
  }

  *cond = 0;
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
leaq 0x129d0(%rip), %r12     # 0x1cf20
movq (%r12), %r15
andl $0x0, (%rdi)
leaq 0x8(%rsp), %rdi
callq 0x4fa0
xorl %ebx, %ebx
testl %eax, %eax
jne 0xa5b1
cmpl $0x21, 0xc(%rsp)
jne 0xa59f
leaq 0x129bb(%rip), %r13     # 0x1cf30
cmpl $0x2c, (%r13)
jne 0xa590
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x59a0
testq %rax, %rax
je 0xa5c2
movq %r15, (%r12)
movsbl -0x1(%r15), %eax
movl %eax, (%r13)
jmp 0xa5b1
movq %r15, (%r12)
movsbl -0x1(%r15), %eax
leaq 0x12981(%rip), %rcx     # 0x1cf30
movl %eax, (%rcx)
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x5, 0x8(%rsp)
jle 0xa5dc
leaq 0x19c2(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
callq 0x96cc
movl %eax, %ebx
jmp 0xa5b1
leaq 0x9b4d(%rip), %r15      # 0x14130
leaq 0x40(%rsp), %r12
movl 0x8(%r15), %ebp
testl %ebp, %ebp
je 0xa608
movq %r15, %rdi
movq %r12, %rsi
callq 0x3060
addq $0xc, %r15
testl %eax, %eax
jne 0xa5e8
movl %ebp, (%r14)
jmp 0xa5b1
andl $0x0, (%r14)
pushq $0x1
popq %rbx
jmp 0xa5b1
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: cond_rel
int cond_rel(int op )
{
  int cond;
  int32_t dest;
  int err;

  if ( GetCondition( & cond ) ) return 1;

  if ( cond && !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  if ( (err = Expression(&dest)) == EXPR_ERR) return 1;

  op = ( op << 10 ) | cond;

  if ( (Global.pc < 0xf03000) && (Global.pc & 3) ){
    Warning("JR not long-aligned ! NOP inserted !");
    writeOp(0xe400); /* NOP */
  }

  if ( err == EXPR_UNSOLVED ){
    saveCurrentLine();
  } else {
    int32_t dist = (int32_t)dest - (Global.pc + 2);
    if ( dist < -32 || dist > 30 ) {
      return Error(DISTANCE_ERR,"");
    }
    dist >>= 1;
    op  |= (dist & 31) << 5;
  }

  writeOp( op );
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0xc(%rsp), %rdi
callq 0xa538
pushq $0x1
popq %rbp
testl %eax, %eax
je 0xa63f
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0xc(%rsp), %r15d
testl %r15d, %r15d
je 0xa655
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa6ae
leaq 0x8(%rsp), %rdi
callq 0x929a
cmpl $0x11, %eax
je 0xa630
movl %eax, %r14d
shll $0xa, %ebx
leaq 0x9d3f(%rip), %r12      # 0x143b0
movl (%r12), %eax
cmpl $0xf03000, %eax         # imm = 0xF03000
setae %cl
testb $0x3, %al
sete %al
orb %cl, %al
jne 0xa69c
leaq 0x24fc(%rip), %rdi      # 0xcb89
callq 0x9cd8
movl $0xffffe400, %edi       # imm = 0xFFFFE400
callq 0x9d8c
orl %ebx, %r15d
cmpl $0x2, %r14d
jne 0xa6c9
xorl %eax, %eax
callq 0x960c
jmp 0xa6e8
leaq 0x18dd(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x96cc
movl 0x8(%rsp), %eax
subl (%r12), %eax
leal 0x1e(%rax), %ecx
cmpl $0x3e, %ecx
ja 0xa6f8
addl $-0x2, %eax
andl $0x3e, %eax
shll $0x4, %eax
orl %r15d, %eax
movl %eax, %r15d
movswl %r15w, %edi
callq 0x9d8c
xorl %ebp, %ebp
jmp 0xa630
leaq 0x1893(%rip), %rsi      # 0xbf92
pushq $0x16
popq %rdi
callq 0x96cc
movl %eax, %ebp
jmp 0xa630
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: cond_abs
int cond_abs(int op )
{
  int cond;
  int reg;

  if ( GetCondition( &cond ) ) return 1;

  if ( cond && !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  op = ( op << 10 ) | cond;

  if ( !TestAtom('(') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister( &reg ) ) return 1;

  if ( !TestAtom(')') ) return Error(SYNTAX_ERR,"");

  op |= reg << 5;

  if ( (Global.pc < 0xf03000) && (Global.pc & 3) ){
    Warning("JUMP not long-aligned ! NOP inserted !");
    writeOp((short)0xe400);
  }

  writeOp( op );
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0xc(%rsp), %rdi
callq 0xa538
pushq $0x1
popq %rbp
testl %eax, %eax
je 0xa734
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl 0xc(%rsp), %r14d
testl %r14d, %r14d
je 0xa74a
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa7be
pushq $0x28
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa7be
leaq 0x8(%rsp), %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa729
pushq $0x29
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa7be
shll $0xa, %ebx
movl 0x8(%rsp), %eax
shll $0x5, %eax
orl %r14d, %ebx
orl %eax, %ebx
leaq 0x9c2a(%rip), %rax      # 0x143b0
movl (%rax), %eax
cmpl $0xf03000, %eax         # imm = 0xF03000
setae %cl
testb $0x3, %al
sete %al
orb %cl, %al
jne 0xa7af
leaq 0x240e(%rip), %rdi      # 0xcbae
callq 0x9cd8
movl $0xffffe400, %edi       # imm = 0xFFFFE400
callq 0x9d8c
movswl %bx, %edi
callq 0x9d8c
xorl %ebp, %ebp
jmp 0xa729
leaq 0x17cd(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x96cc
// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/jaguar.c
// Function: load2_reg
int load2_reg(int op )
{
  int reg1,reg2;

  if ( !TestAtom('(') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister(&reg1) ) return 1;

  if ( !TestAtom(')') || !TestAtom(',') ) return Error(SYNTAX_ERR,"");

  if ( GetRegister( &reg2 ) ) return 1;

  op = ( op << 10 ) | ( reg1 << 5 ) | reg2;

  writeOp( op );

  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x28
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa9dd
leaq 0x4(%rsp), %rdi
callq 0x9f8b
pushq $0x1
popq %rbp
testl %eax, %eax
je 0xa99e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x29
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa9dd
pushq $0x2c
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0xa9dd
movq %rsp, %rdi
callq 0x9f8b
testl %eax, %eax
jne 0xa995
shll $0xa, %ebx
movl 0x4(%rsp), %eax
shll $0x5, %eax
orl %ebx, %eax
orl (%rsp), %eax
movswl %ax, %edi
callq 0x9d8c
xorl %ebp, %ebp
jmp 0xa995
leaq 0x15ae(%rip), %rsi      # 0xbf92
pushq $0x12
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x96cc
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_3/exercise_3_04/itoa.c
// Function: int_to_array
void int_to_array(int n, char s[])
{
  int i, sign;

  sign = n;

  i = 0;
  do
  {
    s[i++] = abs(n % 10) + '0';
  } while (n /= 10);

  if (sign < 0)
  {
    s[i++] = '-';
  }

  s[i] = '\0';

  int s_len = strlen(s);
  str_reverse(s, 0, s_len - 1);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
xorl %esi, %esi
pushq $0xa
popq %r8
movl %edi, %ecx
movl %ecx, %eax
cltd
idivl %r8d
movl %edx, %r9d
negl %r9d
cmovsl %edx, %r9d
addb $0x30, %r9b
movb %r9b, (%rbx,%rsi)
incq %rsi
addl $0x9, %ecx
cmpl $0x12, %ecx
movl %eax, %ecx
ja 0x1183
testl %edi, %edi
jns 0x11b5
movl %esi, %eax
incq %rsi
movb $0x2d, (%rbx,%rax)
movslq %esi, %rax
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x1040
leal -0x1(%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x11d2
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_aerospike.c
// Function: as_aerospike_new
as_aerospike * as_aerospike_new(void * s, const as_aerospike_hooks * h)
{
	as_aerospike * a = (as_aerospike *) cf_rc_alloc(sizeof(as_aerospike));
	a->is_rcalloc = true;
	a->source = s;
	a->hooks = h;
	return a;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x8850
movb $0x1, 0x10(%rax)
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_init
as_arraylist*
as_arraylist_init(as_arraylist* list, uint32_t capacity, uint32_t block_size)
{
	if (!list) return list;

	as_list_cons((as_list *) list, false, &as_arraylist_list_hooks);
	list->block_size = block_size;
	list->capacity = capacity;
	list->size = 0;
	if (list->capacity > 0) {
		list->free = true;
		list->elements = (as_val**) cf_calloc(capacity, sizeof(as_val*));
	}
	else {
		list->free = false;
		list->elements = NULL;
	}
	return list;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x8d67
movl %edx, %r14d
movq 0x15286(%rip), %rdx     # 0x1dfb8
movl %esi, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8b70
movl %r14d, 0x18(%rbx)
movl %ebp, 0x1c(%rbx)
andl $0x0, 0x20(%rbx)
testl %ebp, %ebp
je 0x8d5d
movb $0x1, 0x30(%rbx)
movl %ebp, %edi
pushq $0x8
popq %rsi
callq 0x8960
jmp 0x8d63
xorl %eax, %eax
movb $0x0, 0x30(%rbx)
movq %rax, 0x28(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_new
as_arraylist*
as_arraylist_new(uint32_t capacity, uint32_t block_size)
{
	as_arraylist* list = (as_arraylist*) cf_malloc(sizeof(as_arraylist));
	if (!list) return list;

	as_list_cons((as_list *) list, true, &as_arraylist_list_hooks);
	list->block_size = block_size;
	list->capacity = capacity;
	list->size = 0;
	if (list->capacity > 0) {
		list->free = true;
		list->elements = (as_val**) cf_calloc(capacity, sizeof(as_val*));
	}
	else {
		list->free = false;
		list->elements = NULL;
	}
	return list;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movl %edi, %ebp
pushq $0x38
popq %rdi
callq 0x8080
movq %rax, %rbx
testq %rax, %rax
je 0x8dc3
movq 0x15229(%rip), %rdx     # 0x1dfb8
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x8b70
movl %r14d, 0x18(%rbx)
movl %ebp, 0x1c(%rbx)
andl $0x0, 0x20(%rbx)
testl %ebp, %ebp
je 0x8db9
movb $0x1, 0x30(%rbx)
movl %ebp, %edi
pushq $0x8
popq %rsi
callq 0x8960
jmp 0x8dbf
xorl %eax, %eax
movb $0x0, 0x30(%rbx)
movq %rax, 0x28(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_release
bool
as_arraylist_release(as_arraylist* list)
{
	if (list->elements) {
		for (uint32_t i = 0; i < list->size; i++) {
			if (list->elements[i]) {
				as_val_destroy(list->elements[i]);
			}
			list->elements[i] = NULL;
		}

		if (list->free) {
			cf_free(list->elements);
		}
	}
	
	list->elements = NULL;
	list->size = 0;
	list->capacity = 0;

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x28(%rdi)
movq %rdi, %rbx
je 0x8e13
xorl %r14d, %r14d
movl 0x20(%rbx), %eax
cmpq %rax, %r14
jae 0x8e04
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x8dfa
callq 0x84e0
movq 0x28(%rbx), %rax
andq $0x0, (%rax,%r14,8)
incq %r14
jmp 0x8ddc
cmpb $0x0, 0x30(%rbx)
je 0x8e13
movq 0x28(%rbx), %rdi
callq 0x8a00
andq $0x0, 0x28(%rbx)
andq $0x0, 0x1c(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_set
int
as_arraylist_set(as_arraylist* list, uint32_t index, as_val* value)
{
	int rc = AS_ARRAYLIST_OK;

	if (index >= list->capacity) {
		rc = as_arraylist_ensure(list, (index + 1) - list->size);

		if (rc != AS_ARRAYLIST_OK) {
			return rc;
		}
	}

	// Make sure that, before we free (destroy) something, it is within the
	// legal bounds of the object.
	if (index < list->size) {
		as_val_destroy(list->elements[index]);
	}

	list->elements[index] = value ? value : (as_val*)&as_nil;

	if (index == list->size) {
		list->size++;
	}
	else if (index > list->size) {
		for (uint32_t i = list->size; i < index; i++) {
			list->elements[i] = (as_val*)&as_nil;
		}

		list->size = index + 1;
	}

	return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl %esi, 0x1c(%rdi)
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
ja 0x8ed6
movl %ebx, %esi
movq %r14, %rdi
subl 0x20(%r14), %esi
incl %esi
callq 0x8f42
testl %eax, %eax
jne 0x8f36
cmpl %ebx, 0x20(%r14)
jbe 0x8eee
movq 0x28(%r14), %rax
movl %ebx, %r12d
movq (%rax,%r12,8), %rdi
callq 0x84e0
jmp 0x8ef1
movl %ebx, %r12d
testq %r15, %r15
jne 0x8efd
movq 0x150e3(%rip), %r15     # 0x1dfe0
movq 0x28(%r14), %rax
movq %r15, (%rax,%r12,8)
movl 0x20(%r14), %ecx
cmpl %ebx, %ecx
jne 0x8f17
incl %ebx
xorl %eax, %eax
movl %ebx, 0x20(%r14)
jmp 0x8f36
xorl %eax, %eax
cmpl %ebx, %ecx
jae 0x8f36
movq 0x150bc(%rip), %rax     # 0x1dfe0
cmpq %r12, %rcx
jae 0x8f0d
movq 0x28(%r14), %rdx
movq %rax, (%rdx,%rcx,8)
incq %rcx
jmp 0x8f24
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_ensure
static int
as_arraylist_ensure(as_arraylist* list, uint32_t delta)
{
	// Check for capacity (in terms of elements, NOT size in bytes), and if we
	// need to allocate more, do a realloc.
	if ((list->size + delta) > list->capacity) {
		// by convention - we allocate more space ONLY when the unit of
		// (new) allocation is > 0.
		if (list->block_size == 0) {
			return AS_ARRAYLIST_ERR_MAX;
		}
		// Compute how much room we're missing for the new stuff
		int new_room = (list->size + delta) - list->capacity;
		// Compute new capacity in terms of multiples of block_size
		// This will get us (conservatively) at least one block
		int new_blocks = (new_room + list->block_size) / list->block_size;
		int new_capacity = list->capacity + (new_blocks * list->block_size);
		size_t new_bytes = sizeof(as_val*) * new_capacity;
		as_val** elements = (as_val**) cf_realloc(list->elements, new_bytes);
		if (! elements) {
			return AS_ARRAYLIST_ERR_ALLOC;
		}
		// Zero everything beyond the old pointers.
		size_t old_bytes = sizeof(as_val*) * list->capacity;
		memset((uint8_t *)elements + old_bytes, 0, new_bytes - old_bytes);
		// Set the new array pointer and capacity.
		list->elements = elements;
		list->capacity = new_capacity;
		list->free = true;
	}

	return AS_ARRAYLIST_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movl 0x1c(%rdi), %ecx
xorl %r14d, %r14d
addl 0x20(%rdi), %ebp
subl %ecx, %ebp
jbe 0x8fba
movl 0x18(%rdi), %esi
movq %rdi, %rbx
testl %esi, %esi
je 0x8fb2
addl %esi, %ebp
xorl %edx, %edx
xorl %r14d, %r14d
movl %ebp, %eax
divl %esi
movq 0x28(%rbx), %rdi
subl %edx, %ebp
addl %ecx, %ebp
movslq %ebp, %r15
shlq $0x3, %r15
movq %r15, %rsi
callq 0x8540
testq %rax, %rax
je 0x8fb6
movq %rax, %r12
movl 0x1c(%rbx), %eax
xorl %esi, %esi
leaq (%r12,%rax,8), %rdi
shlq $0x3, %rax
subq %rax, %r15
movq %r15, %rdx
callq 0x8420
movq %r12, 0x28(%rbx)
movl %ebp, 0x1c(%rbx)
movb $0x1, 0x30(%rbx)
jmp 0x8fba
pushq $0x2
jmp 0x8fb8
pushq $0x1
popq %r14
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_insert
int
as_arraylist_insert(as_arraylist* list, uint32_t index, as_val* value)
{
	uint32_t delta = 1;

	if (index > list->size) {
		delta = index + 1 - list->size;
	}

	int rc = as_arraylist_ensure(list, delta);

	if (rc != AS_ARRAYLIST_OK) {
		return rc;
	}

	for (uint32_t i = list->size; i > index; i--) {
		list->elements[i] = list->elements[i - 1];
	}

	list->elements[index] = value ? value : (as_val*)&as_nil;

	if (index <= list->size) {
		list->size++;
	}
	else {
		for (uint32_t i = list->size; i < index; i++) {
			list->elements[i] = (as_val*)&as_nil;
		}

		list->size = index + 1;
	}

	return AS_ARRAYLIST_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x20(%rdi), %eax
movl %esi, %r14d
movq %rdx, %r15
movq %rdi, %rbx
leal 0x1(%r14), %ebp
movl %ebp, %ecx
subl %eax, %ecx
cmpl %esi, %eax
pushq $0x1
popq %rsi
cmovbl %ecx, %esi
callq 0x8f42
testl %eax, %eax
jne 0x90be
movl 0x20(%rbx), %ecx
movl %r14d, %eax
cmpq %rax, %rcx
jbe 0x9080
movq 0x28(%rbx), %rdx
leaq -0x1(%rcx), %rsi
movl %esi, %edi
movq (%rdx,%rdi,8), %rdi
movq %rdi, (%rdx,%rcx,8)
movq %rsi, %rcx
jmp 0x9064
testq %r15, %r15
jne 0x908c
movq 0x14f54(%rip), %r15     # 0x1dfe0
movq 0x28(%rbx), %rcx
movq %r15, (%rcx,%rax,8)
movl 0x20(%rbx), %ecx
cmpl %r14d, %ecx
jae 0x90b5
movq 0x14f3d(%rip), %rdx     # 0x1dfe0
cmpq %rax, %rcx
jae 0x90b9
movq 0x28(%rbx), %rsi
movq %rdx, (%rsi,%rcx,8)
incq %rcx
jmp 0x90a3
incl %ecx
movl %ecx, %ebp
xorl %eax, %eax
movl %ebp, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_remove
int
as_arraylist_remove(as_arraylist* list, uint32_t index)
{
	if (index >= list->size) {
		return AS_ARRAYLIST_ERR_INDEX;
	}

	if (list->elements[index]) {
		as_val_destroy(list->elements[index]);
	}

	for (uint32_t i = index + 1; i < list->size; i++) {
		list->elements[i - 1] = list->elements[i];
	}

	list->size--;
	list->elements[list->size] = NULL; // clean vacated pointer slot

	return AS_ARRAYLIST_OK;
}

// Assembly:
cmpl %esi, 0x20(%rdi)
jbe 0x9235
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rax
movl %esi, %ecx
movq %rdi, %rbx
movl %esi, %r14d
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x91f7
callq 0x84e0
leal 0x1(%r14), %eax
movl 0x20(%rbx), %edx
leal 0x1(%r14), %ecx
cmpl %edx, %ecx
jae 0x921d
movq 0x28(%rbx), %rdx
movl %r14d, %edi
movl %ecx, %r14d
movq (%rdx,%rax,8), %rsi
incq %rax
movq %rsi, (%rdx,%rdi,8)
jmp 0x91fb
decl %edx
movl %edx, 0x20(%rbx)
movq 0x28(%rbx), %rax
andq $0x0, (%rax,%rdx,8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x3
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_concat
int
as_arraylist_concat(as_arraylist* list, const as_arraylist* list2)
{
	int rc = as_arraylist_ensure(list, list2->size);

	if (rc != AS_ARRAYLIST_OK) {
		return rc;
	}

	for (uint32_t i = 0; i < list2->size; i++) {
		if (list2->elements[i]) {
			as_val_reserve(list2->elements[i]);
		}

		list->elements[list->size++] = list2->elements[i];
	}

	return AS_ARRAYLIST_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x20(%rsi), %esi
movq %rdi, %r14
callq 0x8f42
movl %eax, %r15d
testl %eax, %eax
je 0x9265
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %r15d, %r15d
xorl %r12d, %r12d
movl 0x20(%rbx), %eax
cmpq %rax, %r12
jae 0x9256
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x928f
callq 0x83c0
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rax
jmp 0x9291
xorl %eax, %eax
movl 0x20(%r14), %edx
movq 0x28(%r14), %rcx
incq %r12
leal 0x1(%rdx), %esi
movl %esi, 0x20(%r14)
movq %rax, (%rcx,%rdx,8)
jmp 0x926b
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_trim
int
as_arraylist_trim(as_arraylist* list, uint32_t index)
{
	if (index >= list->size) {
		return AS_ARRAYLIST_ERR_INDEX;
	}

	for (uint32_t i = index; i < list->size; i++) {
		if (list->elements[i]) {
			as_val_destroy(list->elements[i]);
			list->elements[i] = NULL;
		}
	}

	list->size = index;

	return AS_ARRAYLIST_OK;
}

// Assembly:
movl 0x20(%rdi), %eax
cmpl %esi, %eax
jbe 0x92f4
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
movl %eax, %ecx
cmpq %rcx, %r15
jae 0x92e8
movq 0x28(%r14), %rcx
movq (%rcx,%r15,8), %rdi
testq %rdi, %rdi
je 0x92e3
callq 0x84e0
movq 0x28(%r14), %rax
andq $0x0, (%rax,%r15,8)
movl 0x20(%r14), %eax
incq %r15
jmp 0x92bd
movl %ebx, 0x20(%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
pushq $0x3
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_tail
as_arraylist*
as_arraylist_tail(const as_arraylist* list)
{
	if (list->size == 0) return NULL;

	as_arraylist* list2 = as_arraylist_new(list->size-1, list->block_size);

	for(uint32_t i = 1, j = 0; i < list->size; i++, j++) {
		if (list->elements[i]) {
			as_val_reserve(list->elements[i]);
			list2->elements[j] = list2->elements[i];
		}
		else {
			list2->elements[j] = 0;
		}
	}

	return list2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x20(%rdi), %edi
testl %edi, %edi
je 0x9354
movl 0x18(%rbx), %esi
decl %edi
callq 0x8560
movq %rax, %r14
pushq $0x1
popq %r15
movl 0x20(%rbx), %eax
cmpq %rax, %r15
jae 0x9357
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x9344
callq 0x83c0
movq 0x28(%r14), %rax
movq (%rax,%r15,8), %rcx
jmp 0x934a
movq 0x28(%r14), %rax
xorl %ecx, %ecx
movq %rcx, -0x8(%rax,%r15,8)
incq %r15
jmp 0x9320
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_drop
as_arraylist*
as_arraylist_drop(const as_arraylist* list, uint32_t n)
{
	uint32_t		sz		= list->size;
	uint32_t		c		= n < sz ? n : sz;
	as_arraylist*	list2	= as_arraylist_new(sz-c, list->block_size);
	
	list2->size = sz-c;
	for(uint32_t i = c, j = 0; j < list2->size; i++, j++) {
		if (list->elements[i]) {
			as_val_reserve(list->elements[i]);
			list2->elements[j] = list->elements[i];
		}
		else {
			list2->elements[j] = 0;
		}
	}

	return list2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x20(%rdi), %r13d
movl %esi, %r15d
movl 0x18(%rdi), %esi
xorl %r12d, %r12d
movq %rdi, %rbx
movl %r13d, %ebp
subl %r15d, %ebp
cmovbl %r12d, %ebp
movl %ebp, %edi
callq 0x8560
movl %r15d, %r15d
movq %rax, %r14
movl %ebp, 0x20(%rax)
cmpq %r15, %r13
cmovbq %r13, %r15
movl %ebp, %eax
cmpq %rax, %r12
jae 0x93d9
movq 0x28(%rbx), %rcx
leaq (%r15,%r12), %rax
movl %eax, %r13d
movq (%rcx,%r13,8), %rdi
testq %rdi, %rdi
je 0x93c6
callq 0x83c0
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rax
jmp 0x93c8
xorl %eax, %eax
movq 0x28(%r14), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movl 0x20(%r14), %ebp
jmp 0x939c
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_take
as_arraylist*
as_arraylist_take(const as_arraylist* list, uint32_t n)
{
	uint32_t		sz		= list->size;
	uint32_t		c		= n < sz ? n : sz;
	as_arraylist*	list2	= as_arraylist_new(c, list->block_size);

	list2->size = c;
	for(uint32_t i = 0; i < c; i++) {
		if (list->elements[i]) {
			as_val_reserve(list->elements[i]);
			list2->elements[i] = list->elements[i];
		}
		else {
			list2->elements[i] = 0;
		}
	}

	return list2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x20(%rdi), %eax
movl %esi, %ebx
movl 0x18(%rdi), %esi
movq %rdi, %r14
cmpl %ebx, %eax
cmovbl %eax, %ebx
movl %ebx, %edi
callq 0x8560
movq %rax, %r15
xorl %r12d, %r12d
movl %ebx, 0x20(%rax)
cmpq %r12, %rbx
je 0x9443
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x9434
callq 0x83c0
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rax
jmp 0x9436
xorl %eax, %eax
movq 0x28(%r15), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
jmp 0x9413
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist.c
// Function: as_arraylist_foreach
bool
as_arraylist_foreach(const as_arraylist* list, as_list_foreach_callback callback, void* udata)
{
	for(uint32_t i = 0; i < list->size; i++) {
		if (! callback(list->elements[i], udata)) {
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ecx, %ecx
movl 0x20(%r15), %r13d
movq %rcx, %r12
cmpq %r13, %rcx
jae 0x9489
movq 0x28(%r15), %rax
movq %rbx, %rsi
movq (%rax,%r12,8), %rdi
callq *%r14
leaq 0x1(%r12), %rcx
testb %al, %al
jne 0x9466
cmpq %r13, %r12
setae %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist_iterator.c
// Function: as_arraylist_iterator_init
as_arraylist_iterator * as_arraylist_iterator_init(as_arraylist_iterator * iterator, const as_arraylist * list)
{
	if ( !iterator ) return iterator;

	as_iterator_init((as_iterator *) iterator, false, NULL, &as_arraylist_iterator_hooks);
	iterator->list = list;
	iterator->pos = 0;
	return iterator;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x9576
movq 0x14a69(%rip), %rcx     # 0x1dfc8
movq %rsi, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8a10
movq %r14, 0x18(%rbx)
andl $0x0, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_arraylist_iterator.c
// Function: as_arraylist_iterator_new
as_arraylist_iterator * as_arraylist_iterator_new(const as_arraylist * list)
{
	as_arraylist_iterator * iterator = (as_arraylist_iterator *) cf_malloc(sizeof(as_arraylist_iterator));
	if ( !iterator ) return iterator;

	as_iterator_init((as_iterator *) iterator, true, NULL, &as_arraylist_iterator_hooks);
	iterator->list = list;
	iterator->pos = 0;
	return iterator;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x28
popq %rdi
callq 0x8080
movq %rax, %r14
testq %rax, %rax
je 0x95b5
movq 0x14a29(%rip), %rcx     # 0x1dfc8
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x8a10
movq %rbx, 0x18(%r14)
andl $0x0, 0x20(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_boolean.c
// Function: as_boolean_val_tostring
char * as_boolean_val_tostring(const as_val * v)
{
	if ( as_val_type(v) != AS_BOOLEAN ) return NULL;

	as_boolean * b = (as_boolean *) v;
	char * str = (char *) cf_malloc(sizeof(char) * 6);
    if (!str) return str;
	memset(str, 0, 6);
	if ( b->value ) {
		strcpy(str,"true");
	}
	else {
		strcpy(str,"false");
	}
	return str;

}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x96a6
cmpb $0x2, 0x4(%rdi)
movq %rdi, %rbx
jne 0x96a6
pushq $0x6
popq %rdi
callq 0x8080
testq %rax, %rax
je 0x96a6
andw $0x0, 0x4(%rax)
andl $0x0, (%rax)
cmpb $0x1, 0x8(%rbx)
jne 0x96aa
movb $0x0, 0x4(%rax)
movl $0x65757274, (%rax)     # imm = 0x65757274
jmp 0x96a8
xorl %eax, %eax
popq %rbx
retq
movw $0x65, 0x4(%rax)
movl $0x736c6166, (%rax)     # imm = 0x736C6166
jmp 0x96a8
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer.c
// Function: as_buffer_destroy
void as_buffer_destroy(as_buffer * b) {
	if ( b->data ) { 
		cf_free(b->data);
		b->data = 0; 
	}
    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x96db
callq 0x8a00
andq $0x0, 0x8(%rbx)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer_pool.c
// Function: as_buffer_pool_init
int
as_buffer_pool_init(as_buffer_pool* pool, uint32_t header_size, uint32_t buffer_size)
{
	// Initialize empty queue.
	pool->queue = cf_queue_create(sizeof(void*), true);
	pool->header_size = header_size;
	pool->buffer_size = buffer_size;
	return (pool->queue)? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x8
popq %rdi
pushq $0x1
popq %rsi
callq 0x8810
xorl %ecx, %ecx
cmpq $0x1, %rax
movq %rax, (%r14)
movl %ebp, 0x8(%r14)
movl %ebx, 0xc(%r14)
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer_pool.c
// Function: as_buffer_pool_pop
int
as_buffer_pool_pop(as_buffer_pool* pool, uint32_t size, as_buffer_result* buffer)
{
	size += pool->header_size;
	
	if (size > pool->buffer_size) {
		// Requested size is greater than fixed buffer size.
		// Allocate new buffer, but don't put back into pool.
		buffer->data = cf_malloc(size);
		
		if (! buffer->data) {
			return -1;
		}
		
		buffer->capacity = size - pool->header_size;
		return 2;
	}
	
	// Pop existing buffer from queue.
	int rc = cf_queue_pop(pool->queue, &buffer->data, CF_QUEUE_NOWAIT);
	
	if (rc == CF_QUEUE_OK) {
		buffer->capacity = pool->buffer_size - pool->header_size;
		return 0;
	}
	
	if (rc == CF_QUEUE_EMPTY) {
		// Queue is empty.  Create new buffer.  Queue can grow indefinitely.
		buffer->data = cf_malloc(pool->buffer_size);
		
		if (! buffer->data) {
			return -1;
		}
		
		buffer->capacity = pool->buffer_size - pool->header_size;
		return 1;
	}
	// Queue failure.
	return -2;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdx, %rbx
movq %rdi, %r14
addl 0x8(%rdi), %ebp
cmpl 0xc(%rdi), %ebp
jbe 0x9738
movl %ebp, %edi
callq 0x8080
testq %rax, %rax
movq %rax, (%rbx)
je 0x976f
pushq $0x2
popq %rax
jmp 0x9766
movq (%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x8860
testl %eax, %eax
je 0x9762
cmpl $-0x2, %eax
jne 0x9773
movl 0xc(%r14), %edi
callq 0x8080
testq %rax, %rax
movq %rax, (%rbx)
je 0x976f
pushq $0x1
popq %rax
movl 0xc(%r14), %ebp
subl 0x8(%r14), %ebp
movl %ebp, 0x8(%rbx)
jmp 0x9776
pushq $-0x1
jmp 0x9775
pushq $-0x2
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer_pool.c
// Function: as_buffer_pool_push
int
as_buffer_pool_push(as_buffer_pool* pool, void* buffer, uint32_t capacity)
{
	if (capacity + pool->header_size <= pool->buffer_size) {
		// Put buffer back into pool.
		if (cf_queue_push(pool->queue, &buffer) == CF_QUEUE_OK) {
			return 0;
		}
		else {
			cf_free(buffer);
			return -1;
		}
	}
	else {
		// Do not put large buffers back into pool.
		cf_free(buffer);
		return -2;
	}
}

// Assembly:
pushq %rax
movq %rsi, (%rsp)
addl 0x8(%rdi), %edx
cmpl 0xc(%rdi), %edx
jbe 0x9794
movq %rsi, %rdi
callq 0x8a00
pushq $-0x2
jmp 0x97ae
movq (%rdi), %rdi
movq %rsp, %rsi
callq 0x8280
testl %eax, %eax
je 0x97b1
movq (%rsp), %rdi
callq 0x8a00
pushq $-0x1
popq %rax
popq %rcx
retq
xorl %eax, %eax
jmp 0x97af
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer_pool.c
// Function: as_buffer_pool_push_limit
int
as_buffer_pool_push_limit(as_buffer_pool* pool, void* buffer, uint32_t capacity, uint32_t max_buffers)
{
	if (capacity + pool->header_size <= pool->buffer_size) {
		// Put buffer back into pool up to a limit.
		if (cf_queue_push_limit(pool->queue, &buffer, max_buffers)) {
			// Success.
			return 0;
		}
		else {
			cf_free(buffer);
			return -1;
		}
	}
	else {
		// Do not put large buffers back into pool.
		cf_free(buffer);
		return -2;
	}
}

// Assembly:
pushq %rax
movq %rsi, (%rsp)
addl 0x8(%rdi), %edx
cmpl 0xc(%rdi), %edx
jbe 0x97ce
movq %rsi, %rdi
callq 0x8a00
pushq $-0x2
jmp 0x97ee
movq (%rdi), %rdi
movq %rsp, %rsi
movl %ecx, %edx
callq 0x8a40
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
jne 0x97ef
movq (%rsp), %rdi
callq 0x8a00
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer_pool.c
// Function: as_buffer_pool_drop_buffers
int
as_buffer_pool_drop_buffers(as_buffer_pool* pool, int buffer_count)
{
	// Number of buffers in pool may grow too large if burst of concurrent buffer usage happens.
	// Delete buffer_count buffers from pool.
	void* buffer;
	int count = 0;
	
	while (count < buffer_count) {
		if (cf_queue_pop(pool->queue, &buffer, CF_QUEUE_NOWAIT) == CF_QUEUE_OK) {
			cf_free(buffer);
			count++;
		}
		else {
			break;
		}
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebp, %ebp
movl %esi, %ebx
testl %esi, %esi
movq %rdi, %r14
movq %rsp, %r15
cmovlel %ebp, %ebx
cmpl %ebp, %ebx
je 0x982b
movq (%r14), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x8860
testl %eax, %eax
jne 0x9829
movq (%rsp), %rdi
callq 0x8a00
incl %ebp
jmp 0x9807
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_buffer_pool.c
// Function: as_buffer_pool_destroy
void
as_buffer_pool_destroy(as_buffer_pool* pool)
{
	// Empty and destroy queue.
	void* buffer;
	while (cf_queue_pop(pool->queue, &buffer, CF_QUEUE_NOWAIT) == CF_QUEUE_OK) {
		cf_free(buffer);
	}
	cf_queue_destroy(pool->queue);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x8860
testl %eax, %eax
jne 0x985e
movq (%rsp), %rdi
callq 0x8a00
jmp 0x9842
movq (%rbx), %rdi
callq 0x8380
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_cons
static inline as_bytes * as_bytes_cons(
	as_bytes * bytes, bool free, 
	uint32_t capacity, uint32_t size, uint8_t * value, 
	bool value_free, as_bytes_type type)
{
	if ( !bytes ) return bytes;

    as_val_cons((as_val *) bytes, AS_BYTES, free);
    bytes->capacity = capacity;
    bytes->size = size;
    bytes->value = value;
    bytes->free = value_free;
    bytes->type = AS_BYTES_BLOB;

    if ( value == NULL && size == 0 && capacity > 0 ) {
	    bytes->value = cf_calloc(capacity, sizeof(uint8_t));
    }
    
	return bytes;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x98c6
testl %edx, %edx
movb $0x9, 0x4(%rbx)
movb %sil, 0x5(%rbx)
movl $0x1, (%rbx)
movl %edx, 0x8(%rbx)
movl %ecx, 0xc(%rbx)
movq %r8, 0x10(%rbx)
movb %r9b, 0x18(%rbx)
movl $0x4, 0x1c(%rbx)
je 0x98c6
testl %ecx, %ecx
jne 0x98c6
testq %r8, %r8
jne 0x98c6
movl %edx, %edi
pushq $0x1
popq %rsi
callq 0x8960
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_get_var_int
uint32_t as_bytes_get_var_int(const as_bytes * bytes, uint32_t index, uint32_t * value)
{
	uint8_t* begin = bytes->value + index;
	uint8_t* p = begin;
	uint32_t val = 0;
	uint32_t shift = 0;
	uint8_t b;
	
	do {
		b = *p++;
		val |= (b & 0x7F) << shift;
		shift += 7;
	} while ((b & 0x80));
	
	*value = val;
	return (uint32_t)(p - begin);
}

// Assembly:
movl %esi, %esi
xorl %eax, %eax
xorl %ecx, %ecx
addq 0x10(%rdi), %rsi
xorl %edi, %edi
movzbl (%rsi,%rax), %r8d
incq %rax
movl %r8d, %r9d
andl $0x7f, %r9d
shll %cl, %r9d
addl $0x7, %ecx
orl %r9d, %edi
testb %r8b, %r8b
js 0x9981
movl %edi, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_set
bool as_bytes_set(as_bytes * bytes, uint32_t index, const uint8_t * value, uint32_t size)
{
    if ( index + size > bytes->capacity ) return false;
    memcpy(&bytes->value[index], value, size);
    if ( index + size > bytes->size ) {
    	bytes->size = index + size;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %r14d
leal (%rcx,%rsi), %ebp
cmpl %r14d, %ebp
ja 0x99cf
movq %rdi, %rbx
movl %esi, %edi
movl %ecx, %eax
movq %rdx, %rsi
addq 0x10(%rbx), %rdi
movq %rax, %rdx
callq 0x8630
cmpl 0xc(%rbx), %ebp
jbe 0x99cf
movl %ebp, 0xc(%rbx)
cmpl %r14d, %ebp
setbe %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_set_var_int
uint32_t as_bytes_set_var_int(const as_bytes * bytes, uint32_t index, uint32_t value)
{
	uint8_t* begin = bytes->value + index;
	uint8_t* end = bytes->value + bytes->capacity;
	uint8_t* p = begin;
	
	while (p < end && value >= 0x80) {
		*p++ = (uint8_t)(value | 0x80);
		value >>= 7;
	}
	
	if (p < end) {
		*p++ = (uint8_t)value;
		return (uint32_t)(p - begin);
	}
	return 0;
}

// Assembly:
movq 0x10(%rdi), %rax
movl 0x8(%rdi), %edi
movl %esi, %ecx
addq %rax, %rcx
addq %rax, %rdi
pushq $0x1
popq %rsi
cmpq %rdi, %rcx
jae 0x9a09
cmpl $0x80, %edx
jb 0x9a09
movl %edx, %eax
shrl $0x7, %edx
incl %esi
orb $-0x80, %al
movb %al, (%rcx)
incq %rcx
jmp 0x99ec
xorl %eax, %eax
cmpq %rdi, %rcx
jae 0x9a14
movl %esi, %eax
movb %dl, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_ensure
bool as_bytes_ensure(as_bytes * bytes, uint32_t capacity, bool resize)
{
	if ( capacity <= bytes->capacity ) return true;
	if ( !resize ) return false;

	uint8_t * buffer = NULL;

	if ( bytes->free ) {
		// this is a previously cf_malloc'd value
		buffer = cf_realloc(bytes->value, capacity);
		if ( !buffer ) {
			// allocation failed, so return false.
			return false;
		}
	}
	else {
		// this is a previously stack alloc'd value
		buffer = cf_malloc(capacity);
		if ( !buffer ) {
			// allocation failed, so return false.
			return false;
		}
		// copy the bytes
		memcpy(buffer, bytes->value, bytes->size);
	}

	bytes->free = true;
	bytes->value = buffer;
	bytes->capacity = capacity;

	return true;
}

// Assembly:
cmpl %esi, 0x8(%rdi)
setae %al
xorb $0x1, %dl
orb %al, %dl
jne 0x9ac6
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x1, 0x18(%rdi)
movl %esi, %ebx
movq %rdi, %r14
jne 0x9a8f
movq 0x10(%r14), %rdi
movl %ebx, %esi
callq 0x8540
movq %rax, %r15
testq %rax, %rax
jne 0x9aae
jmp 0x9abf
movl %ebx, %edi
callq 0x8080
testq %rax, %rax
je 0x9abf
movq 0x10(%r14), %rsi
movl 0xc(%r14), %edx
movq %rax, %rdi
movq %rax, %r15
callq 0x8630
movb $0x1, %al
movb $0x1, 0x18(%r14)
movq %r15, 0x10(%r14)
movl %ebx, 0x8(%r14)
jmp 0x9ac1
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_val_hashcode
uint32_t as_bytes_val_hashcode(const as_val * v)
{
    as_bytes * bytes = as_bytes_fromval(v);
    if ( bytes == NULL || bytes->value == NULL ) return 0;
    uint32_t hash = 0;
    uint8_t * buf = bytes->value;
    int len = bytes->size;
    while ( len-- ) {
        int b = *buf++;
        hash = b + (hash << 6) + (hash << 16) - hash;
    }
    return hash;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x9b16
cmpb $0x9, 0x4(%rdi)
jne 0x9b16
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x9b16
movl 0xc(%rdi), %edx
xorl %eax, %eax
subl $0x1, %edx
jb 0x9b16
movzbl (%rcx), %esi
imull $0x1003f, %eax, %eax    # imm = 0x1003F
incq %rcx
addl %esi, %eax
jmp 0x9b01
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_to_string
bool
as_bytes_to_string(const uint8_t* bytes, uint32_t bytes_size, char* str, uint32_t str_size)
{
	// Ensure hex string has enough space including null terminator.
	if ((bytes_size * 2 + 1) > str_size) {
		if (str_size > 0) {
			*str = 0;
		}
		return false;
	}

	while (bytes_size > 0) {
		uint8_t b = *bytes++;
		*str++ = as_hex_chars[(b >> 4) & 0xf];
		*str++ = as_hex_chars[b & 0xf];
		bytes_size--;
	}
	*str = 0;
	return true;
}

// Assembly:
leal (%rsi,%rsi), %eax
cmpl %ecx, %eax
jae 0x9bd7
movq 0x14425(%rip), %r8      # 0x1dfd0
subl $0x1, %esi
jb 0x9bdb
movzbl (%rdi), %r9d
incq %rdi
movl %r9d, %r10d
andl $0xf, %r9d
shrl $0x4, %r10d
movb (%r8,%r10), %r10b
movb %r10b, (%rdx)
movb (%r8,%r9), %r9b
movb %r9b, 0x1(%rdx)
addq $0x2, %rdx
jmp 0x9bab
testl %ecx, %ecx
je 0x9bde
movb $0x0, (%rdx)
cmpl %ecx, %eax
setb %al
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_to_string_with_prefix
bool
as_bytes_to_string_with_prefix(
	const uint8_t* bytes, uint32_t bytes_size, char* str, uint32_t str_size
	)
{
	if (as_bytes_to_string(bytes, bytes_size, str + 2, str_size - 2)) {
		*str++ = '0';
		*str = 'x';
		return true;
	}

	if (str_size > 0) {
		*str = 0;
	}
	return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %rbx
addq $0x2, %rdx
leal -0x2(%r14), %ecx
callq 0x80d0
testb %al, %al
je 0x9c06
movw $0x7830, (%rbx)         # imm = 0x7830
jmp 0x9c0e
testl %r14d, %r14d
je 0x9c0e
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq