LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: initLCPmem
void initLCPmem(g_data *g)
{
  char filename[Filename_size];
  
  assert(g->lcpMerge);
  // allocate g->lcps and g->lcp[0..]
  g->lcps = (lcpInt **) malloc(g->numBwt*sizeof(lcpInt *));
  if(!g->lcps) die(__func__);
  
  snprintf(filename,Filename_size,"%s.%s",g->lcpinPath,LCP_EXT);
  int fd = open(filename,O_RDWR);
  if(fd == -1) die(__func__);
  // mmap lcp values, init lcps[] with a copy of the LCP values  
  g->lcps[0] = mmap(NULL,g->mergeLen*sizeof(lcpInt),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
  if(g->lcps[0] == MAP_FAILED) die(__func__);
  #ifdef USE_MMAP_ADVISE
  madvise(g->lcps[0], g->mergeLen*sizeof(lcpInt), MADV_DONTNEED);// lcp values are not need untill the end of the bwt-merge phase 
  #endif
  if(close(fd)!=0) die(__func__);

  // init lcps[1..]
  for(int i=0;i<g->numBwt-1;i++)
    g->lcps[i+1] = g->lcps[i] + g->bwtLen[i];
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
movslq 0x20(%rdi), %rdi
shlq $0x3, %rdi
callq 0xc70e
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x3d08
movq 0x78(%rbx), %rcx
leaq 0xaccf(%rip), %rdx      # 0xe91e
leaq 0xb06f(%rip), %r8       # 0xecc5
movq %rsp, %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
xorl %eax, %eax
callq 0x2140
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x22f0
cmpl $-0x1, %eax
je 0x3d08
movl %eax, %ebp
movq 0x28(%rbx), %rsi
xorl %edi, %edi
movl $0x3, %edx
movl $0x1, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x2230
movq 0x88(%rbx), %rcx
movq %rax, (%rcx)
movq 0x88(%rbx), %rax
movq (%rax), %rdi
cmpq $-0x1, %rdi
je 0x3d08
movq 0x28(%rbx), %rsi
movl $0x4, %edx
callq 0x22e0
movl %ebp, %edi
callq 0x2160
testl %eax, %eax
jne 0x3d08
movl 0x20(%rbx), %eax
cmpl $0x2, %eax
jl 0x3cfc
decl %eax
xorl %ecx, %ecx
movq 0x8(%rbx), %rdx
movq 0x88(%rbx), %rsi
movq (%rsi,%rcx,8), %rdi
addq (%rdx,%rcx,8), %rdi
movq %rdi, 0x8(%rsi,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x3cdc
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xafab(%rip), %rdi      # 0xecba
callq 0x39fc
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: openDAFile
static FILE *openDAFile(g_data *g)
{
  char filename[Filename_size];

  if(g->verbose>1) puts("Writing Document Array");
  assert(g->outputDA);
  snprintf(filename,Filename_size,"%s.%d.%s",g->outPath,g->outputDA,DA_EXT);
  FILE *f = fopen(filename,"wb");
  if(f==NULL) die("Error opening Document array file");
  return f;
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
cmpl $0x2, 0x94(%rdi)
jl 0x400a
leaq 0xb3de(%rip), %rdi      # 0xf3e3
callq 0x2090
movq 0x80(%rbx), %rcx
movl 0x44(%rbx), %r8d
leaq 0xab58(%rip), %rdx      # 0xeb74
leaq 0xa2da(%rip), %r9       # 0xe2fd
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0xa8f2(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
je 0x4052
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0xb3a1(%rip), %rdi      # 0xf3fa
callq 0x39fc
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: openSAFile
static FILE *openSAFile(g_data *g)
{
  char filename[Filename_size];

  if(g->verbose>1) puts("Writing Suffix Array");
  assert(g->outputSA);
  snprintf(filename,Filename_size,"%s.%d.%s",g->outPath,g->outputSA,SA_EXT);
  FILE *f = fopen(filename,"wb");
  if(f==NULL) die("Error opening Suffix array file");
  return f;
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
cmpl $0x2, 0x94(%rdi)
jl 0x47b7
leaq 0xac6a(%rip), %rdi      # 0xf41c
callq 0x2090
movq 0x80(%rbx), %rcx
movl 0x4c(%rbx), %r8d
leaq 0xa3ab(%rip), %rdx      # 0xeb74
leaq 0x9b6a(%rip), %r9       # 0xe33a
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0xa145(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
je 0x47ff
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0xac2b(%rip), %rdi      # 0xf431
callq 0x39fc
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: openSLFile
static FILE *openSLFile(g_data *g)
{
  char filename[Filename_size];

  if(g->verbose>1) puts("Writing Suffix Array");
  assert(g->outputSL);
  snprintf(filename,Filename_size,"%s.%d.%s",g->outPath,g->outputSL,SL_EXT);
  FILE *f = fopen(filename,"wb");
  if(f==NULL) die("Error opening Suffixes' lengths file");
  return f;
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
cmpl $0x2, 0x94(%rdi)
jl 0x482b
leaq 0xabf6(%rip), %rdi      # 0xf41c
callq 0x2090
movq 0x80(%rbx), %rcx
movl 0x50(%rbx), %r8d
leaq 0xa337(%rip), %rdx      # 0xeb74
leaq 0xa397(%rip), %r9       # 0xebdb
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0xa0d1(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
je 0x4873
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0xabd7(%rip), %rdi      # 0xf451
callq 0x39fc
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: openQSFile
static FILE *openQSFile(g_data *g)
{
  char filename[Filename_size];

  if(g->verbose>1) puts("Writing QS");
  assert(g->outputQS);
  snprintf(filename,Filename_size,"%s.%s",g->outPath,QS_EXT);
  FILE *f = fopen(filename,"wb");
  if(f==NULL) die("Error opening QS file");
  return f;
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
cmpl $0x2, 0x94(%rdi)
jl 0x489f
leaq 0xac2c(%rip), %rdi      # 0xf4c6
callq 0x2090
movq 0x80(%rbx), %rcx
leaq 0xa071(%rip), %rdx      # 0xe91e
leaq 0x9ad0(%rip), %r8       # 0xe384
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0xa061(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
je 0x48e3
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0xabe7(%rip), %rdi      # 0xf4d1
callq 0x39fc
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: free_merge_arrays
void free_merge_arrays(g_data *g) {
  if(g->extMem) {
    int e = unlink(g->merge_fname);
    if(e!=0) perror("Error deleting temporary merge file (1)");
    e = unlink(g->newmerge_fname);
    if(e!=0) perror("Error deleting temporary merge file (2)");
    free(g->merge_fname); // deallocate file names 
    free(g->newmerge_fname);
  }
  else if(g->mmapZ) {
    int e = munmap(g->mergeColor,g->mergeLen*sizeof(palette));
    if(e!=0) die("gap (unmap mergeColor)");
    e = munmap(g->newMergeColor,g->mergeLen*sizeof(palette));
    if(e!=0) die("gap (unmap newMergeColor)");  }
  else {
    free(g->newMergeColor);
    free(g->mergeColor);
  }
  g->newMergeColor = NULL;
  g->mergeColor = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x69(%rdi)
jne 0x548f
movq 0x50d8(%rbx), %rdi
callq 0x2060
testl %eax, %eax
jne 0x54f6
movq 0x50e0(%rbx), %rdi
callq 0x2060
testl %eax, %eax
jne 0x5507
leaq 0x50e0(%rbx), %r14
movq 0x50d8(%rbx), %rdi
callq 0xc7ba
jmp 0x54dc
cmpb $0x1, 0x70(%rbx)
jne 0x54c9
movq 0x50e8(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
jne 0x5518
movq 0x50f0(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
je 0x54e4
leaq 0x9e68(%rip), %rdi      # 0xf32c
callq 0x39fc
movq 0x50f0(%rbx), %rdi
callq 0xc7ba
leaq 0x50e8(%rbx), %r14
movq (%r14), %rdi
callq 0xc7ba
xorps %xmm0, %xmm0
movups %xmm0, 0x50e8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9dc8(%rip), %rdi      # 0xf2c5
callq 0x2320
jmp 0x5466
leaq 0x9ddf(%rip), %rdi      # 0xf2ed
callq 0x2320
jmp 0x547a
leaq 0x9df6(%rip), %rdi      # 0xf315
callq 0x39fc
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: alloc_merge_array
void alloc_merge_array(g_data *g) {
  if(g->mmapZ) {
    g->mergeColor = mmap(NULL,g->mergeLen*sizeof(palette),PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
    if(g->mergeColor== MAP_FAILED) die(__func__);
  }
  else {
    g->mergeColor =  calloc(g->mergeLen,sizeof(palette)); 
     if(!g->mergeColor) die(__func__);
  }
  // make sure these are not used 
  g->newMergeColor = NULL;
  g->mergeColor16=NULL;
  g->array32 = NULL;
  g->fmergeColor = NULL;
  g->fnewMergeColor = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpb $0x1, 0x70(%rdi)
jne 0x5568
xorl %edi, %edi
movq %rax, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x2230
movq %rax, 0x50e8(%rbx)
cmpq $-0x1, %rax
jne 0x5581
leaq 0x9de3(%rip), %rdi      # 0xf346
callq 0x39fc
movl $0x1, %esi
movq %rax, %rdi
callq 0xc860
movq %rax, 0x50e8(%rbx)
testq %rax, %rax
je 0x555c
xorps %xmm0, %xmm0
movups %xmm0, 0x50c8(%rbx)
movups %xmm0, 0x50f0(%rbx)
movq $0x0, 0x5100(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: free_merge_array
void free_merge_array(g_data *g) {
  assert(g->newMergeColor==NULL);
  if(g->mmapZ) {
    int e = munmap(g->mergeColor,g->mergeLen*sizeof(palette));
    if(e!=0) die("gap (unmap mergeColor)");
  }
  else {
    free(g->mergeColor);
  }
  g->mergeColor = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x50e8(%rdi), %rdi
cmpb $0x1, 0x70(%rbx)
jne 0x55c9
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
je 0x55ce
leaq 0x9d51(%rip), %rdi      # 0xf315
callq 0x39fc
callq 0xc7ba
movq $0x0, 0x50e8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: alloc0_B_array
void alloc0_B_array(g_data *g) {
  if(g->mmapB) {
    // zero intialized 
    g->blockBeginsAt = mmap(NULL,g->mergeLen*sizeof(lcpInt),PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
    if(g->blockBeginsAt== MAP_FAILED) die(__func__);
  }
  else {
    g->blockBeginsAt = (lcpInt *) calloc(g->mergeLen,sizeof(lcpInt));
    if(!g->blockBeginsAt) die(__func__);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpb $0x1, 0x71(%rdi)
jne 0x561f
xorl %edi, %edi
movq %rax, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x2230
movq %rax, 0x98(%rbx)
cmpq $-0x1, %rax
jne 0x5638
leaq 0x9d3e(%rip), %rdi      # 0xf358
callq 0x39fc
movl $0x1, %esi
movq %rax, %rdi
callq 0xc860
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x5613
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: free_B_array
void free_B_array(g_data *g) {
  if(g->mmapB) {
    int e = munmap(g->blockBeginsAt,g->mergeLen*sizeof(lcpInt));
    if(e) die(__func__);
  }
  else free(g->blockBeginsAt); // if used free storage for lcp values
  g->blockBeginsAt = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
cmpb $0x1, 0x71(%rbx)
jne 0x5664
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
je 0x5669
leaq 0x9d08(%rip), %rdi      # 0xf367
callq 0x39fc
callq 0xc7ba
movq $0x0, 0x98(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: alloc_merge_array16
void alloc_merge_array16(g_data *g) {
  if(g->mmapZ) {
    g->mergeColor16 = mmap(NULL,g->mergeLen*sizeof(uint16_t),PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
    if(g->mergeColor16 == MAP_FAILED) die(__func__);
  }
  else {
    g->mergeColor16 =  calloc(g->mergeLen,sizeof(uint16_t)); 
     if(!g->mergeColor16) die(__func__);
  }
  g->mergeColor = g->newMergeColor = NULL;
  g->array32 = NULL;
  g->fmergeColor = NULL;
  g->fnewMergeColor = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpb $0x1, 0x70(%rdi)
jne 0x56bd
addq %rax, %rax
xorl %edi, %edi
movq %rax, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x2230
movq %rax, 0x50f8(%rbx)
cmpq $-0x1, %rax
jne 0x56d6
leaq 0x9cbc(%rip), %rdi      # 0xf374
callq 0x39fc
movl $0x2, %esi
movq %rax, %rdi
callq 0xc860
movq %rax, 0x50f8(%rbx)
testq %rax, %rax
je 0x56b1
movq $0x0, 0x5100(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50c8(%rbx)
movups %xmm0, 0x50e8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: free_merge_array16
void free_merge_array16(g_data *g) {
  assert(g->mergeColor==NULL && g->newMergeColor==NULL && g->array32==NULL);
  if(g->mmapZ) {
    int e = munmap(g->mergeColor16,g->mergeLen*sizeof(uint16_t));
    if(e!=0) die("gap (unmap mergeColor16)");
  }
  else {
    free(g->mergeColor16);
  }
  g->mergeColor16 = NULL; // make sure it is no longer used
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x50f8(%rdi), %rdi
cmpb $0x1, 0x70(%rbx)
jne 0x5721
movq 0x28(%rbx), %rsi
addq %rsi, %rsi
callq 0x2290
testl %eax, %eax
je 0x5726
leaq 0x9c6c(%rip), %rdi      # 0xf388
callq 0x39fc
callq 0xc7ba
movq $0x0, 0x50f8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: alloc_array32
void alloc_array32(g_data *g) {
  if(g->mmapZ) {
    g->array32 = mmap(NULL,g->mergeLen*sizeof(uint32_t),PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
    if(g->array32 == MAP_FAILED) die(__func__);
  }
  else {
    g->array32 =  calloc(g->mergeLen,sizeof(uint32_t)); 
    if(!g->array32) die(__func__);
  }
  g->mergeColor = g->newMergeColor = NULL;
  g->mergeColor16 = NULL; // make sure it is not used
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpb $0x1, 0x70(%rdi)
jne 0x577b
shlq $0x2, %rax
xorl %edi, %edi
movq %rax, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x2230
movq %rax, 0x5100(%rbx)
cmpq $-0x1, %rax
jne 0x5794
leaq 0x9c2b(%rip), %rdi      # 0xf3a1
callq 0x39fc
movl $0x4, %esi
movq %rax, %rdi
callq 0xc860
movq %rax, 0x5100(%rbx)
testq %rax, %rax
je 0x576f
xorps %xmm0, %xmm0
movups %xmm0, 0x50e8(%rbx)
movq $0x0, 0x50f8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/util.c
// Function: free_array32
void free_array32(g_data *g) {
  assert(g->mergeColor==NULL && g->newMergeColor==NULL && g->mergeColor16 == NULL);
  if(g->mmapZ) {
    int e = munmap(g->array32,g->mergeLen*sizeof(uint32_t));
    if(e!=0) die("gap (unmap array32)");
  }
  else {
    free(g->array32);
  }
  g->array32 = NULL; // make sure it is no longer used
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x5100(%rdi), %rdi
cmpb $0x1, 0x70(%rbx)
jne 0x57d9
movq 0x28(%rbx), %rsi
shlq $0x2, %rsi
callq 0x2290
testl %eax, %eax
je 0x57de
leaq 0x9bdb(%rip), %rdi      # 0xf3af
callq 0x39fc
callq 0xc7ba
movq $0x0, 0x5100(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: open_bw_files
void open_bw_files(g_data *g) {
  assert(g->extMem);
  g->bwf = malloc(g->numBwt*sizeof(FILE *));
  if(g->bwf==NULL) die(__func__);
  for(int i=0; i< g->numBwt; i++) {
    g->bwf[i] = fopen(g->bwfname,"r");
    if(!g->bwf[i]) die(__func__);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0xc70e
movq %rax, 0x50a0(%rbx)
testq %rax, %rax
jne 0x5824
leaq 0x9ccc(%rip), %rdi      # 0xf4e7
callq 0x39fc
movl 0x20(%rbx), %r14d
testl %r14d, %r14d
jle 0x5879
leaq 0xa0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa9f3(%rip), %r15      # 0x1022d
leaq 0x9ca6(%rip), %r12      # 0xf4e7
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x50a0(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x50a0(%rbx), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x586d
movq %r12, %rdi
callq 0x39fc
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5841
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: rewind_bw_files
void rewind_bw_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fseek(g->bwf[i],sizeof(symbol)*(g->bws[i]-g->bws[0]+g->symb_offset),SEEK_SET);
    if(e!=0) die(__func__);
  }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jle 0x58d8
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9c5a(%rip), %r14      # 0xf4f5
movq 0x50a0(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
subq (%rax), %rsi
addq 0x30(%rbx), %rsi
xorl %edx, %edx
callq 0x2260
testl %eax, %eax
je 0x58c7
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x589b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: close_bw_files
void close_bw_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fclose(g->bwf[i]);
    if(e!=0) die(__func__);
  }
  free(g->bwf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jle 0x5919
xorl %r15d, %r15d
leaq 0x9c14(%rip), %r14      # 0xf505
movq 0x50a0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x590d
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x58f1
movq 0x50a0(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc7ba
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: open_sa_files
void open_sa_files(g_data *g) {
  assert(g->extMem);
  g->saf = malloc(g->numBwt*sizeof(FILE *));
  if(g->saf==NULL) die(__func__);
  for(int i=0; i< g->numBwt; i++) {
    g->saf[i] = fopen(g->safname,"r");
    if(!g->saf[i]) die(__func__);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0xc70e
movq %rax, 0x50b0(%rbx)
testq %rax, %rax
jne 0x5962
leaq 0x9bbb(%rip), %rdi      # 0xf514
callq 0x39fc
movl 0x20(%rbx), %r14d
testl %r14d, %r14d
jle 0x59b7
leaq 0x20a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa8b5(%rip), %r15      # 0x1022d
leaq 0x9b95(%rip), %r12      # 0xf514
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x50b0(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x50b0(%rbx), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x59ab
movq %r12, %rdi
callq 0x39fc
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x597f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: rewind_sa_files
void rewind_sa_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fseek(g->saf[i],(g->outputSA)*(g->bws[i]-g->bws[0]+g->symb_offset),SEEK_SET);
    if(e!=0) die(__func__);
  }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jle 0x5a1e
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9b49(%rip), %r14      # 0xf522
movq 0x50b0(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
subq (%rax), %rsi
movslq 0x4c(%rbx), %rax
addq 0x30(%rbx), %rsi
imulq %rax, %rsi
xorl %edx, %edx
callq 0x2260
testl %eax, %eax
je 0x5a0d
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x59d9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: close_sa_files
void close_sa_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fclose(g->saf[i]);
    if(e!=0) die(__func__);
  }
  free(g->saf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jle 0x5a5f
xorl %r15d, %r15d
leaq 0x9afb(%rip), %r14      # 0xf532
movq 0x50b0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5a53
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5a37
movq 0x50b0(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc7ba
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: open_sl_files
void open_sl_files(g_data *g) {
  assert(g->extMem);
  g->slf = malloc(g->numBwt*sizeof(FILE *));
  if(g->slf==NULL) die(__func__);
  for(int i=0; i< g->numBwt; i++) {
    g->slf[i] = fopen(g->slfname,"r");
    if(!g->slf[i]) die(__func__);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0xc70e
movq %rax, 0x50b8(%rbx)
testq %rax, %rax
jne 0x5aa8
leaq 0x9aa2(%rip), %rdi      # 0xf541
callq 0x39fc
movl 0x20(%rbx), %r14d
testl %r14d, %r14d
jle 0x5afd
leaq 0x30a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa76f(%rip), %r15      # 0x1022d
leaq 0x9a7c(%rip), %r12      # 0xf541
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x50b8(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x50b8(%rbx), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x5af1
movq %r12, %rdi
callq 0x39fc
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5ac5
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: rewind_sl_files
void rewind_sl_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fseek(g->slf[i],(g->outputSL)*(g->bws[i]-g->bws[0]+g->symb_offset),SEEK_SET);
    if(e!=0) die(__func__);
  }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jle 0x5b64
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9a30(%rip), %r14      # 0xf54f
movq 0x50b8(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
subq (%rax), %rsi
movslq 0x50(%rbx), %rax
addq 0x30(%rbx), %rsi
imulq %rax, %rsi
xorl %edx, %edx
callq 0x2260
testl %eax, %eax
je 0x5b53
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5b1f
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: close_sl_files
void close_sl_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fclose(g->slf[i]);
    if(e!=0) die(__func__);
  }
  free(g->slf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jle 0x5ba5
xorl %r15d, %r15d
leaq 0x99e2(%rip), %r14      # 0xf55f
movq 0x50b8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5b99
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5b7d
movq 0x50b8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc7ba
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: open_qs_files
void open_qs_files(g_data *g) {
  assert(g->extMem);
  g->qsf = malloc(g->numBwt*sizeof(FILE *));
  if(g->qsf==NULL) die(__func__);
  for(int i=0; i< g->numBwt; i++) {
    g->qsf[i] = fopen(g->qsfname,"r");
    if(!g->qsf[i]) die(__func__);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0xc70e
movq %rax, 0x50c0(%rbx)
testq %rax, %rax
jne 0x5bee
leaq 0x9989(%rip), %rdi      # 0xf56e
callq 0x39fc
movl 0x20(%rbx), %r14d
testl %r14d, %r14d
jle 0x5c43
leaq 0x40a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa629(%rip), %r15      # 0x1022d
leaq 0x9963(%rip), %r12      # 0xf56e
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x50c0(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x50c0(%rbx), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x5c37
movq %r12, %rdi
callq 0x39fc
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5c0b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: rewind_qs_files
void rewind_qs_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fseek(g->qsf[i],sizeof(symbol)*(g->bws[i]-g->bws[0]+g->symb_offset),SEEK_SET);
    if(e!=0) die(__func__);
  }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jle 0x5ca2
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9917(%rip), %r14      # 0xf57c
movq 0x50c0(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
subq (%rax), %rsi
addq 0x30(%rbx), %rsi
xorl %edx, %edx
callq 0x2260
testl %eax, %eax
je 0x5c91
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5c65
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: close_qs_files
void close_qs_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fclose(g->qsf[i]);
    if(e!=0) die(__func__);
  }
  free(g->qsf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jle 0x5ce3
xorl %r15d, %r15d
leaq 0x98d1(%rip), %r14      # 0xf58c
movq 0x50c0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5cd7
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5cbb
movq 0x50c0(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc7ba
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: open_da_files
void open_da_files(g_data *g) {
  assert(g->extMem);
  g->daf = malloc(g->numBwt*sizeof(FILE *));
  if(g->daf==NULL) die(__func__);
  for(int i=0; i< g->numBwt; i++) {
    g->daf[i] = fopen(g->dafname,"r");
    if(!g->daf[i]) die(__func__);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0xc70e
movq %rax, 0x50a8(%rbx)
testq %rax, %rax
jne 0x5d2c
leaq 0x9878(%rip), %rdi      # 0xf59b
callq 0x39fc
movl 0x20(%rbx), %r14d
testl %r14d, %r14d
jle 0x5d81
leaq 0x10a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa4eb(%rip), %r15      # 0x1022d
leaq 0x9852(%rip), %r12      # 0xf59b
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x50a8(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x50a8(%rbx), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x5d75
movq %r12, %rdi
callq 0x39fc
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5d49
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: rewind_da_files
void rewind_da_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fseek(g->daf[i],(g->outputDA)*(g->bws[i]-g->bws[0]+g->symb_offset),SEEK_SET);
    if(e!=0) die(__func__);
  }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jle 0x5de8
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9806(%rip), %r14      # 0xf5a9
movq 0x50a8(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
subq (%rax), %rsi
movslq 0x44(%rbx), %rax
addq 0x30(%rbx), %rsi
imulq %rax, %rsi
xorl %edx, %edx
callq 0x2260
testl %eax, %eax
je 0x5dd7
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5da3
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: close_da_files
void close_da_files(g_data *g) {
  assert(g->extMem);
  for(int i=0; i< g->numBwt; i++) {
    int e = fclose(g->daf[i]);
    if(e!=0) die(__func__);
  }
  free(g->daf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jle 0x5e29
xorl %r15d, %r15d
leaq 0x97b8(%rip), %r14      # 0xf5b9
movq 0x50a8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5e1d
movq %r14, %rdi
callq 0x39fc
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5e01
movq 0x50a8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc7ba
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: gap_tmpfile
FILE *gap_tmpfile(char* path)
{
  // create local copy of template
  char s[strlen(path)+11];
  sprintf(s,"%s.tmpXXXXXX",path);
  assert(strlen(s)==strlen(path) + 10);
  // get file descriptor for tmp file 
  int fd = mkstemp(s);
  if(fd == -1) die("gap_tmpfile: Tempfile creation failed (1)");
  // get the FILE * (we need buffering)
  FILE *f = fdopen(fd,"w+"); 
  if(f==NULL)  die("gap_tmpfile: Tempfile creation failed (2)");
  // unlink file so it is deleted as soon as it is closed
  int e = unlink(s);
  if(e!=0)     die("gap_tmpfile: Tempfile creation failed (3)");
  return f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x20f0
movq %rsp, %rbx
addq $0x1a, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
leaq 0x9767(%rip), %rsi      # 0xf5c8
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2370
movq %rbx, %rdi
callq 0x21a0
movl %eax, %r14d
cmpl $-0x1, %eax
jne 0x5e8a
leaq 0x9750(%rip), %rdi      # 0xf5d5
callq 0x39fc
leaq 0x976e(%rip), %rsi      # 0xf5ff
movl %r14d, %edi
callq 0x2270
movq %rax, %r14
testq %rax, %rax
jne 0x5ead
leaq 0x975a(%rip), %rdi      # 0xf602
callq 0x39fc
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0x5ec5
leaq 0x976c(%rip), %rdi      # 0xf62c
callq 0x39fc
movq %r14, %rax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: huge_pwrite
void huge_pwrite(int fd, const void *vbuf, size_t count, off_t offset)
{
  const char *buf = (const char *) vbuf;
  while(count>0) {
    ssize_t w = pwrite(fd,buf,count,offset);
    if(w==0) die(__func__);
    count -= w;
    buf += w;
    offset += w;
  }
}

// Assembly:
testq %rdx, %rdx
je 0x5f2c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
leaq 0x9763(%rip), %r12      # 0xf656
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2210
movq %rax, %r13
testq %rax, %rax
jne 0x5f13
movq %r12, %rdi
callq 0x39fc
addq %r13, %r15
addq %r13, %rbx
subq %r13, %r14
jne 0x5ef3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: huge_pread
void huge_pread(int fd, void *vbuf, size_t count, off_t offset)
{
  char *buf = (char *) vbuf;
  while(count>0) {
    ssize_t w = pread(fd,buf,count,offset);
    if(w==0) die(__func__);
    count -= w;
    buf += w;
    offset += w;
  }
}

// Assembly:
testq %rdx, %rdx
je 0x5f88
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
leaq 0x9713(%rip), %r12      # 0xf662
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2300
movq %rax, %r13
testq %rax, %rax
jne 0x5f6f
movq %r12, %rdi
callq 0x39fc
addq %r13, %r15
addq %r13, %rbx
subq %r13, %r14
jne 0x5f4f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: cwriter_flush
static void cwriter_flush(cwriter *w)
{
  if(w->cur>0) {
    huge_pwrite(w->fd,w->buffer,w->cur*sizeof(palette),w->offset);
    w->offset += w->cur*sizeof(palette);
    w->cur=0;
  }
}

// Assembly:
movslq 0x1c(%rdi), %rdx
testq %rdx, %rdx
jle 0x5fea
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
movq 0x10(%rbx), %rsi
movq 0x8(%rbx), %rcx
callq 0x5ed1
movslq 0x1c(%rbx), %rax
addq %rax, 0x8(%rbx)
movl $0x0, 0x1c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: cwriter_init
void cwriter_init(cwriter *w, int fd, size_t size, off_t o) {
  assert(size>0);
  w->buffer = malloc(size*sizeof(palette));
  if(!w->buffer) die(__func__);
  w->size = size;
  w->cur = 0;
  w->offset = o;
  w->fd = fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0xc70e
movq %rax, 0x10(%r14)
testq %rax, %rax
jne 0x6051
leaq 0x9621(%rip), %rdi      # 0xf66d
callq 0x39fc
movl %r15d, 0x18(%r14)
movl $0x0, 0x1c(%r14)
movq %rbx, 0x8(%r14)
movl %ebp, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: bitfile_save
static void bitfile_save(bitfile *b, bool endfile)
{
  if(b->cur>0) {
    if(b->cur%8!=0 && !endfile) die("Illegal bitfile save");
    size_t bytes = (b->cur+7)/8;
    assert(bytes*8 <= b->size);
    huge_pwrite(b->fd,b->buffer,bytes,b->offset);
    b->offset += bytes;
    b->cur=b->size=0;
  }
}

// Assembly:
movl 0x24(%rdi), %eax
testl %eax, %eax
jle 0x60d3
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x7, %al
sete %cl
orb %sil, %cl
jne 0x609d
leaq 0x9846(%rip), %rdi      # 0xf8db
callq 0x39fc
movl 0x24(%rbx), %eax
leal 0x7(%rax), %ecx
addl $0xe, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x3, %eax
movslq %eax, %r14
movl (%rbx), %edi
movq 0x10(%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r14, %rdx
callq 0x5ed1
addq %r14, 0x8(%rbx)
movq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: bitfile_create
void bitfile_create(bitfile *b, size_t size, char *path, int order) {
  // create local copy of template
  char s[Filename_size];
  if(order==0) { // this is a temp file create unique name 
    sprintf(s,"%s.bitXXXXXX",path);
    // get file descriptor for tmp file fill it with 0s and delete file  
    b->fd = mkstemp(s);
    if(b->fd == -1) die("bitfile_create: Tempfile creation failed");
    int e = ftruncate(b->fd,(size+7)/8); // fill with size 0 bits
    if(e!=0)        die("bitfile_create: Tempfile ftruncate failed");
    e = unlink(s);
    if(e!=0)        die("bitfile_create: Tempfile unlink failed");
    }
  else { // we keep this file (to compute the DB-graph) 
    sprintf(s,"%s.%d.lcpbit1",path,order);
    // get file descriptor for bitfile fill it with 0s  
    b->fd = open(s,O_RDWR|O_CREAT|O_TRUNC, 0666);
    if(b->fd == -1) die("bitfile_create: bitfile creation failed");
    int e = ftruncate(b->fd,(size+7)/8); // fill with size 0 bits
    if(e!=0)        die("bitfile_create: bitfile ftruncate failed");
  }
  // initialization of other fields for b
  b->filesize = size;  // total size of the bitfile (in bits) 
  b->buffer = malloc(Bitfile_bufsize_bytes);
  if(!b->buffer)  die("bitfile_create: malloc error");
  b->size = 0;         // current size of the buffer in bits
  b->cur = 0;          // bit index inside buffer
  b->offset = 0;       // offset in bytes in the file 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %r14
movq %rdi, %rbx
testl %ecx, %ecx
je 0x6143
leaq 0x9610(%rip), %rsi      # 0xf701
movq %rsp, %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2370
movq %r15, %rdi
movl $0x242, %esi            # imm = 0x242
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22f0
movl %eax, (%rbx)
cmpl $-0x1, %eax
jne 0x6127
leaq 0x95ef(%rip), %rdi      # 0xf70f
callq 0x39fc
movl (%rbx), %eax
leaq 0x7(%r14), %rsi
shrq $0x3, %rsi
movl %eax, %edi
callq 0x22b0
testl %eax, %eax
je 0x61ab
leaq 0x95f6(%rip), %rdi      # 0xf737
jmp 0x61a6
leaq 0x9530(%rip), %rsi      # 0xf67a
movq %rsp, %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2370
movq %r15, %rdi
callq 0x21a0
movl %eax, (%rbx)
cmpl $-0x1, %eax
jne 0x6174
leaq 0x951a(%rip), %rdi      # 0xf687
callq 0x39fc
movl (%rbx), %eax
leaq 0x7(%r14), %rsi
shrq $0x3, %rsi
movl %eax, %edi
callq 0x22b0
testl %eax, %eax
je 0x6193
leaq 0x9522(%rip), %rdi      # 0xf6b0
callq 0x39fc
movq %rsp, %rdi
callq 0x2060
testl %eax, %eax
je 0x61ab
leaq 0x9534(%rip), %rdi      # 0xf6da
callq 0x39fc
movq %r14, 0x18(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0xc70e
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x61ce
leaq 0x9597(%rip), %rdi      # 0xf760
callq 0x39fc
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movq %rax, 0x8(%rbx)
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: bitfile_read_or_write
bool bitfile_read_or_write(bitfile *b, bool new)
{
  // make sure there is a bit to read in the buffer, possibily reading from disk 
  if(b->cur >= b->size) {
    assert(b->cur==b->size);
    bitfile_save(b,false);
    assert(b->cur==0);
    assert(b->size==0);
    ssize_t n = pread(b->fd,b->buffer,Bitfile_bufsize_bytes,b->offset);
    if(n<=0) die("Unable to read bitfile data (bitfile_read_or_write)");
    b->size = n*8; // number of bits available for reading
    // note we did not change offset since we are going to write at this offset 
  }
  assert(b->cur<b->size);
  int i = b->cur/8;
  int j = b->cur%8;
  b->cur++;
  bool old = b->buffer[i] & (1<<j); // get old bit value
  if(new) b->buffer[i] |= (1<<j);
  return old;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl 0x24(%rdi), %ecx
cmpl 0x20(%rdi), %ecx
jl 0x6274
movq %r14, %rdi
xorl %esi, %esi
callq 0x6076
movl (%r14), %edi
movq 0x10(%r14), %rsi
movq 0x8(%r14), %rcx
movl $0x10000, %edx          # imm = 0x10000
callq 0x2300
movq %rax, %r15
testq %rax, %rax
jg 0x6264
leaq 0x952e(%rip), %rdi      # 0xf78d
callq 0x39fc
leal (,%r15,8), %eax
movl %eax, 0x20(%r14)
movl 0x24(%r14), %ecx
leal 0x7(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x3, %edx
leal 0x1(%rcx), %eax
movl %eax, 0x24(%r14)
movq 0x10(%r14), %rax
movslq %edx, %rsi
movzbl (%rax,%rsi), %edx
andb $0x7, %cl
movl $0x1, %edi
shll %cl, %edi
testb %bl, %bl
je 0x62a6
movl %edx, %ecx
orl %edi, %ecx
movb %cl, (%rax,%rsi)
testl %edx, %edi
setne %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: bitfile_skip
void bitfile_skip(bitfile *b, uint64_t s) {
  if(b->cur+s <= b->size) { // easy case: we stay in the current buffer
    b->cur+= s;
    return;
  }
  // complete current byte
  int delta = (8 - (b->cur%8)) % 8;
  s -= delta;
  b->cur += delta;
  assert(b->cur%8==0 && b->cur <= b->size&& s>0);
  bitfile_save(b,false); // advance offset to the current b->cur
  // skip as many full bytes as possible
  b->offset += s/8;       
  s = s%8;                // we are left with < 8 bits
  ssize_t n = pread(b->fd,b->buffer,Bitfile_bufsize_bytes,b->offset); // read a full buffer 
  if(n<0 ) die("Error reading bitfile data (bitfile_skip)");
  else if(n==0 && s>0) die("Unable to read bitfile data (bitfile_skip)");
  b->size = n*8; // number of bits available for reading
  b->cur = s;    // virtually skip the remaining bits 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq 0x24(%rdi), %rax
leaq (%rax,%rsi), %r15
movslq 0x20(%rdi), %rcx
cmpq %rcx, %r15
jbe 0x6344
movq %rsi, %r14
movl %eax, %ecx
negl %ecx
andl $0x7, %ecx
subq %rcx, %r14
addl %eax, %ecx
movl %ecx, 0x24(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6076
movq %r14, %rcx
shrq $0x3, %rcx
addq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rbx)
movl %r14d, %r15d
andl $0x7, %r15d
movl (%rbx), %edi
movq 0x10(%rbx), %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0x2300
movq %rax, %r14
testq %rax, %rax
js 0x632d
sete %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6339
leaq 0x94c0(%rip), %rdi      # 0xf7eb
jmp 0x6334
leaq 0x948d(%rip), %rdi      # 0xf7c1
callq 0x39fc
leal (,%r14,8), %eax
movl %eax, 0x20(%rbx)
movl %r15d, 0x24(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/io.c
// Function: extract_bitfile
void extract_bitfile(char *name, size_t size, char *outpath, int order)  
{
  FILE *f = fopen(name,"rb");
  if(f==NULL) die("extract_bitfile: unable to open input file");
  char s[Filename_size];
  sprintf(s,"%s.%d.lcpbit0",outpath,order);
  assert(strlen(s)==strlen(outpath) + 9);
  FILE *g = fopen(s,"wb");
  if(f==NULL) die("extract_bitfile: unable to open output file");
  uint8_t buf=0;
  palette p;
  palette mask = ((uint64_t) 1) << ((8*sizeof(palette)) -1);
  for(size_t i=0; i<size;i++) {
    if(fread(&p, sizeof(palette), 1, f)!=1) {
      die("extract_bitfile: error reading from input file");
    }
    if(p&mask) // last bit is 1
      buf |= (1u << (i%8));
    if(i%8==7) {
      if(fwrite(&buf,1,1,g)!=1) 
        die("extract_bitfile: error writing to output file");
      buf = 0;
    }
  }
  if(size%8 != 0) 
    if(fwrite(&buf,1,1,g)!=1) 
      die("extract_bitfile: error writing to output file");
  assert(ftell(g)==(size+7)/8);  
  fclose(g);
  fclose(f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
leaq 0x949b(%rip), %rsi      # 0xf816
callq 0x21e0
movq %rax, %rbx
testq %rax, %rax
jne 0x6394
leaq 0x948a(%rip), %rdi      # 0xf819
callq 0x39fc
leaq 0x94a9(%rip), %rsi      # 0xf844
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2370
leaq 0x8578(%rip), %rsi      # 0xe92e
movq %r12, %rdi
callq 0x21e0
movq %rax, %r15
testq %rbx, %rbx
jne 0x63d2
leaq 0x9485(%rip), %rdi      # 0xf852
callq 0x39fc
movb $0x0, 0xe(%rsp)
testq %r14, %r14
je 0x649e
xorl %ebp, %ebp
leaq 0xf(%rsp), %r12
xorl %r13d, %r13d
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x20a0
cmpq $0x1, %rax
je 0x6411
leaq 0x9472(%rip), %rdi      # 0xf87e
callq 0x39fc
cmpb $0x0, 0xf(%rsp)
jns 0x642a
movl %r13d, %ecx
andb $0x7, %cl
movb $0x1, %al
shlb %cl, %al
orb %al, %bpl
movb %bpl, 0xe(%rsp)
movl %r13d, %eax
notl %eax
testb $0x7, %al
jne 0x6463
movl $0x1, %esi
movl $0x1, %edx
leaq 0xe(%rsp), %rdi
movq %r15, %rcx
callq 0x2390
cmpq $0x1, %rax
je 0x645c
leaq 0x9456(%rip), %rdi      # 0xf8ad
callq 0x39fc
movb $0x0, 0xe(%rsp)
xorl %ebp, %ebp
incq %r13
cmpq %r13, %r14
jne 0x63ea
testb $0x7, %r14b
je 0x649e
leaq 0xe(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2390
cmpq $0x1, %rax
je 0x649e
leaq 0x9414(%rip), %rdi      # 0xf8ad
callq 0x39fc
movq %r15, %rdi
callq 0x20e0
movq %rbx, %rdi
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
nop
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: showBlock
void showBlock(solidBlock *b, g_data *g, int num)
{
  printf("Beg "CUSTOM_FORMAT" End "CUSTOM_FORMAT" ",b->beginsAt, b->endsAt);
  if(b->endsAt - b->beginsAt > SMALLSOLID_LIMIT) {
    printf("occ: ");
    for(int i=0;i<num;i++) printf(CUSTOM_FORMAT" ",b->occ[i]);
  } else {
    printf("smallOcc: ");
    for(int i=0;i<num;i++) printf(SMALLSOLID_FORMAT" ",b->smallOcc[i]);
  }
  puts("SolEND");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
leaq 0x942d(%rip), %rdi      # 0xf908
xorl %eax, %eax
callq 0x2100
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cmpq $0x10000, %rax          # imm = 0x10000
jb 0x652c
leaq 0x9421(%rip), %rdi      # 0xf919
xorl %eax, %eax
callq 0x2100
testl %ebp, %ebp
jle 0x6566
movl %ebp, %r15d
leaq 0x9407(%rip), %r14      # 0xf914
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2100
incq %r12
cmpq %r12, %r15
jne 0x6510
jmp 0x6566
leaq 0x93ec(%rip), %rdi      # 0xf91f
xorl %eax, %eax
callq 0x2100
testl %ebp, %ebp
jle 0x6566
movl %ebp, %r15d
leaq 0x93e2(%rip), %r14      # 0xf92a
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movzwl (%rax,%r12,2), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2100
incq %r12
cmpq %r12, %r15
jne 0x654b
leaq 0x93c1(%rip), %rdi      # 0xf92e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: showLiquid
void showLiquid(liquidBlock *b)
{
  printf("Beg "CUSTOM_FORMAT" End "CUSTOM_FORMAT" ",b->beginsAt, b->endsAt);
  customInt totA=0, totB=0;
  for(int i=0;i<b->numBwt;i++) totB += b->occ[i];
  for(int i=0;i<b->sizeOfAlpha;i++) totA += b->occ[b->numBwt+i];
  printf("Chars: "CUSTOM_FORMAT" Bwts: "CUSTOM_FORMAT" Empty: %d ",totA,totB,b->empty);  
  puts("LiqEND");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
leaq 0x9379(%rip), %rdi      # 0xf908
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x2100
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x65b7
movq 0x20(%rbx), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
addq (%rcx,%rdx,8), %r14
incq %rdx
cmpq %rdx, %rax
jne 0x65ab
movslq 0x14(%rbx), %rcx
testq %rcx, %rcx
jle 0x65da
shlq $0x3, %rax
addq 0x20(%rbx), %rax
xorl %edx, %edx
xorl %esi, %esi
addq (%rax,%rdx,8), %rsi
incq %rdx
cmpq %rdx, %rcx
jne 0x65cc
jmp 0x65dc
xorl %esi, %esi
movzbl 0x2c(%rbx), %ecx
leaq 0x934e(%rip), %rdi      # 0xf935
movq %r14, %rdx
xorl %eax, %eax
callq 0x2100
leaq 0x935d(%rip), %rdi      # 0xf955
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: liquid_new
liquidBlock *liquid_new(g_data *g){
  liquidBlock *newB = malloc(sizeof(*newB));
  if(newB==NULL) die("Out of mem in liquid_new()");
  newB->beginsAt = 0; 
  newB->endsAt = 0; 
  newB->empty = true; 
  newB->occ_size = g->numBwt+g->sizeOfAlpha;
  newB->numBwt = g->numBwt;
  newB->sizeOfAlpha = g->sizeOfAlpha;
  newB->solid_limit = max(g->solid_limit,newB->occ_size);
  // solid limit cannot be smaller than mergeLen  
  newB->solid_limit = min(newB->solid_limit,g->mergeLen);  
  newB->occ = calloc(newB->occ_size,sizeof(customInt));
  if(newB->occ==NULL) die("Out of mem in liquid_new()");
  return newB;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x30, %edi
callq 0xc70e
movq %rax, %rbx
testq %rax, %rax
jne 0x6629
leaq 0x9338(%rip), %rdi      # 0xf95c
callq 0x39fc
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movb $0x1, 0x2c(%rbx)
movl 0x20(%r14), %eax
movl 0x38(%r14), %ecx
leal (%rcx,%rax), %edx
movl %edx, 0x18(%rbx)
movl %eax, 0x10(%rbx)
movl %ecx, 0x14(%rbx)
movl 0x90(%r14), %eax
cmpl %edx, %eax
cmovlel %edx, %eax
cltq
movq 0x28(%r14), %rcx
cmpq %rax, %rcx
cmovbel %ecx, %eax
movl %eax, 0x28(%rbx)
movslq %edx, %rdi
movl $0x8, %esi
callq 0xc860
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x6684
leaq 0x92dd(%rip), %rdi      # 0xf95c
callq 0x39fc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: ibHead_new
solidBlockFile *ibHead_new(g_data *g) {
  solidBlockFile *ibList = malloc(sizeof(*ibList));
  if(ibList==NULL) die("Out of mem in inHead_new");
  ibList->fin = ibList->fout = NULL;
  ibList->occ_size = g->sizeOfAlpha + g->numBwt;
  ibList->solidList = NULL;
  ibList->occList = NULL;
  ibList->smallOccList = NULL;
  return ibList;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x30, %edi
callq 0xc70e
movq %rax, %r14
testq %rax, %rax
jne 0x66ca
leaq 0x92b2(%rip), %rdi      # 0xf977
callq 0x39fc
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl 0x20(%rbx), %eax
addl 0x38(%rbx), %eax
movl %eax, 0x10(%r14)
movups %xmm0, 0x18(%r14)
movq $0x0, 0x28(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: ibHead_free
void ibHead_free(solidBlockFile *b)
{
  // free list of solid blocks
  assert(b!=NULL);
  {
    solidBlock *next=b->solidList; int tot=0;
    while(next!=NULL) {
      solidBlock *tmp = next->nextBlock;
      free(next); next = tmp; tot++;
    }
    assert(tot<=3); // blocks are on disk: at most three in mem simultaneously 
  }
  // free list of occList
  {customInt *next=b->occList;
  while(next!=NULL) {
    customInt **n = (customInt **) next; // pretend next is an array of pointers customInt *
    customInt *tmp = n[0];
    free(next); next = tmp;
  }}
  // free list of smallOccList
  {smallSolidInt *next= b->smallOccList;
  while(next!=NULL) {
    smallSolidInt **n = (smallSolidInt **) next; // pretend next is an array of pointers customInt *
    smallSolidInt *tmp = n[0];
    free(next); next = tmp;
  }}
  free(b);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x6714
movq 0x18(%rdi), %r14
callq 0xc7ba
movq %r14, %rdi
testq %r14, %r14
jne 0x6703
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x672d
movq (%rdi), %r14
callq 0xc7ba
movq %r14, %rdi
testq %r14, %r14
jne 0x671d
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6746
movq (%rdi), %r14
callq 0xc7ba
movq %r14, %rdi
testq %r14, %r14
jne 0x6736
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc7ba
// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/./blocks.h
// Function: get_block
solidBlock *get_block(solidBlockFile *s)
{
  solidBlock *newB =  s->solidList;
  if(newB!=NULL) {
    s->solidList = newB->nextBlock;
  }
  else {
    newB = malloc(sizeof(*newB));
    if(newB==NULL) die("Out of mem in get_block()");
  }
  return newB;
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x6769
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
jmp 0x6786
movl $0x20, %edi
callq 0xc70e
testq %rax, %rax
jne 0x6786
leaq 0x9211(%rip), %rdi      # 0xf990
callq 0x39fc
xorl %eax, %eax
popq %rcx
retq