// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/mergegap.c
// Function: gap
void gap(g_data *g, bool lastRound) {
  
  // maybe there is nothing to do
  if(g->numBwt<2 && !g->lcpCompute && g->dbOrder==0) {
    assert(g->numBwt==1);
    if(g->verbose>0) puts("Single BWT/LCP merging: nothing to do!");
    return;
  }
  // try preferred algorithm
  if(g->algorithm==8 && g->numBwt <=8 && !g->lcpMerge)
    return gap8(g,lastRound);
  else if(g->algorithm==16 && g->numBwt <=16 && !g->extMem &&!g->lcpCompute)
    return gap16(g,lastRound);    
  else if(g->algorithm==128 && g->numBwt <=128 && !g->lcpMerge)
    return g->extMem ? gap128ext(g,lastRound) : gap128(g,lastRound);    
  else if(g->algorithm==256 && g->numBwt <=256 && g->lcpCompute && !g->mwXMerge)
    return gap256(g,lastRound);
  else if(!g->algorithm) {      
    // use a best fit strategy
    if(g->numBwt<=128 && g->extMem)
      return gap128ext(g,lastRound); // gap128ext is the best extMem also since uses o(n) RAM 
    // case of lcpCompute or bwtOnly not in external memory for at most 128 bwts
    if(!g->lcpMerge && g->numBwt <= 128 && !g->extMem) 
      return gap128(g,lastRound);  // possibly use gap8 or gap16      
    // case <=16 with lcpMerge not in external memory
    if(g->numBwt<=16 && g->lcpMerge && !g->extMem) return gap16(g,lastRound);
  }

  // everything else is handled here!
  if(g->verbose>0) {
    if(g->lcpCompute) puts("BWT Merge + LCP compute with gap");
    else if(g->lcpMerge) puts("BWT/LCP Merge with gap");  
    else puts("BWT only merging with gap");
  }
  assert(g->numBwt <= MAX_NUMBER_OF_BWTS);
  if(g->lcpCompute) {       // we compute LCP values only if we are at the last round 
    assert(!g->bwtOnly && lastRound);
    open_unsortedLCP_files(g);
  }
  else assert(g->bwtOnly || g->lcpMerge);
  
  // init local global vars
  check_g_data(g);
  if(g->extMem) open_bw_files(g);
  // allocate and clear bit/int array B 
  if(!g->lcpMerge) g->bitB = tba_alloc(g->mergeLen, g->mmapB);
  else alloc0_B_array(g); // alloc and clear blockBeginsAt array
        
  // allocate Z (merge) Znew 
  alloc_merge_arrays(g);
  // allocate other useful arrays
  g->inCnt = malloc(g->numBwt*sizeof(customInt));
  g->firstColumn = malloc(g->sizeOfAlpha*sizeof(customInt));
  g->F = malloc(g->sizeOfAlpha*sizeof(customInt));
  if(!g->inCnt || !g->firstColumn || !g->F)  die(__func__);
  // init the above arrays
  if(g->smallAlpha) init_arrays(g);
  else init_arrays_largealpha(g);
  // we are now ready to give mmap advise
  #ifdef USE_MMAP_ADVISE
  if(g->mmapZ) { // advise on g->mergeColor
    for (int i = 0; i < g->sizeOfAlpha-1; ++i)
      madvise(g->mergeColor + g->firstColumn[i], (g->firstColumn[i+1]-g->firstColumn[i])*sizeof(palette), MADV_SEQUENTIAL);
    madvise(g->mergeColor + g->firstColumn[g->sizeOfAlpha-1], (g->mergeLen-g->firstColumn[g->sizeOfAlpha-1])*sizeof(palette), MADV_SEQUENTIAL);
  }
  #endif

  // init liquid block (containing list of allocated mem)
  liquidBlock *liquid = liquid_new(g); 
  // init list (on disk) of irrelevant blocks, initially empty 
  solidBlockFile *ibList = ibHead_new(g);

  // main loop
  customInt prefixLength = 1;      
  int lcpSize = POS_SIZE + BSIZE;   // number of bytes for each pos,lcp pair: see writeLcp()
  int round=0;
  bool merge_completed; 
  do {
    prefixLength+= 1;
    if(prefixLength>MAX_LCP_SIZE && g->lcpMerge) {fprintf(stderr,"LCP too large (use --lbytes=4)\n");exit(EXIT_FAILURE);}
    if(g->lcpCompute && prefixLength-2>MAX_LCP_SIZE) {fprintf(stderr,"LCP too large (2) (use --lbytes=4)\n");exit(EXIT_FAILURE);}
    bool mergeChanged = false; // the Z vector has changed in this iteration (used when g->bwtOnly)
    ibList->fout = gap_tmpfile(g->outPath);
    merge_completed=addCharToPrefix(ibList,liquid,prefixLength,&mergeChanged,round,g);
    if (g->verbose>1 && lastRound) {
      #if MALLOC_COUNT_FLAG
        printf("Lcp: "CUSTOM_FORMAT". Memory peak/current: %.2lf/%.2lf bytes/symbol. ibList: %ju\n", prefixLength-1, (double)malloc_count_peak()/g->mergeLen, (double)malloc_count_current()/g->mergeLen, (uintmax_t) ftello(ibList->fout));
      #else
        printf("Lcp: "CUSTOM_FORMAT". ibList: %ju\n", prefixLength-1, (uintmax_t) ftello(ibList->fout));
      #endif
      // also EOF are written to unsortedLcp file so percentages are not accurate     
      if(g->unsortedLcp) printf("   unsorted lcp values: %ju (%.2lf%%)\n",  
      (uintmax_t) ftello(g->unsortedLcp)/lcpSize, (double) 100*ftello(g->unsortedLcp)/(lcpSize*g->mergeLen));
    }
    round  = 1 - round; // change round parity
    if(g->bwtOnly && !mergeChanged) {
      if(g->verbose>1) puts("Gap bwt-only early termination");
      fclose(ibList->fout);
      break;
    }
    if(ibList->fin!=NULL) fclose(ibList->fin);
    rewind(ibList->fout);
    ibList->fin = ibList->fout;
  } while(!merge_completed);  // end main loop
  if(ibList->fin!=NULL) fclose(ibList->fin);

  #if MALLOC_COUNT_FLAG
    if (g->verbose>0) {
      if(lastRound)
        printf("Merge completed (%d bwts). Mem: %zu peak, %zu current, %.2lf/%.2lf bytes/symbol\n", g->numBwt, malloc_count_peak(),
             malloc_count_current(), (double)malloc_count_peak()/g->mergeLen,
             (double)malloc_count_current()/g->mergeLen);
      else if(g->verbose>1)
        printf("Merge completed (%d bwts). Mem: %zu peak, %zu current\n", g->numBwt, malloc_count_peak(),
             malloc_count_current());
    }
  #else
    if (g->verbose>0) {
        printf("Merge completed (%d bwts).\n", g->numBwt);
    }
  #endif
  liquid_free(liquid);
  ibHead_free(ibList);
  if(g->extMem) close_bw_files(g);

  // computation complete, do the merging. The following call writes the
  // (possibly remapped) merged BWT back to g->bws[0]; and if lcpMerge==true the merged LCP to g->lcps[0] 
  mergeBWTandLCP(g,lastRound);
  if(g->lcpCompute) {
    assert(lastRound);
    // close lcp file (and merge them?)
    close_unsortedLCP_files(g);
    if(g->verbose>0) printf("Remind to run mergelcp to obtain the final LCP array\n"); 
  }

  // free B array 
  if(!g->lcpMerge) tba_free(g->bitB, g->mergeLen, g->mmapB);
  else free_B_array(g); 
  free(g->F); // last five arrays deallocated
  free(g->firstColumn); 
  free(g->inCnt);
  free_merge_arrays(g);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl 0x20(%rdi), %eax
cmpl $0x1, %eax
jg 0xa6b4
cmpb $0x0, 0x3e(%rbx)
jne 0xa6b4
cmpl $0x0, 0x40(%rbx)
je 0xa9fb
movl 0x6c(%rbx), %ecx
cmpl $0x8, %ecx
setne %dl
cmpl $0x9, %eax
setge %sil
orb %dl, %sil
jne 0xa6d3
cmpb $0x0, 0x3d(%rbx)
je 0xa760
cmpl $0x10, %ecx
setne %dl
cmpl $0x11, %eax
setge %sil
orb %dl, %sil
jne 0xa6f5
cmpb $0x0, 0x69(%rbx)
jne 0xa6f5
cmpb $0x0, 0x3e(%rbx)
je 0xa7d9
cmpl $0x80, %ecx
setne %dl
cmpl $0x81, %eax
setge %sil
orb %dl, %sil
jne 0xa712
cmpb $0x0, 0x3d(%rbx)
je 0xa77a
cmpl $0x100, %ecx            # imm = 0x100
setne %dl
cmpl $0x101, %eax            # imm = 0x101
setge %sil
orb %dl, %sil
jne 0xa739
cmpb $0x1, 0x3e(%rbx)
jne 0xa739
cmpb $0x0, 0x3f(%rbx)
je 0xaea1
testl %ecx, %ecx
je 0xa782
cmpl $0x0, 0x94(%rbx)
jle 0xa828
cmpb $0x0, 0x3e(%rbx)
je 0xa80d
leaq 0x5753(%rip), %rdi      # 0xfeae
jmp 0xa823
movzbl %bpl, %esi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b9b
cmpb $0x1, 0x69(%rbx)
je 0xa78f
jmp 0xa7f3
cmpl $0x80, %eax
jg 0xa7a9
cmpb $0x1, 0x69(%rbx)
jne 0xa7a9
movzbl %bpl, %esi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9024
cmpl $0x81, %eax
setge %dl
movb 0x3d(%rbx), %cl
orb %cl, %dl
jne 0xa7be
cmpb $0x0, 0x69(%rbx)
je 0xa7f3
xorb $0x1, %cl
cmpl $0x11, %eax
setge %al
orb %cl, %al
jne 0xa73d
cmpb $0x0, 0x69(%rbx)
jne 0xa73d
movzbl %bpl, %esi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7827
movzbl %bpl, %esi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x83cb
leaq 0x56bb(%rip), %rax      # 0xfecf
leaq 0x56cb(%rip), %rdi      # 0xfee6
cmpb $0x0, 0x3d(%rbx)
cmovneq %rax, %rdi
callq 0x2090
cmpb $0x1, 0x3e(%rbx)
jne 0xa836
movq %rbx, %rdi
callq 0x39d0
movq %rbx, %rdi
callq 0x39cf
cmpb $0x1, 0x69(%rbx)
jne 0xa84c
movq %rbx, %rdi
callq 0x5748
cmpb $0x0, 0x3d(%rbx)
movl %ebp, 0x14(%rsp)
je 0xa860
movq %rbx, %rdi
callq 0x5535
jmp 0xa874
movq 0x28(%rbx), %rdi
movzbl 0x71(%rbx), %esi
callq 0x6aef
movq %rax, 0x98(%rbx)
movq %rbx, %rdi
callq 0x5200
movslq 0x20(%rbx), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, %r15
movq %rax, 0x5118(%rbx)
movslq 0x38(%rbx), %r12
shlq $0x3, %r12
movq %r12, %rdi
callq 0xc63a
movq %rax, %r14
movq %rax, 0x5108(%rbx)
movq %r12, %rdi
callq 0xc63a
movq %rax, 0x5110(%rbx)
testq %r15, %r15
je 0xa8d1
testq %r14, %r14
setne %cl
testq %rax, %rax
setne %al
testb %al, %cl
jne 0xa8dd
leaq 0x560a(%rip), %rdi      # 0xfee2
callq 0x3973
cmpb $0x1, 0x68(%rbx)
jne 0xa8f0
movq %rbx, %rdi
callq 0xaed4
jmp 0xa9ae
movslq 0x20(%rbx), %rdi
shlq $0x3, %rdi
callq 0xc63a
movq %rax, 0x18(%rbx)
testq %rax, %rax
jne 0xa912
leaq 0x5973(%rip), %rdi      # 0x10280
callq 0x3973
cmpl $0x0, 0x20(%rbx)
jle 0xa973
xorl %r15d, %r15d
leaq 0x595e(%rip), %r14      # 0x10280
movslq 0x38(%rbx), %rdi
movl $0x8, %esi
callq 0xc78c
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x18(%rbx), %rax
cmpq $0x0, (%rax,%r15,8)
jne 0xa94b
movq %r14, %rdi
callq 0x3973
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq (%rax,%r15,8), %rdi
movq (%rcx,%r15,8), %rsi
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rdx
callq 0xc41b
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0xa922
movq %rbx, %rdi
callq 0xaed4
cmpl $0x0, 0x20(%rbx)
jle 0xa99d
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xc6e6
incq %r14
movslq 0x20(%rbx), %rax
cmpq %rax, %r14
jl 0xa984
movq 0x18(%rbx), %rdi
callq 0xc6e6
movq $0x0, 0x18(%rbx)
cmpb $0x1, 0x70(%rbx)
jne 0xaa4c
movl 0x38(%rbx), %eax
cmpl $0x2, %eax
jl 0xaa22
xorl %r14d, %r14d
movq 0x5108(%rbx), %rax
movq (%rax,%r14,8), %rcx
movq 0x8(%rax,%r14,8), %rsi
movq 0x50e8(%rbx), %rdi
addq %rcx, %rdi
incq %r14
subq %rcx, %rsi
movl $0x2, %edx
callq 0x22e0
movslq 0x38(%rbx), %rax
decq %rax
cmpq %rax, %r14
jl 0xa9c3
jmp 0xaa24
cmpl $0x0, 0x94(%rbx)
jle 0xaebb
leaq 0x5478(%rip), %rdi      # 0xfe87
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2090
decl %eax
movq 0x5108(%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rax
movq 0x50e8(%rbx), %rdi
addq %rax, %rdi
movq 0x28(%rbx), %rsi
subq %rax, %rsi
movl $0x2, %edx
callq 0x22e0
movq %rbx, %rdi
callq 0x6534
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x65d8
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movq $-0x100, %r14
movl 0x14(%rsp), %eax
xorb $0x1, %al
movb %al, 0x20(%rsp)
leaq 0x102(%r14), %r12
cmpq $0x100, %r12            # imm = 0x100
jb 0xaa94
cmpb $0x1, 0x3d(%rbx)
je 0xaecf
cmpq $-0x101, %r14           # imm = 0xFEFF
ja 0xaaa7
cmpb $0x0, 0x3e(%rbx)
jne 0xaeca
movb $0x0, 0x7(%rsp)
movq 0x80(%rbx), %rdi
callq 0x5d78
movq 0x8(%rsp), %rdi
movq %rax, 0x8(%rdi)
movq 0x18(%rsp), %rsi
movq %r12, %rdx
leaq 0x7(%rsp), %rcx
movl %r13d, %r8d
movq %rbx, %r9
callq 0xb0e6
movl %eax, %r15d
cmpl $0x2, 0x94(%rbx)
setl %al
orb 0x20(%rsp), %al
jne 0xac4b
leaq 0x101(%r14), %r12
callq 0xc614
movq %rax, %xmm0
movq 0x3507(%rip), %xmm4     # 0xe010
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x350b(%rip), %xmm3     # 0xe020
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, %xmm2
movq 0x28(%rbx), %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movapd %xmm2, 0x40(%rsp)
callq 0xc60c
movq %rax, %xmm0
movq 0x34b2(%rip), %xmm3     # 0xe010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x34b6(%rip), %xmm2     # 0xe020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, %xmm4
movq 0x28(%rbx), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm4
movapd %xmm4, 0x30(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2190
leaq 0x538e(%rip), %rdi      # 0xff44
movq %r12, %rsi
movapd 0x40(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
movq %rax, %rdx
movb $0x2, %al
callq 0x2100
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0xac4b
callq 0x2190
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movq %rdx, %r12
shrq $0x2, %r12
movq 0x58(%rbx), %rdi
callq 0x2190
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x4cf6(%rip), %xmm0     # 0xf900
movq 0x28(%rbx), %rax
addq %rax, %rax
leaq (%rax,%rax,2), %rax
movq %rax, %xmm1
punpckldq 0x33ee(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x33f6(%rip), %xmm1     # 0xe020
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x4e34(%rip), %rdi      # 0xfa75
movq %r12, %rsi
movb $0x1, %al
callq 0x2100
cmpb $0x1, 0x3c(%rbx)
jne 0xac58
cmpb $0x0, 0x7(%rsp)
je 0xac98
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xac6a
callq 0x20e0
movl $0x1, %ebp
subl %r13d, %ebp
movq 0x8(%rsp), %r13
movq 0x8(%r13), %r12
movq %r12, %rdi
callq 0x2120
movq %r12, (%r13)
incq %r14
movl %ebp, %r13d
testb %r15b, %r15b
je 0xaa7a
jmp 0xacbb
cmpl $0x2, 0x94(%rbx)
jl 0xacad
leaq 0x4df4(%rip), %rdi      # 0xfa9c
callq 0x2090
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x20e0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xaccd
callq 0x20e0
movl 0x94(%rbx), %eax
testl %eax, %eax
movl 0x14(%rsp), %r14d
jle 0xade5
testb %r14b, %r14b
je 0xadba
movl 0x20(%rbx), %ebp
callq 0xc614
movq %rax, %r12
callq 0xc60c
movq %rax, %r13
callq 0xc614
movq %rax, %xmm0
movq 0x3302(%rip), %xmm4     # 0xe010
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x3306(%rip), %xmm3     # 0xe020
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, %xmm2
movq 0x28(%rbx), %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movapd %xmm2, 0x20(%rsp)
callq 0xc60c
movq %rax, %xmm0
movq 0x32ad(%rip), %xmm3     # 0xe010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x32b1(%rip), %xmm2     # 0xe020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq 0x28(%rbx), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
leaq 0x51e7(%rip), %rdi      # 0xff8a
movl %ebp, %esi
movq %r12, %rdx
movq %r13, %rcx
movapd 0x20(%rsp), %xmm0
movb $0x2, %al
callq 0x2100
jmp 0xade5
cmpl $0x1, %eax
je 0xade5
movl 0x20(%rbx), %ebp
callq 0xc614
movq %rax, %r12
callq 0xc60c
leaq 0x5205(%rip), %rdi      # 0xffdb
movl %ebp, %esi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2100
movq 0x18(%rsp), %r12
movq 0x20(%r12), %rdi
callq 0xc6e6
movq %r12, %rdi
callq 0xc6e6
movq 0x8(%rsp), %rdi
callq 0x6626
cmpb $0x1, 0x69(%rbx)
jne 0xae14
movq %rbx, %rdi
callq 0x582f
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0x3c93
cmpb $0x1, 0x3e(%rbx)
jne 0xae43
movq %rbx, %rdi
callq 0x3b7a
cmpl $0x0, 0x94(%rbx)
jle 0xae43
leaq 0x548e(%rip), %rdi      # 0x102cc
callq 0x2090
cmpb $0x0, 0x3d(%rbx)
je 0xae53
movq %rbx, %rdi
callq 0x5594
jmp 0xae67
movq 0x28(%rbx), %rsi
movq 0x98(%rbx), %rdi
movzbl 0x71(%rbx), %edx
callq 0x6b59
movq 0x5110(%rbx), %rdi
callq 0xc6e6
movq 0x5108(%rbx), %rdi
callq 0xc6e6
movq 0x5118(%rbx), %rdi
callq 0xc6e6
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x539f
movzbl %bpl, %esi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9caf
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x25d9
callq 0x25fe