// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/fmi-sufbwtstream.c
// Function: gt_sufbwt2fmindex
int gt_sufbwt2fmindex(Fmindex *fmindex,
                   GtSpecialcharinfo *specialcharinfo,
                   unsigned int log2bsize,
                   unsigned int log2markdist,
                   const char *outfmindex,
                   const GtStrArray *indexnametab,
                   bool storeindexpos,
                   GtLogger *logger,
                   GtError *err)
{
  Suffixarray suffixarray;
  Emissionmergedesa emmesa;
  GtUchar cc;
  GtUword bwtpos,
         totallength = 0,
         suftabvalue = 0,
         *sequenceoffsettable = NULL,
         firstignorespecial = 0,
         nextmark,
         *markptr,
         nextprogress,
         tmpsuftabvalue,
         stepprogress;
  unsigned int numofchars = 0,
               suffixlength = 0,
               numofindexes;
  int retval;
  Definedunsignedlong longest = { false, 0 };
  GtPairBwtidx *pairptr;
  FILE *outbwt = NULL;
  GtStr *tmpfilename = NULL;
  bool haserr = false;

  gt_error_check(err);
  longest.defined = false;
  longest.valueunsignedlong = 0;
  numofindexes = (unsigned int) gt_str_array_size(indexnametab);
  if (numofindexes == 1U)
  {
    const char *indexname = gt_str_array_get(indexnametab,0);

    if (streamsuffixarray(&suffixarray,
                          SARR_BWTTAB | (storeindexpos ? SARR_SUFTAB : 0),
                          indexname,
                          logger,
                          err) != 0)
    {
      haserr = true;
    } else
    {
      totallength = gt_encseq_total_length(suffixarray.encseq);
    }
    if (!haserr && gt_specialcharinfo_read(specialcharinfo,indexname,err) != 0)
    {
      haserr = true;
    }
    if (!haserr)
    {
      numofchars = gt_alphabet_num_of_chars(
                               gt_encseq_alphabet(suffixarray.encseq));
      firstignorespecial = totallength - specialcharinfo->specialcharacters;
      if (gt_alphabet_to_file(gt_encseq_alphabet(suffixarray.encseq),
                              outfmindex, err) != 0)
      {
        haserr = true;
      }
    }
    if (!haserr)
    {
      if (copytheindexfile(outfmindex,
                            indexname,
                            GT_BWTTABSUFFIX,
                            (uint64_t) firstignorespecial,
                            err) != 0)
      {
        haserr = true;
      }
    }
  } else
  {
    GtEncseqMetadata *emd = NULL;
    if (gt_emissionmergedesa_init(&emmesa,
                               indexnametab,
                               SARR_ESQTAB | SARR_SUFTAB | SARR_LCPTAB,
                               logger,
                               err) != 0)
    {
      haserr = true;
    }
    if (!haserr)
    {
      const char *indexname = NULL;
      indexname = gt_str_array_get(indexnametab,0);
      emd = gt_encseq_metadata_new(indexname, err);
      if (emd == NULL) {
        haserr = true;
      }
    }
    if (!haserr) {
      suffixlength = 0;
      if (gt_alphabet_to_file(gt_encseq_metadata_alphabet(emd),
                              outfmindex, err) != 0)
      {
        haserr = true;
      }
    }
    gt_encseq_metadata_delete(emd);
    if (!haserr)
    {
      sequenceoffsettable = gt_encseqtable2sequenceoffsets(&totallength,
                                                        specialcharinfo,
                                                        emmesa.suffixarraytable,
                                                        numofindexes);
      if (sequenceoffsettable == NULL)
      {
        haserr = true;
      }
    }
    if (!haserr)
    {
      longest.defined = false;
      longest.valueunsignedlong = 0;
      outbwt = gt_fa_fopen_with_suffix(outfmindex,GT_BWTTABSUFFIX,"wb",err);
      if (outbwt == NULL)
      {
        haserr = true;
      }
    }
    if (!haserr)
    {
      numofchars = emmesa.numofchars;
      firstignorespecial = totallength - specialcharinfo->specialcharacters;
    }
  }
  if (!haserr)
  {
    printf("# firstignorespecial="GT_WU"\n",
              firstignorespecial);
    gt_computefmkeyvalues (fmindex,
                        specialcharinfo,
                        totallength+1,
                        log2bsize,
                        log2markdist,
                        numofchars,
                        suffixlength,
                        storeindexpos);
    showconstructionmessage(outfmindex,
                            totallength,
                            fmindex->sizeofindex,
                            log2bsize,
                            log2markdist,
                            numofchars);
    allocatefmtables(fmindex,specialcharinfo,storeindexpos);
    set0frequencies(fmindex);
    if (storeindexpos)
    {
      markptr = fmindex->markpostable;
    } else
    {
      markptr = NULL;
    }
    nextprogress = stepprogress = totallength/78;
    for (bwtpos = 0, nextmark = 0; ; bwtpos++)
    {
      if (numofindexes == 1U)
      {
        if (storeindexpos)
        {
          retval = gt_readnextfromstream_GtUword(&tmpsuftabvalue,
                                            &suffixarray.suftabstream_GtUword);
          if (retval == 0)
          {
            break;
          }
          suftabvalue = (GtUword) tmpsuftabvalue;
        }
        retval = gt_readnextfromstream_GtUchar(&cc,&suffixarray.bwttabstream);
        if (retval == 0)
        {
          break;
        }
      } else
      {
        retval = nextesamergedsufbwttabvalues(&longest,
                                              &cc,
                                              &suftabvalue,
                                              &emmesa,
                                              sequenceoffsettable,
                                              bwtpos,
                                              err);
        if (retval < 0)
        {
          haserr = true;
          break;
        }
        if (retval == 0)
        {
          break;
        }
        gt_xfwrite(&cc, sizeof (GtUchar), (size_t) 1, outbwt);
      }
      if (bwtpos == nextprogress)
      {
        if (bwtpos == stepprogress)
        {
          (void) putchar('#');
        }
        (void) putchar('.');
        (void) fflush(stdout);
        nextprogress += stepprogress;
      }
      if (storeindexpos && bwtpos == nextmark)
      {
        *markptr++ = suftabvalue;
        nextmark += fmindex->markdist;
      }
      if (GT_ISBWTSPECIAL(cc))
      {
        if (storeindexpos && bwtpos < firstignorespecial)
        {
          pairptr = fmindex->specpos.spaceGtPairBwtidx +
                    fmindex->specpos.nextfreeGtPairBwtidx++;
          if (pairptr >= fmindex->specpos.spaceGtPairBwtidx +
                         fmindex->specpos.allocatedGtPairBwtidx)
          {
            gt_error_set(err,"program error: not enough space for specpos");
            haserr = true;
            break;
          }
          pairptr->bwtpos = bwtpos;
          pairptr->suftabvalue = suftabvalue;
        }
      } else
      {
        fmindex->tfreq[cc+1]++;
        fmindex->bfreq[(cc * fmindex->nofblocks) +
                       (bwtpos >> fmindex->log2bsize)]++;
        fmindex->superbfreq[(cc * fmindex->nofsuperblocks) +
                       (bwtpos >> fmindex->log2superbsize) + 1]++;
      }
    }
  }
  if (!haserr)
  {
    if (storeindexpos &&
        fmindex->specpos.allocatedGtPairBwtidx !=
        fmindex->specpos.nextfreeGtPairBwtidx)
    {
      gt_error_set(err,"program error: too much space for specpos: "
                    "allocated = "GT_WU" != "GT_WU" = used",
                    fmindex->specpos.allocatedGtPairBwtidx,
                    fmindex->specpos.nextfreeGtPairBwtidx);
      haserr = true;
    }
  }
  if (!haserr)
  {
    (void) putchar('\n');
    finalizefmfrequencies(fmindex);
    if (fmindex->suffixlength > 0)
    {
      fmindex->boundarray = gt_malloc(sizeof *fmindex->boundarray
                                      * fmindex->numofcodes);
    }
    if (numofindexes == 1U)
    {
      fmindex->longestsuffixpos = suffixarray.longest.valueunsignedlong;
      gt_freesuffixarray(&suffixarray);
    } else
    {
      if (!longest.defined)
      {
        gt_error_set(err,"longest is not defined after merging");
        haserr = true;
      }
      if (!haserr)
      {
        fmindex->longestsuffixpos = longest.valueunsignedlong;
      }
      gt_fa_xfclose(outbwt);
      gt_emissionmergedesa_wrap(&emmesa);
    }
  }
  gt_free(sequenceoffsettable);
  gt_free(tmpfilename);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x301c8, %rsp          # imm = 0x301C8
movq %r9, %rbp
movq %r8, %r15
movl %ecx, 0x48(%rsp)
movl %edx, 0x58(%rsp)
movq %rsi, %r12
movq %rdi, %r14
movq 0x30210(%rsp), %rbx
movq $0x0, 0x30(%rsp)
testq %rbx, %rbx
je 0x1aec27
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1af7c1
movq 0x30208(%rsp), %r13
movq %rbp, %rdi
callq 0x11c131
movq %rax, 0x40(%rsp)
cmpl $0x1, %eax
jne 0x1aecb0
movq %r15, 0x20(%rsp)
xorl %r15d, %r15d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x11bfb3
movq %rax, %rbp
movzbl 0x30200(%rsp), %eax
leal 0x8(,%rax,2), %esi
leaq 0x60(%rsp), %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %rbx, %r8
callq 0x1a1676
movb $0x1, %r13b
testl %eax, %eax
jne 0x1af779
movq 0x60(%rsp), %rdi
callq 0xe7b9c
movq %rax, 0x30(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xebc60
testl %eax, %eax
je 0x1aedfb
xorl %r15d, %r15d
jmp 0x1af779
leaq 0x160(%rsp), %rdi
movq %rbp, %rsi
movl $0x7, %edx
movq %r13, %rcx
movq %rbx, %r8
callq 0x311956
testl %eax, %eax
je 0x1aece1
xorl %r15d, %r15d
xorl %edi, %edi
callq 0xfbf9f
movb $0x1, %r13b
jmp 0x1af779
movq %r15, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq %rbx, %r15
setne %bl
movq %rbp, %rdi
xorl %esi, %esi
callq 0x11bfb3
movq %rax, %rdi
movq %r15, %rsi
callq 0xfb8bc
movq %rax, %r12
testq %rax, %rax
sete %r13b
orb %bl, %r13b
jne 0x1aed3d
movq %r12, %rdi
callq 0xfbec4
movq %rax, %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0xd1f1a
testl %eax, %eax
movzbl %r13b, %eax
movl $0x1, %r13d
cmovel %eax, %r13d
movq %r15, %rbx
movq 0x40(%rsp), %r15
movq %r12, %rdi
callq 0xfbf9f
testb %r13b, %r13b
je 0x1aed57
xorl %r15d, %r15d
jmp 0x1aed85
movq 0x301b8(%rsp), %rdx
leaq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %r15d, %ecx
callq 0x30fb60
movq %rax, %r15
testq %rax, %rax
movzbl %r13b, %eax
movl $0x1, %r13d
cmovnel %eax, %r13d
xorl %ebp, %ebp
testb %r13b, %r13b
je 0x1aed97
movq $0x0, 0x28(%rsp)
jmp 0x1aedd5
leaq 0x1f5519(%rip), %rsi    # 0x3a42b7
leaq 0x1a6d3c(%rip), %rdx    # 0x355ae1
leaq 0x1f7c93(%rip), %rcx    # 0x3a6a3f
movq 0x20(%rsp), %rdi
movl $0x16e, %r8d            # imm = 0x16E
movq %rbx, %r9
callq 0xfcf97
movq %rax, 0x28(%rsp)
testq %rax, %rax
movzbl %r13b, %eax
movl $0x1, %r13d
cmovnel %eax, %r13d
testb %r13b, %r13b
je 0x1aede2
xorl %r12d, %r12d
jmp 0x1aefa3
movl 0x301c0(%rsp), %ebp
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %rax
subq (%rax), %r12
jmp 0x1aefa3
movq 0x60(%rsp), %rdi
callq 0xebcd9
movq %rax, %rdi
callq 0xd11be
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq %r12, 0x18(%rsp)
subq (%r12), %rax
movq %rax, %r12
movq 0x60(%rsp), %rdi
callq 0xebcd9
movq %rax, %rdi
movq 0x20(%rsp), %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0xd1f1a
testl %eax, %eax
setne %r13b
je 0x1aee5e
movq $0x0, 0x28(%rsp)
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
jmp 0x1aefa3
testq %rbx, %rbx
je 0x1aee73
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1af7cb
movq %r12, 0x50(%rsp)
leaq 0x1f5438(%rip), %rsi    # 0x3a42b7
leaq 0x1a6c5b(%rip), %rdx    # 0x355ae1
leaq 0x1f7bb2(%rip), %rcx    # 0x3a6a3f
movq %r15, %rdi
movl $0x33, %r8d
movq %rbx, %r9
callq 0xfcf97
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x1aef4c
movl %r13d, 0x3c(%rsp)
leaq 0x1f53ff(%rip), %r13    # 0x3a42b7
leaq 0x1f685e(%rip), %rdx    # 0x3a571d
leaq 0x1f7b79(%rip), %rcx    # 0x3a6a3f
movq %rbp, %rdi
movq %r13, %rsi
movl $0x3a, %r8d
movq %rbx, %r9
callq 0xfcf97
movq %rax, %r12
leaq 0x1f7c3d(%rip), %rdi    # 0x3a6b21
movq %rbp, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x17070
testq %r12, %r12
je 0x1aef72
movq 0x50(%rsp), %rbx
testq %rbx, %rbx
movl 0x3c(%rsp), %r13d
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r15
je 0x1aef3d
movq %r12, %rdi
callq 0x17c20
cmpl $-0x1, %eax
je 0x1aef82
movl %eax, %edi
movq %r15, %rsi
callq 0x17f80
decq %rbx
jne 0x1aef15
jmp 0x1aef82
movl %eax, %edi
movq %r15, %rsi
callq 0x17f80
movq %r12, %rdi
callq 0x17c20
cmpl $-0x1, %eax
jne 0x1aef33
jmp 0x1aef82
leaq 0x1f7bce(%rip), %rdi    # 0x3a6b21
leaq 0x1f535d(%rip), %rdx    # 0x3a42b7
xorl %r12d, %r12d
movq %rbp, %rsi
movq %r15, %rcx
movq %rdx, %r8
xorl %eax, %eax
callq 0x17070
movb $0x1, %r13b
jmp 0x1aef78
movb $0x1, %r13b
xorl %r12d, %r12d
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xfd09a
movq %r12, %rdi
callq 0xfd09a
movq $0x0, 0x28(%rsp)
xorl %r15d, %r15d
movq 0x50(%rsp), %r12
testb %r13b, %r13b
jne 0x1af779
movq %r15, 0x10(%rsp)
movl %r13d, 0x3c(%rsp)
leaq 0x1f7a9f(%rip), %rdi    # 0x3a6a5c
movq %r12, 0x50(%rsp)
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
movq 0x30(%rsp), %rdx
incq %rdx
movb 0x30200(%rsp), %bl
movzbl %bl, %eax
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movl 0x58(%rsp), %r12d
movl %r12d, %ecx
movl 0x48(%rsp), %ebx
movl %ebx, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x317bb7
addq $0x10, %rsp
movq 0x30(%rsp), %r13
movq 0xa0(%r14), %r15
movl $0x1, %eax
movl $0x1, %edx
movl %r12d, %ecx
shll %cl, %edx
movl %ebx, %ecx
shll %cl, %eax
leaq 0x1f7b07(%rip), %rdi    # 0x3a6b31
movq 0x20(%rsp), %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x17070
leaq 0x1f7b29(%rip), %rdi    # 0x3a6b69
movq %r13, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x17070
movq %r15, %xmm1
movq 0x198887(%rip), %xmm2   # 0x3478e0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x19888b(%rip), %xmm3   # 0x3478f0
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
incq %r13
movq %r13, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x1f7aeb(%rip), %rdi    # 0x3a6b87
movq %r15, %rsi
movb $0x1, %al
callq 0x17070
movl 0x78(%r14), %edi
incl %edi
shlq $0x3, %rdi
leaq 0x1f7988(%rip), %r13    # 0x3a6a3f
movq %r13, %rsi
movl $0x60, %edx
callq 0x104226
movq %rax, 0x18(%r14)
movl 0x78(%r14), %edi
imulq 0xb0(%r14), %rdi
shlq $0x3, %rdi
movq %r13, %rsi
movl $0x62, %edx
callq 0x104226
movq %rax, 0x20(%r14)
cmpb $0x0, 0x30200(%rsp)
je 0x1af1b4
movq 0x10(%r14), %rax
decq %rax
xorl %edx, %edx
divq 0xb8(%r14)
leaq 0x8(,%rax,8), %rdi
leaq 0x1f7929(%rip), %r13    # 0x3a6a3f
movq %r13, %rsi
movl $0x67, %edx
callq 0x104226
movq %rax, 0x28(%r14)
movq $0x0, 0x60(%r14)
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x317b90
movq %rax, 0x58(%r14)
movq (%rbx), %rdx
movq %rdx, %rsi
subq %rax, %rsi
movq %rsi, %xmm1
movq 0x19878a(%rip), %xmm2   # 0x3478e0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x19878e(%rip), %xmm3   # 0x3478f0
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rdx, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x1f7a11(%rip), %rdi    # 0x3a6ba7
movb $0x1, %al
callq 0x17070
movq 0x58(%r14), %rdi
shlq $0x4, %rdi
movq %r13, %rsi
movl $0x74, %edx
callq 0x104226
jmp 0x1af1c8
movq $0x0, 0x28(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x58(%r14)
xorl %eax, %eax
movq %rax, 0x50(%r14)
movl 0x78(%r14), %edi
imulq 0xa8(%r14), %rdi
leaq 0x1f7860(%rip), %rsi    # 0x3a6a3f
movl $0x7b, %edx
callq 0x104226
movq %rax, 0x8(%r14)
movl 0x78(%r14), %ebx
movl %ebx, %eax
incl %eax
movq 0x40(%rsp), %rbp
je 0x1af20d
movl %eax, %edx
movq 0x18(%r14), %rdi
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x173a0
movq 0xa8(%r14), %rax
imulq %rbx, %rax
testq %rax, %rax
je 0x1af23e
xorl %eax, %eax
movq 0x8(%r14), %rcx
movb $0x0, (%rcx,%rax)
incq %rax
movl 0x78(%r14), %ebx
movq 0xa8(%r14), %rcx
imulq %rbx, %rcx
cmpq %rcx, %rax
jb 0x1af21f
movq 0xb0(%r14), %rax
imulq %rbx, %rax
testq %rax, %rax
movb 0x30200(%rsp), %sil
je 0x1af277
movq 0x20(%r14), %rax
xorl %ecx, %ecx
movq $0x0, (%rax,%rcx,8)
incq %rcx
movq 0xb0(%r14), %rdx
imulq %rbx, %rdx
cmpq %rdx, %rcx
jb 0x1af25c
testb %sil, %sil
je 0x1af287
movq 0x28(%r14), %rax
movq %rax, 0x48(%rsp)
jmp 0x1af290
movq $0x0, 0x48(%rsp)
movq 0x30(%rsp), %rax
shrq %rax
movabsq $0x6906906906906907, %rcx # imm = 0x6906906906906907
mulq %rcx
movq %rdx, %r13
shrq $0x4, %r13
xorl %ebx, %ebx
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq %r13, 0x58(%rsp)
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpl $0x1, %ebp
jne 0x1af3e5
testb %sil, %sil
je 0x1af35d
movl 0x104(%rsp), %eax
movq 0x108(%rsp), %rdi
cmpl 0x100(%rsp), %eax
jb 0x1af34d
movq 0x110(%rsp), %rcx
movl $0x8, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x17b40
movq %rax, %rbp
movl %ebp, 0x100(%rsp)
movq 0x110(%rsp), %rdi
callq 0x17f00
testl %eax, %eax
jne 0x1af7c6
movl $0x0, 0x104(%rsp)
testl %ebp, %ebp
movq 0x40(%rsp), %rbp
je 0x1af5e3
xorl %eax, %eax
movq 0x108(%rsp), %rdi
leal 0x1(%rax), %ecx
movl %ecx, 0x104(%rsp)
movl %eax, %eax
movq (%rdi,%rax,8), %rbx
movl 0x11c(%rsp), %eax
movq 0x120(%rsp), %rdi
cmpl 0x118(%rsp), %eax
jb 0x1af3cd
movq 0x128(%rsp), %rcx
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x17b40
movq %rax, %rbp
movl %ebp, 0x118(%rsp)
movq 0x128(%rsp), %rdi
callq 0x17f00
testl %eax, %eax
jne 0x1af7bc
movl $0x0, 0x11c(%rsp)
testl %ebp, %ebp
movq 0x40(%rsp), %rbp
je 0x1af5e3
xorl %eax, %eax
movq 0x120(%rsp), %rdi
leal 0x1(%rax), %ecx
movl %ecx, 0x11c(%rsp)
movl %eax, %eax
movb (%rdi,%rax), %al
movb %al, 0xf(%rsp)
jmp 0x1af4e7
movq 0x30210(%rsp), %rdi
testq %rdi, %rdi
je 0x1af3ff
callq 0xfcc32
testb %al, %al
jne 0x1af7b7
movl 0x178(%rsp), %ecx
cmpl 0x17c(%rsp), %ecx
jb 0x1af455
cmpl $0x0, 0x168(%rsp)
je 0x1af5e3
leaq 0x160(%rsp), %rdi
movq 0x30210(%rsp), %rsi
callq 0x3115c0
testl %eax, %eax
jne 0x1af771
cmpl $0x0, 0x17c(%rsp)
je 0x1af5e3
movl $0x0, 0x178(%rsp)
xorl %ecx, %ecx
movl %ecx, %eax
shlq $0x4, %rax
leaq 0x10180(%rsp), %rsi
movl (%rsi,%rax), %edx
movq 0x8(%rsi,%rax), %rsi
movq 0x10(%rsp), %rax
movq (%rax,%rdx,8), %rbx
addq %rsi, %rbx
testq %rsi, %rsi
je 0x1af4a1
movq 0x301b8(%rsp), %rax
shlq $0x8, %rdx
movq (%rax,%rdx), %rdi
decq %rsi
movl 0x48(%rax,%rdx), %edx
callq 0xe7bbc
movl 0x178(%rsp), %ecx
jmp 0x1af4c1
movb $-0x1, %al
testq %rdx, %rdx
jne 0x1af4c1
testb $0x1, 0x20(%rsp)
jne 0x1af756
movb $-0x2, %al
movb $0x1, %dl
movq %rdx, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movb %al, 0xf(%rsp)
incl %ecx
movl %ecx, 0x178(%rsp)
movl $0x1, %esi
movl $0x1, %edx
leaq 0xf(%rsp), %rdi
movq 0x28(%rsp), %rcx
callq 0x11f89c
cmpq %r13, %r12
movb 0x30200(%rsp), %sil
jne 0x1af52b
cmpq 0x58(%rsp), %r13
jne 0x1af505
movl $0x23, %edi
callq 0x17a20
movl $0x2e, %edi
callq 0x17a20
movq 0x3099c2(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdi
callq 0x178f0
addq 0x58(%rsp), %r13
movb 0x30200(%rsp), %sil
testb %sil, %sil
je 0x1af54d
cmpq %r15, %r12
jne 0x1af54d
movq 0x48(%rsp), %rax
movq %rbx, (%rax)
addq $0x8, %rax
movq %rax, 0x48(%rsp)
addq 0xb8(%r14), %r15
movzbl 0xf(%rsp), %eax
cmpq $0xfe, %rax
jb 0x1af58f
testb %sil, %sil
je 0x1af5db
cmpq 0x50(%rsp), %r12
jae 0x1af5db
movq 0x50(%r14), %rax
movq 0x60(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x60(%r14)
cmpq 0x58(%r14), %rcx
jge 0x1af6e7
shlq $0x4, %rcx
movq %r12, (%rax,%rcx)
movq %rbx, 0x8(%rax,%rcx)
jmp 0x1af5db
movq 0x18(%r14), %rcx
incq 0x8(%rcx,%rax,8)
movb 0x88(%r14), %cl
movq %r12, %rdx
shrq %cl, %rdx
imulq 0xa8(%r14), %rax
addq 0x8(%r14), %rax
incb (%rdx,%rax)
movzbl 0xf(%rsp), %eax
imulq 0xb0(%r14), %rax
movb 0x8c(%r14), %cl
movq %r12, %rdx
shrq %cl, %rdx
shlq $0x3, %rax
addq 0x20(%r14), %rax
incq 0x8(%rax,%rdx,8)
incq %r12
jmp 0x1af2cb
cmpb $0x0, 0x30200(%rsp)
movl 0x3c(%rsp), %r13d
je 0x1af608
testb %r13b, %r13b
jne 0x1af608
movq 0x58(%r14), %rdx
movq 0x60(%r14), %rcx
cmpq %rcx, %rdx
jne 0x1af6ff
testb %r13b, %r13b
movq 0x30210(%rsp), %rbx
movq 0x10(%rsp), %r15
jne 0x1af779
movl $0xa, %edi
callq 0x17a20
movl 0x78(%r14), %eax
cmpl $0x2, %eax
jb 0x1af65c
movq 0x18(%r14), %rcx
leal 0x1(%rax), %esi
cmpl $0x4, %esi
movl $0x3, %edx
cmovael %esi, %edx
movq 0x8(%rcx), %rsi
movl $0x2, %edi
addq (%rcx,%rdi,8), %rsi
movq %rsi, (%rcx,%rdi,8)
incq %rdi
cmpq %rdi, %rdx
jne 0x1af64c
testl %eax, %eax
je 0x1af69e
movq 0x20(%r14), %rcx
movq 0xb0(%r14), %rsi
xorl %edx, %edx
cmpq $0x3, %rsi
jb 0x1af694
movq 0x8(%rcx), %rdi
movl $0x2, %r8d
addq (%rcx,%r8,8), %rdi
movq %rdi, (%rcx,%r8,8)
incq %r8
movq 0xb0(%r14), %rsi
cmpq %rsi, %r8
jb 0x1af67d
leaq (%rcx,%rsi,8), %rcx
incl %edx
cmpl %eax, %edx
jne 0x1af66d
cmpl $0x0, 0x98(%r14)
je 0x1af6cb
movq 0xc0(%r14), %rdi
shlq $0x4, %rdi
leaq 0x1f7385(%rip), %rsi    # 0x3a6a3f
movl $0x1fa, %edx            # imm = 0x1FA
callq 0x104226
movq %rax, 0xc8(%r14)
cmpl $0x1, %ebp
jne 0x1af717
leaq 0x60(%rsp), %rdi
movq 0x40(%rdi), %rax
movq %rax, 0x30(%r14)
callq 0x1a1540
jmp 0x1af779
leaq 0x1f7388(%rip), %rsi    # 0x3a6a76
movq 0x30210(%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x1af771
leaq 0x1f739c(%rip), %rsi    # 0x3a6aa2
movq 0x30210(%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x1af771
testb $0x1, 0x20(%rsp)
je 0x1af729
movq 0x18(%rsp), %rax
movq %rax, 0x30(%r14)
jmp 0x1af73d
leaq 0x1f73bb(%rip), %rsi    # 0x3a6aeb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movb $0x1, %r13b
movq 0x28(%rsp), %rdi
callq 0xfd09a
leaq 0x160(%rsp), %rdi
callq 0x311bfd
jmp 0x1af779
leaq 0x1f749a(%rip), %rsi    # 0x3a6bf7
movq 0x30210(%rsp), %rdi
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0xfcb67
movb $0x1, %r13b
movq 0x10(%rsp), %r15
leaq 0x1f72bf(%rip), %rbx    # 0x3a6a3f
movq %r15, %rdi
movq %rbx, %rsi
movl $0x20f, %edx            # imm = 0x20F
callq 0x1045eb
xorl %edi, %edi
movq %rbx, %rsi
movl $0x210, %edx            # imm = 0x210
callq 0x1045eb
movzbl %r13b, %eax
negl %eax
addq $0x301c8, %rsp          # imm = 0x301C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6496d
callq 0x649ce
callq 0x648fd
callq 0x649a6
callq 0x64936