// File: /workspace/github_c_makefile_star2_O1/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 0xf1c71
movq %rax, %r15
movq %r13, %rdi
callq 0xfac80
movl %eax, %ebx
movq %r13, %rdi
callq 0xec1d8
leaq -0x1(%rax), %r12
shrq %r12
testb %bl, %bl
cmoveq %rax, %r12
movq %r13, %rdi
callq 0xec1e8
movq %rax, %rbx
leaq -0x1(%r12), %rax
shrq $0x5, %rax
incq %rax
cmpq $0x20, %r12
movl $0x1, %r14d
cmovaeq %rax, %r14
leaq 0x1fb9ae(%rip), %rdi    # 0x3aeed8
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x108e02
movq %r13, %rdi
callq 0xfac0f
cmpl $0x2, %eax
jne 0x1b3580
movq %r13, %rdi
callq 0xfac12
xorl %ecx, %ecx
cmpl $0x2, %ebp
leaq 0x7d(%rip), %r10        # 0x1b35d5
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 0x1b1360
jmp 0x1b35b2
xorl %eax, %eax
cmpl $0x2, %ebp
leaq 0x49(%rip), %r10        # 0x1b35d5
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 0x1b335b
addq $0x20, %rsp
leaq 0x1fb93d(%rip), %rdi    # 0x3aeefa
movq %rax, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x108e02