LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: rank
int rank(char *T, char c, int i){

  int sum=0;
  int j;

  for(j=0; j<i; j++) if(T[j] <= c) sum++;
  int len = strlen(T);
  for(; j<len; j++) if(T[j] < c) sum++;

return sum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testl %edx, %edx
jle 0x4c36
movl %edx, %r15d
movl %edx, %eax
xorl %ecx, %ecx
xorl %ebp, %ebp
xorl %edx, %edx
cmpb %bl, (%r14,%rcx)
setle %dl
addl %edx, %ebp
incq %rcx
cmpq %rcx, %rax
jne 0x4c21
jmp 0x4c3b
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x20c0
cmpl %eax, %r15d
jge 0x4c60
movl %r15d, %ecx
movl %eax, %eax
xorl %edx, %edx
cmpb %bl, (%r14,%rcx)
setl %dl
addl %edx, %ebp
incq %rcx
cmpq %rcx, %rax
jne 0x4c4d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: bwt_lyndon_suffix_order
int bwt_lyndon_suffix_order(char *T, int_t *LA, int n){

int p, r=1;
int i, s;

int_t size=1;
//base cases
LA[n-2]=size++;
LA[n-1]=size++;

for(s=n-3; s>=0; s--){

  /*steps 1 and 2*/
  p=r+1;
  for(i=s+1, r=0; T[i]!=0; i++)if(T[i]<=T[s])r++;
  for(; i<n; i++) if(T[i]<T[s])r++;
  
  T[p+s] = T[s]; //replace('$', T[s]);

  for(i=s; i<s+r; i++){
    T[i] = T[i+1];
    LA[i] = LA[i+1];
  }

  T[s+r] = 0; //END_MARKER;
  LA[s+r]=size++;
}

for(i=n-1; i>0; i--){
  int_t max=0;
  for(s=i-1; s>=0; s--){
    if(LA[s]<LA[i] && LA[s]>max) max = LA[s];
  }
  LA[i]-=max;
}

return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %edx, %rax
movabsq $0x200000001, %rcx      # imm = 0x200000001
movq %rcx, -0x8(%rsi,%rax,4)
cmpl $0x3, %edx
jl 0x4f67
leal -0x3(%rdx), %eax
leal -0x2(%rdx), %ecx
leaq (%rsi,%rax,4), %r8
addq $0x4, %r8
leaq (%rax,%rdi), %r9
incq %r9
movl $0x1, %ebx
movl $0x3, %r10d
movb 0x1(%rdi,%rax), %r15b
testb %r15b, %r15b
je 0x4ed6
movb (%rdi,%rax), %bpl
xorl %r11d, %r11d
movq %rcx, %r14
xorl %r12d, %r12d
cmpb %bpl, %r15b
setle %r12b
addl %r12d, %r11d
movb 0x1(%rdi,%r14), %r15b
incq %r14
testb %r15b, %r15b
jne 0x4eba
jmp 0x4edd
leaq 0x1(%rax), %r14
xorl %r11d, %r11d
cmpl %edx, %r14d
jge 0x4f04
movb (%rdi,%rax), %bpl
movl %r14d, %r15d
addq %rdi, %r15
xorl %r12d, %r12d
cmpb %bpl, (%r15)
setl %r12b
addl %r12d, %r11d
incq %r15
incl %r14d
cmpl %edx, %r14d
jl 0x4eec
incl %ebx
movb (%rdi,%rax), %bpl
addl %eax, %ebx
movslq %ebx, %rbx
movb %bpl, (%rdi,%rbx)
leal (%r11,%rax), %ebx
testl %r11d, %r11d
jle 0x4f3c
xorl %r14d, %r14d
movb (%r9,%r14), %bpl
movb %bpl, -0x1(%r9,%r14)
movl (%r8,%r14,4), %ebp
movl %ebp, -0x4(%r8,%r14,4)
incq %r14
leal (%r14,%rax), %ebp
cmpl %ebp, %ebx
jg 0x4f1f
movslq %ebx, %rbx
movb $0x0, (%rdi,%rbx)
movl %r10d, (%rsi,%rbx,4)
leal 0x1(%r10), %ebp
decq %rax
decq %rcx
addq $-0x4, %r8
decq %r9
movl %r11d, %ebx
cmpl %edx, %r10d
movl %ebp, %r10d
jne 0x4ea6
cmpl $0x2, %edx
jl 0x4fb7
leal -0x1(%rdx), %eax
movl %eax, %ecx
leaq -0x1(%rcx), %rax
movl (%rsi,%rcx,4), %r8d
xorl %edi, %edi
movq %rax, %r9
movl %edx, %r10d
movl %edi, %r11d
movl %r9d, %ebx
movl (%rsi,%rbx,4), %ebx
cmpl %edi, %ebx
cmovgl %ebx, %edi
cmpl %r8d, %ebx
cmovgel %r11d, %edi
decl %r10d
decq %r9
cmpl $0x1, %r10d
jg 0x4f81
subl %edi, (%rsi,%rcx,4)
leaq -0x1(%rcx), %rdi
decl %edx
decq %rax
cmpq $0x1, %rcx
movq %rdi, %rcx
jg 0x4f75
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: bwt_lyndon_text_order
int bwt_lyndon_text_order(char *T, int_t *LA, int n){

  int p, r=1;
  int i, s;
  
  //base cases
  LA[n-2]=n-1;
  LA[n-1]=n-2;
  
  for(s=n-3; s>=0; s--){
  
    /*steps 1 and 2*/
    p=r+1;
    for(i=s+1, r=0; T[i]!=0; i++)if(T[i]<=T[s])r++;
    for(; i<n; i++) if(T[i]<T[s])r++;
    
    T[p+s] = T[s]; //replace('$', T[s]);
    
    for(i=s; i<s+r; i++){
      T[i] = T[i+1];
    }
    
    for(i=s+1; i<n; i++){
      if(LA[i]<=s+r) LA[i]--; 
    }
    
    T[s+r] = 0; //END_MARKER;
    LA[s]=s+r;
  }
  
  //LA = ISA
  for(i=0; i<n; i++){
  //find the next suffix smaller than T[i,n]
    for(s=i+1; s<n; s++){
      if(LA[s]<LA[i]) break;
    }
    LA[i]=s-i;
  }

return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leal -0x1(%rdx), %eax
leal -0x2(%rdx), %ecx
movslq %edx, %r8
movl %eax, -0x8(%rsi,%r8,4)
movl %ecx, -0x4(%rsi,%r8,4)
movl %r8d, %eax
cmpl $0x3, %r8d
jl 0x50e1
leal -0x3(%rdx), %r8d
leaq (%r8,%rdi), %r9
incq %r9
leaq (%rsi,%rcx,4), %r10
movl $0x1, %r14d
leaq 0x1(%r8), %rbx
movb 0x1(%rdi,%r8), %bpl
movl $0x0, %r11d
movq %rbx, %r15
testb %bpl, %bpl
je 0x503c
movb (%rdi,%r8), %r12b
xorl %r11d, %r11d
movq %rcx, %r15
xorl %r13d, %r13d
cmpb %r12b, %bpl
setle %r13b
addl %r13d, %r11d
movb 0x1(%rdi,%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x5022
cmpl %edx, %r15d
jge 0x5064
movb (%rdi,%r8), %bpl
movl %r15d, %r12d
addq %rdi, %r12
xorl %r13d, %r13d
cmpb %bpl, (%r12)
setl %r13b
addl %r13d, %r11d
incq %r12
incl %r15d
cmpl %edx, %r15d
jl 0x504b
movb (%rdi,%r8), %bpl
addl %r8d, %r14d
incl %r14d
movslq %r14d, %r14
movb %bpl, (%rdi,%r14)
leal (%r11,%r8), %ebp
testl %r11d, %r11d
jle 0x5096
xorl %r14d, %r14d
movb (%r9,%r14), %r15b
movb %r15b, -0x1(%r9,%r14)
incq %r14
leal (%r14,%r8), %r15d
cmpl %r15d, %ebp
jg 0x5081
cmpq %rax, %rbx
jge 0x50b9
xorl %ebx, %ebx
movl (%r10,%rbx,4), %r14d
cmpl %ebp, %r14d
jg 0x50ad
decl %r14d
movl %r14d, (%r10,%rbx,4)
incq %rbx
leal (%rbx,%rcx), %r14d
cmpl %edx, %r14d
jl 0x509d
movslq %ebp, %rbx
movb $0x0, (%rdi,%rbx)
movl %ebp, (%rsi,%r8,4)
leaq -0x1(%r8), %rbx
decq %rcx
decq %r9
addq $-0x4, %r10
movl %r11d, %r14d
testq %r8, %r8
movq %rbx, %r8
jg 0x5001
testl %edx, %edx
jle 0x5121
movl $0x1, %ecx
xorl %edx, %edx
movq %rdx, %rdi
incq %rdx
movl %edx, %r8d
cmpq %rax, %rdx
jae 0x5112
movl (%rsi,%rdi,4), %r9d
movq %rcx, %r8
cmpl %r9d, (%rsi,%r8,4)
jl 0x5112
incq %r8
cmpq %r8, %rax
jne 0x5101
movl %eax, %r8d
subl %edi, %r8d
movl %r8d, (%rsi,%rdi,4)
incq %rcx
cmpq %rax, %rdx
jne 0x50ec
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: bwt_inplace
int bwt_inplace(char *T, int n){

  int p, r=1;
  int i, s;

  for(s=n-3; s>=0; s--){

    p = r+1;//  p = find_sentinel(&T[s]);
    r = rank(&T[s+1], T[s], p);
  
    T[p+s] = T[s]; //replace('$', T[s]);

    for(i=s; i<s+r; i++) 
      T[i] = T[i+1];

    T[s+r] = 0; //END_MARKER;
  }

return 0;
}

// Assembly:
cmpl $0x3, %esi
jl 0x51c3
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
addl $-0x3, %r14d
leaq (%r14,%rdi), %r15
incq %r15
movl $0x1, %r12d
leal 0x1(%r12), %edx
leaq (%rbx,%r14), %rdi
incq %rdi
movsbl -0x1(%rdi), %ebp
movl %ebp, %esi
callq 0x4c08
leal (%r12,%r14), %ecx
incl %ecx
movslq %ecx, %rcx
movb %bpl, (%rbx,%rcx)
leal (%rax,%r14), %ecx
testl %eax, %eax
jle 0x51a2
xorl %edx, %edx
movb (%r15,%rdx), %sil
movb %sil, -0x1(%r15,%rdx)
incq %rdx
leal (%r14,%rdx), %esi
cmpl %esi, %ecx
jg 0x518e
movslq %ecx, %rcx
movb $0x0, (%rbx,%rcx)
leaq -0x1(%r14), %rcx
decq %r15
movl %eax, %r12d
testq %r14, %r14
movq %rcx, %r14
jg 0x5160
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: bwt_reverse
char* bwt_reverse(char *bwt, int n){

  char* rev = (char*) malloc((n+1)*sizeof(char));
  int p = 0;

  //backward reconstruction
  int s;
  for(s=n-2; s>=0; s--){

    rev[s] = bwt[p];
    p = rank(bwt, rev[s], p);
  }

  rev[n-1] = 0; //END_MARKER;
  rev[n] = '\0';

return rev;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leal 0x1(%rbx), %eax
movslq %eax, %rdi
callq 0x7f0e
movq %rax, %r15
cmpl $0x2, %ebx
jl 0x5209
leal -0x2(%rbx), %r12d
incq %r12
xorl %eax, %eax
movslq %eax, %rdx
movsbl (%r14,%rdx), %esi
movb %sil, -0x1(%r15,%r12)
movq %r14, %rdi
callq 0x4c08
decq %r12
jg 0x51ef
movslq %ebx, %rax
movw $0x0, -0x1(%r15,%rax)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: get_count
void get_count(char* T, int *C){

  int i;
  for(i=0; i<UCHAR_SIZE; i++) C[i]=0;
  int size = strlen(T);
  for(i=0; i<size; i++) C[(int)T[i]]++;  
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x400, %edx            # imm = 0x400
movq %rsi, %rdi
xorl %esi, %esi
callq 0x2130
movq %r14, %rdi
callq 0x20c0
testl %eax, %eax
jle 0x525f
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movsbq (%r14,%rcx), %rdx
incl (%rbx,%rdx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x524f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: get_bucket
void get_bucket(int *C, int *B){

  int sum=0;
  int i;
  for(i=0; i<UCHAR_SIZE; i++){
      B[i] = sum;
      sum+=C[i];
  }
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
movl %ecx, (%rsi,%rax,4)
addl (%rdi,%rax,4), %ecx
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x526b
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/bwt.c
// Function: find_sentinel
int find_sentinel(char *T){

  int i;
  for(i=0; i<strlen(T); i++)
    if(T[i] == 0) return i; //END_MARKER

return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x20c0
movq %rax, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
je 0x52a7
xorl %edx, %edx
cmpb $0x0, (%rbx,%rdx)
je 0x52a5
incq %rdx
cmpq %rdx, %rcx
jne 0x5295
jmp 0x52a7
movl %edx, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/suffix-array.c
// Function: suffix_array_write
int suffix_array_write(int_t *SA, int_t n, char* c_file, const char* ext){

  FILE *f_out;
  char *c_out = malloc((strlen(c_file)+strlen(ext)+3)*sizeof(char));
  
  sprintf(c_out, "%s.%s", c_file, ext);
  f_out = file_open(c_out, "wb");
  
  fwrite(SA, sizeof(int_t), n, f_out);
  
  file_close(f_out);
  free(c_out);

return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x20c0
movq %rax, %r14
movq %r15, %rdi
callq 0x20c0
leaq (%r14,%rax), %rdi
addq $0x3, %rdi
callq 0x7f0e
movq %rax, %r14
leaq 0x4403(%rip), %rsi      # 0x96ec
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2260
leaq 0x4148(%rip), %rsi      # 0x9448
movq %r14, %rdi
callq 0x42ac
movq %rax, %r15
movslq %ebp, %rdx
movl $0x4, %esi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x2280
movq %r15, %rdi
callq 0x42d9
movq %r14, %rdi
callq 0x7fc5
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/suffix-array.c
// Function: suffix_array_read
int_t suffix_array_read(int_t** SA, char* c_file, const char* ext){

  FILE *f_in;
  char *c_in = malloc((strlen(c_file)+strlen(ext)+3)*sizeof(char));

  sprintf(c_in, "%s.%s", c_file, ext);
  f_in = file_open(c_in, "rb");

  fseek(f_in, 0L, SEEK_END);
  size_t size = ftell(f_in);
  rewind(f_in);
  
  int_t n = size/sizeof(int_t);

  *SA = (int_t*) malloc(n*sizeof(int_t));
  fread(*SA, sizeof(int_t), n, f_in);

  file_close(f_in);
  free(c_in);

return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20c0
movq %rax, %r14
movq %r15, %rdi
callq 0x20c0
leaq (%r14,%rax), %rdi
addq $0x3, %rdi
callq 0x7f0e
movq %rax, %r14
leaq 0x4375(%rip), %rsi      # 0x96ec
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2260
leaq 0x4341(%rip), %rsi      # 0x96cf
movq %r14, %rdi
callq 0x42ac
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21d0
movq %r15, %rdi
callq 0x2190
movq %rax, %r12
movq %r15, %rdi
callq 0x2110
shrq $0x2, %r12
movslq %r12d, %r12
leaq (,%r12,4), %rdi
callq 0x7f0e
movq %rax, (%rbx)
movl $0x4, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x2090
movq %r15, %rdi
callq 0x42d9
movq %r14, %rdi
callq 0x7fc5
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: stack_pair_init
int stack_pair_init(stack_pair *S, int_t size){

	S->array = (s_pair*) malloc(size*sizeof(s_pair));	
	if(S->array==NULL) return 0;

	S->size = size;
	S->top = 0;

return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %rdi
shlq $0x3, %rdi
callq 0x7f0e
movq %rax, (%rbx)
testq %rax, %rax
je 0x56ce
movl %ebp, 0xc(%rbx)
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: stack_pair_push
void stack_pair_push(stack_pair *S, int_t i, int_t j){

	if(S->top==S->size){
		S->size += STACK_SIZE;
		S->array = (s_pair*) realloc(S->array, S->size*sizeof(s_pair));
	} 

	S->array[S->top].i = i;
	S->array[S->top].j = j;

	(S->top)++;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl 0xc(%rdi), %eax
cmpl %eax, 0x8(%rdi)
jne 0x5705
addl $0x500, %eax            # imm = 0x500
movl %eax, 0xc(%rbx)
movq (%rbx), %rdi
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x808e
movq %rax, (%rbx)
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
movl %r14d, (%rax,%rcx,8)
movl %ebp, 0x4(%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: stack_pair_print
void stack_pair_print(stack_pair *S){

	int_t i;

	for(i=S->top-1; i>0; i--)
		printf("%d\t(%d, %d)\n", i, S->array[i].i, S->array[i].j);
	
	printf("%d\t(%d, %d)\n", i, S->array[i].i, S->array[i].j);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %eax
leal -0x1(%rax), %ebp
cmpl $0x2, %eax
jl 0x5776
movl %ebp, %r15d
incq %r15
leaq 0x4012(%rip), %r14      # 0x9764
movq (%rbx), %rax
movl -0x8(%rax,%r15,8), %edx
movl -0x4(%rax,%r15,8), %ecx
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x20f0
decq %r15
decl %ebp
cmpq $0x1, %r15
jg 0x5752
movq (%rbx), %rax
movslq %ebp, %rsi
movl (%rax,%rsi,8), %edx
movl 0x4(%rax,%rsi,8), %ecx
leaq 0x3fda(%rip), %rdi      # 0x9764
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: stack_init
int stack_init(stack *S, int_t size){

	S->array = (int_t*) malloc(size*sizeof(int_t));	
	if(S->array==NULL) return 0;

	S->size = size;
	S->top = 0;

return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %rdi
shlq $0x2, %rdi
callq 0x7f0e
movq %rax, (%rbx)
testq %rax, %rax
je 0x57c1
movl %ebp, 0xc(%rbx)
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: stack_push
void stack_push(stack *S, int_t i){

	if(S->top==S->size){
		S->size += STACK_SIZE;
		S->array = (int_t*) realloc(S->array, S->size*sizeof(int_t));
	} 

	S->array[S->top] = i;

	(S->top)++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0xc(%rdi), %eax
cmpl %eax, 0x8(%rdi)
jne 0x57f4
addl $0x500, %eax            # imm = 0x500
movl %eax, 0xc(%rbx)
movq (%rbx), %rdi
movslq %eax, %rsi
shlq $0x2, %rsi
callq 0x808e
movq %rax, (%rbx)
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
movl %ebp, (%rax,%rcx,4)
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: stack_print
void stack_print(stack *S){

	int_t i;

	for(i=S->top-1; i>0; i--)
		printf("%d\t(%d)\n", i, S->array[i]);
	
	printf("%d\t(%d)\n", i, S->array[i]);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %eax
leal -0x1(%rax), %ebp
cmpl $0x2, %eax
jl 0x5862
movl %ebp, %r15d
incq %r15
leaq 0x3f2e(%rip), %r14      # 0x9771
movq (%rbx), %rax
movl -0x4(%rax,%r15,4), %edx
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x20f0
decq %r15
decl %ebp
cmpq $0x1, %r15
jg 0x5843
movq (%rbx), %rax
movslq %ebp, %rsi
movl (%rax,%rsi,4), %edx
leaq 0x3eff(%rip), %rdi      # 0x9771
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: find_symbol
unsigned char find_symbol(int_t pos, int_t* F, unsigned char* Alpha, int_t n){

	//binary search
	int_t a=0;
	int_t b=n-2;

	int_t i=0;
	while(a<=b){
		i=a+(b-a)/2;
		if(pos>=F[i] && pos<F[i+1]){
			return Alpha[i];
		}
		if(pos>F[i]) a=i+1;
		else b=i-1;
	}

	return 0;
}

// Assembly:
xorl %eax, %eax
cmpl $0x2, %ecx
jl 0x5950
addl $-0x2, %ecx
movl %ecx, %r9d
subl %eax, %r9d
movl %r9d, %r8d
shrl $0x1f, %r8d
addl %r9d, %r8d
sarl %r8d
addl %eax, %r8d
movslq %r8d, %r10
movl (%rsi,%r10,4), %r9d
cmpl %edi, %r9d
jg 0x5934
cmpl %edi, 0x4(%rsi,%r10,4)
jg 0x5951
leal 0x1(%r8), %r10d
decl %r8d
cmpl %edi, %r9d
cmovll %r10d, %eax
cmovll %ecx, %r8d
movl %r8d, %ecx
cmpl %r8d, %eax
jle 0x590b
xorl %eax, %eax
retq
movb (%rdx,%r10), %al
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/lib/lyndon-array.c
// Function: compute_nsv
int compute_nsv(int_t* NSV, int_t *array, int_t n){

	stack S;
	S.top=0; S.size=STACK_SIZE;
	stack_init(&S,STACK_SIZE);
	stack_push(&S, 0);//(idx, value)=(pos, step)

	int_t i;
  for(i=n-1; i>0; i--){

    NSV[i] = stack_top(&S);
		
    if(array[i-1]>array[i]){
      stack_push(&S, i);
    }
    else{
      //while(stack_top(&S).j >= array[i-1]) stack_pop(&S);
      while(array[stack_top(&S)] >= array[i-1]) stack_pop(&S);
    }
  }

  NSV[0] = stack_top(&S);
  free(S.array);

return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movl $0x1400, %edi           # imm = 0x1400
callq 0x7f0e
movl $0x0, (%rax)
movl $0x1, %ecx
cmpl $0x2, %ebp
jl 0x5bcd
movl %ebp, %ebx
movl $0x500, %edi            # imm = 0x500
movl $0x1, %ebp
xorl %r13d, %r13d
movq 0x8(%rsp), %rsi
movq %rbx, %r15
decq %rbx
movslq %ebp, %r12
movl -0x4(%rax,%r12,4), %ecx
movl %ecx, -0x4(%rsi,%r15,4)
movl -0x8(%r14,%r15,4), %ecx
cmpl -0x4(%r14,%r15,4), %ecx
jle 0x5bb1
cmpl %edi, %ebp
jne 0x5ba3
addl $0x500, %edi            # imm = 0x500
movl %edi, 0x14(%rsp)
movslq %edi, %rsi
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x808e
movl 0x14(%rsp), %edi
movq 0x8(%rsp), %rsi
movl %ebx, (%rax,%r12,4)
incl %ebp
cmpq $0x2, %r15
jg 0x5b5e
jmp 0x5bd4
movslq -0x4(%rax,%r12,4), %rdx
cmpl %ecx, (%r14,%rdx,4)
jl 0x5ba9
subl $0x1, %ebp
cmovbl %r13d, %ebp
movslq %ebp, %rdx
movslq -0x4(%rax,%rdx,4), %rdx
jmp 0x5bb6
movq 0x8(%rsp), %rsi
jmp 0x5bd7
movslq %ebp, %rcx
movl -0x4(%rax,%rcx,4), %ecx
movl %ecx, (%rsi)
movq %rax, %rdi
callq 0x7fc5
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/external/sacak-lyndon.c
// Function: getBuckets_k
void getBuckets_k(int_t *s, 
  int_t *bkt, int_t n,
  unsigned int K, int end, int cs) { 
  int_t i, sum=0;
  
  // clear all buckets .
  for(i=0; i<K; i++) bkt[i]=0; 
  
  // compute the size of each bucket .
  for(i=0; i<n; i++) bkt[chr(i)]++; 
  
  for(i=0; i<K; i++) { 
    sum+=bkt[i]; 
    bkt[i]=end ? sum-1 : sum-bkt[i]; 
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %r8d, %ebx
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %r12
movl %ecx, %r15d
testl %ecx, %ecx
je 0x6440
leaq (,%r15,4), %rdx
movq %r14, %rdi
xorl %esi, %esi
movl %ecx, 0x4(%rsp)
callq 0x2130
movl 0x4(%rsp), %ecx
testl %r13d, %r13d
jle 0x6469
movl %r13d, %eax
xorl %esi, %esi
cmpl $0x4, %ebp
jne 0x6455
movl (%r12,%rsi,4), %edx
jmp 0x645a
movzbl (%r12,%rsi), %edx
movslq %edx, %rdx
incl (%r14,%rdx,4)
incq %rsi
cmpq %rsi, %rax
jne 0x644a
testl %ecx, %ecx
je 0x648c
xorl %eax, %eax
xorl %ecx, %ecx
movl (%r14,%rax,4), %edx
testl %ebx, %ebx
leal -0x1(%rdx,%rcx), %esi
cmovel %ecx, %esi
addl %edx, %ecx
movl %esi, (%r14,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x6471
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]lyndon-array/external/sacak-lyndon.c
// Function: putSuffix0
void putSuffix0(int_t *SA, 
  int_t *s, int_t *bkt, 
  int_t n, unsigned int K, int_t n1, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  // put the suffixes into their buckets.
  for(i=n1-1; i>0; i--) {
    j=SA[i]; SA[i]=0;
    SA[bkt[chr(j)]--]=j;
  }
  SA[0]=n-1; // set the single sentinel suffix.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r13d
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl 0x40(%rsp), %ebp
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
movl $0x1, %r8d
movl %ebp, %r9d
callq 0x6405
cmpl $0x2, %r13d
jl 0x6519
movl %r13d, %eax
incq %rax
movl -0x8(%r14,%rax,4), %ecx
movl $0x0, -0x8(%r14,%rax,4)
movslq %ecx, %rdx
cmpl $0x4, %ebp
jne 0x64f9
movl (%r12,%rdx,4), %edx
jmp 0x64fe
movzbl (%r12,%rdx), %edx
movslq %edx, %rdx
movslq (%r15,%rdx,4), %rsi
leal -0x1(%rsi), %edi
movl %edi, (%r15,%rdx,4)
movl %ecx, (%r14,%rsi,4)
decq %rax
cmpq $0x2, %rax
jg 0x64dd
decl %ebx
movl %ebx, (%r14)
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]lyndon-array/external/sacak-lyndon.c
// Function: induceSAl0
void induceSAl0(int_t *SA,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the head of each bucket.
  getBuckets_k(s, bkt, n, K, false, cs);

  bkt[0]++; // skip the virtual sentinel.
  for(i=0; i<n; i++)
    if(SA[i]>0) {
      j=SA[i]-1;
      if(chr(j)>=chr(j+1)) {
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]++;
        if(!suffix && i>0) SA[i]=0;
      }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x40(%rsp), %ebp
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x6405
incl (%r14)
testl %r13d, %r13d
jle 0x65fb
movl %r13d, %eax
xorl %ecx, %ecx
movslq (%r12,%rcx,4), %rsi
testq %rsi, %rsi
jle 0x65ef
leal -0x1(%rsi), %edx
cmpl $0x4, %ebp
jne 0x6589
movl (%r15,%rdx,4), %edi
jmp 0x658e
movzbl (%r15,%rdx), %edi
cmpl $0x4, %ebp
jne 0x6599
movl (%r15,%rsi,4), %esi
jmp 0x659e
movzbl (%r15,%rsi), %esi
cmpl %esi, %edi
jl 0x65ef
movl %edx, %esi
cmpl $0x4, %ebp
jne 0x65af
movl (%r15,%rsi,4), %edi
jmp 0x65b4
movzbl (%r15,%rsi), %edi
movslq %edi, %rdi
movslq (%r14,%rdi,4), %rdi
movl %edx, (%r12,%rdi,4)
cmpl $0x4, %ebp
jne 0x65ca
movl (%r15,%rsi,4), %edx
jmp 0x65cf
movzbl (%r15,%rsi), %edx
testl %ebx, %ebx
setne %sil
movslq %edx, %rdx
incl (%r14,%rdx,4)
testq %rcx, %rcx
sete %dl
orb %sil, %dl
jne 0x65ef
movl $0x0, (%r12,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x6572
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]lyndon-array/external/sacak-lyndon.c
// Function: induceSAs0
void induceSAs0(int_t *SA,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  for(i=n-1; i>0; i--)
    if(SA[i]>0) {
      j=SA[i]-1;
      if(chr(j)<=chr(j+1) && bkt[chr(j)]<i) {
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]--;
        if(!suffix) SA[i]=0;
      }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x40(%rsp), %ebp
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
movl $0x1, %r8d
movl %ebp, %r9d
callq 0x6405
cmpl $0x2, %r13d
jl 0x66f5
movl %r13d, %eax
decq %rax
movslq (%r12,%rax,4), %rdx
testq %rdx, %rdx
jle 0x66e1
leal -0x1(%rdx), %ecx
cmpl $0x4, %ebp
jne 0x666c
movl (%r15,%rcx,4), %esi
jmp 0x6671
movzbl (%r15,%rcx), %esi
cmpl $0x4, %ebp
jne 0x667c
movl (%r15,%rdx,4), %edx
jmp 0x6681
movzbl (%r15,%rdx), %edx
cmpl %edx, %esi
jg 0x66e1
movl %ecx, %edx
cmpl $0x4, %ebp
jne 0x6692
movl (%r15,%rdx,4), %esi
jmp 0x6697
movzbl (%r15,%rdx), %esi
movslq %esi, %rsi
movslq (%r14,%rsi,4), %rsi
cmpq %rsi, %rax
jle 0x66e1
cmpl $0x4, %ebp
jne 0x66ae
movl (%r15,%rdx,4), %esi
jmp 0x66b3
movzbl (%r15,%rdx), %esi
movslq %esi, %rsi
movslq (%r14,%rsi,4), %rsi
movl %ecx, (%r12,%rsi,4)
cmpl $0x4, %ebp
jne 0x66c9
movl (%r15,%rdx,4), %ecx
jmp 0x66ce
movzbl (%r15,%rdx), %ecx
movslq %ecx, %rcx
decl (%r14,%rcx,4)
testl %ebx, %ebx
jne 0x66e1
movl $0x0, (%r12,%rax,4)
leaq -0x1(%rax), %rcx
incq %rax
cmpq $0x2, %rax
movq %rcx, %rax
jg 0x6651
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]lyndon-array/external/sacak-lyndon.c
// Function: induceSAs0_LA
void induceSAs0_LA(int_t *SA, int_t *LA,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  for(i=n-1; i>0; i--){

		j=SA[i];
		if(!LA[j]){// LA[j]=1;
				int_t l=j+1;
				//while(LA[l++]!=0);
				//LA[j]=l-j-1;
				while(LA[l]!=0) l+=LA[l];//jumping
				LA[j]=l-j;
		}

    if(SA[i]>0) {

      j=SA[i]-1;
      if(chr(j)<=chr(j+1) && bkt[chr(j)]<i) {
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]--;
        if(!suffix) SA[i]=0;
      }
    }
	}

	LA[n-1]=1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r13d
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl 0x48(%rsp), %ebp
movq %rdx, %rdi
movq %rcx, %rsi
movl %r8d, %edx
movl %r9d, %ecx
movl $0x1, %r8d
movl %ebp, %r9d
callq 0x6405
leal -0x1(%r13), %eax
cmpl $0x2, %r13d
jl 0x6818
movl 0x40(%rsp), %ecx
movl %eax, %edx
movslq (%r12,%rdx,4), %rsi
cmpl $0x0, (%rbx,%rsi,4)
jne 0x6776
leal 0x1(%rsi), %r8d
movl %r8d, %edi
movslq %r8d, %r8
movl (%rbx,%r8,4), %r9d
leal (%r9,%rdi), %r8d
testl %r9d, %r9d
jne 0x675e
subl %esi, %edi
movl %edi, (%rbx,%rsi,4)
movslq (%r12,%rdx,4), %rdi
testq %rdi, %rdi
jle 0x6807
leal -0x1(%rdi), %esi
cmpl $0x4, %ebp
jne 0x6791
movl (%r15,%rsi,4), %r8d
jmp 0x6796
movzbl (%r15,%rsi), %r8d
cmpl $0x4, %ebp
jne 0x67a1
movl (%r15,%rdi,4), %edi
jmp 0x67a6
movzbl (%r15,%rdi), %edi
cmpl %edi, %r8d
jg 0x6807
movl %esi, %edi
cmpl $0x4, %ebp
jne 0x67b8
movl (%r15,%rdi,4), %r8d
jmp 0x67bd
movzbl (%r15,%rdi), %r8d
movslq %r8d, %r8
movslq (%r14,%r8,4), %r8
cmpq %r8, %rdx
jle 0x6807
cmpl $0x4, %ebp
jne 0x67d4
movl (%r15,%rdi,4), %r8d
jmp 0x67d9
movzbl (%r15,%rdi), %r8d
movslq %r8d, %r8
movslq (%r14,%r8,4), %r8
movl %esi, (%r12,%r8,4)
cmpl $0x4, %ebp
jne 0x67ef
movl (%r15,%rdi,4), %esi
jmp 0x67f4
movzbl (%r15,%rdi), %esi
movslq %esi, %rsi
decl (%r14,%rsi,4)
testl %ecx, %ecx
jne 0x6807
movl $0x0, (%r12,%rdx,4)
leaq -0x1(%rdx), %rsi
cmpq $0x1, %rdx
movq %rsi, %rdx
jg 0x6750
cltq
movl $0x1, (%rbx,%rax,4)
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]lyndon-array/external/sacak-lyndon.c
// Function: induceSAs0_LA_17n
void induceSAs0_LA_17n(int_t *SA, int_t *LA, int_t *PREV, int_t *NEXT,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  for(i=n-1; i>0; i--){

		j=SA[i];

		LA[j]=NEXT[j]-j;	
		NEXT[PREV[j]]=NEXT[j];
		PREV[NEXT[j]]=PREV[j];

    if(SA[i]>0) {

      j=SA[i]-1;
      if(chr(j)<=chr(j+1) && bkt[chr(j)]<i) {
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]--;
        if(!suffix) SA[i]=0;
      }
    }
	}

	LA[n-1]=1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbp
movl 0x58(%rsp), %ebx
movl 0x40(%rsp), %edx
movl 0x48(%rsp), %ecx
movq %r8, %rdi
movq %r9, %rsi
movl $0x1, %r8d
movl %ebx, %r9d
callq 0x6405
movq (%rsp), %r9
movl 0x40(%rsp), %ecx
leal -0x1(%rcx), %eax
cmpl $0x2, %ecx
jl 0x6956
movl 0x50(%rsp), %ecx
movl %eax, %edx
movslq (%rbp,%rdx,4), %rsi
movl (%r12,%rsi,4), %edi
subl %esi, %edi
movl %edi, (%r15,%rsi,4)
movl (%r12,%rsi,4), %edi
movslq (%r13,%rsi,4), %r8
movl %edi, (%r12,%r8,4)
movl (%r13,%rsi,4), %edi
movslq (%r12,%rsi,4), %rsi
movl %edi, (%r13,%rsi,4)
movslq (%rbp,%rdx,4), %rdi
testq %rdi, %rdi
jle 0x6945
leal -0x1(%rdi), %esi
cmpl $0x4, %ebx
jne 0x68ce
movl (%r14,%rsi,4), %r8d
jmp 0x68d3
movzbl (%r14,%rsi), %r8d
cmpl $0x4, %ebx
jne 0x68de
movl (%r14,%rdi,4), %edi
jmp 0x68e3
movzbl (%r14,%rdi), %edi
cmpl %edi, %r8d
jg 0x6945
movl %esi, %edi
cmpl $0x4, %ebx
jne 0x68f5
movl (%r14,%rdi,4), %r8d
jmp 0x68fa
movzbl (%r14,%rdi), %r8d
movslq %r8d, %r8
movslq (%r9,%r8,4), %r8
cmpq %r8, %rdx
jle 0x6945
cmpl $0x4, %ebx
jne 0x6911
movl (%r14,%rdi,4), %r8d
jmp 0x6916
movzbl (%r14,%rdi), %r8d
movslq %r8d, %r8
movslq (%r9,%r8,4), %r8
movl %esi, (%rbp,%r8,4)
cmpl $0x4, %ebx
jne 0x692d
movl (%r14,%rdi,4), %esi
jmp 0x6932
movzbl (%r14,%rdi), %esi
movslq %esi, %rsi
decl (%r9,%rsi,4)
testl %ecx, %ecx
jne 0x6945
movl $0x0, (%rbp,%rdx,4)
leaq -0x1(%rdx), %rsi
cmpq $0x1, %rdx
movq %rsi, %rdx
jg 0x6888
cltq
movl $0x1, (%r15,%rax,4)
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]lyndon-array/external/sacak-lyndon.c
// Function: induceSAs0_LA_13n
void induceSAs0_LA_13n(int_t *SA, int_t *LA, int_t *PREV,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  for(i=n-1; i>0; i--){

		j=SA[i];

		int_t next, prev=PREV[j];
		if(LA[j+1]==0) next=j+1;
		else next=PREV[j+1];

		LA[j]=next-j;	

		PREV[next]=prev;
		PREV[prev+1]=next;

    if(SA[i]>0) {
      j=SA[i]-1;
      if(chr(j)<=chr(j+1) && bkt[chr(j)]<i) {
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]--;
        if(!suffix) SA[i]=0;
      }
    }
	}

	LA[n-1]=1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, (%rsp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r13
movl 0x50(%rsp), %ebp
movl 0x40(%rsp), %ecx
movq %r15, %rdi
movq %r8, %rsi
movl %r9d, %edx
movl $0x1, %r8d
movl %ebp, %r9d
callq 0x6405
movq (%rsp), %r10
leal -0x1(%rbx), %eax
cmpl $0x2, %ebx
jl 0x6a98
movl 0x48(%rsp), %ecx
movl %eax, %edx
movslq (%r13,%rdx,4), %rsi
cmpl $0x0, 0x4(%r14,%rsi,4)
je 0x69d6
movl 0x4(%r12,%rsi,4), %edi
jmp 0x69da
leaq 0x1(%rsi), %rdi
movl (%r12,%rsi,4), %r8d
movslq %r8d, %r8
movslq %edi, %r9
subl %esi, %edi
movl %edi, (%r14,%rsi,4)
movl %r8d, (%r12,%r9,4)
movl %r9d, 0x4(%r12,%r8,4)
movslq (%r13,%rdx,4), %rdi
testq %rdi, %rdi
jle 0x6a87
leal -0x1(%rdi), %esi
cmpl $0x4, %ebp
jne 0x6a0f
movl (%r15,%rsi,4), %r8d
jmp 0x6a14
movzbl (%r15,%rsi), %r8d
cmpl $0x4, %ebp
jne 0x6a1f
movl (%r15,%rdi,4), %edi
jmp 0x6a24
movzbl (%r15,%rdi), %edi
cmpl %edi, %r8d
jg 0x6a87
movl %esi, %edi
cmpl $0x4, %ebp
jne 0x6a36
movl (%r15,%rdi,4), %r8d
jmp 0x6a3b
movzbl (%r15,%rdi), %r8d
movslq %r8d, %r8
movslq (%r10,%r8,4), %r8
cmpq %r8, %rdx
jle 0x6a87
cmpl $0x4, %ebp
jne 0x6a52
movl (%r15,%rdi,4), %r8d
jmp 0x6a57
movzbl (%r15,%rdi), %r8d
movslq %r8d, %r8
movslq (%r10,%r8,4), %r8
movl %esi, (%r13,%r8,4)
cmpl $0x4, %ebp
jne 0x6a6e
movl (%r15,%rdi,4), %esi
jmp 0x6a73
movzbl (%r15,%rdi), %esi
movslq %esi, %rsi
decl (%r10,%rsi,4)
testl %ecx, %ecx
jne 0x6a87
movl $0x0, (%r13,%rdx,4)
leaq -0x1(%rdx), %rsi
cmpq $0x1, %rdx
movq %rsi, %rdx
jg 0x69c2
cltq
movl $0x1, (%r14,%rax,4)
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]lyndon-array/external/sacak-lyndon.c
// Function: induceSAs0_LA_9n
void induceSAs0_LA_9n(int_t *SA, int_t *LA, 
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  for(i=n-1; i>0; i--){

    #if DEBUG
	    printf("\n\n");
	    printf("LA (%d)\n",SA[i]);
      for(j=0; j<n; j++)
	    	printf("%" PRIdN "\t", LA[j]);
	    printf("\n\n");
    #endif

		j=SA[i];
		int_t next, prev;

    if(SA[i]>0) {

      if(LA[j-1]<j) prev=LA[j-1];
      else prev=j-1;
	    next=LA[j];

		  LA[next-1]=prev;
      if(prev>=0) LA[prev]=next;

      j=SA[i]-1;
      if(chr(j)<=chr(j+1) && bkt[chr(j)]<i) { //Inducing S-type
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]--;
        if(!suffix) SA[i]=0;
      }
    }
    else{
      prev=j-1;
	    next=LA[j];
		  LA[next-1]=prev;
    }
	}

  #if DEBUG
	  printf("\n\n");
	  printf("LA (%d)\n",SA[i]);
    for(j=0; j<n; j++)
	  	printf("%" PRIdN "\t", LA[j]);
	  printf("\n\n");
  #endif 

	LA[n-1]=n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r13
movl 0x48(%rsp), %ebp
movq %rdx, %rdi
movq %rcx, %rsi
movl %r8d, %edx
movl %r9d, %ecx
movl $0x1, %r8d
movl %ebp, %r9d
callq 0x6405
leal -0x1(%rbx), %eax
cmpl $0x2, %ebx
jl 0x6bd3
movl 0x40(%rsp), %ecx
movl %eax, %edx
movslq (%r13,%rdx,4), %rdi
leal -0x1(%rdi), %esi
testq %rdi, %rdi
jle 0x6b3e
movl %esi, %r8d
movl (%r14,%r8,4), %r8d
cmpl %edi, %r8d
cmovll %r8d, %esi
movslq (%r14,%rdi,4), %rdi
movl %esi, -0x4(%r14,%rdi,4)
testl %esi, %esi
js 0x6b29
movl %esi, %esi
movl %edi, (%r14,%rsi,4)
movslq (%r13,%rdx,4), %rsi
leaq -0x1(%rsi), %rdi
cmpl $0x4, %ebp
jne 0x6b49
movl -0x4(%r12,%rsi,4), %r8d
jmp 0x6b4e
movslq (%r14,%rdi,4), %rdi
movl %esi, -0x4(%r14,%rdi,4)
jmp 0x6bc2
movzbl (%r12,%rdi), %r8d
cmpl $0x4, %ebp
jne 0x6b59
movl (%r12,%rsi,4), %r9d
jmp 0x6b5e
movzbl (%r12,%rsi), %r9d
cmpl %r9d, %r8d
jg 0x6bc2
cmpl $0x4, %ebp
jne 0x6b6f
movl -0x4(%r12,%rsi,4), %r8d
jmp 0x6b74
movzbl (%r12,%rdi), %r8d
movslq %r8d, %r8
movslq (%r15,%r8,4), %r8
cmpq %r8, %rdx
jle 0x6bc2
cmpl $0x4, %ebp
jne 0x6b8c
movl -0x4(%r12,%rsi,4), %r8d
jmp 0x6b91
movzbl (%r12,%rdi), %r8d
movslq %r8d, %r8
movslq (%r15,%r8,4), %r8
movl %edi, (%r13,%r8,4)
cmpl $0x4, %ebp
jne 0x6ba9
movl -0x4(%r12,%rsi,4), %esi
jmp 0x6bae
movzbl (%r12,%rdi), %esi
movslq %esi, %rsi
decl (%r15,%rsi,4)
testl %ecx, %ecx
jne 0x6bc2
movl $0x0, (%r13,%rdx,4)
leaq -0x1(%rdx), %rsi
cmpq $0x1, %rdx
movq %rsi, %rdx
jg 0x6afb
cltq
movl %ebx, (%r14,%rax,4)
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]lyndon-array/external/sacak-lyndon.c
// Function: putSubstr0
void putSubstr0(int_t *SA,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int cs) {
  int_t i, cur_t, succ_t;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  // set each item in SA as empty.
  for(i=0; i<n; i++) SA[i]=0;

  succ_t=0; // s[n-2] must be L-type.
  for(i=n-2; i>0; i--) {
    cur_t=(chr(i-1)<chr(i) ||
           (chr(i-1)==chr(i) && succ_t==1)
          )?1:0;
    if(cur_t==0 && succ_t==1) SA[bkt[chr(i)]--]=i;
    succ_t=cur_t;
  }

  // set the single sentinel LMS-substring.
  SA[0]=n-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebp
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
movl $0x1, %r8d
callq 0x6405
testl %ebx, %ebx
jle 0x6c28
movl %ebx, %edx
shlq $0x2, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2130
cmpl $0x3, %ebx
jl 0x6cd1
leal -0x2(%rbx), %eax
xorl %ecx, %ecx
cmpl $0x4, %ebp
jne 0x6c42
movl -0x4(%r12,%rax,4), %esi
jmp 0x6c48
movzbl -0x1(%r12,%rax), %esi
cmpl $0x4, %ebp
jne 0x6c53
movl (%r12,%rax,4), %edi
jmp 0x6c58
movzbl (%r12,%rax), %edi
movl $0x1, %edx
cmpl %edi, %esi
jl 0x6c95
cmpl $0x4, %ebp
jne 0x6c6d
movl -0x4(%r12,%rax,4), %edx
jmp 0x6c73
movzbl -0x1(%r12,%rax), %edx
cmpl $0x4, %ebp
jne 0x6c7e
movl (%r12,%rax,4), %esi
jmp 0x6c83
movzbl (%r12,%rax), %esi
cmpl %esi, %edx
sete %dl
testl %ecx, %ecx
setne %sil
andb %dl, %sil
movzbl %sil, %edx
xorl $0x1, %ecx
orl %edx, %ecx
jne 0x6cbe
cmpl $0x4, %ebp
jne 0x6ca7
movl (%r12,%rax,4), %ecx
jmp 0x6cac
movzbl (%r12,%rax), %ecx
movslq %ecx, %rcx
movslq (%r15,%rcx,4), %rsi
leal -0x1(%rsi), %edi
movl %edi, (%r15,%rcx,4)
movl %eax, (%r14,%rsi,4)
leaq -0x1(%rax), %rsi
movl %edx, %ecx
cmpq $0x1, %rax
movq %rsi, %rax
jg 0x6c36
decl %ebx
movl %ebx, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/external/sacak-lyndon.c
// Function: getLengthOfLMS
int_t getLengthOfLMS(int_t *s, 
  int_t n, int level, int_t x, int cs) {
  if(x==n-1) return 1;  
  
  int_t dist=0, i=1;  
  while(1) {
    if(chr(x+i)<chr(x+i-1)) break;
    i++;
  }  
  while(1) {
    if(x+i>n-1 || chr(x+i)>chr(x+i-1)) break;
    if(x+i==n-1 || chr(x+i)<chr(x+i-1)) dist=i;
    i++;
  }
  
  return dist+1;
}

// Assembly:
leal -0x1(%rsi), %r9d
movl $0x1, %eax
cmpl %ecx, %r9d
je 0x735e
pushq %rbp
pushq %r14
pushq %rbx
movslq %ecx, %r10
leaq (%rdi,%r10,4), %r11
addq $0x4, %r11
leaq (%r10,%rdi), %rbx
incq %rbx
xorl %edx, %edx
cmpl $0x4, %r8d
jne 0x72be
movl (%r11,%rdx,4), %ebp
jmp 0x72c2
movzbl (%rbx,%rdx), %ebp
cmpl $0x4, %r8d
jne 0x72cf
movl -0x4(%r11,%rdx,4), %r14d
jmp 0x72d5
movzbl -0x1(%rbx,%rdx), %r14d
incq %rdx
cmpl %r14d, %ebp
jge 0x72b2
movl %ecx, %ecx
addq %rdx, %rcx
cmpl %esi, %ecx
popq %rbx
popq %r14
popq %rbp
jge 0x735e
movslq %ecx, %rcx
movslq %esi, %rsi
movslq %r9d, %r9
subq %r10, %rsi
xorl %eax, %eax
cmpl $0x4, %r8d
jne 0x7304
movl (%rdi,%rcx,4), %r10d
jmp 0x7309
movzbl (%rdi,%rcx), %r10d
cmpl $0x4, %r8d
jne 0x7316
movl -0x4(%rdi,%rcx,4), %r11d
jmp 0x731c
movzbl -0x1(%rdi,%rcx), %r11d
cmpl %r11d, %r10d
jg 0x735c
cmpq %rcx, %r9
je 0x734f
cmpl $0x4, %r8d
jne 0x7332
movl (%rdi,%rcx,4), %r10d
jmp 0x7337
movzbl (%rdi,%rcx), %r10d
cmpl $0x4, %r8d
jne 0x7344
movl -0x4(%rdi,%rcx,4), %r11d
jmp 0x734a
movzbl -0x1(%rdi,%rcx), %r11d
cmpl %r11d, %r10d
jge 0x7351
movl %edx, %eax
incq %rdx
incq %rcx
cmpq %rsi, %rdx
jl 0x72f8
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]lyndon-array/external/sacak-lyndon.c
// Function: getSAlms
void getSAlms(int_t *SA, 
  int_t *s, 
  int_t *s1, int_t n, 
  int_t n1, int level, int cs) {
  int_t i, j, cur_t, succ_t;

  j=n1-1; s1[j--]=n-1;
  succ_t=0; // s[n-2] must be L-type
  for(i=n-2; i>0; i--) {
    cur_t=(chr(i-1)<chr(i) ||
          (chr(i-1)==chr(i) && succ_t==1))?1:0;
    if(cur_t==0 && succ_t==1) s1[j--]=i;
    succ_t=cur_t;
  }
}

// Assembly:
leal -0x1(%rcx), %eax
movslq %r8d, %rdi
movl %eax, -0x4(%rdx,%rdi,4)
cmpl $0x3, %ecx
jl 0x7609
movl 0x8(%rsp), %eax
addl $-0x2, %ecx
addl $-0x2, %r8d
xorl %edi, %edi
cmpl $0x4, %eax
jne 0x758d
movl -0x4(%rsi,%rcx,4), %r10d
jmp 0x7593
movzbl -0x1(%rsi,%rcx), %r10d
cmpl $0x4, %eax
jne 0x759e
movl (%rsi,%rcx,4), %r11d
jmp 0x75a3
movzbl (%rsi,%rcx), %r11d
movl $0x1, %r9d
cmpl %r11d, %r10d
jl 0x75e4
cmpl $0x4, %eax
jne 0x75ba
movl -0x4(%rsi,%rcx,4), %r9d
jmp 0x75c0
movzbl -0x1(%rsi,%rcx), %r9d
cmpl $0x4, %eax
jne 0x75cb
movl (%rsi,%rcx,4), %r10d
jmp 0x75d0
movzbl (%rsi,%rcx), %r10d
cmpl %r10d, %r9d
sete %r9b
testl %edi, %edi
setne %r10b
andb %r9b, %r10b
movzbl %r10b, %r9d
xorl $0x1, %edi
orl %r9d, %edi
jne 0x75f5
movslq %r8d, %rdi
decl %r8d
movl %ecx, (%rdx,%rdi,4)
leaq -0x1(%rcx), %r10
movl %r9d, %edi
cmpq $0x1, %rcx
movq %r10, %rcx
jg 0x7581
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_load_file
unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename)
{
  long size = lodepng_filesize(filename);
  if (size < 0) return 78;
  *outsize = (size_t)size;

  *out = (unsigned char*)lodepng_malloc((size_t)size);
  if(!(*out) && size > 0) return 83; /*the above malloc failed*/

  return lodepng_buffer_file(*out, (size_t)size, filename);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
leaq 0xe6e2(%rip), %rsi      # 0xf95c
movq %rdx, %rdi
callq 0x1130
testq %rax, %rax
je 0x12ce
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1110
movq $-0x1, %r14
testl %eax, %eax
jne 0x12c4
movq %r13, %rdi
callq 0x10d0
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, %rax
movq $-0x1, %r14
cmovneq %rax, %r14
movq %r13, %rdi
callq 0x1070
jmp 0x12d5
movq $-0x1, %r14
movl $0x4e, %eax
testq %r14, %r14
js 0x134d
movq %r14, (%r12)
movq %r14, %rdi
callq 0x10f0
movq %rax, %r12
movq %rax, (%r15)
testq %rax, %rax
sete %cl
testq %r14, %r14
setne %dl
movl $0x53, %eax
testb %cl, %dl
jne 0x134d
leaq 0xe64f(%rip), %rsi      # 0xf95c
movq %rbx, %rdi
callq 0x1130
movq %rax, %rbx
movl $0x4e, %eax
testq %rbx, %rbx
je 0x134d
movl $0x1, %esi
movq %r12, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1060
movq %rax, %r15
movq %rbx, %rdi
callq 0x1070
xorl %ecx, %ecx
cmpq %r14, %r15
movl $0x4e, %eax
cmovel %ecx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_save_file
unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename)
{
  FILE* file;
  file = fopen(filename, "wb" );
  if(!file) return 79;
  fwrite((char*)buffer , 1 , buffersize, file);
  fclose(file);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd708(%rip), %rsi      # 0xea71
movq %rdx, %rdi
callq 0x1130
testq %rax, %rax
je 0x1398
movq %rax, %r15
movl $0x1, %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x1150
movq %r15, %rdi
callq 0x1070
xorl %eax, %eax
jmp 0x139d
movl $0x4f, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: bpmnode_create
static BPMNode* bpmnode_create(BPMLists* lists, int weight, unsigned index, BPMNode* tail)
{
  unsigned i;
  BPMNode* result;

  /*memory full, so garbage collect*/
  if(lists->nextfree >= lists->numfree)
  {
    /*mark only those that are in use*/
    for(i = 0; i != lists->memsize; ++i) lists->memory[i].in_use = 0;
    for(i = 0; i != lists->listsize; ++i)
    {
      BPMNode* node;
      for(node = lists->chains0[i]; node != 0; node = node->tail) node->in_use = 1;
      for(node = lists->chains1[i]; node != 0; node = node->tail) node->in_use = 1;
    }
    /*collect those that are free*/
    lists->numfree = 0;
    for(i = 0; i != lists->memsize; ++i)
    {
      if(!lists->memory[i].in_use) lists->freelist[lists->numfree++] = &lists->memory[i];
    }
    lists->nextfree = 0;
  }

  result = lists->freelist[lists->nextfree++];
  result->weight = weight;
  result->index = index;
  result->tail = tail;
  return result;
}

// Assembly:
pushq %rbx
movl 0x14(%rdi), %eax
cmpl 0x10(%rdi), %eax
jb 0x185a
movl (%rdi), %eax
testq %rax, %rax
je 0x17c9
movq 0x8(%rdi), %r8
leaq (,%rax,8), %r9
leaq (%r9,%r9,2), %r9
xorl %r10d, %r10d
movl $0x0, 0x10(%r8,%r10)
addq $0x18, %r10
cmpq %r10, %r9
jne 0x17b7
movl 0x20(%rdi), %r8d
testq %r8, %r8
je 0x1811
movq 0x28(%rdi), %r9
movq 0x30(%rdi), %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %rbx
testq %rbx, %rbx
je 0x17f3
movl $0x1, 0x10(%rbx)
movq 0x8(%rbx), %rbx
jmp 0x17e1
movq (%r10,%r11,8), %rbx
testq %rbx, %rbx
je 0x1809
movl $0x1, 0x10(%rbx)
movq 0x8(%rbx), %rbx
jmp 0x17f7
incq %r11
cmpq %r8, %r11
jne 0x17dd
movl $0x0, 0x10(%rdi)
testq %rax, %rax
je 0x1853
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
xorl %r8d, %r8d
movq 0x8(%rdi), %r9
cmpl $0x0, 0x10(%r9,%r8)
jne 0x184a
addq %r8, %r9
movq 0x18(%rdi), %r10
movl 0x10(%rdi), %r11d
leal 0x1(%r11), %ebx
movl %ebx, 0x10(%rdi)
movq %r9, (%r10,%r11,8)
addq $0x18, %r8
cmpq %r8, %rax
jne 0x1828
movl $0x0, 0x14(%rdi)
movq 0x18(%rdi), %rax
movl 0x14(%rdi), %r8d
leal 0x1(%r8), %r9d
movl %r9d, 0x14(%rdi)
movq (%rax,%r8,8), %rax
movl %esi, (%rax)
movl %edx, 0x4(%rax)
movq %rcx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: boundaryPM
static void boundaryPM(BPMLists* lists, BPMNode* leaves, size_t numpresent, int c, int num)
{
  unsigned lastindex = lists->chains1[c]->index;

  if(c == 0)
  {
    if(lastindex >= numpresent) return;
    lists->chains0[c] = lists->chains1[c];
    lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, 0);
  }
  else
  {
    /*sum of the weights of the head nodes of the previous lookahead chains.*/
    int sum = lists->chains0[c - 1]->weight + lists->chains1[c - 1]->weight;
    lists->chains0[c] = lists->chains1[c];
    if(lastindex < numpresent && sum > leaves[lastindex].weight)
    {
      lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, lists->chains1[c]->tail);
      return;
    }
    lists->chains1[c] = bpmnode_create(lists, sum, lastindex, lists->chains1[c - 1]);
    /*in the end we are only interested in the chain of the last list, so no
    need to recurse if we're at the last one (this gives measurable speedup)*/
    if(num + 1 < (int)(2 * numpresent - 2))
    {
      boundaryPM(lists, leaves, numpresent, c - 1, num);
      boundaryPM(lists, leaves, numpresent, c - 1, num);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movslq %ecx, %rax
negl %ecx
movq %rcx, 0x20(%rsp)
leaq (,%rax,8), %r15
decl %eax
movq %rax, 0x18(%rsp)
xorl %r13d, %r13d
movq %r8, 0x10(%rsp)
leal 0x1(%r8), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
leaq (%rsi,%r15), %rax
movq (%rax,%r13,8), %rax
movl 0x4(%rax), %edx
cmpl %r13d, 0x20(%rsp)
je 0x194a
movq 0x28(%rbx), %rdi
movq 0x18(%rsp), %rcx
leaq (%rcx,%r13), %rbp
movslq %ebp, %rcx
movq (%rdi,%rcx,8), %r8
movq (%rsi,%rcx,8), %rsi
movl (%rsi), %esi
addl (%r8), %esi
addq %r15, %rdi
movq %rax, (%rdi,%r13,8)
cmpq %r12, %rdx
jae 0x1904
leaq (%rdx,%rdx,2), %rax
movl (%r14,%rax,8), %eax
cmpl %eax, %esi
jg 0x196b
movq 0x30(%rbx), %rax
movq (%rax,%rcx,8), %rcx
movq %rbx, %rdi
callq 0x1790
movq 0x30(%rbx), %rcx
addq %r15, %rcx
movq %rax, (%rcx,%r13,8)
leal -0x2(,%r12,2), %eax
cmpl %eax, 0xc(%rsp)
jge 0x198e
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq 0x10(%rsp), %r8
callq 0x1879
decq %r13
jmp 0x18b9
cmpq %r12, %rdx
jae 0x198e
movq 0x28(%rbx), %rcx
addq %r15, %rcx
movq %rax, (%rcx,%r13,8)
leaq (%rdx,%rdx,2), %rax
movl (%r14,%rax,8), %esi
incl %edx
movq %rbx, %rdi
xorl %ecx, %ecx
jmp 0x1981
incl %edx
movq 0x30(%rbx), %rcx
addq %r15, %rcx
movq (%rcx,%r13,8), %rcx
movq 0x8(%rcx), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x1790
addq 0x30(%rbx), %r15
movq %rax, (%r15,%r13,8)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq