// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq $0x0, 0x48(%rsp)
testq %r8, %r8
je 0xb91cd
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0xb949b
testq %r14, %r14
je 0xb9496
movl 0x10(%r14), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0xb923f
cmpl $0x3, %eax
je 0xb92ed
testl %eax, %eax
jne 0xb94a0
movq (%r14), %rdi
callq 0x120e13
movq %rax, %r14
leaq 0x2a2619(%rip), %rsi    # 0x35b81e
movq %rax, %rdi
callq 0x12097f
movq %r14, %rdi
callq 0x120d23
leaq 0x48(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %r8
callq 0x1caf4e
movl %eax, %r15d
movq %r14, %rdi
callq 0x121b03
jmp 0xb9450
callq 0xf36ef
movq %rax, %r12
movq %rax, %rdi
callq 0xf6920
movq %r12, %rdi
callq 0xf69cc
cmpb $0x0, 0x14(%r14)
jne 0xb9266
movq %r12, %rdi
callq 0xf69bc
movq (%r14), %rdi
callq 0x120d23
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xf374b
movq %rax, %r13
testq %rax, %rax
je 0xb936e
movzbl 0x14(%r14), %edx
xorl %r8d, %r8d
cmpl $0x2, 0x10(%r14)
sete %r8b
leaq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x18(%rsp)
movl $0x1, (%rsp)
xorl $0x1, %edx
xorl %r15d, %r15d
movl $0x1, %r9d
movl $0x1, %edi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x1d3480
jmp 0xb9374
movq $0x0, 0x40(%rsp)
movzbl 0x15(%r14), %edi
movq 0x40ac7e(%rip), %rax    # 0x4c3f80
movq (%rax), %rdx
leaq 0x2965c8(%rip), %rsi    # 0x34f8d4
callq 0x108ed0
movq %rax, %r12
movq (%r14), %rdi
callq 0x120d23
movq %rax, %rdi
movl $0x86, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %rbx, %r8
callq 0x1ae094
movq %rax, 0x40(%rsp)
movq %rbx, %rdi
callq 0x101a9a
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb %al, %al
jne 0xb9436
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0xec1e8
movq %rax, 0x50(%rsp)
cmpb $0x0, 0x14(%r14)
je 0xb9389
xorl %r13d, %r13d
jmp 0xb9394
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %r13, %rdi
callq 0xee90c
movq %r12, %rdi
callq 0xf424d
jmp 0xb9450
movq %rax, %r13
shrq %r13
movq %r13, 0x50(%rsp)
movq 0x50(%rsp), %rax
leaq -0x1(%rax), %rcx
shrq $0x6, %rcx
cmpq $0x40, %rax
leaq 0x8(,%rcx,8), %rax
movl $0x8, %ebp
cmovaeq %rax, %rbp
leaq 0x2a3027(%rip), %rdx    # 0x35c3e4
xorl %r15d, %r15d
xorl %edi, %edi
movq %rbp, %rsi
movl $0xc3, %ecx
callq 0x1094e6
movq %rax, 0x48(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x173a0
cmpb $0x0, 0x14(%r14)
movl $0x0, %r8d
jne 0xb9419
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0xfac0f
cmpl $0x2, %eax
jne 0xb9416
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rdi
xorl %esi, %esi
callq 0xeffd3
movq %rax, %r8
jmp 0xb9419
xorl %r8d, %r8d
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
cmpb $0x0, 0x14(%r14)
cmovneq %r15, %r13
xorl %esi, %esi
movq %r13, %rcx
callq 0x1cb5cc
cmpq $0x0, 0x40(%rsp)
je 0xb9448
leaq 0x40(%rsp), %rdi
callq 0x1ae1ac
movq %r12, %rdi
callq 0x10916a
testl %r15d, %r15d
jne 0xb946e
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x1cada7
movl %eax, %r15d
movq 0x48(%rsp), %rdi
leaq 0x2a2f6a(%rip), %rsi    # 0x35c3e4
movl $0xd4, %edx
callq 0x109670
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1dc49
callq 0x1dbd7
callq 0x1dc10
nopl (%rax)