// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_readjoiner_cnttest.c
// Function: gt_readjoiner_cnttest_runner
static int gt_readjoiner_cnttest_runner(GT_UNUSED int argc,
    GT_UNUSED const char **argv, GT_UNUSED int parsed_args,
    void *tool_arguments, GT_UNUSED GtError *err)
{
  GtReadjoinerCnttestArguments *arguments = tool_arguments;
  GtEncseqLoader *el = NULL;
  GtEncseq *reads = NULL;
  GtBitsequence *bits = NULL;
  GtUword nofreads;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

  if (arguments->test == GT_READJOINER_CNTTEST_SHOWLIST)
  {
    GtStr *fn = NULL;
    fn = gt_str_clone(arguments->readset);
    gt_str_append_cstr(fn, GT_READJOINER_SUFFIX_CNTLIST);
    had_err = gt_cntlist_parse(gt_str_get(fn), true, &bits, &nofreads, err);
    gt_str_delete(fn);
  }
  else if (arguments->test == GT_READJOINER_CNTTEST_BRUTEFORCE ||
      arguments->test == GT_READJOINER_CNTTEST_KMP)
  {
    el = gt_encseq_loader_new();
    gt_encseq_loader_drop_description_support(el);
    gt_encseq_loader_disable_autosupport(el);
    if (!arguments->singlestrand)
      gt_encseq_loader_mirror(el);
    reads = gt_encseq_loader_load(el, gt_str_get(arguments->readset), err);
    if (reads == NULL)
      had_err = -1;
    else
    {
      gt_rdj_pairwise_exact(GT_OVLFIND_CNT, reads, !arguments->singlestrand,
          false, arguments->test == GT_READJOINER_CNTTEST_KMP, 1UL, true,
          NULL, NULL, false, NULL, &bits, &nofreads);
    }
    gt_encseq_delete(reads);
    gt_encseq_loader_delete(el);
  }
  else if (arguments->test == GT_READJOINER_CNTTEST_ESA)
  {
    Sequentialsuffixarrayreader *ssar = NULL;
    GtUword readlength = 0, firstrevcompl = 0;
    GtLogger *verbose_logger = gt_logger_new(arguments->verbose,
        GT_LOGGER_DEFLT_PREFIX, stderr);
    ssar = gt_newSequentialsuffixarrayreaderfromfile(gt_str_get(
          arguments->readset), SARR_LCPTAB | SARR_SUFTAB | SARR_SSPTAB,
        true, verbose_logger, err);
    if (gt_error_is_set(err))
      had_err = -1;
    else
    {
      nofreads = gt_encseq_num_of_sequences(ssar->encseq);
      if (!arguments->singlestrand)
      {
        nofreads = GT_DIV2(nofreads);
        firstrevcompl = nofreads;
      }
      GT_INITBITTAB(bits, nofreads);
      if (!arguments->singlestrand)
      if (gt_encseq_accesstype_get(ssar->encseq) == GT_ACCESS_TYPE_EQUALLENGTH)
        readlength = gt_encseq_seqlength(ssar->encseq, 0);
      (void)gt_contfind_bottomup(ssar, false, bits, arguments->singlestrand ? 0
          : firstrevcompl, readlength);
    }
    if (ssar != NULL)
      gt_freeSequentialsuffixarrayreader(&ssar);
    gt_logger_delete(verbose_logger);
  }
  else
  {
    gt_assert(false);
  }
  if (!had_err)
    had_err = gt_cntlist_show(bits, nofreads, NULL, false, err);
  gt_free(bits);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %rbx
movq %rcx, %r14
andq $0x0, 0x40(%rsp)
testq %r8, %r8
je 0x3a8a1
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x3ab7c
testq %r14, %r14
je 0x3ab4e
movl 0x10(%r14), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x3a911
cmpl $0x3, %eax
je 0x3a9b2
testl %eax, %eax
jne 0x3abaa
movq (%r14), %rdi
callq 0xad442
movq %rax, %r14
leaq 0x2b7f1d(%rip), %rsi    # 0x2f27f6
movq %rax, %rdi
callq 0xacbfb
movq %r14, %rdi
callq 0xad1fa
pushq $0x1
popq %rsi
leaq 0x40(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movq %rax, %rdi
movq %rbx, %r8
callq 0x172354
movl %eax, %r12d
movq %r14, %rdi
callq 0xae103
jmp 0x3ab08
callq 0x791cd
movq %rax, %r15
movq %rax, %rdi
callq 0x7cece
movq %r15, %rdi
callq 0x7d046
cmpb $0x0, 0x14(%r14)
jne 0x3a938
movq %r15, %rdi
callq 0x7d003
movq (%r14), %rdi
callq 0xad1fa
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x7921d
movq %rax, %r13
testq %rax, %rax
je 0x3aa14
movzbl 0x14(%r14), %edx
xorl %r8d, %r8d
cmpl $0x2, 0x10(%r14)
sete %r8b
leaq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
andq $0x0, 0x20(%rsp)
andl $0x0, 0x18(%rsp)
movl $0x1, (%rsp)
xorl $0x1, %edx
pushq $0x1
popq %rdi
xorl %r12d, %r12d
pushq $0x1
popq %r9
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x17abd4
jmp 0x3aa18
movzbl 0x15(%r14), %edi
movq 0x3fd5aa(%rip), %rax    # 0x437f68
movq (%rax), %rdx
leaq 0x2abf0c(%rip), %rsi    # 0x2e68d4
callq 0x92b50
movq %rax, %r15
movq (%r14), %rdi
callq 0xad1fa
pushq $0x1
popq %rdx
movq %rax, %rdi
movl $0x86, %esi
movq %r15, %rcx
movq %rbx, %r8
callq 0x1516ac
movq %rax, %r13
movq %rax, 0x60(%rsp)
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
je 0x3aa2d
pushq $-0x1
popq %r12
testq %r13, %r13
jne 0x3aaf6
jmp 0x3ab00
pushq $-0x1
popq %r12
movq %r13, %rdi
callq 0x735fd
movq %r15, %rdi
callq 0x79f01
jmp 0x3ab08
movq 0x38(%r13), %rdi
callq 0x705a1
movq %rax, 0x48(%rsp)
cmpb $0x0, 0x14(%r14)
movq %r15, 0x58(%rsp)
je 0x3aa52
movq $0x0, 0x50(%rsp)
jmp 0x3aa5f
shrq %rax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
leaq -0x1(%rax), %rcx
shrq $0x6, %rcx
cmpq $0x40, %rax
leaq 0x8(,%rcx,8), %rax
pushq $0x8
popq %rbp
cmovaeq %rax, %rbp
leaq 0x2b893b(%rip), %rdx    # 0x2f33bc
xorl %r12d, %r12d
xorl %edi, %edi
movq %rbp, %rsi
movl $0xc3, %ecx
callq 0x93472
movq %rax, %r15
movq %rax, 0x40(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x17380
cmpb $0x0, 0x14(%r14)
movl $0x0, %r8d
jne 0x3aad6
movq 0x38(%r13), %rdi
callq 0x81d17
cmpl $0x2, %eax
jne 0x3aad3
movq 0x38(%r13), %rdi
xorl %esi, %esi
callq 0x75173
movq %rax, %r8
jmp 0x3aad6
xorl %r8d, %r8d
cmpb $0x0, 0x14(%r14)
movq 0x50(%rsp), %rcx
cmovneq %r12, %rcx
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x172b95
movq 0x58(%rsp), %r15
leaq 0x60(%rsp), %rdi
callq 0x1517e5
movq %r15, %rdi
callq 0x92fd0
testl %r12d, %r12d
jne 0x3ab26
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x1720f8
movl %eax, %r12d
movq 0x40(%rsp), %rdi
leaq 0x2b888a(%rip), %rsi    # 0x2f33bc
movl $0xd4, %edx
callq 0x936f9
movl %r12d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3fd413(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2aa4b4(%rip), %rsi    # 0x2e5013
leaq 0x30daed(%rip), %rdx    # 0x348653
leaq 0x2b8a62(%rip), %rcx    # 0x2f35cf
leaq 0x2b8848(%rip), %r8     # 0x2f33bc
movl $0x92, %r9d
jmp 0x3abd6
movq 0x3fd3e5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2aa486(%rip), %rsi    # 0x2e5013
leaq 0x2aa62b(%rip), %rdx    # 0x2e51bf
leaq 0x2b8a34(%rip), %rcx    # 0x2f35cf
leaq 0x2b881a(%rip), %r8     # 0x2f33bc
movl $0x91, %r9d
jmp 0x3abd6
movq 0x3fd3b7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2aa458(%rip), %rsi    # 0x2e5013
leaq 0x2ebe2a(%rip), %rdx    # 0x3269ec
leaq 0x2b8a06(%rip), %rcx    # 0x2f35cf
leaq 0x2b87ec(%rip), %r8     # 0x2f33bc
movl $0xd0, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nop