// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_extractprefixcode
GtCodetype gt_encseq_extractprefixcode(unsigned int *unitsnotspecial,
                                       const GtEncseq *encseq,
                                       const GtCodetype *filltable,
                                       GtReadmode readmode,
                                       GtEncseqReader *esr,
                                       const GtCodetype **multimappower,
                                       GtUword frompos,
                                       unsigned int prefixlength)
{
  GtUword pos, twobitencodingstoppos;
  GtCodetype code = 0;
  GtUchar cc;

  gt_assert(prefixlength > 0);
  gt_encseq_reader_reinit_with_readmode(esr, encseq, readmode, frompos);
  if (frompos + prefixlength - 1 < encseq->logicaltotallength)
    twobitencodingstoppos = frompos + prefixlength;
  else
    twobitencodingstoppos = encseq->logicaltotallength;

  *unitsnotspecial = 0;
  for (pos = frompos; pos < twobitencodingstoppos; pos++) {
    cc = gt_encseq_reader_next_encoded_char(esr);
    if (GT_ISNOTSPECIAL(cc)) {
      code += multimappower[*unitsnotspecial][cc];
      (*unitsnotspecial)++;
    }
    else
      break;
  }
  if (*unitsnotspecial < prefixlength)
    code += (GtCodetype) filltable[*unitsnotspecial];
  return code;
}

// Assembly:
subq $0x58, %rsp
movl 0x68(%rsp), %eax
movq 0x60(%rsp), %rax
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl %ecx, 0x3c(%rsp)
movq %r8, 0x30(%rsp)
movq %r9, 0x28(%rsp)
movq $0x0, 0x10(%rsp)
cmpl $0x0, 0x68(%rsp)
ja 0x11fc82
movq 0x94387(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x3e40b(%rip), %rsi     # 0x15e066
leaq 0x66ded(%rip), %rdx     # 0x186a4f
leaq 0x66df7(%rip), %rcx     # 0x186a60
leaq 0x659ee(%rip), %r8      # 0x18565e
movl $0x1c8d, %r9d           # imm = 0x1C8D
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11fc84
movq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x60(%rsp), %rcx
callq 0x115f90
movq 0x60(%rsp), %rax
movl 0x68(%rsp), %ecx
addq %rcx, %rax
subq $0x1, %rax
movq 0x48(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x11fcca
movq 0x60(%rsp), %rax
movl 0x68(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
jmp 0x11fcd8
movq 0x48(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
movl $0x0, (%rax)
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x11fd58
movq 0x30(%rsp), %rdi
callq 0x115010
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
cmpl $0xfe, %eax
jge 0x11fd44
movq 0x28(%rsp), %rax
movq 0x50(%rsp), %rcx
movl (%rcx), %ecx
movq (%rax,%rcx,8), %rax
movzbl 0xf(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x11fd46
jmp 0x11fd58
jmp 0x11fd48
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x11fced
movq 0x50(%rsp), %rax
movl (%rax), %eax
cmpl 0x68(%rsp), %eax
jae 0x11fd7f
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rcx
movl (%rcx), %ecx
movq (%rax,%rcx,8), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax)