LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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
testq %rdi, %rdi
je 0x67a3
movq 0x8(%rbx), %rax
cmpq (%r12), %rax
jne 0x67a3
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x689e
jmp 0x6891
movq 0x8(%r12), %rax
subq (%r12), %rax
movslq 0x28(%r12), %rcx
cmpq %rcx, %rax
jae 0x67d6
movb $0x1, 0x2c(%r12)
movq 0x20(%r12), %rdi
movslq 0x18(%r12), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2150
jmp 0x6891
movq %r14, %rdi
callq 0x6688
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 0x6831
callq 0x66f0
movq %rax, 0x10(%r13)
movslq 0x18(%r12), %rax
testq %rax, %rax
jle 0x685f
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 0x681b
jmp 0x685f
callq 0x66bb
movq %rax, 0x10(%r13)
movslq 0x18(%r12), %rax
testq %rax, %rax
jle 0x685f
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 0x684b
movb $0x1, 0x2c(%r12)
movq 0x20(%r12), %rdi
movslq 0x18(%r12), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2150
movq %r15, 0x18(%r13)
testq %rbx, %rbx
je 0x688e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6950
movq %r13, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x68e7
movslq 0x18(%rbx), %rax
testq %rax, %rax
jle 0x691d
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 0x68d1
jmp 0x691d
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x68fa
movq %r14, %rdi
movq %rdx, %rsi
callq 0xb796
movslq 0x18(%rbx), %rax
testq %rax, %rax
jle 0x691d
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 0x6909
movq 0x8(%rbx), %rax
cmpq (%r14), %rax
jne 0x692e
movq (%rbx), %rax
movq %rax, (%r14)
jmp 0x6932
movq %rax, 0x8(%r14)
movb $0x1, 0x2c(%rbx)
movq 0x20(%rbx), %rdi
movslq 0x18(%rbx), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O1/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 0x6b2f
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 0x6b41
movq $-0x1, %rbx
jmp 0x6b48
movl $0x8, %esi
movq %rax, %rdi
callq 0xc78c
testq %rax, %rax
je 0x6b46
movq %rax, %rbx
jmp 0x6b54
xorl %ebx, %ebx
leaq 0x8e90(%rip), %rdi      # 0xf9df
callq 0x3973
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc6e6
pushq %rax
addq $0x1f, %rsi
shrq $0x2, %rsi
andq $-0x8, %rsi
callq 0x2290
testl %eax, %eax
leaq 0x8(%rsp), %rsp
je 0x6b88
leaq 0x8e66(%rip), %rdi      # 0xf9e9
jmp 0x3973
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7264
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x50e8(%rdi), %rdx
orb $0x40, (%rdx,%rcx)
movq 0x5108(%rdi), %rdx
movq %rcx, (%rdx,%rax,8)
cmpl $0x0, 0x20(%rdi)
jle 0x7254
xorl %edx, %edx
movq 0x18(%rdi), %rsi
movq (%rsi,%rdx,8), %rsi
cmpq $0x0, (%rsi,%rax,8)
je 0x7248
leal (%rdx,%rdx,8), %esi
xorl %r8d, %r8d
testq %rax, %rax
jne 0x7226
movq 0x50e8(%rdi), %r9
addq %rcx, %r9
orb $0x40, (%r8,%r9)
movq 0x50e8(%rdi), %r9
addq %rcx, %r9
orb %sil, (%r8,%r9)
incq %r8
movq 0x18(%rdi), %r9
movq (%r9,%rdx,8), %r9
cmpq (%r9,%rax,8), %r8
jb 0x7212
addq %r8, %rcx
incq %rdx
movslq 0x20(%rdi), %rsi
cmpq %rsi, %rdx
jl 0x71fd
incq %rax
movslq 0x38(%rdi), %rdx
cmpq %rdx, %rax
jl 0x71df
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7ec6
pushq %r14
pushq %rbx
xorl %eax, %eax
xorl %edx, %edx
cmpb $0x1, 0x3c(%rdi)
jne 0x7dfd
movq 0x98(%rdi), %rsi
movq %rdx, %r8
leal (%rdx,%rdx), %ecx
movl $0x1, %r9d
shlq %cl, %r9
shrq $0x5, %r8
orq %r9, (%rsi,%r8,8)
jmp 0x7e08
movq 0x98(%rdi), %rcx
movb $0x1, (%rcx,%rdx)
movq 0x5108(%rdi), %rcx
movq %rdx, (%rcx,%rax,8)
cmpl $0x0, 0x20(%rdi)
jle 0x7eb3
xorl %esi, %esi
movq 0x18(%rdi), %rcx
movq (%rcx,%rsi,8), %rcx
cmpq $0x0, (%rcx,%rax,8)
je 0x7ea3
movl %esi, %r8d
shll $0x4, %r8d
addl %esi, %r8d
leaq (%rdx,%rdx), %r9
xorl %r10d, %r10d
testq %rax, %rax
jne 0x7e7d
cmpb $0x1, 0x3c(%rdi)
jne 0x7e6e
leaq (%rdx,%r10), %r11
movq 0x98(%rdi), %rbx
movl %r9d, %ecx
andb $0x3e, %cl
movl $0x1, %r14d
shlq %cl, %r14
shrq $0x5, %r11
orq %r14, (%rbx,%r11,8)
jmp 0x7e7d
movq 0x98(%rdi), %rcx
addq %rdx, %rcx
movb $0x1, (%r10,%rcx)
movq 0x50e8(%rdi), %rcx
addq %rdx, %rcx
movb %r8b, (%r10,%rcx)
incq %r10
movq 0x18(%rdi), %rcx
movq (%rcx,%rsi,8), %rcx
addq $0x2, %r9
cmpq (%rcx,%rax,8), %r10
jb 0x7e3f
addq %r10, %rdx
incq %rsi
movslq 0x20(%rdi), %rcx
cmpq %rcx, %rsi
jl 0x7e1f
incq %rax
movslq 0x38(%rdi), %rcx
cmpq %rcx, %rax
jl 0x7dd7
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8ac3
pushq %rbp
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 0x8ab9
movq 0x18(%rdi), %r10
xorl %r11d, %r11d
movq (%r10,%r11,8), %rbx
movq (%rbx,%r8,8), %rbx
testq %rbx, %rbx
je 0x8ab1
movl %r11d, %ebp
shll $0x7, %ebp
addl %r11d, %ebp
testq %r8, %r8
jne 0x8aa4
orb $0x40, 0x1(%rcx,%r9,2)
orw %bp, (%rcx,%r9,2)
incq %r9
decq %rbx
jne 0x8a99
incq %r11
cmpq %rsi, %r11
jne 0x8a83
incq %r8
cmpq %rax, %r8
jne 0x8a6e
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa288
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)
cmpl $0x0, 0x20(%rdi)
jle 0xa27c
movq 0x18(%rdi), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r10
movq (%r10,%rdx,8), %r10
testq %r10, %r10
je 0xa270
movl %r9d, %r11d
shll $0x8, %r11d
addl %r9d, %r11d
testq %rdx, %rdx
jne 0xa264
movw $0x1, 0x2(%rax,%rsi,4)
orl %r11d, (%rax,%rsi,4)
incq %rsi
decq %r10
jne 0xa258
incq %r9
movslq 0x20(%rdi), %r10
cmpq %r10, %r9
jl 0xa241
incq %rdx
movslq 0x38(%rdi), %r8
cmpq %r8, %rdx
jl 0xa229
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x66bb
movslq 0x10(%r14), %rcx
testq %rcx, %rcx
jle 0xb7c7
xorl %edx, %edx
movq 0x10(%rbx), %rsi
movzwl (%rsi,%rdx,2), %esi
movq %rsi, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0xb7b3
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_O1/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 0xb886
movq %rdi, %r14
movq %rsp, %rdi
movl $0x8, %esi
movl $0x2, %edx
callq 0x20a0
testl %eax, %eax
je 0xb886
cmpl $0x2, %eax
je 0xb824
leaq 0x488b(%rip), %rdi      # 0x100aa
callq 0x3973
movq %r14, %rdi
callq 0x6688
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 0xb88d
callq 0x66f0
movq %rax, 0x10(%rbx)
movslq 0x10(%r14), %rdx
movq (%r14), %rcx
movl $0x2, %esi
movq %rax, %rdi
callq 0x20a0
cmpl %eax, 0x10(%r14)
je 0xb908
leaq 0x4853(%rip), %rdi      # 0x100cf
callq 0x3973
jmp 0xb908
xorl %ebx, %ebx
jmp 0xb910
callq 0x66bb
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 0xb8d1
leaq 0x4828(%rip), %rdi      # 0x100f4
callq 0x3973
movslq 0x10(%r14), %rax
testq %rax, %rax
jle 0xb908
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 0xb8e1
incq %rdx
addq $0x5, %r15
cmpq %rax, %rdx
jne 0xb8dc
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_O1/felipelouza[P]egap/./blocks.h
// Function: add_proto2liquid
static void add_proto2liquid(protoBlock *proto,liquidBlock *liquid)
{
  assert(liquid->endsAt==proto->beginsAt);
  assert(proto->endsAt>proto->beginsAt+1);
  liquid->endsAt=proto->endsAt;
  // update color occurrences
  assert(proto->color==proto->lastColor); 
  liquid->occ[proto->color] += (proto->endsAt-proto->beginsAt);
  // update alpha occurences 
  for(int i=0;i<proto->endsAt-proto->beginsAt;i++)
    liquid->occ[liquid->numBwt + (proto->start)[i]] +=1;
  liquid->empty = false;
}

