LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x20(%rax), %rdi
shlq $0x3, %rdi
callq 0x127b0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x50b8(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x50b8(%rax)
jne 0x71c5
leaq 0xe36a(%rip), %rdi      # 0x1552a
callq 0x3ce0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x723e
movq 0x10(%rsp), %rdi
addq $0x30a0, %rdi           # imm = 0x30A0
leaq 0xf08b(%rip), %rsi      # 0x16279
callq 0x21d0
movq %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x50b8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq 0x50b8(%rax), %rax
movslq 0xc(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x722f
leaq 0xe300(%rip), %rdi      # 0x1552a
callq 0x3ce0
jmp 0x7231
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x71cd
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x72e9
movq 0x10(%rsp), %rax
movq 0x50b8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rax
movslq 0x50(%rax), %rsi
movq 0x10(%rsp), %rax
movq (%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq 0x10(%rsp), %rcx
addq 0x30(%rcx), %rax
imulq %rax, %rsi
xorl %edx, %edx
callq 0x2250
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x72d7
leaq 0xe266(%rip), %rdi      # 0x15538
callq 0x3ce0
jmp 0x72d9
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x7261
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x734f
movq 0x10(%rsp), %rax
movq 0x50b8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20d0
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x7340
leaq 0xe20d(%rip), %rdi      # 0x15548
callq 0x3ce0
jmp 0x7342
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x7301
movq 0x10(%rsp), %rax
movq 0x50b8(%rax), %rdi
callq 0x12940
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x20(%rax), %rdi
shlq $0x3, %rdi
callq 0x127b0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x50c0(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x50c0(%rax)
jne 0x73b5
leaq 0xe1a7(%rip), %rdi      # 0x15557
callq 0x3ce0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x742e
movq 0x10(%rsp), %rdi
addq $0x40a0, %rdi           # imm = 0x40A0
leaq 0xee9b(%rip), %rsi      # 0x16279
callq 0x21d0
movq %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x50c0(%rax), %rax
movslq 0xc(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq 0x50c0(%rax), %rax
movslq 0xc(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x741f
leaq 0xe13d(%rip), %rdi      # 0x15557
callq 0x3ce0
jmp 0x7421
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x73bd
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x74cd
movq 0x10(%rsp), %rax
movq 0x50c0(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
subq %rax, %rsi
movq 0x10(%rsp), %rax
addq 0x30(%rax), %rsi
shlq $0x0, %rsi
xorl %edx, %edx
callq 0x2250
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x74be
leaq 0xe0ac(%rip), %rdi      # 0x15565
callq 0x3ce0
jmp 0x74c0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x7451
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x753f
movq 0x10(%rsp), %rax
movq 0x50c0(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20d0
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x7530
leaq 0xe04a(%rip), %rdi      # 0x15575
callq 0x3ce0
jmp 0x7532
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x74f1
movq 0x10(%rsp), %rax
movq 0x50c0(%rax), %rdi
callq 0x12940
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x20(%rax), %rdi
shlq $0x3, %rdi
callq 0x127b0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x50a8(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x50a8(%rax)
jne 0x75a5
leaq 0xdfe4(%rip), %rdi      # 0x15584
callq 0x3ce0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x761e
movq 0x10(%rsp), %rdi
addq $0x10a0, %rdi           # imm = 0x10A0
leaq 0xecab(%rip), %rsi      # 0x16279
callq 0x21d0
movq %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x50a8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq 0x50a8(%rax), %rax
movslq 0xc(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x760f
leaq 0xdf7a(%rip), %rdi      # 0x15584
callq 0x3ce0
jmp 0x7611
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x75ad
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x76c9
movq 0x10(%rsp), %rax
movq 0x50a8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rax
movslq 0x44(%rax), %rsi
movq 0x10(%rsp), %rax
movq (%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq 0x10(%rsp), %rcx
addq 0x30(%rcx), %rax
imulq %rax, %rsi
xorl %edx, %edx
callq 0x2250
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x76b7
leaq 0xdee0(%rip), %rdi      # 0x15592
callq 0x3ce0
jmp 0x76b9
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x7641
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x772f
movq 0x10(%rsp), %rax
movq 0x50a8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20d0
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
je 0x7720
leaq 0xde87(%rip), %rdi      # 0x155a2
callq 0x3ce0
jmp 0x7722
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x76e1
movq 0x10(%rsp), %rax
movq 0x50a8(%rax), %rdi
callq 0x12940
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20e0
movq %rax, %rcx
movq %rcx, %rax
addq $0xb, %rax
movq %rsp, %rdx
movq %rdx, -0x10(%rbp)
addq $0x1a, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x38(%rbp)
movq %rdi, %rsp
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdx
leaq 0xde17(%rip), %rsi      # 0x155b1
movb $0x0, %al
callq 0x2360
movq -0x38(%rbp), %rdi
callq 0x2190
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x77bf
leaq 0xde04(%rip), %rdi      # 0x155be
callq 0x3ce0
movl -0x1c(%rbp), %edi
leaq 0xde1f(%rip), %rsi      # 0x155e8
callq 0x2260
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x77e5
leaq 0xde0b(%rip), %rdi      # 0x155eb
callq 0x3ce0
movq -0x38(%rbp), %rdi
callq 0x2050
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x7803
leaq 0xde17(%rip), %rdi      # 0x15615
callq 0x3ce0
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x20(%rsp)
jbe 0x78ac
movl 0x34(%rsp), %edi
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x2200
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x787a
leaq 0xddca(%rip), %rdi      # 0x1563f
callq 0x3ce0
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x7841
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x20(%rsp)
jbe 0x794c
movl 0x34(%rsp), %edi
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x22f0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x791a
leaq 0xdd36(%rip), %rdi      # 0x1564b
callq 0x3ce0
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x78e1
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
cmpl $0x0, 0x1c(%rax)
jle 0x7a19
movq (%rsp), %rax
movl (%rax), %edi
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movq (%rsp), %rax
movslq 0x1c(%rax), %rdx
shlq $0x0, %rdx
movq (%rsp), %rax
movq 0x8(%rax), %rcx
callq 0x7820
movq (%rsp), %rax
movslq 0x1c(%rax), %rcx
shlq $0x0, %rcx
movq (%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq (%rsp), %rax
movl $0x0, 0x1c(%rax)
popq %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
shlq $0x0, %rdi
callq 0x127b0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x7ae9
leaq 0xdb72(%rip), %rdi      # 0x15656
callq 0x3ce0
movq 0x10(%rsp), %rax
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x20(%rsp), %rax
movl $0x0, 0x1c(%rax)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x24(%rax)
jle 0x7bfd
movq 0x10(%rsp), %rax
movl 0x24(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x7b99
testb $0x1, 0xf(%rsp)
jne 0x7b99
leaq 0xdd30(%rip), %rdi      # 0x158c4
callq 0x3ce0
movq 0x10(%rsp), %rax
movl 0x24(%rax), %eax
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
cltq
movq %rax, (%rsp)
movq 0x10(%rsp), %rax
movl (%rax), %edi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movq (%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
callq 0x7820
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x20(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x24(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movb %sil, %al
movq %rdi, 0x20(%rsp)
andb $0x1, %al
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rax
movl 0x24(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jl 0x7eef
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x7b50
movq 0x20(%rsp), %rax
movl (%rax), %edi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
movl $0x10000, %edx          # imm = 0x10000
callq 0x22f0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jg 0x7edc
leaq 0xd89f(%rip), %rdi      # 0x15776
callq 0x3ce0
movq 0x10(%rsp), %rax
shlq $0x3, %rax
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x20(%rsp), %rax
movl 0x24(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
movl 0x24(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl 0x8(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x7(%rsp)
testb $0x1, 0x1f(%rsp)
je 0x7f7b
movl 0x8(%rsp), %ecx
movl $0x1, %esi
shll %cl, %esi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movslq 0x24(%rax), %rax
addq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movslq 0x20(%rcx), %rcx
cmpq %rcx, %rax
ja 0x7fd3
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movslq 0x24(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x24(%rax)
jmp 0x80c5
movq 0x20(%rsp), %rax
movl 0x24(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x8, %eax
subl %edx, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, 0x14(%rsp)
movslq 0x14(%rsp), %rcx
movq 0x18(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x18(%rsp)
movl 0x14(%rsp), %ecx
movq 0x20(%rsp), %rax
addl 0x24(%rax), %ecx
movl %ecx, 0x24(%rax)
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x7b50
movq 0x18(%rsp), %rcx
shrq $0x3, %rcx
movq 0x20(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
andq $0x7, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movl (%rax), %edi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
movl $0x10000, %edx          # imm = 0x10000
callq 0x22f0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jge 0x8085
leaq 0xd72c(%rip), %rdi      # 0x157aa
callq 0x3ce0
jmp 0x80a3
cmpq $0x0, 0x8(%rsp)
jne 0x80a1
cmpq $0x0, 0x18(%rsp)
jbe 0x80a1
leaq 0xd738(%rip), %rdi      # 0x157d4
callq 0x3ce0
jmp 0x80a3
movq 0x8(%rsp), %rax
shlq $0x3, %rax
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x18(%rsp), %rax
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x24(%rax)
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x1048, %rsp           # imm = 0x1048
movq %rdi, 0x1040(%rsp)
movq %rsi, 0x1038(%rsp)
movq %rdx, 0x1030(%rsp)
movl %ecx, 0x102c(%rsp)
movq 0x1040(%rsp), %rdi
leaq 0xd6da(%rip), %rsi      # 0x157ff
callq 0x21d0
movq %rax, 0x1020(%rsp)
cmpq $0x0, 0x1020(%rsp)
jne 0x8149
leaq 0xd6be(%rip), %rdi      # 0x15802
callq 0x3ce0
leaq 0x20(%rsp), %rdi
movq 0x1030(%rsp), %rdx
movl 0x102c(%rsp), %ecx
leaq 0xd6c9(%rip), %rsi      # 0x1582d
movb $0x0, %al
callq 0x2360
leaq 0x20(%rsp), %rdi
leaq 0xc978(%rip), %rsi      # 0x14aef
callq 0x21d0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x1020(%rsp)
jne 0x8198
leaq 0xd6a8(%rip), %rdi      # 0x1583b
callq 0x3ce0
movb $0x0, 0x17(%rsp)
movb $-0x80, 0x15(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x1038(%rsp), %rax
jae 0x826c
movq 0x1020(%rsp), %rcx
leaq 0x16(%rsp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2090
cmpq $0x1, %rax
je 0x81ea
leaq 0xd682(%rip), %rdi      # 0x15867
callq 0x3ce0
movzbl 0x16(%rsp), %eax
movzbl 0x15(%rsp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x821a
movq 0x8(%rsp), %rax
andq $0x7, %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movzbl 0x17(%rsp), %eax
orl %ecx, %eax
movb %al, 0x17(%rsp)
movq 0x8(%rsp), %rax
andq $0x7, %rax
cmpq $0x7, %rax
jne 0x8257
movq 0x18(%rsp), %rcx
leaq 0x17(%rsp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2380
cmpq $0x1, %rax
je 0x8252
leaq 0xd649(%rip), %rdi      # 0x15896
callq 0x3ce0
movb $0x0, 0x17(%rsp)
jmp 0x8259
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x81ab
movq 0x1038(%rsp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x82a9
movq 0x18(%rsp), %rcx
leaq 0x17(%rsp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2380
cmpq $0x1, %rax
je 0x82a7
leaq 0xd5f4(%rip), %rdi      # 0x15896
callq 0x3ce0
jmp 0x82a9
movq 0x18(%rsp), %rdi
callq 0x20d0
movq 0x1020(%rsp), %rdi
callq 0x20d0
addq $0x1048, %rsp           # imm = 0x1048
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0xd5ee(%rip), %rdi      # 0x158e8
movb $0x0, %al
callq 0x20f0
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
subq (%rcx), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
jbe 0x8369
leaq 0xd5d8(%rip), %rdi      # 0x158f9
movb $0x0, %al
callq 0x20f0
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x8367
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xd5a1(%rip), %rdi      # 0x158f4
movb $0x0, %al
callq 0x20f0
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x8330
jmp 0x83b8
leaq 0xd58f(%rip), %rdi      # 0x158ff
movb $0x0, %al
callq 0x20f0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x83b6
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movzwl (%rax,%rcx,2), %esi
leaq 0xd568(%rip), %rdi      # 0x1590a
movb $0x0, %al
callq 0x20f0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x837f
jmp 0x83b8
leaq 0xd54f(%rip), %rdi      # 0x1590e
callq 0x2080
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0xd4f7(%rip), %rdi      # 0x158e8
movb $0x0, %al
callq 0x20f0
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x8449
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x8412
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x8492
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rsp), %rcx
movl 0x10(%rcx), %ecx
addl 0x8(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x8451
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x20(%rsp), %rax
movb 0x2c(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
leaq 0xd465(%rip), %rdi      # 0x15915
movb $0x0, %al
callq 0x20f0
leaq 0xd477(%rip), %rdi      # 0x15935
callq 0x2080
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0x30, %edi
callq 0x127b0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x84fc
leaq 0xd445(%rip), %rdi      # 0x1593c
callq 0x3ce0
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x18(%rsp), %rax
movb $0x1, 0x2c(%rax)
movq 0x20(%rsp), %rax
movl 0x20(%rax), %ecx
movq 0x20(%rsp), %rax
addl 0x38(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x20(%rsp), %rax
movl 0x20(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x20(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x14(%rax)
movq 0x20(%rsp), %rax
movl 0x90(%rax), %eax
movq 0x18(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jle 0x857c
movq 0x20(%rsp), %rax
movl 0x90(%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x8588
movq 0x18(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x18(%rsp), %rax
movslq 0x28(%rax), %rax
movq 0x20(%rsp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x85b8
movq 0x18(%rsp), %rax
movslq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x85c6
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x18(%rsp), %rax
movslq 0x18(%rax), %rdi
movl $0x8, %esi
callq 0x12a60
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x18(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x860c
leaq 0xd335(%rip), %rdi      # 0x1593c
callq 0x3ce0
movq 0x18(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x30, %edi
callq 0x127b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x866c
leaq 0xd2f0(%rip), %rdi      # 0x15957
callq 0x3ce0
movq 0x8(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rax
movl 0x38(%rax), %ecx
movq 0x10(%rsp), %rax
addl 0x20(%rax), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x8726
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
callq 0x12940
movq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x86ef
movq 0x50(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x8769
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rdi
callq 0x12940
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x8734
movq 0x50(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x87ac
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0x12940
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x8777
movq 0x50(%rsp), %rdi
callq 0x12940
addq $0x58, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x87f3
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x8818
movl $0x20, %edi
callq 0x127b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x8816
leaq 0xd15f(%rip), %rdi      # 0x15970
callq 0x3ce0
jmp 0x8818
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x887c
movq 0x10(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
callq 0x127b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x887a
leaq 0xd115(%rip), %rdi      # 0x1598a
callq 0x3ce0
jmp 0x8895
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x88eb
movq 0x10(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq %rdi
callq 0x127b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x88e9
leaq 0xd0be(%rip), %rdi      # 0x159a2
callq 0x3ce0
jmp 0x8904
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
subq (%rcx), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
jbe 0x89cc
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x8910
jmp 0x89df
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x8950
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./blocks.h
// Function: finalize_liquid
solidBlock *finalize_liquid(solidBlock *last, liquidBlock *b, solidBlock *next, solidBlockFile *sf)
{
  assert(!b->empty);
  if(last!=NULL && last->endsAt==b->beginsAt) {
    // merge b into last and empty it 
    merge_liquid(b,last,sf);  // last and next do not change
  }
  else if(b->endsAt-b->beginsAt>= b->solid_limit) {
    // create new solid and empty b which becomes last block 
    solidBlock *s = liquidToSolid(b,sf);  
    s->nextBlock = next;
    if(last!=NULL) writeBlock(last,sf); // it was: last->nextBlock = s;
    last = s;
  }
  else { // nothing to do, just empty b
    b->empty = true;
    memset(b->occ, 0, (b->occ_size) * sizeof(customInt));
  }
  assert(b->empty);
  return last;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x8a5c
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x8a5c
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x8af0
jmp 0x8ae5
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
subq (%rcx), %rax
movq 0x18(%rsp), %rcx
movslq 0x28(%rcx), %rcx
cmpq %rcx, %rax
jb 0x8abd
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x8c60
movq %rax, (%rsp)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x20(%rsp)
je 0x8ab2
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x8db0
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x8ae3
movq 0x18(%rsp), %rax
movb $0x1, 0x2c(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x18(%rsp), %rax
movslq 0x18(%rax), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2140
jmp 0x8ae5
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./blocks.h
// Function: merge_liquid
static void merge_liquid(liquidBlock *b, solidBlock *s, solidBlockFile *sf) {
  assert(!b->empty);
  // --- merge occs. 
  if((s->endsAt - s->beginsAt) + (b->endsAt - b->beginsAt) <= SMALLSOLID_LIMIT){
    for (int c = 0; c < b->occ_size; ++c) // merged block is small 
      s->smallOcc[c] += (smallSolidInt) b->occ[c];
  } 
  else {
    if((s->endsAt - s->beginsAt)<= SMALLSOLID_LIMIT)
      block_inflate(s,sf);       // enlarge if required 
    for (int c = 0; c < b->occ_size; ++c) 
      s->occ[c] += b->occ[c];
  }
  // --- update extremes
  if(b->endsAt==s->beginsAt)
    s->beginsAt = b->beginsAt;  // liquid before solid
  else {
    assert(s->endsAt==b->beginsAt); // solid before liquid
    s->endsAt = b->endsAt;
  }
  // --- clear b
  b->empty = true;
  memset(b->occ, 0, (b->occ_size) * sizeof(customInt));
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
subq (%rcx), %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x20(%rsp), %rdx
subq (%rdx), %rcx
addq %rcx, %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x8b82
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x8b80
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzwl %ax, %esi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movzwl (%rax,%rcx,2), %edx
addl %esi, %edx
movw %dx, (%rax,%rcx,2)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x8b38
jmp 0x8bf7
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
subq (%rcx), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x8baa
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x10580
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x8bf5
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x8(%rsp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x8bb2
jmp 0x8bf7
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x8c1c
movq 0x20(%rsp), %rax
movq (%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
jmp 0x8c2e
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movb $0x1, 0x2c(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x18(%rax), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2140
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./blocks.h
// Function: liquidToSolid
static solidBlock *liquidToSolid(liquidBlock *s, solidBlockFile *sf) {
  assert(s->endsAt - s->beginsAt >= s->solid_limit);
  
  // ----- get solid block from s->solidList or malloc
  solidBlock *newB = get_block(sf);
  // --- init block size
  newB->beginsAt = s->beginsAt;
  newB->endsAt = s->endsAt;
  // --- get and init occ/smallOcc array
  if (newB->endsAt - newB->beginsAt <= SMALLSOLID_LIMIT) {
    // small solid block  try get mem from s->occList
    newB->smallOcc = get_smallocc(sf);
    for (int i = 0; i < s->occ_size; ++i)  // copy occ from s
      newB->smallOcc[i] = (smallSolidInt) s->occ[i];
  } 
  else { // large solid block  try get mem from s->occList
    newB->occ = get_occ(sf);
    for (int i = 0; i < s->occ_size; ++i) // copy occ from s
      newB->occ[i] = s->occ[i];
  }
  // clear liquid block 
  s->empty=true;
  memset(s->occ, 0, (s->occ_size) * sizeof(customInt));
  return newB;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x87c0
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
subq (%rcx), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x8d1a
movq 0x18(%rsp), %rdi
callq 0x88a0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x8d18
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movw %ax, %dx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x8cd6
jmp 0x8d79
movq 0x18(%rsp), %rdi
callq 0x8830
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x8d77
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x8d38
jmp 0x8d79
movq 0x20(%rsp), %rax
movb $0x1, 0x2c(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x18(%rax), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2140
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./blocks.h
// Function: tba_alloc
uint64_t *tba_alloc(customInt n, bool mmapB)
{
  uint64_t *a;
  customInt j = (n+31)/32;
  if(mmapB) {
    a = mmap(NULL,j*sizeof(*a),PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
    if(a== MAP_FAILED) die(__func__);
  }
  else {
    a = calloc(j,sizeof(*a));
    if(a==NULL) die(__func__);
  }
  return a;
}

// Assembly:
subq $0x28, %rsp
movb %sil, %al
movq %rdi, 0x20(%rsp)
andb $0x1, %al
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rax
addq $0x1f, %rax
shrq $0x5, %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x1f(%rsp)
je 0x9052
movq 0x8(%rsp), %rsi
shlq $0x3, %rsi
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq %r9, %rdi
callq 0x2220
movq %rax, 0x10(%rsp)
movq $-0x1, %rax
cmpq %rax, 0x10(%rsp)
jne 0x9050
leaq 0xc974(%rip), %rdi      # 0x159bf
callq 0x3ce0
jmp 0x907c
movq 0x8(%rsp), %rdi
movl $0x8, %esi
callq 0x12a60
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x907a
leaq 0xc94a(%rip), %rdi      # 0x159bf
callq 0x3ce0
jmp 0x907c
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./blocks.h
// Function: tba_free
void tba_free(uint64_t *a, customInt n, bool mmap)
{
  if(mmap) {
    customInt j = (n+31)/32;
    int e = munmap(a,j*sizeof(*a));
    if(e!=0) die(__func__);
  }
  else free(a);
}

// Assembly:
subq $0x28, %rsp
movb %dl, %al
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
andb $0x1, %al
movb %al, 0x17(%rsp)
testb $0x1, 0x17(%rsp)
je 0x90eb
movq 0x18(%rsp), %rax
addq $0x1f, %rax
shrq $0x5, %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
shlq $0x3, %rsi
callq 0x2280
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
je 0x90e9
leaq 0xc8e5(%rip), %rdi      # 0x159c9
callq 0x3ce0
jmp 0x90f5
movq 0x20(%rsp), %rdi
callq 0x12940
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./blocks.h
// Function: tba_get
int tba_get(uint64_t *a,customInt i)
{
  customInt q = i/32;
  customInt r = i%32;
  int b2 = (a[q] >> (2*r)) & 3;       // shift and check last 2 bits
  return b2;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x10(%rsp), %rax
shrq $0x5, %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
andq $0x1f, %rax
movq %rax, -0x20(%rsp)
movq -0x8(%rsp), %rax
movq -0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x20(%rsp), %rcx
shlq %rcx
shrq %cl, %rax
andq $0x3, %rax
movl %eax, -0x24(%rsp)
movl -0x24(%rsp), %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/./merge8.h
// Function: init_arrays8
static void init_arrays8(g_data *g)
{
  assert(g->numBwt<=8);
  customInt i=0; // position inside Z newZ and B  

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

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x9b37
movq 0x20(%rsp), %rax
movq 0x50e8(%rax), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x10610
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x5108(%rax), %rax
movslq 0x14(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x9b25
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x18(%rcx), %rcx
movslq 0x10(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0x14(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jae 0x9b13
cmpl $0x0, 0x14(%rsp)
jne 0x9ad8
movq 0x20(%rsp), %rax
movq 0x50e8(%rax), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x10610
imull $0x9, 0x10(%rsp), %esi
movq 0x20(%rsp), %rax
movq 0x50e8(%rax), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x9a94
jmp 0x9b15
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x9a79
jmp 0x9b27
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x9a2a
addq $0x28, %rsp
retq
nopl (%rax)