LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: get_occ
customInt *get_occ(solidBlockFile *s) {
  customInt *occ = s->occList;  // try occlist
  if(occ == NULL) {
    occ = malloc(s->occ_size* sizeof(customInt));
    if(occ==NULL) die("Out of mem in get_occ()");
  }
  else { // update list occList
    customInt **n = (customInt **) occ;
    s->occList = n[0];
  }
  return occ;  
}

// Assembly:
pushq %rax
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x679b
movq (%rax), %rcx
movq %rcx, 0x20(%rdi)
jmp 0x67bb
movslq 0x10(%rdi), %rdi
shlq $0x3, %rdi
callq 0xc70e
testq %rax, %rax
jne 0x67bb
leaq 0x91f6(%rip), %rdi      # 0xf9aa
callq 0x39fc
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: get_smallocc
smallSolidInt *get_smallocc(solidBlockFile *s) {
  smallSolidInt *occ = s->smallOccList;  // try smallOcclist
  if(occ == NULL) {
    occ = malloc(s->occ_size* sizeof(smallSolidInt));
    if(occ==NULL) die("Out of mem in get_smallocc()");
  }
  else { // update list occList
    smallSolidInt **n = (smallSolidInt **) occ;
    s->smallOccList = n[0];
  }
  return occ;  
}

// Assembly:
pushq %rax
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x67d0
movq (%rax), %rcx
movq %rcx, 0x28(%rdi)
jmp 0x67ef
movslq 0x10(%rdi), %rdi
addq %rdi, %rdi
callq 0xc70e
testq %rax, %rax
jne 0x67ef
leaq 0x91da(%rip), %rdi      # 0xf9c2
callq 0x39fc
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: finalize_liquid
solidBlock *finalize_liquid(solidBlock *last, liquidBlock *b, solidBlock *next, solidBlockFile *sf)
{
  assert(!b->empty);
  if(last!=NULL && last->endsAt==b->beginsAt) {
    // merge b into last and empty it 
    merge_liquid(b,last,sf);  // last and next do not change
  }
  else if(b->endsAt-b->beginsAt>= b->solid_limit) {
    // create new solid and empty b which becomes last block 
    solidBlock *s = liquidToSolid(b,sf);  
    s->nextBlock = next;
    if(last!=NULL) writeBlock(last,sf); // it was: last->nextBlock = s;
    last = s;
  }
  else { // nothing to do, just empty b
    b->empty = true;
    memset(b->occ, 0, (b->occ_size) * sizeof(customInt));
  }
  assert(b->empty);
  return last;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rsi), %rax
