// File: /workspace/github_c_makefile_star2_O3/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
movq $0x0, 0x40(%rsp)
testq %r8, %r8
je 0xb70ab
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0xb7371
testq %r14, %r14
je 0xb736c
movl 0x10(%r14), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0xb711d
cmpl $0x3, %eax
je 0xb71c8
testl %eax, %eax
jne 0xb7376
movq (%r14), %rdi
callq 0x11b191
movq %rax, %r14
leaq 0x29b703(%rip), %rsi    # 0x3527e6
movq %rax, %rdi
callq 0x11acf3
movq %r14, %rdi
callq 0x11b0a1
leaq 0x40(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %r8
callq 0x1c2117
movl %eax, %r12d
movq %r14, %rdi
callq 0x11bdbf
jmp 0xb7326
callq 0xef0cd
movq %rax, %r15
movq %rax, %rdi
callq 0xf22df
movq %r15, %rdi
callq 0xf238b
cmpb $0x0, 0x14(%r14)
jne 0xb7144
movq %r15, %rdi
callq 0xf237b
movq (%r14), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xef129
movq %rax, %r13
testq %rax, %rax
je 0xb722e
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)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x18(%rsp)
movl $0x1, (%rsp)
xorl $0x1, %edx
xorl %r12d, %r12d
movl $0x1, %r9d
movl $0x1, %edi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x1ca224
jmp 0xb7234
movzbl 0x15(%r14), %edi
movq 0x401dac(%rip), %rax    # 0x4b8f80
movq (%rax), %rdx
leaq 0x28f6f6(%rip), %rsi    # 0x3468d4
callq 0x103e40
movq %rax, %r15
movq (%r14), %rdi
callq 0x11b0a1
movq %rax, %rdi
movl $0x86, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x1a5580
movq %rax, %r13
movq %rax, 0x60(%rsp)
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
je 0xb7249
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %r13, %r13
jne 0xb7314
jmp 0xb731e
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r13, %rdi
callq 0xea375
movq %r15, %rdi
callq 0xefbe3
jmp 0xb7326
movq 0x38(%r13), %rdi
callq 0xe7bac
movq %rax, 0x48(%rsp)
cmpb $0x0, 0x14(%r14)
movq %r15, 0x58(%rsp)
je 0xb726e
movq $0x0, 0x50(%rsp)
jmp 0xb727b
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
movl $0x8, %ebp
cmovaeq %rax, %rbp
leaq 0x29c10d(%rip), %rdx    # 0x3533ac
xorl %r12d, %r12d
xorl %edi, %edi
movq %rbp, %rsi
movl $0xc3, %ecx
callq 0x104461
movq %rax, %r15
movq %rax, 0x40(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x173a0
cmpb $0x0, 0x14(%r14)
movl $0x0, %r8d
jne 0xb72f4
movq 0x38(%r13), %rdi
callq 0xf64f6
cmpl $0x2, %eax
jne 0xb72f1
movq 0x38(%r13), %rdi
xorl %esi, %esi
callq 0xeb9d2
movq %rax, %r8
jmp 0xb72f4
xorl %r8d, %r8d
cmpb $0x0, 0x14(%r14)
movq 0x50(%rsp), %rcx
cmovneq %r12, %rcx
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1c2744
movq 0x58(%rsp), %r15
leaq 0x60(%rsp), %rdi
callq 0x1a5698
movq %r15, %rdi
callq 0x1040e0
testl %r12d, %r12d
jne 0xb7344
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x1c1f57
movl %eax, %r12d
movq 0x40(%rsp), %rdi
leaq 0x29c05c(%rip), %rsi    # 0x3533ac
movl $0xd4, %edx
callq 0x1045eb
movl %r12d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1d968
callq 0x1d8f6
callq 0x1d92f
nop