// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/tyr-mkindex.c
// Function: enumeratelcpintervals
static int enumeratelcpintervals(const char *inputindex,
                                 Sequentialsuffixarrayreader *ssar,
                                 const char *storeindex,
                                 bool storecounts,
                                 GtUword mersize,
                                 GtUword minocc,
                                 GtUword maxocc,
                                 bool performtest,
                                 GtLogger *logger,
                                 GtError *err)
{
  TyrDfsstate *state;
  bool haserr = false;
  unsigned int alphasize;

  gt_error_check(err);
  state = gt_malloc(sizeof (*state));
  GT_INITARRAY(&state->occdistribution,Countwithpositions);
  state->esrspace = gt_encseq_create_reader_with_readmode(
                                   gt_encseqSequentialsuffixarrayreader(ssar),
                                   gt_readmodeSequentialsuffixarrayreader(ssar),
                                   0);
  state->mersize = (GtUword) mersize;
  state->encseq = gt_encseqSequentialsuffixarrayreader(ssar);
  alphasize = gt_alphabet_num_of_chars(gt_encseq_alphabet(state->encseq));
  state->readmode = gt_readmodeSequentialsuffixarrayreader(ssar);
  state->storecounts = storecounts;
  state->minocc = minocc;
  state->maxocc = maxocc;
  state->totallength = gt_encseq_total_length(state->encseq);
  state->performtest = performtest;
  state->countoutputmers = 0;
  state->merindexfpout = NULL;
  state->countsfilefpout = NULL;
  GT_INITARRAY(&state->largecounts,Largecount);
  if (strlen(storeindex) == 0)
  {
    state->sizeofbuffer = 0;
    state->bytebuffer = NULL;
  } else
  {
    state->sizeofbuffer = MERBYTES(mersize);
    state->bytebuffer = gt_malloc(sizeof *state->bytebuffer
                                  * state->sizeofbuffer);
  }
  if (performtest)
  {
    state->currentmer = gt_malloc(sizeof *state->currentmer
                                  * state->mersize);
    state->suftab = gt_suftabSequentialsuffixarrayreader(ssar);
  } else
  {
    state->currentmer = NULL;
    state->suftab = NULL;
  }
  if (state->mersize > state->totallength)
  {
    gt_error_set(err,"mersize "GT_WU" > "GT_WU" = totallength not allowed",
                 state->mersize,
                 state->totallength);
    haserr = true;
  } else
  {
    if (strlen(storeindex) == 0)
    {
      state->processoccurrencecount = adddistpos2distribution;
    } else
    {
      state->merindexfpout = gt_fa_fopen_with_suffix(storeindex,MERSUFFIX,
                                                    "wb",err);
      if (state->merindexfpout == NULL)
      {
        haserr = true;
      } else
      {
        if (state->storecounts)
        {
          state->countsfilefpout
            = gt_fa_fopen_with_suffix(storeindex,COUNTSSUFFIX,"wb",err);
          if (state->countsfilefpout == NULL)
          {
            haserr = true;
          }
        }
      }
      state->processoccurrencecount = outputsortedstring2index;
    }
    if (!haserr)
    {
      if (gt_depthfirstesa(ssar,
                          tyr_allocateDfsinfo,
                          tyr_freeDfsinfo,
                          tyr_processleafedge,
                          NULL,
                          tyr_processcompletenode,
                          tyr_assignleftmostleaf,
                          tyr_assignrightmostleaf,
                          (Dfsstate*) state,
                          logger,
                          err) != 0)
      {
        haserr = true;
      }
      if (strlen(storeindex) == 0)
      {
        showfinalstatistics(state,inputindex,logger);
      }
    }
    if (!haserr)
    {
      if (state->countsfilefpout != NULL)
      {
        gt_logger_log(logger,"write "GT_WU" mercounts > "GT_WU
                      " to file \"%s%s\"",
                      state->largecounts.nextfreeLargecount,
                      (GtUword) MAXSMALLMERCOUNT,
                      storeindex,
                      COUNTSSUFFIX);
        gt_xfwrite(state->largecounts.spaceLargecount, sizeof (Largecount),
                  (size_t) state->largecounts.nextfreeLargecount,
                  state->countsfilefpout);
      }
    }
    if (!haserr)
    {
      gt_logger_log(logger,"number of "GT_WU"-mers in index: "GT_WU"",
                  mersize,
                  state->countoutputmers);
      gt_logger_log(logger,"index size: %.2f megabytes\n",
                  GT_MEGABYTES(state->countoutputmers * state->sizeofbuffer +
                               sizeof (GtUword) * EXTRAINTEGERS));
    }
  }
  /* now out EXTRAINTEGERS integer values */
  if (!haserr && state->merindexfpout != NULL)
  {
    outputbytewiseUlongvalue(state->merindexfpout,
                             (GtUword) state->mersize);
    outputbytewiseUlongvalue(state->merindexfpout,(GtUword) alphasize);
  }
  gt_fa_xfclose(state->merindexfpout);
  gt_fa_xfclose(state->countsfilefpout);
  GT_FREEARRAY(&state->occdistribution,Countwithpositions);
  gt_free(state->currentmer);
  gt_free(state->bytebuffer);
  GT_FREEARRAY(&state->largecounts,Largecount);
  gt_encseq_reader_delete(state->esrspace);
  gt_free(state);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq 0xa8(%rsp), %rax
movq 0xa0(%rsp), %rax
movb 0x98(%rsp), %al
movq 0x90(%rsp), %r10
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
andb $0x1, %cl
movb %cl, 0x5f(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
andb $0x1, %al
movb %al, 0x47(%rsp)
movb $0x0, 0x37(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x2f5777
movq 0xa8(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2f573f
jmp 0x2f5777
movq 0x34685a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2208c3(%rip), %rsi    # 0x516013
leaq 0x220a68(%rip), %rdx    # 0x5161bf
leaq 0x29a3f6(%rip), %rcx    # 0x58fb54
leaq 0x29a3d7(%rip), %r8     # 0x58fb3c
movl $0x211, %r9d            # imm = 0x211
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2f5779
movl $0xb0, %edi
leaq 0x29a3b7(%rip), %rsi    # 0x58fb3c
movl $0x212, %edx            # imm = 0x212
callq 0xe80f0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq $0x0, 0x38(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x68(%rsp), %rdi
callq 0x23bd50
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rdi
callq 0x23bda0
movq 0x28(%rsp), %rdi
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rdi
callq 0x23bd50
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x7e8c0
movl %eax, 0x30(%rsp)
movq 0x68(%rsp), %rdi
callq 0x23bda0
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x28(%rax)
movb 0x5f(%rsp), %cl
movq 0x38(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x69(%rax)
movq 0x48(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x90(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0xa9d00
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movb 0x47(%rsp), %cl
movq 0x38(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x68(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x98(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x58(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x90(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x88(%rax)
movq 0x60(%rsp), %rdi
callq 0x192b0
cmpq $0x0, %rax
jne 0x2f591e
movq 0x38(%rsp), %rax
movq $0x0, 0x78(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x70(%rax)
jmp 0x2f5975
movq 0x50(%rsp), %rcx
shrq $0x2, %rcx
movq 0x50(%rsp), %rsi
andq $0x3, %rsi
movl $0x1, %eax
xorl %edx, %edx
cmpq $0x0, %rsi
cmoveq %rdx, %rax
addq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x78(%rax)
movq 0x38(%rsp), %rax
movq 0x78(%rax), %rdi
shlq $0x0, %rdi
leaq 0x29a1dd(%rip), %rsi    # 0x58fb3c
movl $0x22d, %edx            # imm = 0x22D
callq 0xe80f0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x70(%rax)
testb $0x1, 0x47(%rsp)
je 0x2f59c3
movq 0x38(%rsp), %rax
movq (%rax), %rdi
shlq $0x0, %rdi
leaq 0x29a1ad(%rip), %rsi    # 0x58fb3c
movl $0x232, %edx            # imm = 0x232
callq 0xe80f0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0xa8(%rax)
movq 0x68(%rsp), %rdi
callq 0x23bdf0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0xa0(%rax)
jmp 0x2f59e3
movq 0x38(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0xa0(%rax)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x2f5a27
movq 0xa8(%rsp), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rdx
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rcx
leaq 0x29a154(%rip), %rsi    # 0x58fb6a
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x37(%rsp)
jmp 0x2f5cab
movq 0x60(%rsp), %rdi
callq 0x192b0
cmpq $0x0, %rax
jne 0x2f5a4c
movq 0x38(%rsp), %rax
leaq 0x3ed(%rip), %rcx       # 0x2f5e30
movq %rcx, 0x30(%rax)
jmp 0x2f5b01
movq 0x60(%rsp), %rdi
movq 0xa8(%rsp), %r9
leaq 0x29a136(%rip), %rsi    # 0x58fb96
leaq 0x231136(%rip), %rdx    # 0x526b9d
leaq 0x29a0ce(%rip), %rcx    # 0x58fb3c
movl $0x247, %r8d            # imm = 0x247
callq 0xd92c0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x2f5a98
movb $0x1, 0x37(%rsp)
jmp 0x2f5af1
movq 0x38(%rsp), %rax
testb $0x1, 0x69(%rax)
je 0x2f5aef
movq 0x60(%rsp), %rdi
movq 0xa8(%rsp), %r9
leaq 0x29a0e4(%rip), %rsi    # 0x58fb9b
leaq 0x2310df(%rip), %rdx    # 0x526b9d
leaq 0x29a077(%rip), %rcx    # 0x58fb3c
movl $0x250, %r8d            # imm = 0x250
callq 0xd92c0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x2f5aed
movb $0x1, 0x37(%rsp)
jmp 0x2f5aef
jmp 0x2f5af1
movq 0x38(%rsp), %rax
leaq 0x3e3(%rip), %rcx       # 0x2f5ee0
movq %rcx, 0x30(%rax)
testb $0x1, 0x37(%rsp)
jne 0x2f5ba3
movq 0x68(%rsp), %rdi
movq 0x38(%rsp), %r11
movq 0xa0(%rsp), %r10
movq 0xa8(%rsp), %rax
leaq 0x4a3(%rip), %rsi       # 0x2f5fd0
leaq 0x4cc(%rip), %rdx       # 0x2f6000
leaq 0x505(%rip), %rcx       # 0x2f6040
xorl %r8d, %r8d
leaq 0x61b(%rip), %r9        # 0x2f6160
leaq 0x734(%rip), %r14       # 0x2f6280
leaq 0x75d(%rip), %rbx       # 0x2f62b0
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x4b5200
cmpl $0x0, %eax
je 0x2f5b7a
movb $0x1, 0x37(%rsp)
movq 0x60(%rsp), %rdi
callq 0x192b0
cmpq $0x0, %rax
jne 0x2f5ba1
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0xa0(%rsp), %rdx
callq 0x2f6300
jmp 0x2f5ba3
testb $0x1, 0x37(%rsp)
jne 0x2f5c16
movq 0x38(%rsp), %rax
cmpq $0x0, 0x58(%rax)
je 0x2f5c14
movq 0xa0(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x90(%rax), %rdx
movq 0x60(%rsp), %r8
leaq 0x299fca(%rip), %rsi    # 0x58fba0
movl $0xff, %ecx
leaq 0x299fb9(%rip), %r9     # 0x58fb9b
movb $0x0, %al
callq 0xe7cd0
movq 0x38(%rsp), %rax
movq 0x80(%rax), %rdi
movq 0x38(%rsp), %rax
movq 0x90(%rax), %rdx
movq 0x38(%rsp), %rax
movq 0x58(%rax), %rcx
movl $0x10, %esi
callq 0x126d30
jmp 0x2f5c16
testb $0x1, 0x37(%rsp)
jne 0x2f5ca9
movq 0xa0(%rsp), %rdi
movq 0x50(%rsp), %rdx
movq 0x38(%rsp), %rax
movq 0x98(%rax), %rcx
leaq 0x299f88(%rip), %rsi    # 0x58fbc9
xorl %eax, %eax
callq 0xe7cd0
movq 0xa0(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x78(%rax), %rcx
movq 0x98(%rax), %rax
imulq %rcx, %rax
addq $0x10, %rax
movq %rax, %xmm0
movaps 0x222cbc(%rip), %xmm1   # 0x518930
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x222cc0(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x222c89(%rip), %xmm1   # 0x518920
divsd %xmm1, %xmm0
leaq 0x299f48(%rip), %rsi    # 0x58fbea
movb $0x1, %al
callq 0xe7cd0
jmp 0x2f5cab
testb $0x1, 0x37(%rsp)
jne 0x2f5ce8
movq 0x38(%rsp), %rax
cmpq $0x0, 0x50(%rax)
je 0x2f5ce8
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0x2f63f0
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rdi
movl 0x30(%rsp), %eax
movl %eax, %esi
callq 0x2f63f0
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0xd9570
movq 0x38(%rsp), %rax
movq 0x58(%rax), %rdi
callq 0xd9570
movq 0x38(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x2f5d51
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0x299e1c(%rip), %rsi    # 0x58fb3c
movl $0x290, %edx            # imm = 0x290
callq 0xe88c0
movq 0x38(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x38(%rax)
jmp 0x2f5d53
movq 0x38(%rsp), %rax
movq 0xa8(%rax), %rdi
leaq 0x299dd6(%rip), %rsi    # 0x58fb3c
movl $0x291, %edx            # imm = 0x291
callq 0xe88c0
movq 0x38(%rsp), %rax
movq 0x70(%rax), %rdi
leaq 0x299dbc(%rip), %rsi    # 0x58fb3c
movl $0x292, %edx            # imm = 0x292
callq 0xe88c0
movq 0x38(%rsp), %rax
cmpq $0x0, 0x80(%rax)
je 0x2f5de6
movq 0x38(%rsp), %rax
movq 0x80(%rax), %rdi
leaq 0x299d90(%rip), %rsi    # 0x58fb3c
movl $0x293, %edx            # imm = 0x293
callq 0xe88c0
movq 0x38(%rsp), %rax
movq $0x0, 0x88(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x90(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x80(%rax)
jmp 0x2f5de8
movq 0x38(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0xac3f0
movq 0x38(%rsp), %rdi
leaq 0x299d3a(%rip), %rsi    # 0x58fb3c
movl $0x295, %edx            # imm = 0x295
callq 0xe88c0
movb 0x37(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
retq
nopw %cs:(%rax,%rax)