testq %rdi, %rdi
je 0x686f
cmpq %rax, 0x8(%rbx)
jne 0x686f
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6967
jmp 0x695a
movq 0x8(%r12), %rcx
subq %rax, %rcx
movslq 0x28(%r12), %rax
cmpq %rax, %rcx
jae 0x68a1
movb $0x1, 0x2c(%r12)
movq 0x20(%r12), %rdi
movslq 0x18(%r12), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2150
jmp 0x695a
movq %r14, %rdi
callq 0x6755
movq %rax, %r13
movq (%r12), %rax
movq %rax, (%r13)
movq 0x8(%r12), %rcx
movq %rcx, 0x8(%r13)
subq %rax, %rcx
movq %r14, %rdi
cmpq $0xffff, %rcx           # imm = 0xFFFF
ja 0x68fc
callq 0x67bd
movq %rax, 0x10(%r13)
movslq 0x18(%r12), %rax
testq %rax, %rax
jle 0x692a
movq 0x20(%r12), %rcx
xorl %edx, %edx
movzwl (%rcx,%rdx,8), %esi
movq 0x10(%r13), %rdi
movw %si, (%rdi,%rdx,2)
incq %rdx
cmpq %rdx, %rax
jne 0x68e6
jmp 0x692a
callq 0x6788
movq %rax, 0x10(%r13)
movslq 0x18(%r12), %rax
testq %rax, %rax
jle 0x692a
movq 0x20(%r12), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq 0x10(%r13), %rdi
movq %rsi, (%rdi,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x6916
movb $0x1, 0x2c(%r12)
movq 0x20(%r12), %rdi
movslq %eax, %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2150
movq %r15, 0x18(%r13)
testq %rbx, %rbx
je 0x6957
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6a18
movq %r13, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: merge_liquid
static void merge_liquid(liquidBlock *b, solidBlock *s, solidBlockFile *sf) {
  assert(!b->empty);
  // --- merge occs. 
  if((s->endsAt - s->beginsAt) + (b->endsAt - b->beginsAt) <= SMALLSOLID_LIMIT){
    for (int c = 0; c < b->occ_size; ++c) // merged block is small 
      s->smallOcc[c] += (smallSolidInt) b->occ[c];
  } 
  else {
    if((s->endsAt - s->beginsAt)<= SMALLSOLID_LIMIT)
      block_inflate(s,sf);       // enlarge if required 
    for (int c = 0; c < b->occ_size; ++c) 
      s->occ[c] += b->occ[c];
  }
  // --- update extremes
  if(b->endsAt==s->beginsAt)
    s->beginsAt = b->beginsAt;  // liquid before solid
  else {
    assert(s->endsAt==b->beginsAt); // solid before liquid
    s->endsAt = b->endsAt;
  }
  // --- clear b
  b->empty = true;
  memset(b->occ, 0, (b->occ_size) * sizeof(customInt));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movq 0x8(%rdi), %rcx
addq %rax, %rcx
subq (%rdi), %rcx
cmpq $0xffff, %rcx           # imm = 0xFFFF
ja 0x69b0
movslq 0x18(%rbx), %rax
testq %rax, %rax
jle 0x69e6
movq 0x20(%rbx), %rcx
xorl %edx, %edx
movzwl (%rcx,%rdx,8), %esi
movq 0x10(%r14), %rdi
addw %si, (%rdi,%rdx,2)
incq %rdx
cmpq %rdx, %rax
jne 0x699a
jmp 0x69e6
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x69c3
movq %r14, %rdi
movq %rdx, %rsi
callq 0xb82c
movslq 0x18(%rbx), %rax
testq %rax, %rax
jle 0x69e6
movq 0x20(%rbx), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq 0x10(%r14), %rdi
addq %rsi, (%rdi,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x69d2
movq 0x8(%rbx), %rcx
cmpq (%r14), %rcx
jne 0x69f7
movq (%rbx), %rcx
movq %rcx, (%r14)
jmp 0x69fb
movq %rcx, 0x8(%r14)
movb $0x1, 0x2c(%rbx)
movq 0x20(%rbx), %rdi
movslq %eax, %rdx
shlq $0x3, %rdx
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: tba_alloc
uint64_t *tba_alloc(customInt n, bool mmapB)
{
  uint64_t *a;
  customInt j = (n+31)/32;
  if(mmapB) {
    a = mmap(NULL,j*sizeof(*a),PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
    if(a== MAP_FAILED) die(__func__);
  }
  else {
    a = calloc(j,sizeof(*a));
    if(a==NULL) die(__func__);
  }
  return a;
}

// Assembly:
pushq %rbx
movq %rdi, %rax
addq $0x1f, %rax
shrq $0x5, %rax
testl %esi, %esi
je 0x6bf7
shlq $0x3, %rax
xorl %edi, %edi
movq %rax, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x2230
cmpq $-0x1, %rax
jne 0x6c09
movq $-0x1, %rbx
jmp 0x6c10
movl $0x8, %esi
movq %rax, %rdi
callq 0xc860
testq %rax, %rax
je 0x6c0e
movq %rax, %rbx
jmp 0x6c1c
xorl %ebx, %ebx
leaq 0x8dc8(%rip), %rdi      # 0xf9df
callq 0x39fc
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: tba_free
void tba_free(uint64_t *a, customInt n, bool mmap)
{
  if(mmap) {
    customInt j = (n+31)/32;
    int e = munmap(a,j*sizeof(*a));
    if(e!=0) die(__func__);
  }
  else free(a);
}

// Assembly:
testl %edx, %edx
je 0xc7ba
pushq %rax
addq $0x1f, %rsi
shrq $0x2, %rsi
andq $-0x8, %rsi
callq 0x2290
testl %eax, %eax
leaq 0x8(%rsp), %rsp
je 0x6c50
leaq 0x8d9e(%rip), %rdi      # 0xf9e9
jmp 0x39fc
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./merge8.h
// Function: init_arrays8
static void init_arrays8(g_data *g)
{
  assert(g->numBwt<=8);
  customInt i=0; // position inside Z newZ and B  

  for(int j=0;j<g->sizeOfAlpha;j++) {
    tba_or_m8(g->mergeColor,i,1);
    g->firstColumn[j] = i;  // symbol j starts at position i
    for(int b=0;b<g->numBwt;b++) {
      for(customInt t=0;t<g->bwtOcc[b][j];t++) {
        if(j==0)   // zero chars are all different, Z are newZ do not change 
          tba_or_m8(g->mergeColor,i,1);
        g->mergeColor[i++] |= b*9;      // write b in both cur and next
      } // end for t
    } // end for b 
  } // end for j
  assert(i==g->mergeLen); 
  // extra check on mergeColor, can be commented out
  #ifndef NDEBUG
  customInt cnt[MAX_NUMBER_OF_BWTS] = {0};
  for(i=0;i<g->mergeLen;i++) cnt[g->mergeColor[i]&0x7]++;
  bool stop=false;
  for(int i=0; i<g->numBwt; i++)
    if(cnt[i]!=g->bwtLen[i]) {
      printf("INIT %d cnt:"CUSTOM_FORMAT" len:"CUSTOM_FORMAT"\n",i,cnt[i],g->bwtLen[i]);
      stop=true;
    }
  assert(!stop);
  #endif
}

// Assembly:
cmpl $0x0, 0x38(%rdi)
jle 0x7338
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x50e8(%rdi), %rdx
orb $0x40, (%rdx,%rcx)
movq 0x5108(%rdi), %rdx
movq %rcx, (%rdx,%rax,8)
movl 0x20(%rdi), %r8d
testl %r8d, %r8d
jle 0x7328
movq 0x18(%rdi), %rsi
xorl %edx, %edx
movq (%rsi,%rdx,8), %r9
cmpq $0x0, (%r9,%rax,8)
je 0x731d
leal (%rdx,%rdx,8), %r8d
xorl %r9d, %r9d
testq %rax, %rax
jne 0x72f7
movq 0x50e8(%rdi), %rsi
addq %rcx, %rsi
orb $0x40, (%r9,%rsi)
movq 0x50e8(%rdi), %rsi
addq %rcx, %rsi
orb %r8b, (%r9,%rsi)
incq %r9
movq 0x18(%rdi), %rsi
movq (%rsi,%rdx,8), %r10
cmpq (%r10,%rax,8), %r9
jb 0x72e3
movl 0x20(%rdi), %r8d
addq %r9, %rcx
incq %rdx
movslq %r8d, %r9
cmpq %r9, %rdx
jl 0x72d1
incq %rax
movslq 0x38(%rdi), %rdx
cmpq %rdx, %rax
jl 0x72ac
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./merge16.h
// Function: init_arrays16
static void init_arrays16(g_data *g)
{
  assert(g->numBwt<=16);
  customInt i=0; // position inside Z newZ and B  

  for(int j=0;j<g->sizeOfAlpha;j++) {
    if(g->bwtOnly) tba_or_m(g->bitB,i,1);
    else g->blockBeginsAt[i]=1;  // start of symbol j, correct lcp is 0
    g->firstColumn[j] = i;  // symbol j starts at position i    
    for(int b=0;b<g->numBwt;b++) {
      for(customInt t=0;t<g->bwtOcc[b][j];t++) {
        if(j==0) { // zero chars are all different, Z are newZ do not change 
          if(g->bwtOnly) tba_or_m(g->bitB,i,1);
          else g->blockBeginsAt[i]=1;  
        }
        g->mergeColor[i++] = b*17;      // write b in both cur and next
      } // end for t
    } // end for b 
  } // end for j
  assert(i==g->mergeLen);
  // extra check on mergeColor, can be commented out
  #ifndef NDEBUG
  customInt cnt[MAX_NUMBER_OF_BWTS] = {0};
  for(i=0;i<g->mergeLen;i++) cnt[g->mergeColor[i]&0xF]++;
  bool stop=false;
  for(int i=0; i<g->numBwt; i++)
    if(cnt[i]!=g->bwtLen[i]) {
      printf("INIT %d cnt:"CUSTOM_FORMAT" len:"CUSTOM_FORMAT"\n",i,cnt[i],g->bwtLen[i]);
      stop=true;
    }
  assert(!stop);
  #endif
}

// Assembly:
cmpl $0x0, 0x38(%rdi)
jle 0x7f90
pushq %r14
pushq %rbx
xorl %eax, %eax
xorl %edx, %edx
movq 0x98(%rdi), %rsi
cmpb $0x1, 0x3c(%rdi)
jne 0x7ecf
movq %rdx, %r8
leal (%rdx,%rdx), %ecx
movl $0x1, %r9d
shlq %cl, %r9
shrq $0x5, %r8
orq %r9, (%rsi,%r8,8)
jmp 0x7ed3
movb $0x1, (%rsi,%rdx)
movq 0x5108(%rdi), %rcx
movq %rdx, (%rcx,%rax,8)
movl 0x20(%rdi), %r8d
testl %r8d, %r8d
jle 0x7f7d
movq 0x18(%rdi), %rcx
xorl %esi, %esi
movq (%rcx,%rsi,8), %r9
cmpq $0x0, (%r9,%rax,8)
je 0x7f6e
movl %esi, %r8d
shll $0x4, %r8d
addl %esi, %r8d
leaq (%rdx,%rdx), %r10
xorl %r9d, %r9d
testq %rax, %rax
jne 0x7f44
movq 0x98(%rdi), %r11
cmpb $0x1, 0x3c(%rdi)
jne 0x7f3c
leaq (%rdx,%r9), %rbx
movl %r10d, %ecx
andb $0x3e, %cl
movl $0x1, %r14d
shlq %cl, %r14
shrq $0x5, %rbx
orq %r14, (%r11,%rbx,8)
jmp 0x7f44
addq %rdx, %r11
movb $0x1, (%r9,%r11)
movq 0x50e8(%rdi), %rcx
addq %rdx, %rcx
movb %r8b, (%r9,%rcx)
incq %r9
movq 0x18(%rdi), %rcx
movq (%rcx,%rsi,8), %r11
addq $0x2, %r10
cmpq (%r11,%rax,8), %r9
jb 0x7f0d
movl 0x20(%rdi), %r8d
addq %r9, %rdx
incq %rsi
movslq %r8d, %r9
cmpq %r9, %rsi
jl 0x7ef1
incq %rax
movslq 0x38(%rdi), %rcx
cmpq %rcx, %rax
jl 0x7ea9
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./merge128.h
// Function: init_arrays128
static void init_arrays128(g_data *g)
{
  assert(g->numBwt<=128);
  customInt i=0; // position inside Z newZ and B  

  for(int j=0;j<g->sizeOfAlpha;j++) {
    tba_or_m16(g->mergeColor16,i,1);
    g->firstColumn[j] = i;  // symbol j starts at position i
    for(int b=0;b<g->numBwt;b++) {
      for(customInt t=0;t<g->bwtOcc[b][j];t++) {
        if(j==0)   // zero chars are all different, Z are newZ do not change 
          tba_or_m16(g->mergeColor16,i,1);
        g->mergeColor16[i++] |= b*129;      // write b in both cur and next
      } // end for t
    } // end for b 
  } // end for j
  assert(i==g->mergeLen); 
  // extra check on mergeColor, can be commented out
  #ifndef NDEBUG
  customInt cnt[MAX_NUMBER_OF_BWTS] = {0};
  for(i=0;i<g->mergeLen;i++) cnt[g->mergeColor16[i]&0x7F]++;
  bool stop=false;
  for(int i=0; i<g->numBwt; i++)
    if(cnt[i]!=g->bwtLen[i]) {
      printf("INIT %d cnt:"CUSTOM_FORMAT" len:"CUSTOM_FORMAT"\n",i,cnt[i],g->bwtLen[i]);
      stop=true;
    }
  assert(!stop);
  #endif
}

// Assembly:
movslq 0x38(%rdi), %rax
testq %rax, %rax
jle 0x8b81
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x50f8(%rdi), %rcx
movq 0x5108(%rdi), %rdx
movl 0x20(%rdi), %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
orb $0x40, 0x1(%rcx,%r9,2)
movq %r9, (%rdx,%r8,8)
testl %esi, %esi
jle 0x8b73
movq 0x18(%rdi), %r10
xorl %r11d, %r11d
movq (%r10,%r11,8), %rbx
movq (%rbx,%r8,8), %rbx
testq %rbx, %rbx
je 0x8b6b
movl %r11d, %ebp
shll $0x7, %ebp
addl %r11d, %ebp
movzwl (%rcx,%r9,2), %r14d
movl %r14d, %r15d
orl $0x4000, %r15d          # imm = 0x4000
testq %r8, %r8
cmovnel %r14d, %r15d
orl %ebp, %r15d
movw %r15w, (%rcx,%r9,2)
incq %r9
decq %rbx
jne 0x8b45
incq %r11
cmpq %rsi, %r11
jne 0x8b2f
incq %r8
cmpq %rax, %r8
jne 0x8b1a
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./merge256.h
// Function: init_arrays256
static void init_arrays256(g_data *g)
{
  assert(g->numBwt<=256);
  customInt i=0; // position inside Z newZ and B  

  for(int j=0;j<g->sizeOfAlpha;j++) {
    set_blockBeginsAt(i,1);   // start of symbol j, correct lcp is 0
    g->firstColumn[j] = i;    // symbol j starts at position i    
    for(int b=0;b<g->numBwt;b++) {
      for(customInt t=0;t<g->bwtOcc[b][j];t++) {
        if(j==0)  // zero chars are all different, Z are newZ do not change 
          set_blockBeginsAt(i,1);  
        g->array32[i++] |= b*257;      // write b in both cur and next
      } // end for t
    } // end for b 
  } // end for j
  assert(i==g->mergeLen);
  // extra check on mergeColor, can be commented out
  #ifndef NDEBUG
  customInt cnt[MAX_NUMBER_OF_BWTS] = {0};
  for(i=0;i<g->mergeLen;i++) cnt[g->array32[i]&0xFF]++;
  bool stop=false;
  for(int i=0; i<g->numBwt; i++)
    if(cnt[i]!=g->bwtLen[i]) {
      printf("INIT %d cnt:"CUSTOM_FORMAT" len:"CUSTOM_FORMAT"\n",i,cnt[i],g->bwtLen[i]);
      stop=true;
    }
  assert(!stop);
  #endif
}

// Assembly:
cmpl $0x0, 0x38(%rdi)
jle 0xa370
pushq %rbp
pushq %rbx
movq 0x5100(%rdi), %rax
movq 0x5108(%rdi), %rcx
xorl %edx, %edx
xorl %esi, %esi
movw $0x1, 0x2(%rax,%rsi,4)
movq %rsi, (%rcx,%rdx,8)
movl 0x20(%rdi), %r10d
testl %r10d, %r10d
jle 0xa362
movq 0x18(%rdi), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r11
movq (%r11,%rdx,8), %r11
testq %r11, %r11
je 0xa357
movl %r9d, %r10d
shll $0x8, %r10d
addl %r9d, %r10d
movl (%rax,%rsi,4), %ebx
movzwl %bx, %ebp
orl $0x10000, %ebp          # imm = 0x10000
testq %rdx, %rdx
cmovnel %ebx, %ebp
orl %r10d, %ebp
movl %ebp, (%rax,%rsi,4)
incq %rsi
decq %r11
jne 0xa333
movl 0x20(%rdi), %r10d
incq %r9
movslq %r10d, %r11
cmpq %r11, %r9
jl 0xa31c
incq %rdx
movslq 0x38(%rdi), %r8
cmpq %r8, %rdx
jl 0xa301
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: block_inflate
static void block_inflate(solidBlock *b, solidBlockFile *s) {
  assert(b->endsAt - b->beginsAt <= SMALLSOLID_LIMIT);
  customInt *bigOcc = get_occ(s);
  for (int i = 0; i < s->occ_size; ++i) {
    bigOcc[i] = (customInt) b->smallOcc[i];
  }
  free_smallocc(b->smallOcc,s);
  b->occ = bigOcc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x6788
movslq 0x10(%r14), %rcx
testq %rcx, %rcx
jle 0xb85d
xorl %edx, %edx
movq 0x10(%rbx), %rsi
movzwl (%rsi,%rdx,2), %esi
movq %rsi, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0xb849
movq 0x10(%rbx), %rcx
movq 0x28(%r14), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x28(%r14)
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: readBlock
static solidBlock *readBlock(solidBlockFile *sf) 
{
  if(sf->fin==NULL) return NULL;
  // read size of block
  customInt buffer[SIZE_OF_ALPHABET+MAX_NUMBER_OF_BWTS];
  int e = fread(buffer,sizeof(customInt),2,sf->fin);
  if(e==0) return NULL; // no more blocks
  if(e!=2) die("tmp file read error in readBlock (1)");
  // ----- get solid block from s->solidList or malloc
  solidBlock *newB = get_block(sf);  
  newB->beginsAt = buffer[0];
  newB->endsAt = buffer[1];
  // printf("Reading [%ld %ld]\n",newB->beginsAt,newB->endsAt); //!!!!!!
  // --- get and init occ/smallOcc array
  if (newB->endsAt - newB->beginsAt <= SMALLSOLID_LIMIT) {
    // small solid block
    newB->smallOcc = get_smallocc(sf);
    e = fread(newB->smallOcc,sizeof(smallSolidInt),sf->occ_size,sf->fin);
    if(e!=sf->occ_size) die("tmp file read error in readBlock (2)");
  }
  else { // large solid block 
    newB->occ = get_occ(sf);
    memset(newB->occ,0,sf->occ_size*sizeof(customInt));// zero all values
    uint8_t *byteBuffer = (uint8_t *) buffer; // transform to an uint8_t buffer
    e = fread(byteBuffer,POS_SIZE,sf->occ_size,sf->fin); // read POS_SIZE bytes for customInt
    if(e!=sf->occ_size) die("tmp file read error in readBlock (3)");
    // fill newB->occ using five bytes for entry
    for(int j=0;j<sf->occ_size;j++) {
      for(int i=0;i<POS_SIZE;i++) 
        newB->occ[j] |= ((customInt) byteBuffer[j*POS_SIZE+i]) << (8*i);  
    }
  }
  newB->nextBlock=NULL;
  return newB;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq (%rdi), %rcx
testq %rcx, %rcx
je 0xb91c
movq %rdi, %r14
movq %rsp, %rdi
movl $0x8, %esi
movl $0x2, %edx
callq 0x20a0
testl %eax, %eax
je 0xb91c
cmpl $0x2, %eax
je 0xb8ba
leaq 0x47f5(%rip), %rdi      # 0x100aa
callq 0x39fc
movq %r14, %rdi
callq 0x6755
movq %rax, %rbx
movq (%rsp), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rbx)
subq %rax, %rcx
movq %r14, %rdi
cmpq $0xffff, %rcx           # imm = 0xFFFF
ja 0xb923
callq 0x67bd
movq %rax, 0x10(%rbx)
movslq 0x10(%r14), %rdx
movq (%r14), %rcx
movl $0x2, %esi
movq %rax, %rdi
callq 0x20a0
cmpl %eax, 0x10(%r14)
je 0xb99f
leaq 0x47bd(%rip), %rdi      # 0x100cf
callq 0x39fc
jmp 0xb99f
xorl %ebx, %ebx
jmp 0xb9a7
callq 0x6788
movq %rax, 0x10(%rbx)
movslq 0x10(%r14), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2150
movslq 0x10(%r14), %rdx
movq (%r14), %rcx
movq %rsp, %r15
movl $0x5, %esi
movq %r15, %rdi
callq 0x20a0
cmpl %eax, 0x10(%r14)
je 0xb96b
leaq 0x4792(%rip), %rdi      # 0x100f4
callq 0x39fc
movl 0x10(%r14), %eax
testl %eax, %eax
jle 0xb99f
movl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %rsi
movzbl (%rsi), %edi
shlq %cl, %rdi
movq 0x10(%rbx), %r8
orq %rdi, (%r8,%rdx,8)
incq %rsi
addq $0x8, %rcx
cmpq $0x28, %rcx
jne 0xb978
incq %rdx
addq $0x5, %r15
cmpq %rax, %rdx
jne 0xb973
movq $0x0, 0x18(%rbx)
movq %rbx, %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/mergegap.c
// Function: open_merge_files
static void open_merge_files(g_data *g) {
  assert(g->extMem);
  // mergeColor file for reading (Z in pseudocode)
  g->fmergeColor = fopen(g->merge_fname,"rb");
  if(!g->fmergeColor) die("merge_open");
  #ifndef NDEBUG
  customInt c[256] = {0}; // init to zero
  for(customInt i = 0; i < g->mergeLen; i++) {
    int col=fread_color(g->fmergeColor);
    col &= 0x7F;
    assert(col>=0 && col<g->numBwt);
    c[col]++;
  }
  for(int i=0;i<g->numBwt;i++) 
    assert(c[i]==g->bwtLen[i]);
  rewind(g->fmergeColor);
  #endif
  // alphaSize-1 newMergeColor cwriters for writing (newZ in pseudocode)
  int fd = open(g->newmerge_fname,O_WRONLY);
  if(fd == -1) die("new_merge_open");
  g->fnewMergeColor = malloc(g->sizeOfAlpha*sizeof(cwriter));
  if(g->fnewMergeColor==NULL) die("new_merge_alloc");
  g->fnewMergeColor[0].fd = -1; // invalid file descriptor
  for(int i=1; i< g->sizeOfAlpha; i++)
    cwriter_init(&g->fnewMergeColor[i],fd,COLOR_WBUFFER_SIZE, g->firstColumn[i]*sizeof(palette));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50d8(%rdi), %rdi
leaq 0x3a73(%rip), %rsi      # 0xf816
callq 0x21e0
movq %rax, 0x50c8(%rbx)
testq %rax, %rax
jne 0xbdc0
leaq 0x444d(%rip), %rdi      # 0x10208
callq 0x39fc
movq 0x50e0(%rbx), %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x22f0
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0xbde6
leaq 0x4423(%rip), %rdi      # 0x10204
callq 0x39fc
movslq 0x38(%rbx), %r14
movq %r14, %rdi
shlq $0x5, %rdi
callq 0xc70e
movq %rax, 0x50d0(%rbx)
testq %rax, %rax
jne 0xbe19
leaq 0x440a(%rip), %rdi      # 0x10213
callq 0x39fc
movq 0x50d0(%rbx), %rax
movl 0x38(%rbx), %r14d
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
cmpl $0x2, %r14d
jl 0xbe62
movl $0x1, %r14d
movl $0x20, %r15d
movq 0x50d0(%rbx), %rdi
addq %r15, %rdi
movq 0x5108(%rbx), %rax
movq (%rax,%r14,8), %rcx
movl $0x100000, %edx         # imm = 0x100000
movl %ebp, %esi
callq 0x6022
incq %r14
movslq 0x38(%rbx), %rax
addq $0x20, %r15
cmpq %rax, %r14
jl 0xbe31
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/mergegap.c
// Function: fread_color
static int fread_color(FILE *f) {
  int b=0;
  int e = fread(&b,sizeof(palette),1,f);
  if(e!=1) die(__func__);
  return b;
}

// Assembly:
pushq %rax
movq %rdi, %rcx
leaq 0x4(%rsp), %rdi
movl $0x0, (%rdi)
movl $0x1, %esi
movl $0x1, %edx
callq 0x20a0
cmpl $0x1, %eax
je 0xbe9c
leaq 0x438c(%rip), %rdi      # 0x10223
callq 0x39fc
movl 0x4(%rsp), %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/mergegap.c
// Function: close_merge_files
static void close_merge_files(g_data *g) {
  assert(g->extMem);
  // close new merge files
  for(int i=1; i< g->sizeOfAlpha; i++) 
    cwriter_close(&g->fnewMergeColor[i]);
  close(g->fnewMergeColor[1].fd); // close file   
  free(g->fnewMergeColor);
  // close merge file
  int e = fclose(g->fmergeColor);
  if(e!=0) die("merge_close");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x2, 0x38(%rdi)
jl 0xbedb
movl $0x1, %r14d
movl $0x20, %r15d
movq 0x50d0(%rbx), %rdi
addq %r15, %rdi
callq 0x6006
incq %r14
movslq 0x38(%rbx), %rax
addq $0x20, %r15
cmpq %rax, %r14
jl 0xbebc
movq 0x50d0(%rbx), %rax
movl 0x20(%rax), %edi
callq 0x2160
movq 0x50d0(%rbx), %rdi
callq 0xc7ba
movq 0x50c8(%rbx), %rdi
callq 0x20e0
testl %eax, %eax
je 0xbf17
leaq 0x434d(%rip), %rdi      # 0x1025a
popq %rbx
popq %r14
popq %r15
jmp 0x39fc
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/mergehm.c
// Function: init_arrays
static void init_arrays(g_data *g)
{
  customInt i=0; // position inside Z newZ and B 
  for(int j=0;j<g->sizeOfAlpha;j++) {
    if(!g->bwtOnly) g->blockBeginsAt[i]=1;
    g->firstColumn[j] = i;                    // symbol j starts at position i
    for(int b=0;b<g->numBwt;b++)         // scan all occs of symbol j
      for(customInt t=0;t<g->bwtOcc[b][j];t++) {
        if(j==0) { // zero chars are all different, Z are newZ do not change 
          assert(j==0);     // no sqeezing: only zero char is zero
          if(!g->bwtOnly) g->blockBeginsAt[i]=1;
          g->newMergeColor[i]=b;          //for 0-chars write b to both Z and newZ 
        }
        g->mergeColor[i++] = b;
      }
  }
  assert(i==g->mergeLen);
  // extra check on mergeColor, can be commented out
  #ifndef NDEBUG
  customInt cnt[MAX_NUMBER_OF_BWTS] = {0};
  for(i=0;i<g->mergeLen;i++) cnt[g->mergeColor[i]]++;
  bool stop=false;
  for(int i=0; i<g->numBwt; i++)
    if(cnt[i]!=g->bwtLen[i]) {
      printf("INIT %d cnt:"CUSTOM_FORMAT" len:"CUSTOM_FORMAT"\n",i,cnt[i],g->bwtLen[i]);
      stop=true;
    }
  assert(!stop);
  #endif
}

// Assembly:
cmpl $0x0, 0x38(%rdi)
jle 0xc2bd
xorl %eax, %eax
xorl %ecx, %ecx
cmpb $0x0, 0x3c(%rdi)
jne 0xc22c
movq 0x98(%rdi), %rdx
movb $0x1, (%rdx,%rcx)
movq 0x5108(%rdi), %rdx
movq %rcx, (%rdx,%rax,8)
movl 0x20(%rdi), %r8d
testl %r8d, %r8d
jle 0xc2ad
movq 0x18(%rdi), %rsi
xorl %edx, %edx
movq (%rsi,%rdx,8), %r9
cmpq $0x0, (%r9,%rax,8)
je 0xc2a2
xorl %r9d, %r9d
testq %rax, %rax
jne 0xc27c
cmpb $0x0, 0x3c(%rdi)
jne 0xc26e
movq 0x98(%rdi), %rsi
addq %rcx, %rsi
movb $0x1, (%r9,%rsi)
movq 0x50f0(%rdi), %rsi
addq %rcx, %rsi
movb %dl, (%r9,%rsi)
movq 0x50e8(%rdi), %rsi
addq %rcx, %rsi
movb %dl, (%r9,%rsi)
incq %r9
movq 0x18(%rdi), %rsi
movq (%rsi,%rdx,8), %r8
cmpq (%r8,%rax,8), %r9
jb 0xc254
movl 0x20(%rdi), %r8d
addq %r9, %rcx
incq %rdx
movslq %r8d, %r9
cmpq %r9, %rdx
jl 0xc246
incq %rax
movslq 0x38(%rdi), %rdx
cmpq %rdx, %rax
jl 0xc21b
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/alphabet.c
// Function: init_freq
void init_freq(symbol *b, customInt n, customInt *freq)
{
  for(int i=0;i<SIZE_OF_ALPHABET;i++)
    freq[i]=0;
  for(customInt i=0;i<n;i++)
    freq[b[i]]++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2150
testq %r14, %r14
je 0xc4d1
xorl %eax, %eax
movzbl (%r15,%rax), %ecx
incq (%rbx,%rcx,8)
incq %rax
cmpq %rax, %r14
jne 0xc4c0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/alphabet.c
// Function: init_alpha_maps
int init_alpha_maps(g_data *g)
{
  
  // init maps with illegal value -1
  for(int i=0;i<SIZE_OF_ALPHABET;i++)
    alphabet_map[i]=restricted_unmap[i] = ILLEGAL_SYMBOL;

  // compute frequencies of the input symbols
  customInt freq[SIZE_OF_ALPHABET];
  customInt n = g->mergeLen;
  init_freq(g->bws[0],n,freq); // complete scan of bws[0][0..n]
  // compute maps
  int j=0;
  for(int i=0;i<SIZE_OF_ALPHABET;i++)
    if(freq[i]!=0) {
      alphabet_map[i] = j;
      restricted_unmap[j++] = i;
    }
  return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movq %rdi, %r15
leaq 0x7d17(%rip), %rbx      # 0x14220
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0xff, %esi
callq 0x2150
leaq 0x80fe(%rip), %r14      # 0x14620
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movl $0xff, %esi
callq 0x2150
movq (%r15), %rax
movq 0x28(%r15), %r12
movq (%rax), %r13
movq %rsp, %rdi
xorl %r15d, %r15d
movl $0x800, %edx            # imm = 0x800
xorl %esi, %esi
callq 0x2150
testq %r12, %r12
je 0xc569
xorl %eax, %eax
movzbl (%r13,%rax), %ecx
incq (%rsp,%rcx,8)
incq %rax
cmpq %rax, %r12
jne 0xc557
xorl %eax, %eax
cmpq $0x0, (%rsp,%rax,8)
je 0xc57e
movl %r15d, (%r14)
movslq %r15d, %rcx
incl %r15d
movl %eax, (%rbx,%rcx,4)
incq %rax
addq $0x4, %r14
cmpq $0x100, %rax            # imm = 0x100
jne 0xc56b
movl %r15d, %eax
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/alphabet.c
// Function: remap_bwts
void remap_bwts(g_data *g)
{
  int sizeOfAlphabet; // size of alphabet
  
  // remap alphabet, remap bwts and compute occ 
  sizeOfAlphabet = init_alpha_maps(g);
  assert(sizeOfAlphabet>1 && sizeOfAlphabet<= SIZE_OF_ALPHABET);
  if(g->verbose>0) printf("Alphabet size: %d\n", sizeOfAlphabet);
  
  // remap; also compute Occs for each BWT if smallAlpha
  if(g->smallAlpha) {
    g->bwtOcc = malloc(g->numBwt*sizeof(customInt *));
    if(!g->bwtOcc) die(__func__);
    g->bwtOcc[0] = calloc(g->numBwt*sizeOfAlphabet,sizeof(customInt));
   if(!g->bwtOcc[0]) die(__func__);
  }  
  for(int i=0;i<g->numBwt;i++) {
    customInt *bwtOcc = NULL;
    if(g->smallAlpha) { // if the alphabet is small keep bwtOcc[i]
      if(i>0) g->bwtOcc[i] = g->bwtOcc[i-1] + sizeOfAlphabet;
      bwtOcc = g->bwtOcc[i];
    }
    remap_string(g->bws[i],g->bwtLen[i],bwtOcc);
  }
  g->sizeOfAlpha = sizeOfAlphabet;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xc4ef
movl %eax, %ebp
cmpl $0x0, 0x94(%rbx)
jle 0xc5e7
leaq 0x22c1(%rip), %rdi      # 0xe89f
movl %ebp, %esi
xorl %eax, %eax
callq 0x2100
cmpb $0x1, 0x68(%rbx)
jne 0xc64a
movslq 0x20(%rbx), %r15
leaq (,%r15,8), %rdi
callq 0xc70e
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xc60c
movq %rax, %r14
jmp 0xc620
leaq 0x3d4a(%rip), %rdi      # 0x1035d
callq 0x39fc
movl 0x20(%rbx), %r15d
movq 0x18(%rbx), %r14
imull %ebp, %r15d
movslq %r15d, %rdi
movl $0x8, %esi
callq 0xc860
movq %rax, (%r14)
movq 0x18(%rbx), %rax
cmpq $0x0, (%rax)
jne 0xc64a
leaq 0x3d18(%rip), %rdi      # 0x1035d
callq 0x39fc
movl 0x20(%rbx), %esi
testl %esi, %esi
jle 0xc6cf
movslq %ebp, %rax
xorl %ecx, %ecx
shlq $0x3, %rax
leaq 0x7fbf(%rip), %rdx      # 0x14620
cmpb $0x1, 0x68(%rbx)
jne 0xc686
movq 0x18(%rbx), %rdi
testq %rcx, %rcx
je 0xc680
movq -0x8(%rdi,%rcx,8), %r8
addq %rax, %r8
movq %r8, (%rdi,%rcx,8)
movq 0x18(%rbx), %rdi
movq (%rdi,%rcx,8), %rdi
jmp 0xc688
xorl %edi, %edi
movq 0x8(%rbx), %r8
movq (%r8,%rcx,8), %r8
testq %r8, %r8
je 0xc6c4
movq (%rbx), %rsi
movq (%rsi,%rcx,8), %rsi
xorl %r9d, %r9d
movzbl (%rsi,%r9), %r10d
movl (%rdx,%r10,4), %r10d
movb %r10b, (%rsi,%r9)
testq %rdi, %rdi
je 0xc6b9
movzbl %r10b, %r10d
incq (%rdi,%r10,8)
incq %r9
cmpq %r9, %r8
jne 0xc69f
movl 0x20(%rbx), %esi
incq %rcx
movslq %esi, %rdi
cmpq %rdi, %rcx
jl 0xc661
movl %ebp, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/malloc_count/malloc_count.c
// Function: malloc
extern void* malloc(size_t size)
{
    void* ret;

    if (size == 0) return NULL;

    if (real_malloc)
    {
        /* call read malloc procedure in libc */
        ret = (*real_malloc)(alignment + size);

        inc_count(size);
        if (log_operations && size >= log_operations_threshold) {
            fprintf(stderr, PPREFIX "malloc(%'lld) = %p   (current %'lld)\n",
                    (long long)size, (char*)ret + alignment, curr);
        }

        /* prepend allocation size and check sentinel */
        *(size_t*)ret = size;
        *(size_t*)((char*)ret + alignment - sizeof(size_t)) = sentinel;

        return (char*)ret + alignment;
    }
    else
    {
        if (init_heap_use + alignment + size > INIT_HEAP_SIZE) {
            fprintf(stderr, PPREFIX "init heap full !!!\n");
            exit(EXIT_FAILURE);
        }

        ret = init_heap + init_heap_use;
        init_heap_use += alignment + size;

        /* prepend allocation size and check sentinel */
        *(size_t*)ret = size;
        *(size_t*)((char*)ret + alignment - sizeof(size_t)) = sentinel;

        if (log_operations_init_heap) {
            fprintf(stderr, PPREFIX "malloc(%'lld) = %p   on init heap\n",
                    (long long)size, (char*)ret + alignment);
        }

        return (char*)ret + alignment;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xc76c
movq %rdi, %rbx
movq 0x831f(%rip), %rax      # 0x14a40
testq %rax, %rax
je 0xc771
leaq 0x10(%rbx), %rdi
callq *%rax
movq %rbx, %rsi
lock
xaddq %rsi, 0x82e8(%rip)      # 0x14a20
movq %rax, %r14
addq %rbx, %rsi
cmpq 0x82e3(%rip), %rsi      # 0x14a28
jle 0xc74e
movq %rsi, 0x82da(%rip)      # 0x14a28
addq %rbx, 0x10830b(%rip)    # 0x114a60
movq 0x82d4(%rip), %rax      # 0x14a30
testq %rax, %rax
je 0xc79a
movq 0x82d0(%rip), %rdi      # 0x14a38
callq *%rax
jmp 0xc79a
xorl %r14d, %r14d
jmp 0xc7aa
movq 0x82d0(%rip), %rax      # 0x14a48
leaq (%rbx,%rax), %rcx
addq $0x10, %rcx
cmpq $0x100001, %rcx         # imm = 0x100001
jae 0xc7b5
leaq 0x82c0(%rip), %r14      # 0x14a50
addq %rax, %r14
movq %rcx, 0x82ae(%rip)      # 0x14a48
movq %rbx, (%r14)
movl $0xdeadc0de, %eax       # imm = 0xDEADC0DE
movq %rax, 0x8(%r14)
addq $0x10, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2673
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/threads.c
// Function: pc_system_init
void pc_system_init(pc_system *pc, int buf_size)
{
  pc->buf_size = buf_size; 
  pc->pindex=0;
  pc->cindex=0;
  pc->free_slots = xsem_create_destroy(NULL,buf_size,__LINE__,__FILE__);
  pc->ready = xsem_create_destroy(NULL,0,__LINE__,__FILE__);
  int e = pthread_mutex_init(&(pc->cmutex),NULL);
  if(e) die(__func__);
  // re condition variable and related mutex
  e = pthread_mutex_init(&(pc->remutex),NULL);
  if(e) die(__func__);
  e = pthread_cond_init(&(pc->recond),NULL);
  if(e) die(__func__);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x48(%rdi)
movq $0x0, (%rdi)
xorl %edi, %edi
movl $0x7f, %edx
callq 0xcb2f
movq %rax, 0x30(%rbx)
xorl %edi, %edi
xorl %esi, %esi
movl $0x80, %edx
callq 0xcb2f
movq %rax, 0x38(%rbx)
leaq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x23d0
testl %eax, %eax
je 0xcaf3
leaq 0x39cd(%rip), %rdi      # 0x104bb
callq 0x39fc
leaq 0x50(%rbx), %rdi
xorl %esi, %esi
callq 0x23d0
testl %eax, %eax
je 0xcb0e
leaq 0x39b2(%rip), %rdi      # 0x104bb
callq 0x39fc
addq $0x78, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2220
testl %eax, %eax
je 0xcb2d
leaq 0x3994(%rip), %rdi      # 0x104bb
popq %rbx
jmp 0x39fc
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/threads.c
// Function: pc_system_destroy
void pc_system_destroy(pc_system *pc)
{
  assert(pc->pindex==pc->cindex);  
  int e = pthread_cond_destroy(&(pc->recond));
  if(e) die(__func__);
  e = pthread_mutex_destroy(&(pc->remutex));
  if(e) die(__func__);
  e = pthread_mutex_destroy(&(pc->cmutex));
  if(e) die(__func__);
  xsem_create_destroy(pc->ready,0,__LINE__,__FILE__);
  xsem_create_destroy(pc->free_slots,0,__LINE__,__FILE__);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x78, %rdi
callq 0x2310
testl %eax, %eax
je 0xcbb1
leaq 0x391e(%rip), %rdi      # 0x104ca
callq 0x39fc
leaq 0x50(%rbx), %rdi
callq 0x2130
testl %eax, %eax
je 0xcbca
leaq 0x3905(%rip), %rdi      # 0x104ca
callq 0x39fc
leaq 0x8(%rbx), %rdi
callq 0x2130
testl %eax, %eax
je 0xcbe3
leaq 0x38ec(%rip), %rdi      # 0x104ca
callq 0x39fc
movq 0x38(%rbx), %rdi
xorl %esi, %esi
movl $0x94, %edx
callq 0xcb2f
movq 0x30(%rbx), %rdi
xorl %esi, %esi
movl $0x95, %edx
popq %rbx
jmp 0xcb2f
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_clear_errors
void
kmip_clear_errors(KMIP *ctx)
{
    if(ctx == NULL)
    {
        return;
    }
    
    for(size_t i = 0; i < ARRAY_LENGTH(ctx->errors); i++)
    {
        ctx->errors[i] = (ErrorFrame){{0},0};
    }
    ctx->frame_index = ctx->errors;
    
    if(ctx->error_message != NULL)
    {
        ctx->free_func(ctx->state, ctx->error_message);
        ctx->error_message = NULL;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x782a
pushq %rbx
movq %rdi, %rbx
leaq 0x38(%rdi), %rax
movl $0x38, %ecx
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx,%rcx)
movups %xmm0, 0x40(%rbx,%rcx)
movups %xmm0, 0x30(%rbx,%rcx)
movups %xmm0, 0x20(%rbx,%rcx)
movups %xmm0, 0x10(%rbx,%rcx)
movups %xmm0, (%rbx,%rcx)
movq $0x0, 0x60(%rbx,%rcx)
addq $0x68, %rcx
cmpq $0x858, %rcx            # imm = 0x858
jne 0x77d1
movq %rax, 0x860(%rbx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x7829
movq 0x890(%rbx), %rdi
callq *0x878(%rbx)
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_init
void
kmip_init(KMIP *ctx, void *buffer, size_t buffer_size, enum kmip_version v)
{
    if(ctx == NULL)
    {
        return;
    }
    
    ctx->buffer = (uint8 *)buffer;
    ctx->index = ctx->buffer;
    ctx->size = buffer_size;
    ctx->version = v;
    
    if(ctx->calloc_func == NULL)
    {
        ctx->calloc_func = &kmip_calloc;
    }
    if(ctx->realloc_func == NULL)
    {
        ctx->realloc_func = &kmip_realloc;
    }
    if(ctx->memset_func == NULL)
    {
        ctx->memset_func = &kmip_memset;
    }
    if(ctx->free_func == NULL)
    {
        ctx->free_func = &kmip_free;
    }
    if(ctx->memcpy_func == NULL)
        ctx->memcpy_func = &kmip_memcpy;
    
    ctx->max_message_size = 8192;
    ctx->error_message_size = 200;
    ctx->error_message = NULL;
    
    ctx->error_frame_count = 20;
    
    ctx->credential_list = ctx->calloc_func(ctx->state, 1, sizeof(LinkedList));
    
    kmip_clear_errors(ctx);
}

// Assembly:
testq %rdi, %rdi
je 0x793b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl %ecx, 0x18(%rdi)
movq 0x868(%rdi), %rax
testq %rax, %rax
jne 0x7863
movq 0x1f764(%rip), %rax     # 0x26fc0
movq %rax, 0x868(%rbx)
cmpq $0x0, 0x870(%rbx)
jne 0x787b
movq 0x1f73c(%rip), %rcx     # 0x26fb0
movq %rcx, 0x870(%rbx)
cmpq $0x0, 0x888(%rbx)
jne 0x7893
movq 0x1f754(%rip), %rcx     # 0x26fe0
movq %rcx, 0x888(%rbx)
cmpq $0x0, 0x878(%rbx)
jne 0x78ab
movq 0x1f72c(%rip), %rcx     # 0x26fd0
movq %rcx, 0x878(%rbx)
cmpq $0x0, 0x880(%rbx)
jne 0x78c3
movq 0x1f71c(%rip), %rcx     # 0x26fd8
movq %rcx, 0x880(%rbx)
movl $0x2000, 0x1c(%rbx)     # imm = 0x2000
movq $0xc8, 0x30(%rbx)
movq $0x0, 0x28(%rbx)
movq $0x14, 0x858(%rbx)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *%rax
movq %rax, 0x20(%rbx)
leaq 0x38(%rbx), %r14
movl $0x820, %edx            # imm = 0x820
movq %r14, %rdi
xorl %esi, %esi
callq 0x6490
movq %r14, 0x860(%rbx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x7934
movq 0x890(%rbx), %rdi
callq *0x878(%rbx)
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_add_credential
int
kmip_add_credential(KMIP *ctx, Credential *cred)
{
    if(ctx == NULL || cred == NULL)
    {
        return(KMIP_UNSET);
    }
    
    LinkedListItem *item = ctx->calloc_func(ctx->state, 1, sizeof(LinkedListItem));
    if(item != NULL)
    {
        item->data = cred;
        kmip_linked_list_push(ctx->credential_list, item);
        return(KMIP_OK);
    }
    
    return(KMIP_UNSET);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0x79dd
movq %rsi, %r15
movq %rdi, %r14
movq 0x890(%rdi), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%r14)
testq %rax, %rax
je 0x79dd
movq %r15, 0x10(%rax)
movq 0x20(%r14), %rcx
xorl %ebx, %ebx
testq %rcx, %rcx
je 0x79dd
movq (%rcx), %rdx
movq %rax, (%rcx)
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
incq 0x10(%rcx)
testq %rdx, %rdx
je 0x79d2
movq %rax, 0x8(%rdx)
cmpq $0x0, 0x8(%rcx)
jne 0x79dd
movq %rax, 0x8(%rcx)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_remove_credentials
void
kmip_remove_credentials(KMIP *ctx)
{
    if(ctx == NULL)
    {
        return;
    }
    
    LinkedListItem *item = kmip_linked_list_pop(ctx->credential_list);
    while(item != NULL)
    {
        ctx->memset_func(item, 0, sizeof(LinkedListItem));
        ctx->free_func(ctx->state, item);
        
        item = kmip_linked_list_pop(ctx->credential_list);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x7a3a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x65a0
testq %rax, %rax
je 0x7a33
movq %rax, %r14
movl $0x18, %edx
movq %r14, %rdi
xorl %esi, %esi
callq *0x888(%rbx)
movq 0x890(%rbx), %rdi
movq %r14, %rsi
callq *0x878(%rbx)
movq 0x20(%rbx), %rdi
callq 0x65a0
movq %rax, %r14
testq %rax, %rax
jne 0x7a02
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_reset
void
kmip_reset(KMIP *ctx)
{
    if(ctx == NULL)
    {
        return;
    }
    
    if(ctx->buffer != NULL)
    {
        kmip_memset(ctx->buffer, 0, ctx->size);
    }
    ctx->index = ctx->buffer;
    
    kmip_clear_errors(ctx);
}

// Assembly:
testq %rdi, %rdi
je 0x7aa4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x7a5f
movq 0x10(%rbx), %rdx
xorl %esi, %esi
callq 0x6e10
movq (%rbx), %rax
jmp 0x7a61
xorl %eax, %eax
movq %rax, 0x8(%rbx)
leaq 0x38(%rbx), %r14
movl $0x820, %edx            # imm = 0x820
movq %r14, %rdi
xorl %esi, %esi
callq 0x6490
movq %r14, 0x860(%rbx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x7a9d
movq 0x890(%rbx), %rdi
callq *0x878(%rbx)
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_rewind
void
kmip_rewind(KMIP *ctx)
{
    if(ctx == NULL)
    {
        return;
    }
    
    ctx->index = ctx->buffer;
    
    kmip_clear_errors(ctx);
}

// Assembly:
testq %rdi, %rdi
je 0x7af7
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq %rax, 0x8(%rdi)
leaq 0x38(%rdi), %r14
movl $0x820, %edx            # imm = 0x820
movq %r14, %rdi
xorl %esi, %esi
callq 0x6490
movq %r14, 0x860(%rbx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x7af0
movq 0x890(%rbx), %rdi
callq *0x878(%rbx)
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_destroy
void
kmip_destroy(KMIP *ctx)
{
    if(ctx == NULL)
    {
        return;
    }
    
    kmip_reset(ctx);
    kmip_set_buffer(ctx, NULL, 0);

    kmip_remove_credentials(ctx);
    ctx->memset_func(ctx->credential_list, 0, sizeof(LinkedList));
    ctx->free_func(ctx->state, ctx->credential_list);
    
    ctx->calloc_func = NULL;
    ctx->realloc_func = NULL;
    ctx->memset_func = NULL;
    ctx->free_func = NULL;
    ctx->memcpy_func = NULL;
    ctx->state = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x7b68
pushq %rbx
movq %rdi, %rbx
callq 0x6250
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rdi
callq 0x6610
movq 0x20(%rbx), %rdi
movl $0x18, %edx
xorl %esi, %esi
callq *0x888(%rbx)
movq 0x890(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *0x878(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x888(%rbx)
movups %xmm0, 0x878(%rbx)
movups %xmm0, 0x868(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_push_error_frame
void
kmip_push_error_frame(KMIP *ctx, const char *function, const int line)
{
    if(ctx == NULL)
    {
        return;
    }
    
    for(size_t i = 0; i < 20; i++)
    {
        ErrorFrame *frame = &ctx->errors[i];
        if(frame->line == 0)
        {
            ctx->frame_index = frame;
            strncpy(frame->function, function, sizeof(frame->function) - 1);
            frame->line = line;
            break;
        }
    }
}

// Assembly:
testq %rdi, %rdi
je 0x7bba
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
addq $0x38, %rdi
xorl %r15d, %r15d
cmpl $0x0, 0x9c(%r14,%r15)
je 0x7b99
addq $0x68, %r15
cmpq $0x820, %r15            # imm = 0x820
jne 0x7b7f
jmp 0x7bb5
addq %r15, %rdi
movq %rdi, 0x860(%r14)
movl $0x63, %edx
callq 0x60c0
movl %ebx, 0x9c(%r14,%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_set_enum_error_message
void
kmip_set_enum_error_message(KMIP *ctx, enum tag t, int value, int result)
{
    if(ctx == NULL)
    {
        return;
    }
    
    switch(result)
    {
        /* TODO (ph) Update error message for KMIP version 2.0+ */
        case KMIP_INVALID_FOR_VERSION:
        kmip_init_error_message(ctx);
        snprintf(ctx->error_message, ctx->error_message_size, "KMIP 1.%d does not support %s enumeration value (%d)", ctx->version, kmip_attribute_names[kmip_get_enum_string_index(t)], value);
        break;
        
        default: /* KMIP_ENUM_MISMATCH */
        kmip_init_error_message(ctx);
        snprintf(ctx->error_message, ctx->error_message_size, "Invalid %s enumeration value (%d)", kmip_attribute_names[kmip_get_enum_string_index(t)], value);
        break;
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x7c39
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x28(%rdi), %r15
cmpl $-0xb, %ecx
jne 0x7c42
testq %r15, %r15
jne 0x7bfb
movq 0x890(%r14), %rdi
movq 0x30(%r14), %rsi
movl $0x1, %edx
callq *0x868(%r14)
movq %rax, %r15
movq %rax, 0x28(%r14)
movq 0x30(%r14), %r12
movl 0x18(%r14), %r14d
movl %ebp, %edi
callq 0x6290
movl %eax, %eax
leaq 0x1f0fd(%rip), %rcx     # 0x26d10
movq (%rcx,%rax,8), %r8
leaq 0x18312(%rip), %rdx     # 0x1ff30
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %ecx
movl %ebx, %r9d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
jne 0x7c65
movq 0x890(%r14), %rdi
movq 0x30(%r14), %rsi
movl $0x1, %edx
callq *0x868(%r14)
movq %rax, %r15
movq %rax, 0x28(%r14)
movq 0x30(%r14), %r14
movl %ebp, %edi
callq 0x6290
movl %eax, %eax
leaq 0x1f097(%rip), %rcx     # 0x26d10
movq (%rcx,%rax,8), %rcx
leaq 0x182e1(%rip), %rdx     # 0x1ff65
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %r8d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6400
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_set_alloc_error_message
void
kmip_set_alloc_error_message(KMIP *ctx, size_t size, const char *type)
{
    if(ctx == NULL)
    {
        return;
    }
    
    kmip_init_error_message(ctx);
    snprintf(ctx->error_message, ctx->error_message_size, "Could not allocate %zd bytes for a %s", size, type);
}

// Assembly:
testq %rdi, %rdi
je 0x7cf3
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
jne 0x7cd6
movq 0x890(%r15), %rdi
movq 0x30(%r15), %rsi
movl $0x1, %edx
callq *0x868(%r15)
movq %rax, %rdi
movq %rax, 0x28(%r15)
movq 0x30(%r15), %rsi
leaq 0x182a6(%rip), %rdx     # 0x1ff87
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x6400
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_set_error_message
void
kmip_set_error_message(KMIP *ctx, const char *message)
{
    if(ctx == NULL)
    {
        return;
    }
    
    kmip_init_error_message(ctx);
    snprintf(ctx->error_message, ctx->error_message_size, "%s", message);
}

// Assembly:
testq %rdi, %rdi
je 0x7d46
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
jne 0x7d2a
movq 0x890(%r14), %rdi
movq 0x30(%r14), %rsi
movl $0x1, %edx
callq *0x868(%r14)
movq %rax, %rdi
movq %rax, 0x28(%r14)
movq 0x30(%r14), %rsi
leaq 0x18275(%rip), %rdx     # 0x1ffaa
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6400
retq
// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_get_num_items_next
size_t
kmip_get_num_items_next(KMIP *ctx, enum tag t)
{
    if(ctx == NULL)
    {
        return(0);
    }
    
    size_t count = 0;
    
    uint8 *index = ctx->index;
    uint32 length = 0;
    
    while((ctx->size - (uint64)(ctx->index - ctx->buffer)) > 8)
    {
        if(kmip_is_tag_next(ctx, t))
        {
            ctx->index += 4;
            
            length = 0;
            length |= ((int32)*ctx->index++ << 24);
            length |= ((int32)*ctx->index++ << 16);
            length |= ((int32)*ctx->index++ << 8);
            length |= ((int32)*ctx->index++ << 0);
            length += CALCULATE_PADDING(length);
            
            if((ctx->size - (ctx->index - ctx->buffer)) >= length)
            {
                ctx->index += length;
                count++;
            }
            else
            {
                break;
            }
        }
        else
        {
            break;
        }
    }
    
    ctx->index = index;
    return(count);
}

// Assembly:
testq %rdi, %rdi
je 0x7e98
pushq %rbx
movq (%rdi), %rdx
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %r8
movq %r8, %rax
subq %rcx, %rax
addq %rdx, %rax
cmpq $0x9, %rax
jb 0x7e9b
xorl %eax, %eax
movq %rcx, %r10
movq %rcx, %r9
movq %r8, %r11
subq %r10, %r11
addq %rdx, %r11
cmpq $0x3, %r11
jb 0x7e9d
movzbl (%r9), %r10d
shll $0x10, %r10d
movzbl 0x1(%r9), %r11d
shll $0x8, %r11d
orl %r10d, %r11d
movzbl 0x2(%r9), %r10d
orl %r11d, %r10d
cmpl %esi, %r10d
jne 0x7e9d
leaq 0x5(%r9), %r10
movq %r10, 0x8(%rdi)
movzbl 0x4(%r9), %r10d
shll $0x18, %r10d
leaq 0x6(%r9), %r11
movq %r11, 0x8(%rdi)
movzbl 0x5(%r9), %r11d
shll $0x10, %r11d
orl %r10d, %r11d
leaq 0x7(%r9), %r10
movq %r10, 0x8(%rdi)
movzbl 0x6(%r9), %ebx
shll $0x8, %ebx
orl %r11d, %ebx
leaq 0x8(%r9), %r10
movq %r10, 0x8(%rdi)
movzbl 0x7(%r9), %r9d
orl %r9d, %ebx
negl %r9d
andl $0x7, %r9d
addl %ebx, %r9d
movq %r8, %r11
subq %r10, %r11
addq %rdx, %r11
cmpq %r9, %r11
jb 0x7e9d
addq %r9, %r10
movq %r10, 0x8(%rdi)
incq %rax
movq %r8, %r11
subq %r10, %r11
addq %rdx, %r11
movq %r10, %r9
cmpq $0x8, %r11
ja 0x7dde
jmp 0x7e9d
xorl %eax, %eax
retq
xorl %eax, %eax
movq %rcx, 0x8(%rdi)
popq %rbx
retq