// Assembly:
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rsi)
subq (%rdi), %rcx
movq 0x20(%rsi), %rax
movslq 0x1c(%rdi), %rdx
addq %rcx, (%rax,%rdx,8)
movq 0x8(%rdi), %rcx
cmpq (%rdi), %rcx
je 0xb966
movslq 0x10(%rsi), %rcx
movq 0x10(%rdi), %rdx
xorl %r8d, %r8d
movzbl (%rdx,%r8), %r9d
addq %rcx, %r9
incq (%rax,%r9,8)
incq %r8
movq 0x8(%rdi), %r9
subq (%rdi), %r9
cmpq %r8, %r9
ja 0xb94b
movb $0x0, 0x2c(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3b1b(%rip), %rsi      # 0xf816
callq 0x21e0
movq %rax, 0x50c8(%rbx)
testq %rax, %rax
jne 0xbd18
leaq 0x44f5(%rip), %rdi      # 0x10208
callq 0x3973
movq 0x50e0(%rbx), %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x22f0
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0xbd3e
leaq 0x44cb(%rip), %rdi      # 0x10204
callq 0x3973
movslq 0x38(%rbx), %rdi
shlq $0x5, %rdi
callq 0xc63a
movq %rax, 0x50d0(%rbx)
testq %rax, %rax
jne 0xbd63
leaq 0x44b5(%rip), %rdi      # 0x10213
callq 0x3973
movq 0x50d0(%rbx), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
cmpl $0x2, 0x38(%rbx)
jl 0xbdb3
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 0x5f5e
incq %r14
movslq 0x38(%rbx), %rax
addq $0x20, %r15
cmpq %rax, %r14
jl 0xbd82
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbded
leaq 0x443b(%rip), %rdi      # 0x10223
callq 0x3973
movl 0x4(%rsp), %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbe2c
movl $0x1, %r14d
movl $0x20, %r15d
movq 0x50d0(%rbx), %rdi
addq %r15, %rdi
callq 0x5f42
incq %r14
movslq 0x38(%rbx), %rax
addq $0x20, %r15
cmpq %rax, %r14
jl 0xbe0d
movq 0x50d0(%rbx), %rax
movl 0x20(%rax), %edi
callq 0x2160
movq 0x50d0(%rbx), %rdi
callq 0xc6e6
movq 0x50c8(%rbx), %rdi
callq 0x20e0
testl %eax, %eax
je 0xbe68
leaq 0x43fc(%rip), %rdi      # 0x1025a
popq %rbx
popq %r14
popq %r15
jmp 0x3973
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xc1fe
xorl %eax, %eax
xorl %ecx, %ecx
cmpb $0x0, 0x3c(%rdi)
jne 0xc174
movq 0x98(%rdi), %rdx
movb $0x1, (%rdx,%rcx)
movq 0x5108(%rdi), %rdx
movq %rcx, (%rdx,%rax,8)
cmpl $0x0, 0x20(%rdi)
jle 0xc1ee
xorl %edx, %edx
movq 0x18(%rdi), %rsi
movq (%rsi,%rdx,8), %rsi
cmpq $0x0, (%rsi,%rax,8)
je 0xc1e2
xorl %esi, %esi
testq %rax, %rax
jne 0xc1c0
cmpb $0x0, 0x3c(%rdi)
jne 0xc1b2
movq 0x98(%rdi), %r8
addq %rcx, %r8
movb $0x1, (%rsi,%r8)
movq 0x50f0(%rdi), %r8
addq %rcx, %r8
movb %dl, (%rsi,%r8)
movq 0x50e8(%rdi), %r8
addq %rcx, %r8
movb %dl, (%rsi,%r8)
incq %rsi
movq 0x18(%rdi), %r8
movq (%r8,%rdx,8), %r8
cmpq (%r8,%rax,8), %rsi
jb 0xc198
addq %rsi, %rcx
incq %rdx
movslq 0x20(%rdi), %rsi
cmpq %rsi, %rdx
jl 0xc187
incq %rax
movslq 0x38(%rdi), %rdx
cmpq %rdx, %rax
jl 0xc163
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc415
xorl %eax, %eax
movzbl (%r15,%rax), %ecx
incq (%rbx,%rcx,8)
incq %rax
cmpq %rax, %r14
jne 0xc404
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7dd3(%rip), %rbx      # 0x14220
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0xff, %esi
callq 0x2150
leaq 0x81ba(%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 0xc4ad
xorl %eax, %eax
movzbl (%r13,%rax), %ecx
incq (%rsp,%rcx,8)
incq %rax
cmpq %rax, %r12
jne 0xc49b
xorl %eax, %eax
cmpq $0x0, (%rsp,%rax,8)
je 0xc4c2
movl %r15d, (%r14)
movslq %r15d, %rcx
incl %r15d
movl %eax, (%rbx,%rcx,4)
incq %rax
addq $0x4, %r14
cmpq $0x100, %rax            # imm = 0x100
jne 0xc4af
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_O1/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 %r14
pushq %rbx
movq %rdi, %rbx
callq 0xc433
movl %eax, %ebp
cmpl $0x0, 0x94(%rbx)
jle 0xc528
leaq 0x2380(%rip), %rdi      # 0xe89f
movl %ebp, %esi
xorl %eax, %eax
callq 0x2100
cmpb $0x1, 0x68(%rbx)
movslq %ebp, %r14
jne 0xc582
movslq 0x20(%rbx), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x18(%rbx)
testq %rax, %rax
jne 0xc553
leaq 0x3e0f(%rip), %rdi      # 0x1035d
callq 0x3973
movslq 0x20(%rbx), %rdi
imulq %r14, %rdi
movl $0x8, %esi
callq 0xc78c
movq 0x18(%rbx), %rcx
movq %rax, (%rcx)
movq 0x18(%rbx), %rax
cmpq $0x0, (%rax)
jne 0xc582
leaq 0x3de0(%rip), %rdi      # 0x1035d
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0xc601
xorl %eax, %eax
shlq $0x3, %r14
leaq 0x808b(%rip), %rcx      # 0x14620
cmpb $0x1, 0x68(%rbx)
jne 0xc5ba
testq %rax, %rax
je 0xc5b0
movq 0x18(%rbx), %rdx
movq -0x8(%rdx,%rax,8), %rsi
addq %r14, %rsi
movq %rsi, (%rdx,%rax,8)
movq 0x18(%rbx), %rdx
movq (%rdx,%rax,8), %rdx
jmp 0xc5bc
xorl %edx, %edx
movq 0x8(%rbx), %rsi
movq (%rsi,%rax,8), %rsi
testq %rsi, %rsi
je 0xc5f5
movq (%rbx), %rdi
movq (%rdi,%rax,8), %rdi
xorl %r8d, %r8d
movzbl (%rdi,%r8), %r9d
movl (%rcx,%r9,4), %r9d
movb %r9b, (%rdi,%r8)
testq %rdx, %rdx
je 0xc5ed
movzbl %r9b, %r9d
incq (%rdx,%r9,8)
incq %r8
cmpq %r8, %rsi
jne 0xc5d3
incq %rax
movslq 0x20(%rbx), %rdx
cmpq %rdx, %rax
jl 0xc595
movl %ebp, 0x38(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0xc698
movq %rdi, %rbx
movq 0x83f3(%rip), %rax      # 0x14a40
testq %rax, %rax
je 0xc69d
leaq 0x10(%rbx), %rdi
callq *%rax
movq %rbx, %rsi
lock
xaddq %rsi, 0x83bc(%rip)      # 0x14a20
movq %rax, %r14
addq %rbx, %rsi
cmpq 0x83b7(%rip), %rsi      # 0x14a28
jle 0xc67a
movq %rsi, 0x83ae(%rip)      # 0x14a28
addq %rbx, 0x1083df(%rip)    # 0x114a60
movq 0x83a8(%rip), %rax      # 0x14a30
testq %rax, %rax
je 0xc6c6
movq 0x83a4(%rip), %rdi      # 0x14a38
callq *%rax
jmp 0xc6c6
xorl %r14d, %r14d
jmp 0xc6d6
movq 0x83a4(%rip), %rax      # 0x14a48
leaq (%rbx,%rax), %rcx
addq $0x10, %rcx
cmpq $0x100001, %rcx         # imm = 0x100001
jae 0xc6e1
leaq 0x8394(%rip), %r14      # 0x14a50
addq %rax, %r14
movq %rcx, 0x8382(%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_O1/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 0xca5b
movq %rax, 0x30(%rbx)
xorl %edi, %edi
xorl %esi, %esi
movl $0x80, %edx
callq 0xca5b
movq %rax, 0x38(%rbx)
leaq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x23d0
testl %eax, %eax
je 0xca1f
leaq 0x3aa1(%rip), %rdi      # 0x104bb
callq 0x3973
leaq 0x50(%rbx), %rdi
xorl %esi, %esi
callq 0x23d0
testl %eax, %eax
je 0xca3a
leaq 0x3a86(%rip), %rdi      # 0x104bb
callq 0x3973
addq $0x78, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2220
testl %eax, %eax
je 0xca59
leaq 0x3a68(%rip), %rdi      # 0x104bb
popq %rbx
jmp 0x3973
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xcadd
leaq 0x39f2(%rip), %rdi      # 0x104ca
callq 0x3973
leaq 0x50(%rbx), %rdi
callq 0x2130
testl %eax, %eax
je 0xcaf6
leaq 0x39d9(%rip), %rdi      # 0x104ca
callq 0x3973
leaq 0x8(%rbx), %rdi
callq 0x2130
testl %eax, %eax
je 0xcb0f
leaq 0x39c0(%rip), %rdi      # 0x104ca
callq 0x3973
movq 0x38(%rbx), %rdi
xorl %esi, %esi
movl $0x94, %edx
callq 0xca5b
movq 0x30(%rbx), %rdi
xorl %esi, %esi
movl $0x95, %edx
popq %rbx
jmp 0xca5b
// File: /workspace/github_c_makefile_star2_O1/dropletzhu[P]msuite/mlistener.c
// Function: usage
void usage()
{
	printf("Usage: ./mlistener -s source -g group -p port -l length \n");
	printf(" -s souurce	use the source to select bind device\n");
	printf(" -g group	the group to listen\n");
	printf(" -p port	the port to listen\n");
	printf(" -l length	the packet length, default length is 256 bytes\n");
	printf(" Version 	%s\n", version);
}

// Assembly:
pushq %rax
leaq 0xe8a(%rip), %rdi       # 0x20be
callq 0x1040
leaq 0xeb7(%rip), %rdi       # 0x20f7
callq 0x1040
leaq 0xedc(%rip), %rdi       # 0x2128
callq 0x1040
leaq 0xeee(%rip), %rdi       # 0x2146
callq 0x1040
leaq 0xefe(%rip), %rdi       # 0x2162
callq 0x1040
leaq 0xdb0(%rip), %rdi       # 0x2020
leaq 0xdb7(%rip), %rsi       # 0x202e
xorl %eax, %eax
popq %rcx
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O1/dropletzhu[P]msuite/mlistener.c
// Function: term_handler
void term_handler(int signum)
{
	unsigned int s_total, i;

	for( i = 0; i < 65535; i++ ) {
		s_total += s_count[i];
	}

	printf("Total received:	%u\n", l_count);
	printf("Total sent:	%u\n", s_total);
	/* the s_count may not be updated when interrupt the
	   process */
	if( l_count <= s_total )
		printf("Total lost:	%u\n", s_total - l_count);
	else
		printf("Total lost: 0\n");

	exit(0);
}

// Assembly:
pushq %rbx
xorl %eax, %eax
leaq 0x2e47(%rip), %rcx      # 0x40d0
addl (%rax,%rcx), %ebx
addq $0x4, %rax
cmpq $0x3fffc, %rax          # imm = 0x3FFFC
jne 0x1289
movl 0x2e22(%rip), %esi      # 0x40c0
leaq 0xd8d(%rip), %rdi       # 0x2032
xorl %eax, %eax
callq 0x1070
leaq 0xd93(%rip), %rdi       # 0x2046
movl %ebx, %esi
xorl %eax, %eax
callq 0x1070
subl 0x2dfe(%rip), %ebx      # 0x40c0
jae 0x12d2
leaq 0xed1(%rip), %rdi       # 0x219c
callq 0x1040
jmp 0x12e2
leaq 0xd7d(%rip), %rdi       # 0x2056
movl %ebx, %esi
xorl %eax, %eax
callq 0x1070
xorl %edi, %edi
callq 0x1110
// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_strnlen_s
size_t
kmip_strnlen_s(const char *str, size_t strsz)
{
    if(str == NULL)
    {
        return(0);
    }
    
    size_t length = 0;
    for(const char *i = str; *i != 0; i++)
    {
        length++;
        if(length >= strsz)
        {
            return(strsz);
        }
    }
    return(length);
}

// Assembly:
testq %rdi, %rdi
je 0x6f07
cmpb $0x0, (%rdi)
je 0x6f07
cmpq $0x1, %rsi
movq %rsi, %rcx
adcq $-0x1, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x6f0a
leaq 0x1(%rdx), %rax
cmpb $0x0, 0x1(%rdi,%rdx)
movq %rax, %rdx
jne 0x6ef3
retq
xorl %eax, %eax
retq
movq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x38, %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx,%rax)
movups %xmm0, 0x40(%rbx,%rax)
movups %xmm0, 0x30(%rbx,%rax)
movups %xmm0, 0x20(%rbx,%rax)
movups %xmm0, 0x10(%rbx,%rax)
movups %xmm0, (%rbx,%rax)
movq $0x0, 0x60(%rbx,%rax)
addq $0x68, %rax
cmpq $0x858, %rax            # imm = 0x858
jne 0x77ce
leaq 0x38(%rbx), %rax
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_O1/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 0x793d
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl %ecx, 0x18(%rdi)
cmpq $0x0, 0x868(%rdi)
jne 0x7861
movq 0x20766(%rip), %rax     # 0x27fc0
movq %rax, 0x868(%rbx)
cmpq $0x0, 0x870(%rbx)
jne 0x7879
movq 0x2073e(%rip), %rax     # 0x27fb0
movq %rax, 0x870(%rbx)
cmpq $0x0, 0x888(%rbx)
jne 0x7891
movq 0x20756(%rip), %rax     # 0x27fe0
movq %rax, 0x888(%rbx)
cmpq $0x0, 0x878(%rbx)
jne 0x78a9
movq 0x2072e(%rip), %rax     # 0x27fd0
movq %rax, 0x878(%rbx)
cmpq $0x0, 0x880(%rbx)
jne 0x78c1
movq 0x2071e(%rip), %rax     # 0x27fd8
movq %rax, 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 *0x868(%rbx)
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 0x7936
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_O1/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 0x79df
movq %rsi, %r15
movq %rdi, %r14
movq 0x890(%rdi), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%r14)
testq %rax, %rax
je 0x79df
movq %r15, 0x10(%rax)
movq 0x20(%r14), %rcx
xorl %ebx, %ebx
testq %rcx, %rcx
je 0x79df
movq (%rcx), %rdx
movq %rax, (%rcx)
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
incq 0x10(%rcx)
testq %rdx, %rdx
je 0x79d4
movq %rax, 0x8(%rdx)
cmpq $0x0, 0x8(%rcx)
jne 0x79df
movq %rax, 0x8(%rcx)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7a3c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x65a0
testq %rax, %rax
je 0x7a35
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 0x7a04
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7aa2
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x7a5c
movq 0x10(%rbx), %rdx
xorl %esi, %esi
callq 0x6e10
movq (%rbx), %rax
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 0x7a9b
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_O1/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 0x7af5
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 0x7aee
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_O1/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 0x7b66
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_O1/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 0x7bb8
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
addq $0x38, %rdi
xorl %r15d, %r15d
cmpl $0x0, 0x9c(%r14,%r15)
je 0x7b97
addq $0x68, %r15
cmpq $0x820, %r15            # imm = 0x820
jne 0x7b7d
jmp 0x7bb3
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_O1/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 0x7c38
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x28(%rdi), %rax
cmpl $-0xb, %ecx
jne 0x7c41
testq %rax, %rax
jne 0x7bf6
movq 0x890(%r14), %rdi
movq 0x30(%r14), %rsi
movl $0x1, %edx
callq *0x868(%r14)
movq %rax, 0x28(%r14)
movq 0x28(%r14), %r15
movq 0x30(%r14), %r12
movl 0x18(%r14), %r14d
movl %ebp, %edi
callq 0x6290
movl %eax, %eax
leaq 0x200fe(%rip), %rcx     # 0x27d10
movq (%rcx,%rax,8), %r8
leaq 0x192a3(%rip), %rdx     # 0x20ec0
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 %rax, %rax
jne 0x7c61
movq 0x890(%r14), %rdi
movq 0x30(%r14), %rsi
movl $0x1, %edx
callq *0x868(%r14)
movq %rax, 0x28(%r14)
movq 0x28(%r14), %r15
movq 0x30(%r14), %r14
movl %ebp, %edi
callq 0x6290
movl %eax, %eax
leaq 0x20097(%rip), %rcx     # 0x27d10
movq (%rcx,%rax,8), %rcx
leaq 0x19271(%rip), %rdx     # 0x20ef5
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_O1/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 0x7cf2
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, 0x28(%rdi)
jne 0x7cd1
movq 0x890(%r15), %rdi
movq 0x30(%r15), %rsi
movl $0x1, %edx
callq *0x868(%r15)
movq %rax, 0x28(%r15)
movq 0x28(%r15), %rdi
movq 0x30(%r15), %rsi
leaq 0x19237(%rip), %rdx     # 0x20f17
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x6400
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7d44
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x28(%rdi)
jne 0x7d24
movq 0x890(%r14), %rdi
movq 0x30(%r14), %rsi
movl $0x1, %edx
callq *0x868(%r14)
movq %rax, 0x28(%r14)
movq 0x28(%r14), %rdi
movq 0x30(%r14), %rsi
leaq 0x19207(%rip), %rdx     # 0x20f3a
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6400
retq