// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-bwtseq.c
// Function: getMatchBound
static inline void
getMatchBound(const BWTSeq *bwtSeq, const Symbol *query, size_t queryLen,
              struct matchBound *match, bool forward)
{
  const Symbol *qptr, *qend;
  unsigned int cc;
  const Mbtab *mbptr;
  GtPrebwtstate prebwt;

  gt_assert(bwtSeq && query);
  if (forward)
  {
    qptr = query;
    qend = query + queryLen;
  } else
  {
    qptr = query + queryLen - 1;
    qend = query - 1;
  }
  gt_assert(GT_ISNOTSPECIAL(*qptr));
  cc = (unsigned int) *qptr;
  prebwt.mbtab = gt_bwtseq2mbtab((const FMindex *) bwtSeq);
  if (prebwt.mbtab != NULL)
  {
    prebwt.numofchars = gt_bwtseq2numofchars((const FMindex *) bwtSeq);
    prebwt.maxdepth = gt_bwtseq2maxdepth((const FMindex *) bwtSeq);
    prebwt.code = 0;
    prebwt.depth = 0;
    mbptr = gt_prebwt_next(&prebwt,cc);
    match->start = mbptr->lowerbound;
    match->end = mbptr->upperbound;
  } else
  {
    prebwt.numofchars = GT_UNDEF_UINT;
    prebwt.maxdepth = GT_UNDEF_UINT;
    prebwt.code = 0;
    prebwt.depth = GT_UNDEF_UINT;
    match->start = bwtSeq->count[cc];
    match->end   = bwtSeq->count[cc + 1];
  }
  qptr = forward ? (qptr+1) : (qptr-1);
  while (match->start < match->end && qptr != qend)
  {
    GtUwordPair occPair;

    gt_assert(GT_ISNOTSPECIAL(*qptr));
    cc = (unsigned int) *qptr;
    if (prebwt.mbtab != NULL && prebwt.depth < prebwt.maxdepth)
    {
      mbptr = gt_prebwt_next(&prebwt,cc);
      match->start = mbptr->lowerbound;
      match->end = mbptr->upperbound;
    } else
    {
      occPair = BWTSeqTransformedPosPairOcc(bwtSeq, (Symbol) cc, match->start,
                                            match->end);
      match->start = bwtSeq->count[cc] + occPair.a;
      match->end   = bwtSeq->count[cc] + occPair.b;
    }
    qptr = forward ? (qptr+1) : (qptr-1);
  }
}

// Assembly:
subq $0xa8, %rsp
movb %r8b, %al
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
andb $0x1, %al
movb %al, 0x87(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x2269f9
cmpq $0x0, 0x98(%rsp)
jne 0x226a31
movq 0x4155a0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2ef609(%rip), %rsi    # 0x516013
leaq 0x34eb4c(%rip), %rdx    # 0x57555d
leaq 0x34f01f(%rip), %rcx    # 0x575a37
leaq 0x34eaa0(%rip), %r8     # 0x5754bf
movl $0xab, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x226a33
testb $0x1, 0x87(%rsp)
je 0x226a61
movq 0x98(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x98(%rsp), %rax
addq 0x90(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x226a8b
movq 0x98(%rsp), %rax
addq 0x90(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x78(%rsp)
movq 0x98(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x226a8d
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xfe, %eax
jl 0x226ad4
movq 0x4154fd(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2ef566(%rip), %rsi    # 0x516013
leaq 0x34ef91(%rip), %rdx    # 0x575a45
leaq 0x34ef7c(%rip), %rcx    # 0x575a37
leaq 0x34e9fd(%rip), %r8     # 0x5754bf
movl $0xb5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x226ad6
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x6c(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x22fd70
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x226b6c
movq 0xa0(%rsp), %rdi
callq 0x22fe70
movl %eax, 0x48(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x22fdf0
movl %eax, 0x4c(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x50(%rsp)
movl 0x6c(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x2283c0
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x226bd1
movl $0xffffffff, 0x48(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x58(%rsp)
movl $0xffffffff, 0x50(%rsp) # imm = 0xFFFFFFFF
movq 0xa0(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x6c(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
movq 0xa0(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x6c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x8(%rax)
testb $0x1, 0x87(%rsp)
je 0x226beb
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x226bf9
movq 0x78(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x88(%rsp), %rax
movq (%rax), %rcx
movq 0x88(%rsp), %rdx
xorl %eax, %eax
cmpq 0x8(%rdx), %rcx
movb %al, 0x17(%rsp)
jae 0x226c33
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x226c40
jmp 0x226db2
jmp 0x226c42
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xfe, %eax
jl 0x226c89
movq 0x415348(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2ef3b1(%rip), %rsi    # 0x516013
leaq 0x34eddc(%rip), %rdx    # 0x575a45
leaq 0x34edc7(%rip), %rcx    # 0x575a37
leaq 0x34e848(%rip), %r8     # 0x5754bf
movl $0xcf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x226c8b
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x6c(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x226ce9
movl 0x50(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0x226ce9
movl 0x6c(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x2283c0
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x226d7b
movq 0xa0(%rsp), %rdi
movl 0x6c(%rsp), %eax
movq 0x88(%rsp), %rcx
movq (%rcx), %rdx
movq 0x88(%rsp), %rcx
movq 0x8(%rcx), %rcx
movzbl %al, %esi
callq 0x226490
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa0(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x6c(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
addq 0x30(%rsp), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
movq 0xa0(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x6c(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
addq 0x38(%rsp), %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0x8(%rax)
testb $0x1, 0x87(%rsp)
je 0x226d95
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x226da3
movq 0x78(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x78(%rsp)
jmp 0x226c03
addq $0xa8, %rsp
retq
nopw (%rax,%rax)