// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/esa-maxpairs.c
// Function: processbranchingedge_maxpairs
static int processbranchingedge_maxpairs(bool firstsucc,
                                         GtUword fatherdepth,
                                         GtUword fatherlb,
                                         GtBUinfo_maxpairs *father,
                                         GT_UNUSED GtUword sondepth,
                                         GT_UNUSED GtUword sonwidth,
                                         GtBUinfo_maxpairs *son,
                                         GtBUstate_maxpairs *state,
                                         GtError *err)
{
  unsigned int chfather, chson;
  GtUword *start, *spptr, *fptr, *fstart;

#ifdef SKDEBUG
  printf("%s firstsucc=%s, depth(father)= "GT_WU"\n",
          __func__,firstsucc ? "true" : "false",fatherdepth);
#endif
  if (fatherdepth < (GtUword) state->searchlength)
  {
    setpostabto0_maxpairs(state);
    return 0;
  }
  if (state->maxfreqcollect != NULL)
  {
    if (binaryfindlcpinterval(state->maxfreqcollect->arr.spaceLcpinterval,
                              state->maxfreqcollect->arr.nextfreeLcpinterval,
                              fatherdepth,fatherlb))
    {
      return 0;
    }
#ifdef SKDEBUG
    gt_assert(!linearfindlcpinterval(
                              state->maxfreqcollect->arr.spaceLcpinterval,
                              state->maxfreqcollect->arr.nextfreeLcpinterval,
                              fatherdepth,fatherlb));
#endif
  }
  state->initialized = false;
  if (firstsucc)
  {
    return 0;
  }
  if (father->commonchar != ISLEFTDIVERSE)
  {
    gt_assert(son != NULL);
#ifdef SKDEBUG
    printf("commonchar=%u\n",(unsigned int) son->commonchar);
#endif
    if (son->commonchar != ISLEFTDIVERSE)
    {
      CHECKCHAR(son->commonchar);
    } else
    {
      father->commonchar = ISLEFTDIVERSE;
    }
  }
  if (father->commonchar == ISLEFTDIVERSE)
  {
    start = state->uniquechar.spaceGtUword + son->uniquecharposstart;
    for (chfather = 0; chfather < state->alphabetsize; chfather++)
    {
      for (chson = 0; chson < state->alphabetsize; chson++)
      {
        if (chson != chfather)
        {
          if (cartproduct2_maxpairs(state,fatherdepth,father,chfather,
                                    son,chson,err) != 0)
          {
            return -1;
          }
        }
      }
      for (spptr = start; spptr < start + son->uniquecharposlength; spptr++)
      {
        if (cartproduct1_maxpairs(state,fatherdepth,father,chfather,*spptr,
                                  err) != 0)
        {
          return -2;
        }
      }
    }
    fstart = state->uniquechar.spaceGtUword +
             father->uniquecharposstart;
    for (fptr = fstart; fptr < fstart + father->uniquecharposlength; fptr++)
    {
      for (chson = 0; chson < state->alphabetsize; chson++)
      {
        if (cartproduct1_maxpairs(state,fatherdepth,son,chson,*fptr,err) != 0)
        {
          return -3;
        }
      }
      for (spptr = start; spptr < start + son->uniquecharposlength; spptr++)
      {
        if (state->processmaxpairs(state->processmaxpairsinfo,
                                   &state->genericencseq,
                                   fatherdepth,GT_MIN(*fptr,*spptr),
                                               GT_MAX(*fptr,*spptr),err) != 0)
        {
          return -4;
        }
      }
    }
  }
  concatlists_maxpairs(state,father,son);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r15
movl 0x4(%r9), %eax
cmpq %rsi, %rax
jbe 0x14f203
movq %r15, %rdi
callq 0x14f5a4
jmp 0x14f489
movq %r8, %r13
movq %rcx, %r14
movq %rsi, %r12
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x14f279
movq %rdx, %rcx
imulq $0x18, 0x20(%rax), %rdx
movq 0x10(%rax), %r10
leaq (%r10,%rdx), %r9
addq $-0x18, %r9
pushq $0x18
popq %rsi
pushq $0x2
popq %r8
cmpq %r9, %r10
ja 0x14f279
movq %r9, %rax
subq %r10, %rax
cqto
idivq %rsi
incq %rax
cqto
idivq %r8
imulq $0x18, %rax, %rdx
leaq (%r10,%rdx), %rax
cmpq %rcx, 0x8(%r10,%rdx)
ja 0x14f261
jb 0x14f270
movq (%rax), %rdx
cmpq %r12, %rdx
jbe 0x14f26a
addq $-0x18, %rax
movq %rax, %r9
jmp 0x14f230
jae 0x14f489
addq $0x18, %rax
movq %rax, %r10
jmp 0x14f230
movb $0x0, (%r15)
testb %dil, %dil
jne 0x14f489
movb (%r14), %cl
movl 0x8(%r15), %eax
cmpb %al, %cl
jne 0x14f2be
cmpb %al, %cl
je 0x14f2e7
movl %eax, %eax
shlq $0x4, %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x14f481
movq 0x18(%r13), %rdx
movq 0x8(%rdx,%rcx), %rdx
movq 0x18(%r14), %rsi
addq %rdx, 0x8(%rsi,%rcx)
addq $0x10, %rcx
jmp 0x14f29d
testq %r13, %r13
je 0x14f56c
movzbl %al, %edx
movzbl (%r13), %esi
cmpl %esi, %edx
je 0x14f2e4
cmpb %sil, %cl
setne %dil
cmpl %esi, %edx
setbe %dl
orb %dil, %dl
je 0x14f291
movb %al, (%r14)
movq 0x8(%r13), %rcx
shlq $0x3, %rcx
addq 0x10(%r15), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x30(%r15), %rcx
movq %rcx, 0x20(%rsp)
xorl %edx, %edx
pushq $-0x2
popq %rbp
movl %eax, %ecx
cmpq %rcx, %rdx
jae 0x14f49c
movq %rdx, %rsi
shlq $0x4, %rsi
imulq $0x18, %rdx, %rcx
movq %rcx, 0x18(%rsp)
xorl %edi, %edi
movq %rdx, 0x8(%rsp)
movl %eax, %ecx
cmpq %rcx, %rdi
jae 0x14f42c
cmpq %rdx, %rdi
jne 0x14f33d
incq %rdi
jmp 0x14f328
movq %r14, 0x38(%rsp)
movq 0x18(%r14), %r8
movq 0x28(%r15), %rax
movq (%r8,%rsi), %r9
movq %rsi, 0x28(%rsp)
addq %rsi, %r8
shlq $0x3, %r9
movq 0x18(%rsp), %rcx
addq (%rax,%rcx), %r9
movq %r13, 0x30(%rsp)
movq 0x18(%r13), %rcx
movq %rdi, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %r14
imulq $0x18, %rdi, %rsi
movq (%rcx,%rdx), %rbp
shlq $0x3, %rbp
addq (%rax,%rsi), %rbp
movq %r9, %r13
movq %rdi, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r9, 0x40(%rsp)
movq 0x8(%r8), %rax
leaq (%r9,%rax,8), %rax
cmpq %rax, %r13
jae 0x14f40c
movq %rbp, %rbx
movq 0x8(%r14), %rax
leaq (,%rax,8), %rax
addq %rbp, %rax
cmpq %rax, %rbx
jae 0x14f3f7
movq (%r13), %rax
movq (%rbx), %r8
cmpq %r8, %rax
movq %r8, %rcx
cmovbq %rax, %rcx
movq 0x68(%r15), %rdi
cmovaq %rax, %r8
movq 0x20(%rsp), %rsi
movq %r12, %rdx
movq 0x90(%rsp), %r9
callq *0x50(%r15)
addq $0x8, %rbx
testl %eax, %eax
je 0x14f3a9
jmp 0x14f47c
addq $0x8, %r13
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r9
jmp 0x14f399
movl 0x8(%r15), %eax
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
pushq $-0x2
popq %rbp
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %rsi
jmp 0x14f338
movq 0x10(%rsp), %rbx
movq 0x10(%r13), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %rbx
jae 0x14f46b
movq (%rbx), %r8
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movq 0x90(%rsp), %r9
callq 0x14f711
addq $0x8, %rbx
testl %eax, %eax
je 0x14f431
jmp 0x14f48b
movq 0x8(%rsp), %rdx
incq %rdx
movl 0x8(%r15), %eax
jmp 0x14f306
pushq $-0x1
popq %rbp
jmp 0x14f48b
movq 0x10(%r13), %rax
addq %rax, 0x10(%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rcx
shlq $0x3, %rcx
addq 0x10(%r15), %rcx
pushq $-0x4
popq %rbp
movq %rcx, %rdx
movq %rcx, 0x18(%rsp)
movq 0x10(%r14), %rax
leaq (%rcx,%rax,8), %rax
cmpq %rax, %rdx
jae 0x14f563
xorl %ebx, %ebx
movq %rdx, 0x8(%rsp)
cmpl 0x8(%r15), %ebx
jae 0x14f4f9
movq (%rdx), %r8
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %ecx
movq 0x90(%rsp), %r9
callq 0x14f711
movq 0x8(%rsp), %rdx
incl %ebx
testl %eax, %eax
je 0x14f4cb
jmp 0x14f55c
movq 0x10(%rsp), %rbx
movq 0x10(%r13), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %rbx
jae 0x14f54e
movq (%rdx), %rax
movq (%rbx), %r8
cmpq %r8, %rax
movq %r8, %rcx
cmovbq %rax, %rcx
movq 0x68(%r15), %rdi
cmovaq %rax, %r8
movq 0x20(%rsp), %rsi
movq %r12, %rdx
movq 0x90(%rsp), %r9
callq *0x50(%r15)
movq 0x8(%rsp), %rdx
addq $0x8, %rbx
testl %eax, %eax
je 0x14f4fe
jmp 0x14f48b
addq $0x8, %rdx
movq 0x18(%rsp), %rcx
jmp 0x14f4b3
pushq $-0x3
jmp 0x14f47e
movl 0x8(%r15), %eax
jmp 0x14f295
movq 0x2e89f5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x195a96(%rip), %rsi    # 0x2e5013
leaq 0x1f555c(%rip), %rdx    # 0x344ae0
leaq 0x1f5561(%rip), %rcx    # 0x344aec
leaq 0x1f5359(%rip), %r8     # 0x3448eb
movl $0x186, %r9d            # imm = 0x186
xorl %eax, %eax
callq 0x17a50
callq 0x17390