// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-bltrie.c
// Function: blindtrie_findcompanion
static GtBlindtriesnodeptr blindtrie_findcompanion(
                                    GtBlindtrie *blindtrie,
                                    GtUword currentstartpos,
                                    GtUword currenttwobitencodingstoppos)
{
  GtBlindtriesymbol newchar;
  GtBlindtriesnodeptr head, succ;
  GtUword headdepth;

  blindtrie->stack.nextfreeGtBlindtriesnodeptr = 0;
  head = GT_BLINDTRIE_ROOTIDX;
  while (!blindtrie_isleaf(blindtrie,head))
  {
    GT_STOREINARRAY (&blindtrie->stack, GtBlindtriesnodeptr, 128, head);
    headdepth = blindtrie_getdepth(blindtrie,head);
    if (blindtrie_isleftofboundary(blindtrie,currentstartpos,headdepth))
    {
      if (!blindtrie->cmpcharbychar &&
          blindtrie->has_twobitencoding_stoppos_support)
      {
        if ((GT_ISDIRREVERSE(blindtrie->readmode) &&
            GT_REVERSEPOS(blindtrie->totallength,currentstartpos+headdepth)
            >= currenttwobitencodingstoppos) ||
            (!GT_ISDIRREVERSE(blindtrie->readmode) &&
             currentstartpos + headdepth < currenttwobitencodingstoppos))
        {
          newchar = (GtBlindtriesymbol)
                    gt_encseq_get_encoded_char_nospecial(
                                                   blindtrie->encseq,
                                                   currentstartpos + headdepth,
                                                   blindtrie->readmode);
        } else
        {
          newchar = GT_UNIQUEINT(currentstartpos + headdepth);
        }
      } else
      {
        newchar = (GtBlindtriesymbol)
                  gt_encseq_get_encoded_char(blindtrie->encseq,
                                             currentstartpos + headdepth,
                                             blindtrie->readmode);
        if (GT_BLINDTRIECHAR_GT_ISSPECIAL(newchar))
        {
          newchar = GT_UNIQUEINT(currentstartpos + headdepth);
        }
      }
    } else
    {
      newchar = GT_UNIQUEINT(currentstartpos + headdepth);
    }
    if (GT_ISUNIQUEINT(newchar))
    {
      return blindtrie_extractleafnode(blindtrie,head);
    }
    succ = blindtrie_findsucc(blindtrie,
                              blindtrie_firstchild_get(blindtrie,head),
                              newchar);
    if (succ == GT_BLINDTRIE_REFNULL)
    {
      return blindtrie_extractleafnode(blindtrie,head);
    }
    head = succ;
  }
  GT_STOREINARRAY (&blindtrie->stack, GtBlindtriesnodeptr, 128, head);
  return head;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq $0x0, 0x20(%rax)
movl $0x0, 0x2c(%rsp)
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x2b9080
xorb $-0x1, %al
testb $0x1, %al
jne 0x2b8c61
jmp 0x2b8f48
jmp 0x2b8c63
jmp 0x2b8c65
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
addq $0x0, %rax
movq 0x48(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jb 0x2b8d12
movq $0x80, 0x18(%rsp)
xorl %eax, %eax
cmpq 0x18(%rsp), %rax
jbe 0x2b8ccb
movq 0x383306(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x25d36f(%rip), %rsi    # 0x516013
leaq 0x2604fc(%rip), %rdx    # 0x5191a7
leaq 0x2d03d7(%rip), %rcx    # 0x589089
leaq 0x2cfeba(%rip), %r8     # 0x588b73
movl $0x1d0, %r9d            # imm = 0x1D0
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2b8ccd
movq 0x18(%rsp), %rcx
movq 0x48(%rsp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rsi
shlq $0x2, %rsi
leaq 0x2cfe77(%rip), %rdx    # 0x588b73
movl $0x1d0, %ecx            # imm = 0x1D0
callq 0xe8540
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2b8d14
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2b8d58
movq 0x383279(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x25d2e2(%rip), %rsi    # 0x516013
leaq 0x2cffd9(%rip), %rdx    # 0x588d11
leaq 0x2d034a(%rip), %rcx    # 0x589089
leaq 0x2cfe2d(%rip), %r8     # 0x588b73
movl $0x1d0, %r9d            # imm = 0x1D0
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2b8d5a
jmp 0x2b8d5c
movl 0x2c(%rsp), %edx
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x48(%rsp), %rsi
movq 0x20(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x20(%rsi)
movl %edx, (%rax,%rcx,4)
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x2b9fe0
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x2b96c0
testb $0x1, %al
jne 0x2b8db0
jmp 0x2b8eb9
movq 0x48(%rsp), %rax
testb $0x1, 0x78(%rax)
jne 0x2b8e6d
movq 0x48(%rsp), %rax
testb $0x1, 0x7a(%rax)
je 0x2b8e6d
movq 0x48(%rsp), %rax
cmpl $0x1, 0x58(%rax)
je 0x2b8de4
movq 0x48(%rsp), %rax
cmpl $0x3, 0x58(%rax)
jne 0x2b8e05
movq 0x48(%rsp), %rax
movq 0x60(%rax), %rax
subq $0x1, %rax
movq 0x40(%rsp), %rcx
addq 0x20(%rsp), %rcx
subq %rcx, %rax
cmpq 0x38(%rsp), %rax
jae 0x2b8e2c
movq 0x48(%rsp), %rax
cmpl $0x1, 0x58(%rax)
je 0x2b8e56
movq 0x48(%rsp), %rax
cmpl $0x3, 0x58(%rax)
je 0x2b8e56
movq 0x40(%rsp), %rax
addq 0x20(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x2b8e56
movq 0x48(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x40(%rsp), %rsi
addq 0x20(%rsp), %rsi
movq 0x48(%rsp), %rax
movl 0x58(%rax), %edx
callq 0xaa7f0
movzbl %al, %eax
movq %rax, 0x30(%rsp)
jmp 0x2b8e6b
movq 0x40(%rsp), %rax
addq 0x20(%rsp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x30(%rsp)
jmp 0x2b8eb7
movq 0x48(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x40(%rsp), %rsi
addq 0x20(%rsp), %rsi
movq 0x48(%rsp), %rax
movl 0x58(%rax), %edx
callq 0xa9da0
movzbl %al, %eax
movq %rax, 0x30(%rsp)
cmpq $0xfe, 0x30(%rsp)
jb 0x2b8eb5
movq 0x40(%rsp), %rax
addq 0x20(%rsp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x30(%rsp)
jmp 0x2b8eb7
jmp 0x2b8ece
movq 0x40(%rsp), %rax
addq 0x20(%rsp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x30(%rsp)
cmpq $0x100, 0x30(%rsp)      # imm = 0x100
jb 0x2b8ef0
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x2baaa0
movl %eax, 0x54(%rsp)
jmp 0x2b906f
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x2b9f60
movq 0x8(%rsp), %rdi
movl %eax, %esi
movq 0x30(%rsp), %rdx
callq 0x2bab30
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jne 0x2b8f3b
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x2baaa0
movl %eax, 0x54(%rsp)
jmp 0x2b906f
movl 0x28(%rsp), %eax
movl %eax, 0x2c(%rsp)
jmp 0x2b8c48
jmp 0x2b8f4a
jmp 0x2b8f4c
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
addq $0x0, %rax
movq 0x48(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jb 0x2b8ff9
movq $0x80, 0x10(%rsp)
xorl %eax, %eax
cmpq 0x10(%rsp), %rax
jbe 0x2b8fb2
movq 0x38301f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x25d088(%rip), %rsi    # 0x516013
leaq 0x260215(%rip), %rdx    # 0x5191a7
leaq 0x2d00f0(%rip), %rcx    # 0x589089
leaq 0x2cfbd3(%rip), %r8     # 0x588b73
movl $0x202, %r9d            # imm = 0x202
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2b8fb4
movq 0x10(%rsp), %rcx
movq 0x48(%rsp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rsi
shlq $0x2, %rsi
leaq 0x2cfb90(%rip), %rdx    # 0x588b73
movl $0x202, %ecx            # imm = 0x202
callq 0xe8540
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2b8ffb
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2b903f
movq 0x382f92(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x25cffb(%rip), %rsi    # 0x516013
leaq 0x2cfcf2(%rip), %rdx    # 0x588d11
leaq 0x2d0063(%rip), %rcx    # 0x589089
leaq 0x2cfb46(%rip), %r8     # 0x588b73
movl $0x202, %r9d            # imm = 0x202
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2b9041
jmp 0x2b9043
movl 0x2c(%rsp), %edx
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x48(%rsp), %rsi
movq 0x20(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x20(%rsi)
movl %edx, (%rax,%rcx,4)
movl 0x2c(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax,%rax)