// File: /workspace/github_c_makefile_star2_O2/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 0x776db
movq %rax, %r15
movq %r13, %rdi
callq 0x81dea
movl %eax, %ebx
movq %r13, %rdi
callq 0x7055e
leaq -0x1(%rax), %r12
shrq %r12
testb %bl, %bl
cmoveq %rax, %r12
movq %r13, %rdi
callq 0x705a1
movq %rax, %rbx
leaq -0x1(%r12), %rax
shrq $0x5, %rax
incq %rax
cmpq $0x20, %r12
pushq $0x1
popq %r14
cmovaeq %rax, %r14
leaq 0x1ee599(%rip), %rdi    # 0x345cb4
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x92a82
movq %r13, %rdi
callq 0x81d17
cmpl $0x2, %eax
jne 0x157771
movq %r13, %rdi
callq 0x81d1a
xorl %ecx, %ecx
cmpl $0x2, %ebp
leaq 0x7d(%rip), %r10        # 0x1577c6
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 0x155484
jmp 0x1577a3
xorl %eax, %eax
cmpl $0x2, %ebp
leaq 0x49(%rip), %r10        # 0x1577c6
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 0x157536
addq $0x20, %rsp
leaq 0x1ee528(%rip), %rdi    # 0x345cd6
movq %rax, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x92a82