// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-ovlfind-gusfield.c
// Function: rdj_gusfield_processleafedge
static inline
void rdj_gusfield_processleafedge(GtUword leafnumber,
                                  const GtEncseq *encseq,
                                  GtUword nofsequences,
                                  GtArrayGtUword *matchlen_stacks,
                                  GtBitsequence *has_match,
                                  GtBitsequence *sspbittab,
                                  bool find_submaximal,
                                  GtUword firstrevcompl,
                                  GtSpmproc proc,
                                  void* procdata)
{
  GtUword prefix_seqnum, suffix_seqnum, corrected_suffix_seqnum;
  bool suffixseq_direct = true, prefixseq_direct = true;
  GtUword *matchlen;
  GtUword stack_pos;
  gt_assert(encseq != NULL);

  if (leafnumber == 0 || (bool)GT_ISIBITSET(sspbittab, leafnumber-1))
  {
    prefix_seqnum = gt_encseq_seqnum(encseq, leafnumber);
    if (firstrevcompl != 0)
    {
      GT_READJOINER_CORRECT_REVCOMPL(prefix_seqnum, firstrevcompl,
        nofsequences, prefixseq_direct);
    }
    for (suffix_seqnum = 0; suffix_seqnum < nofsequences; suffix_seqnum++)
    {
      if ((bool)GT_ISIBITSET(has_match, suffix_seqnum))
      {
        corrected_suffix_seqnum = suffix_seqnum;
        if (firstrevcompl != 0)
        {
          GT_READJOINER_CORRECT_REVCOMPL(corrected_suffix_seqnum,
            firstrevcompl, nofsequences, suffixseq_direct);
          if (!GT_READJOINER_IS_CORRECT_REVCOMPL_CASE(corrected_suffix_seqnum,
            suffixseq_direct, prefix_seqnum, prefixseq_direct))
            continue;
        }
        if (!find_submaximal)
        {
          matchlen = matchlen_stacks[suffix_seqnum].spaceGtUword +
                     matchlen_stacks[suffix_seqnum].nextfreeGtUword - 1;
          gt_assert(matchlen != NULL);
          if (suffix_seqnum == prefix_seqnum)
          {
            if (*matchlen == gt_encseq_seqlength(encseq, suffix_seqnum))
            {
              /* read overlaps with whole itself */
              if (matchlen_stacks[suffix_seqnum].nextfreeGtUword == 1UL)
              {
                /* no other overlap */
                continue;
              }
              else
              {
                matchlen = matchlen_stacks[suffix_seqnum].spaceGtUword +
                           matchlen_stacks[suffix_seqnum].nextfreeGtUword - 2;
              }
            }
          }
          proc(corrected_suffix_seqnum, prefix_seqnum,
               (GtUword) *matchlen, suffixseq_direct,
               prefixseq_direct, procdata);
        }
        else /* process whole stack, not only the top */
        {
          for (stack_pos = 0;
               stack_pos < matchlen_stacks[suffix_seqnum].nextfreeGtUword;
               stack_pos++)
          {
            matchlen = matchlen_stacks[suffix_seqnum].spaceGtUword + stack_pos;
            gt_assert(matchlen != NULL);
            if (suffix_seqnum == prefix_seqnum)
            {
              if (*matchlen == gt_encseq_seqlength(encseq, suffix_seqnum))
                /* skip ovl of read with whole itself */
                continue;
            }
            proc(corrected_suffix_seqnum, prefix_seqnum,
                 (GtUword) *matchlen, suffixseq_direct,
                 prefixseq_direct, procdata);
          }
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x40(%rsp)
movq %rsi, 0x20(%rsp)
testq %rsi, %rsi
je 0x17aa6f
movq %r8, %rbx
movq %rdx, %r15
movq %rdi, %rdx
testq %rdi, %rdi
je 0x17a7de
leaq -0x1(%rdx), %rcx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
shrq %cl, %rax
shrq $0x6, %rcx
testq %rax, (%r9,%rcx,8)
je 0x17aa2a
movq 0x88(%rsp), %r14
movq 0x20(%rsp), %rdi
movq %rdx, %rsi
callq 0x74c9d
leaq -0x1(%r14), %rcx
movq %rax, %rbp
movq %rax, (%rsp)
movq %rcx, 0x10(%rsp)
cmpq %rax, %rcx
jae 0x17a816
leaq -0x1(%r15), %rbp
subq (%rsp), %rbp
jb 0x17aa99
movb $0x1, %al
movl %eax, 0xc(%rsp)
xorl %esi, %esi
movq %rbx, 0x38(%rsp)
movq %r15, 0x30(%rsp)
cmpq %r15, %rsi
je 0x17aa2a
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movl %esi, %ecx
shrq %cl, %rax
movq %rsi, %rcx
shrq $0x6, %rcx
testq %rax, (%rbx,%rcx,8)
je 0x17aa22
movq %rsi, %rdx
testq %r14, %r14
je 0x17a8ed
cmpq %r14, %rsi
jb 0x17a875
movq %rsi, %rdx
notq %rdx
addq %r15, %rdx
movl $0x0, 0xc(%rsp)
jmp 0x17a889
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq %rsi, %rdx
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
jae 0x17a8ed
cmpq %r14, %rsi
setb %al
movq 0x10(%rsp), %rcx
cmpq (%rsp), %rcx
setae %cl
movq %rdx, %rdi
cmpq %rbp, %rdx
sete %dl
orb %al, %cl
testb %dl, %cl
je 0x17a8af
movq %rbp, %rdx
jmp 0x17a8ed
cmpq %r14, %rsi
jae 0x17a8c9
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
jae 0x17a8c9
cmpq %rdi, %rbp
jbe 0x17a8c9
movq %rdi, %rdx
jmp 0x17a8ed
cmpq %r14, %rsi
jb 0x17aa22
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
jb 0x17aa22
movq %rdi, %rdx
cmpq %rdi, %rbp
jae 0x17aa22
movq %rdx, 0x28(%rsp)
imulq $0x18, %rsi, %r12
addq 0x40(%rsp), %r12
movzbl 0xc(%rsp), %r14d
cmpb $0x0, 0x80(%rsp)
movq %rsi, 0x18(%rsp)
je 0x17a98a
andl $0x1, %r14d
xorl %r13d, %r13d
movq 0x28(%rsp), %rbx
cmpq 0x10(%r12), %r13
jae 0x17aa0b
movq (%r12), %r15
testq %r15, %r15
movq 0x18(%rsp), %rax
je 0x17aa39
cmpq %rbp, %rax
jne 0x17a959
movq (%r15,%r13,8), %rbx
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x75173
cmpq %rax, %rbx
movq 0x28(%rsp), %rbx
je 0x17a985
xorl %r8d, %r8d
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
setae %r8b
movq (%r15,%r13,8), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
movl %r14d, %ecx
movq 0x98(%rsp), %r9
callq *0x90(%rsp)
incq %r13
jmp 0x17a91c
movq (%r12), %rax
movq 0x10(%r12), %rcx
leaq (%rax,%rcx,8), %r13
addq $-0x8, %r13
cmpq %rbp, %rsi
jne 0x17a9d7
movq (%r13), %r15
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x75173
cmpq %rax, %r15
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %rbx
jne 0x17a9d7
movq 0x10(%r12), %rax
cmpq $0x1, %rax
je 0x17aa15
movq (%r12), %rcx
leaq (%rcx,%rax,8), %r13
addq $-0x10, %r13
xorl %r8d, %r8d
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
setae %r8b
movq (%r13), %rdx
andl $0x1, %r14d
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movl %r14d, %ecx
movq 0x98(%rsp), %r9
callq *0x90(%rsp)
jmp 0x17aa15
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %r15
movq 0x88(%rsp), %r14
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x17a828
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bd528(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16a5c9(%rip), %rsi    # 0x2e5013
leaq 0x1d3b44(%rip), %rdx    # 0x34e595
leaq 0x1d3afa(%rip), %rcx    # 0x34e552
leaq 0x1d3a37(%rip), %r8     # 0x34e496
pushq $0x7f
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2bd4f2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16a593(%rip), %rsi    # 0x2e5013
leaq 0x1c582b(%rip), %rdx    # 0x3402b2
leaq 0x1d3ac4(%rip), %rcx    # 0x34e552
leaq 0x1d3a01(%rip), %r8     # 0x34e496
pushq $0x47
jmp 0x17aa61
movq 0x2bd4c8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16a569(%rip), %rsi    # 0x2e5013
leaq 0x1d3abe(%rip), %rdx    # 0x34e56f
leaq 0x1d3a9a(%rip), %rcx    # 0x34e552
leaq 0x1d39d7(%rip), %r8     # 0x34e496
pushq $0x4f
jmp 0x17aa61