// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/firstcodes-scan.c
// Function: gt_firstcode_runkmerscan
void gt_firstcode_runkmerscan(const GtEncseq *encseq,
                              unsigned int mode,
                              unsigned int kmersize,
                              unsigned int minmatchlength)
{
  const GtTwobitencoding *twobitencoding
    = gt_encseq_twobitencoding_export(encseq);
  GtUword totallength, maxunitindex, encodingsum, numofsequences;
  bool withcheck = mode == 1U ? true : false;

  if (gt_encseq_is_mirrored(encseq))
  {
    totallength = (gt_encseq_total_length(encseq)-1)/2;
  } else
  {
    totallength = gt_encseq_total_length(encseq);
  }
  numofsequences = gt_encseq_num_of_sequences(encseq);
  maxunitindex = gt_unitsoftwobitencoding(totallength) - 1;
  gt_log_log("totallength=" GT_WU ",maxunitindex=" GT_WU "\n",
             totallength,maxunitindex);
  if (gt_encseq_accesstype_get(encseq) == GT_ACCESS_TYPE_EQUALLENGTH)
  {
    GtUword equallength = gt_encseq_equallength(encseq);

    encodingsum = gt_firstcodes_kmerscan_eqlen(twobitencoding,
                                               withcheck,
                                               equallength,
                                               totallength,
                                               numofsequences,
                                               maxunitindex,
                                               kmersize,
                                               minmatchlength,
                                               mode == 2U ? showcodes : NULL,
                                               NULL);
  } else
  {
    encodingsum = gt_firstcodes_kmerscan(encseq,
                                         twobitencoding,
                                         withcheck,
                                         totallength,
                                         numofsequences,
                                         maxunitindex,
                                         kmersize,
                                         minmatchlength,
                                         mode == 2U ? showcodes : NULL,
                                         NULL);
  }
  gt_log_log("encodingsum = " GT_WU "\n",encodingsum);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movl %esi, %ebp
movq %rdi, %r13
callq 0xed62d
movq %rax, %r15
movq %r13, %rdi
callq 0xf6567
movl %eax, %ebx
movq %r13, %rdi
callq 0xe7b9c
leaq -0x1(%rax), %r12
shrq %r12
testb %bl, %bl
cmoveq %rax, %r12
movq %r13, %rdi
callq 0xe7bac
movq %rax, %rbx
leaq -0x1(%r12), %rax
shrq $0x5, %rax
incq %rax
cmpq $0x20, %r12
movl $0x1, %r14d
cmovaeq %rax, %r14
leaq 0x1faf9e(%rip), %rdi    # 0x3a5934
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x103d72
movq %r13, %rdi
callq 0xf64f6
cmpl $0x2, %eax
jne 0x1aa9ec
movq %r13, %rdi
callq 0xf64f9
xorl %ecx, %ecx
cmpl $0x2, %ebp
leaq 0x7d(%rip), %r10        # 0x1aaa41
cmovneq %rcx, %r10
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rdx
movq %r12, %rcx
movq %rbx, %r8
movq %r14, %r9
pushq $0x0
pushq %r10
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x1a87cc
jmp 0x1aaa1e
xorl %eax, %eax
cmpl $0x2, %ebp
leaq 0x49(%rip), %r10        # 0x1aaa41
cmovneq %rax, %r10
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %rbx, %r8
movq %r14, %r9
pushq $0x0
pushq %r10
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x1aa7c7
addq $0x20, %rsp
leaq 0x1faf2d(%rip), %rdi    # 0x3a5956
movq %rax, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x103d72