// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/esa-maxpairs.c
// Function: processleafedge_maxpairs
static int processleafedge_maxpairs(bool firstsucc,
                                    GtUword fatherdepth,
                                    GtBUinfo_maxpairs *father,
                                    GtUword leafnumber,
                                    GtBUstate_maxpairs *state,
                                    GtError *err)
{
  unsigned int base;
  GtUword *start, *spptr;
  GtUchar leftchar;

#undef SKDEBUG
#ifdef SKDEBUG
  printf("%s "GT_WU" firstsucc=%s, depth(father)= "GT_WU"\n",
         __func__,
         leafnumber,
         firstsucc ? "true" : "false",
         fatherdepth);
#endif
  if (fatherdepth < (GtUword) state->searchlength)
  {
    setpostabto0_maxpairs(state);
    return 0;
  }
  if (leafnumber == 0)
  {
    leftchar = INITIALCHAR;
  } else
  {
    /* Random access */
    if (state->genericencseq.hasencseq)
    {
      leftchar = gt_encseq_get_encoded_char(state->genericencseq.seqptr.encseq,
                                            leafnumber - 1,
                                            state->readmode);
    } else
    {
      leftchar = state->sequence[leafnumber-1];
    }
  }
  state->initialized = false;
#ifdef SKDEBUG
  printf("%s: leftchar %u\n",__func__,(unsigned int) leftchar);
#endif
  if (firstsucc)
  {
    father->commonchar = leftchar;
    father->uniquecharposlength = 0;
    father->uniquecharposstart = state->uniquechar.nextfreeGtUword;
    for (base = 0; base < state->alphabetsize; base++)
    {
      NODEPOSLISTSTART(father,base) = state->poslist[base].nextfreeGtUword;
      NODEPOSLISTLENGTH(father,base) = 0;
    }
    add2poslist_maxpairs(state,father,(unsigned int) leftchar,leafnumber);
    return 0;
  }
  if (father->commonchar != ISLEFTDIVERSE)
  {
    CHECKCHAR(leftchar);
  }
  if (father->commonchar == ISLEFTDIVERSE)
  {
    for (base = 0; base < state->alphabetsize; base++)
    {
      if (leftchar != (GtUchar) base)
      {
        if (cartproduct1_maxpairs(state,fatherdepth,father,base,leafnumber,
                                  err) != 0)
        {
          return -1;
        }
      }
    }
    start = state->uniquechar.spaceGtUword +
            father->uniquecharposstart;
    for (spptr = start; spptr < start + father->uniquecharposlength; spptr++)
    {
      if (state->processmaxpairs(state->processmaxpairsinfo,
                                 &state->genericencseq,
                                 fatherdepth,
                                 GT_MIN(leafnumber,*spptr),
                                 GT_MAX(leafnumber,*spptr),err) != 0)
      {
        return -2;
      }
    }
  }
  add2poslist_maxpairs(state,father,(unsigned int) leftchar,leafnumber);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %rbx
movl 0x4(%r8), %eax
cmpq %rsi, %rax
jbe 0x1a32fe
xorl %eax, %eax
cmpb $0x0, (%rbx)
jne 0x1a347d
movl 0x8(%rbx), %edx
testq %rdx, %rdx
je 0x1a32ee
movq 0x28(%rbx), %rcx
leaq -0x1(%rdx), %rsi
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x8(,%rdx,8), %rdx
andq $-0x10, %rdx
leaq (%rdx,%rdx,2), %rdx
movdqa 0x1b57ac(%rip), %xmm1   # 0x358a20
xorl %esi, %esi
movdqa 0x1b57b2(%rip), %xmm2   # 0x358a30
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x1b57b2(%rip), %xmm4   # 0x358a40
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edi
notl %edi
testb $0x1, %dil
je 0x1a32c9
movq $0x0, 0x10(%rcx,%rsi)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edi
testb $0x1, %dil
je 0x1a32e1
movq $0x0, 0x28(%rcx,%rsi)
paddq %xmm4, %xmm1
addq $0x30, %rsi
cmpq %rsi, %rdx
jne 0x1a328e
movq $0x0, 0x20(%rbx)
movb $0x1, (%rbx)
jmp 0x1a347d
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movl %edi, %r12d
testq %rcx, %rcx
je 0x1a3329
cmpb $0x1, 0x30(%rbx)
jne 0x1a3332
movq 0x38(%rbx), %rdi
leaq -0x1(%r14), %rsi
movl 0x48(%rbx), %edx
callq 0xe7bbc
movl %eax, %ebp
jmp 0x1a333b
movb 0x8(%rbx), %bpl
incb %bpl
jmp 0x1a333b
movq 0x40(%rbx), %rax
movb -0x1(%rax,%r14), %bpl
movb $0x0, (%rbx)
testb %r12b, %r12b
je 0x1a33a0
movb %bpl, (%r15)
movq $0x0, 0x10(%r15)
movq 0x20(%rbx), %rax
movq %rax, 0x8(%r15)
movl 0x8(%rbx), %edx
testq %rdx, %rdx
je 0x1a3391
movq 0x28(%rbx), %rax
movq 0x18(%r15), %rcx
addq $0x8, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movq 0x10(%rax,%rsi), %rdi
movq %rdi, -0x8(%rcx)
movq $0x0, (%rcx)
addq $0x10, %rcx
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x1a3374
movzbl %bpl, %edx
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x1a3473
movb (%r15), %cl
movl 0x8(%rbx), %eax
movzbl %bpl, %esi
cmpb %al, %cl
movq %r15, (%rsp)
movl %esi, 0xc(%rsp)
je 0x1a33c4
cmpb %bpl, %cl
jne 0x1a33cd
movzbl %al, %edx
movl %ebp, %ecx
cmpl %esi, %edx
jbe 0x1a33cd
cmpb %al, %cl
je 0x1a33d0
jmp 0x1a3468
movb %al, (%r15)
testl %eax, %eax
movq (%rsp), %r15
je 0x1a340d
xorl %r12d, %r12d
cmpb %r12b, %bpl
je 0x1a3405
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %ecx
movq %r14, %r8
movq 0x10(%rsp), %r9
callq 0x1a3a5f
testl %eax, %eax
jne 0x1a3493
movl 0x8(%rbx), %eax
incl %r12d
cmpl %eax, %r12d
jb 0x1a33db
cmpq $0x0, 0x10(%r15)
jle 0x1a3468
movq (%rsp), %rax
movq 0x8(%rax), %r15
shlq $0x3, %r15
addq 0x10(%rbx), %r15
leaq 0x30(%rbx), %r12
movq %r15, %rbp
movq (%rbp), %r8
cmpq %r14, %r8
movq %r14, %rcx
cmovbq %r8, %rcx
movq 0x68(%rbx), %rdi
cmovbeq %r14, %r8
movq %r12, %rsi
movq %r13, %rdx
movq 0x10(%rsp), %r9
callq *0x50(%rbx)
testl %eax, %eax
jne 0x1a348c
addq $0x8, %rbp
movq (%rsp), %rax
movq 0x10(%rax), %rax
leaq (%r15,%rax,8), %rax
cmpq %rax, %rbp
jb 0x1a342b
movq %rbx, %rdi
movq (%rsp), %rsi
movl 0xc(%rsp), %edx
movq %r14, %rcx
callq 0x1a3970
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x1a347d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1a347d