// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/dist-short.c
// Function: gt_forwardprefixmatch
Definedunsignedlong gt_forwardprefixmatch(const GtEncseq *encseq,
                                       unsigned int alphasize,
                                       GtUword startpos,
                                       bool nowildcards,
                                       GtUword *eqsvector,
                                       const GtUchar *useq,
                                       GtUword ulen,
                                       GtUword maxdistance)
{
  DECLARELOCALVARS;
  GtUword pos, totallength = gt_encseq_total_length(encseq);
  GtUchar cc;
  Definedunsignedlong result;

  gt_initeqsvector(eqsvector,(GtUword) alphasize,useq,ulen);
  gt_assert(maxdistance > 0);
  for (pos = startpos; /* Nothing */; pos++)
  {
    gt_assert(pos - startpos <= (GtUword) (ulen + maxdistance));
    cc = gt_encseq_get_encoded_char(encseq,pos,GT_READMODE_FORWARD);
    if (nowildcards && cc == (GtUchar) GT_WILDCARD)
    {
      result.defined = false;
      result.valueunsignedlong = 0;
      return result;
    }
    COMPUTENEWDIST(cc);
    if (distval <= maxdistance || pos == totallength-1)
    {
      break;
    }
  }
  result.defined = true;
  result.valueunsignedlong = (GtUword) (pos - startpos + 1);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, (%rsp)
movq %r8, %r14
movl %ecx, 0xc(%rsp)
movq %rdx, %r15
movl %esi, %r13d
movq 0x78(%rsp), %rbp
movq 0x70(%rsp), %r12
leal -0x1(%r12), %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x28(%rsp)
callq 0x7055e
movq %rax, %rbx
movl %r13d, %esi
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq (%rsp), %rdx
movq %r12, %rcx
callq 0x2c08f8
testq %rbp, %rbp
je 0x2a734d
leaq (%r12,%rbp), %rax
movq %rax, (%rsp)
movq %r15, 0x30(%rsp)
notq %r15
addq %rbx, %r15
movq %r15, 0x18(%rsp)
pushq $-0x1
popq %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
cmpq (%rsp), %r13
ja 0x2a72e7
movq 0x30(%rsp), %rax
leaq (%rax,%r13), %rsi
xorl %ebx, %ebx
movq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x705e4
cmpb $-0x2, %al
sete %cl
testb %cl, 0xc(%rsp)
jne 0x2a72c9
cmpb $-0x2, %al
je 0x2a7252
movzbl %al, %eax
cmpl $0xff, %eax
je 0x2a7315
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rax
jmp 0x2a7254
xorl %eax, %eax
movq %rax, %rcx
andq %r15, %rcx
addq %r15, %rcx
xorq %r15, %rcx
orq %rax, %rcx
movq %rcx, %rdx
orq %r15, %rdx
notq %rdx
orq %r14, %rdx
andq %r15, %rcx
movq %rcx, %rsi
movq 0x20(%rsp), %rdi
andq %rdi, %rsi
negq %rsi
movl $0x0, %esi
sbbq %rsi, %rsi
testq %rdi, %rdx
pushq $0x1
popq %rdi
cmovneq %rdi, %rsi
addq %rsi, %r12
cmpq %rbp, %r12
jbe 0x2a72ce
cmpq %r13, 0x18(%rsp)
je 0x2a72ce
orq %r14, %rax
leaq 0x1(,%rdx,2), %rdx
movq %rdx, %r14
andq %rax, %r14
addq %rcx, %rcx
orq %rdx, %rax
notq %rax
orq %rcx, %rax
incq %r13
movq %rax, %r15
jmp 0x2a7205
xorl %r13d, %r13d
jmp 0x2a72d3
incq %r13
movb $0x1, %bl
movl %ebx, %eax
movq %r13, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x190c7a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3dd1b(%rip), %rsi     # 0x2e5013
leaq 0xd99ec(%rip), %rdx     # 0x380ceb
leaq 0xd99cf(%rip), %rcx     # 0x380cd5
leaq 0xd994c(%rip), %r8      # 0x380c59
movl $0x99, %r9d
jmp 0x2a7341
movq 0x190c4c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3dced(%rip), %rsi     # 0x2e5013
leaq 0xd9943(%rip), %rdx     # 0x380c70
leaq 0xd99a1(%rip), %rcx     # 0x380cd5
leaq 0xd991e(%rip), %r8      # 0x380c59
movl $0xa1, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x190c14(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3dcb5(%rip), %rsi     # 0x2e5013
leaq 0xd994a(%rip), %rdx     # 0x380caf
leaq 0xd9969(%rip), %rcx     # 0x380cd5
leaq 0xd98e6(%rip), %r8      # 0x380c59
movl $0x96, %r9d
jmp 0x2a7341
nop