LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x47a3
leaq 0xac7e(%rip), %rdi      # 0xf41c
callq 0x2090
movq 0x80(%rbx), %rcx
movl 0x50(%rbx), %r8d
leaq 0xa3bf(%rip), %rdx      # 0xeb74
leaq 0xa41f(%rip), %r9       # 0xebdb
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0xa159(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
je 0x47eb
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0xac5f(%rip), %rdi      # 0xf451
callq 0x3973
// File: /workspace/github_c_makefile_star2_O1/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 0x4817
leaq 0xacb4(%rip), %rdi      # 0xf4c6
callq 0x2090
movq 0x80(%rbx), %rcx
leaq 0xa0f9(%rip), %rdx      # 0xe91e
leaq 0x9b58(%rip), %r8       # 0xe384
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
leaq 0xa0e9(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
je 0x485b
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0xac6f(%rip), %rdi      # 0xf4d1
callq 0x3973
// File: /workspace/github_c_makefile_star2_O1/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 0x53e9
movq 0x50d8(%rbx), %rdi
callq 0x2060
testl %eax, %eax
jne 0x5450
movq 0x50e0(%rbx), %rdi
callq 0x2060
testl %eax, %eax
jne 0x5461
leaq 0x50e0(%rbx), %r14
movq 0x50d8(%rbx), %rdi
callq 0xc6e6
jmp 0x5436
cmpb $0x1, 0x70(%rbx)
jne 0x5423
movq 0x50e8(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
jne 0x5472
movq 0x50f0(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
je 0x543e
leaq 0x9f0e(%rip), %rdi      # 0xf32c
callq 0x3973
movq 0x50f0(%rbx), %rdi
callq 0xc6e6
leaq 0x50e8(%rbx), %r14
movq (%r14), %rdi
callq 0xc6e6
xorps %xmm0, %xmm0
movups %xmm0, 0x50e8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9e6e(%rip), %rdi      # 0xf2c5
callq 0x2320
jmp 0x53c0
leaq 0x9e85(%rip), %rdi      # 0xf2ed
callq 0x2320
jmp 0x53d4
leaq 0x9e9c(%rip), %rdi      # 0xf315
callq 0x3973
// File: /workspace/github_c_makefile_star2_O1/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 0x54c2
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 0x54db
leaq 0x9e89(%rip), %rdi      # 0xf346
callq 0x3973
movl $0x1, %esi
movq %rax, %rdi
callq 0xc78c
movq %rax, 0x50e8(%rbx)
testq %rax, %rax
je 0x54b6
xorps %xmm0, %xmm0
movups %xmm0, 0x50c8(%rbx)
movups %xmm0, 0x50f0(%rbx)
movq $0x0, 0x5100(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5523
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
je 0x5528
leaq 0x9df7(%rip), %rdi      # 0xf315
callq 0x3973
callq 0xc6e6
movq $0x0, 0x50e8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5579
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 0x5592
leaq 0x9de4(%rip), %rdi      # 0xf358
callq 0x3973
movl $0x1, %esi
movq %rax, %rdi
callq 0xc78c
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x556d
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x55be
movq 0x28(%rbx), %rsi
callq 0x2290
testl %eax, %eax
je 0x55c3
leaq 0x9dae(%rip), %rdi      # 0xf367
callq 0x3973
callq 0xc6e6
movq $0x0, 0x98(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5617
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 0x5630
leaq 0x9d62(%rip), %rdi      # 0xf374
callq 0x3973
movl $0x2, %esi
movq %rax, %rdi
callq 0xc78c
movq %rax, 0x50f8(%rbx)
testq %rax, %rax
je 0x560b
movq $0x0, 0x5100(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50c8(%rbx)
movups %xmm0, 0x50e8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x567b
movq 0x28(%rbx), %rsi
addq %rsi, %rsi
callq 0x2290
testl %eax, %eax
je 0x5680
leaq 0x9d12(%rip), %rdi      # 0xf388
callq 0x3973
callq 0xc6e6
movq $0x0, 0x50f8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x56d5
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 0x56ee
leaq 0x9cd1(%rip), %rdi      # 0xf3a1
callq 0x3973
movl $0x4, %esi
movq %rax, %rdi
callq 0xc78c
movq %rax, 0x5100(%rbx)
testq %rax, %rax
je 0x56c9
xorps %xmm0, %xmm0
movups %xmm0, 0x50e8(%rbx)
movq $0x0, 0x50f8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5733
movq 0x28(%rbx), %rsi
shlq $0x2, %rsi
callq 0x2290
testl %eax, %eax
je 0x5738
leaq 0x9c81(%rip), %rdi      # 0xf3af
callq 0x3973
callq 0xc6e6
movq $0x0, 0x5100(%rbx)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x50a0(%rbx)
testq %rax, %rax
jne 0x5779
leaq 0x9d73(%rip), %rdi      # 0xf4e7
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0x57cf
leaq 0xa0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xaa9d(%rip), %r15      # 0x1022d
leaq 0x9d50(%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 0x57c3
movq %r12, %rdi
callq 0x3973
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5797
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x582e
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9d04(%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 0x581d
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x57f1
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x586f
xorl %r15d, %r15d
leaq 0x9cbe(%rip), %r14      # 0xf505
movq 0x50a0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5863
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5847
movq 0x50a0(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc6e6
// File: /workspace/github_c_makefile_star2_O1/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), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x50b0(%rbx)
testq %rax, %rax
jne 0x58b1
leaq 0x9c68(%rip), %rdi      # 0xf514
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0x5907
leaq 0x20a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa965(%rip), %r15      # 0x1022d
leaq 0x9c45(%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 0x58fb
movq %r12, %rdi
callq 0x3973
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x58cf
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x596e
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9bf9(%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 0x595d
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5929
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x59af
xorl %r15d, %r15d
leaq 0x9bab(%rip), %r14      # 0xf532
movq 0x50b0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x59a3
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5987
movq 0x50b0(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc6e6
// File: /workspace/github_c_makefile_star2_O1/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), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x50b8(%rbx)
testq %rax, %rax
jne 0x59f1
leaq 0x9b55(%rip), %rdi      # 0xf541
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0x5a47
leaq 0x30a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa825(%rip), %r15      # 0x1022d
leaq 0x9b32(%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 0x5a3b
movq %r12, %rdi
callq 0x3973
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5a0f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5aae
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x9ae6(%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 0x5a9d
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5a69
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5aef
xorl %r15d, %r15d
leaq 0x9a98(%rip), %r14      # 0xf55f
movq 0x50b8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5ae3
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5ac7
movq 0x50b8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc6e6
// File: /workspace/github_c_makefile_star2_O1/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), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x50c0(%rbx)
testq %rax, %rax
jne 0x5b31
leaq 0x9a42(%rip), %rdi      # 0xf56e
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0x5b87
leaq 0x40a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa6e5(%rip), %r15      # 0x1022d
leaq 0x9a1f(%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 0x5b7b
movq %r12, %rdi
callq 0x3973
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5b4f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5be6
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x99d3(%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 0x5bd5
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5ba9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5c27
xorl %r15d, %r15d
leaq 0x998d(%rip), %r14      # 0xf58c
movq 0x50c0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5c1b
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5bff
movq 0x50c0(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc6e6
// File: /workspace/github_c_makefile_star2_O1/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), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x50a8(%rbx)
testq %rax, %rax
jne 0x5c69
leaq 0x9937(%rip), %rdi      # 0xf59b
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0x5cbf
leaq 0x10a0(%rbx), %r14
xorl %r13d, %r13d
leaq 0xa5ad(%rip), %r15      # 0x1022d
leaq 0x9914(%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 0x5cb3
movq %r12, %rdi
callq 0x3973
incq %r13
movslq 0x20(%rbx), %rax
cmpq %rax, %r13
jl 0x5c87
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5d26
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x98c8(%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 0x5d15
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5ce1
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5d67
xorl %r15d, %r15d
leaq 0x987a(%rip), %r14      # 0xf5b9
movq 0x50a8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x20e0
testl %eax, %eax
je 0x5d5b
movq %r14, %rdi
callq 0x3973
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5d3f
movq 0x50a8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xc6e6
// File: /workspace/github_c_makefile_star2_O1/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 0x9829(%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 0x5dc8
leaq 0x9812(%rip), %rdi      # 0xf5d5
callq 0x3973
leaq 0x9830(%rip), %rsi      # 0xf5ff
movl %r14d, %edi
callq 0x2270
movq %rax, %r14
testq %rax, %rax
jne 0x5deb
leaq 0x981c(%rip), %rdi      # 0xf602
callq 0x3973
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0x5e03
leaq 0x982e(%rip), %rdi      # 0xf62c
callq 0x3973
movq %r14, %rax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5e6a
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 0x9825(%rip), %r12      # 0xf656
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2210
movq %rax, %r13
testq %rax, %rax
jne 0x5e51
movq %r12, %rdi
callq 0x3973
addq %r13, %r15
addq %r13, %rbx
subq %r13, %r14
jne 0x5e31
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5ec6
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 0x97d5(%rip), %r12      # 0xf662
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2300
movq %rax, %r13
testq %rax, %rax
jne 0x5ead
movq %r12, %rdi
callq 0x3973
addq %r13, %r15
addq %r13, %rbx
subq %r13, %r14
jne 0x5e8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5f26
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
movq 0x10(%rbx), %rsi
movq 0x8(%rbx), %rcx
callq 0x5e0f
movslq 0x1c(%rbx), %rax
addq %rax, 0x8(%rbx)
movl $0x0, 0x1c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc63a
movq %rax, 0x10(%r14)
testq %rax, %rax
jne 0x5f8d
leaq 0x96e5(%rip), %rdi      # 0xf66d
callq 0x3973
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_O1/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 0x600f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x7, %al
sete %al
orb %sil, %al
jne 0x5fd6
leaq 0x990a(%rip), %rdi      # 0xf8db
callq 0x3973
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 0x5e0f
addq %r14, 0x8(%rbx)
movq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x607d
leaq 0x96d4(%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 0x6061
leaq 0x96b3(%rip), %rdi      # 0xf70f
callq 0x3973
movl (%rbx), %edi
leaq 0x7(%r14), %rsi
shrq $0x3, %rsi
callq 0x22b0
testl %eax, %eax
je 0x60e3
leaq 0x96bc(%rip), %rdi      # 0xf737
jmp 0x60de
leaq 0x95f6(%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 0x60ac
leaq 0x95e0(%rip), %rdi      # 0xf687
callq 0x3973
movl (%rbx), %edi
leaq 0x7(%r14), %rsi
shrq $0x3, %rsi
callq 0x22b0
testl %eax, %eax
je 0x60cb
leaq 0x95ea(%rip), %rdi      # 0xf6b0
callq 0x3973
movq %rsp, %rdi
callq 0x2060
testl %eax, %eax
je 0x60e3
leaq 0x95fc(%rip), %rdi      # 0xf6da
callq 0x3973
movq %r14, 0x18(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0xc63a
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x6106
leaq 0x965f(%rip), %rdi      # 0xf760
callq 0x3973
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_O1/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), %eax
cmpl 0x20(%rdi), %eax
jl 0x61a8
movq %r14, %rdi
xorl %esi, %esi
callq 0x5fb2
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 0x619c
leaq 0x95f6(%rip), %rdi      # 0xf78d
callq 0x3973
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 0x61de
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_O1/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 0x627c
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 0x5fb2
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 0x6265
sete %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6271
leaq 0x9588(%rip), %rdi      # 0xf7eb
jmp 0x626c
leaq 0x9555(%rip), %rdi      # 0xf7c1
callq 0x3973
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_O1/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 0x9563(%rip), %rsi      # 0xf816
callq 0x21e0
movq %rax, %rbx
testq %rax, %rax
jne 0x62cc
leaq 0x9552(%rip), %rdi      # 0xf819
callq 0x3973
leaq 0x9571(%rip), %rsi      # 0xf844
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2370
leaq 0x8640(%rip), %rsi      # 0xe92e
movq %r12, %rdi
callq 0x21e0
movq %rax, %r15
testq %rbx, %rbx
jne 0x630a
leaq 0x954d(%rip), %rdi      # 0xf852
callq 0x3973
movb $0x0, 0xe(%rsp)
testq %r14, %r14
je 0x639e
xorl %r13d, %r13d
leaq 0xf(%rsp), %r12
leaq 0x9557(%rip), %rbp      # 0xf87e
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x20a0
cmpq $0x1, %rax
je 0x634a
movq %rbp, %rdi
callq 0x3973
cmpb $0x0, 0xf(%rsp)
jns 0x635f
movl %r13d, %ecx
andb $0x7, %cl
movb $0x1, %al
shlb %cl, %al
orb %al, 0xe(%rsp)
movl %r13d, %eax
notl %eax
testb $0x7, %al
jne 0x6396
movl $0x1, %esi
movl $0x1, %edx
leaq 0xe(%rsp), %rdi
movq %r15, %rcx
callq 0x2390
cmpq $0x1, %rax
je 0x6391
leaq 0x9521(%rip), %rdi      # 0xf8ad
callq 0x3973
movb $0x0, 0xe(%rsp)
incq %r13
cmpq %r13, %r14
jne 0x6327
testb $0x7, %r14b
je 0x63cd
leaq 0xe(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2390
cmpq $0x1, %rax
je 0x63cd
leaq 0x94e5(%rip), %rdi      # 0xf8ad
callq 0x3973
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_O1/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 0x94fd(%rip), %rdi      # 0xf908
xorl %eax, %eax
callq 0x2100
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cmpq $0x10000, %rax          # imm = 0x10000
jb 0x645c
leaq 0x94f1(%rip), %rdi      # 0xf919
xorl %eax, %eax
callq 0x2100
testl %ebp, %ebp
jle 0x6496
movl %ebp, %r15d
leaq 0x94d7(%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 0x6440
jmp 0x6496
leaq 0x94bc(%rip), %rdi      # 0xf91f
xorl %eax, %eax
callq 0x2100
testl %ebp, %ebp
jle 0x6496
movl %ebp, %r15d
leaq 0x94b2(%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 0x647b
leaq 0x9491(%rip), %rdi      # 0xf92e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O1/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 0x9449(%rip), %rdi      # 0xf908
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x2100
movslq 0x10(%rbx), %rax
testq %rax, %rax
jle 0x64e7
movq 0x20(%rbx), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
addq (%rcx,%rdx,8), %r14
incq %rdx
cmpq %rdx, %rax
jne 0x64db
movslq 0x14(%rbx), %rcx
testq %rcx, %rcx
jle 0x650a
shlq $0x3, %rax
addq 0x20(%rbx), %rax
xorl %edx, %edx
xorl %esi, %esi
addq (%rax,%rdx,8), %rsi
incq %rdx
cmpq %rdx, %rcx
jne 0x64fc
jmp 0x650c
xorl %esi, %esi
movzbl 0x2c(%rbx), %ecx
leaq 0x941e(%rip), %rdi      # 0xf935
movq %r14, %rdx
xorl %eax, %eax
callq 0x2100
leaq 0x942d(%rip), %rdi      # 0xf955
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O1/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 0xc63a
movq %rax, %rbx
testq %rax, %rax
jne 0x6559
leaq 0x9408(%rip), %rdi      # 0xf95c
callq 0x3973
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
movl %eax, 0x28(%rbx)
cltq
movq 0x28(%r14), %rcx
cmpq %rax, %rcx
cmovbel %ecx, %eax
movl %eax, 0x28(%rbx)
movslq %edx, %rdi
movl $0x8, %esi
callq 0xc78c
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x65b7
leaq 0x93aa(%rip), %rdi      # 0xf95c
callq 0x3973
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc63a
movq %rax, %r14
testq %rax, %rax
jne 0x65fd
leaq 0x937f(%rip), %rdi      # 0xf977
callq 0x3973
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_O1/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 0x6647
movq 0x18(%rdi), %r14
callq 0xc6e6
movq %r14, %rdi
testq %r14, %r14
jne 0x6636
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x6660
movq (%rdi), %r14
callq 0xc6e6
movq %r14, %rdi
testq %r14, %r14
jne 0x6650
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6679
movq (%rdi), %r14
callq 0xc6e6
movq %r14, %rdi
testq %r14, %r14
jne 0x6669
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc6e6
// File: /workspace/github_c_makefile_star2_O1/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 0x669c
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
jmp 0x66b9
movl $0x20, %edi
callq 0xc63a
testq %rax, %rax
jne 0x66b9
leaq 0x92de(%rip), %rdi      # 0xf990
callq 0x3973
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/./blocks.h
// Function: get_occ
customInt *get_occ(solidBlockFile *s) {
  customInt *occ = s->occList;  // try occlist
  if(occ == NULL) {
    occ = malloc(s->occ_size* sizeof(customInt));
    if(occ==NULL) die("Out of mem in get_occ()");
  }
  else { // update list occList
    customInt **n = (customInt **) occ;
    s->occList = n[0];
  }
  return occ;  
}

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

// Assembly:
pushq %rax
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x6703
movq (%rax), %rcx
movq %rcx, 0x28(%rdi)
jmp 0x6722
movslq 0x10(%rdi), %rdi
addq %rdi, %rdi
callq 0xc63a
testq %rax, %rax
jne 0x6722
leaq 0x92a7(%rip), %rdi      # 0xf9c2
callq 0x3973
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/./blocks.h
// Function: block_free
void block_free(solidBlock *b, solidBlockFile *x)
{
  assert(b!=NULL && b->occ != NULL);
  // free occ's
  if(b->endsAt -b->beginsAt > SMALLSOLID_LIMIT)
    free_occ(b->occ,x);
  else // smallOcc  
    free_smallocc(b->smallOcc,x);
  // free block itself  
  b->nextBlock = x->solidList;
  x->solidList = b;
}

// Assembly:
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
subq (%rdi), %rax
xorl %edx, %edx
cmpq $0x10000, %rax          # imm = 0x10000
setb %dl
movq 0x20(%rsi,%rdx,8), %rax
movq %rax, (%rcx)
movq %rcx, 0x20(%rsi,%rdx,8)
movq 0x18(%rsi), %rax
movq %rax, 0x18(%rdi)
movq %rdi, 0x18(%rsi)
retq