// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_readjoiner_overlap.c
// Function: gt_readjoiner_overlap_runner
static int gt_readjoiner_overlap_runner(GT_UNUSED int argc,
                                GT_UNUSED const char **argv,
                                GT_UNUSED int parsed_args,
                                void *tool_arguments,
                                GtError *err)
{
  GtReadjoinerOverlapArguments *arguments = tool_arguments;
  GtEncseqLoader *el = NULL;
  GtEncseq *encseq = NULL;
  GtLogger *default_logger, *verbose_logger;
  unsigned int kmersize;
  bool haserr = false;
  bool eqlen;
  GtUword total_nof_irr_spm = 0, total_nof_trans_spm = 0;

  gt_error_check(err);
  gt_assert(arguments);

  default_logger = gt_logger_new(!arguments->quiet, GT_LOGGER_DEFLT_PREFIX,
      stdout);
  gt_logger_log(default_logger,
      "gt readjoiner overlap (version "GT_READJOINER_VERSION")");
  verbose_logger = gt_logger_new(arguments->verbose, GT_LOGGER_DEFLT_PREFIX,
      stdout);
  gt_logger_log(verbose_logger, "verbose output activated");
  kmersize = GT_MIN((unsigned int) GT_UNITSIN2BITENC,arguments->minmatchlength);

  el = gt_encseq_loader_new();
  gt_encseq_loader_drop_description_support(el);
  gt_encseq_loader_disable_autosupport(el);
  encseq = gt_encseq_loader_load(el, gt_str_get(arguments->encseqinput),
                                 err);
  if (encseq == NULL)
    haserr = true;

  if (!haserr)
    eqlen = gt_encseq_accesstype_get(encseq) == GT_ACCESS_TYPE_EQUALLENGTH;

  if (!haserr && !arguments->singlestrand)
  {
    if (gt_encseq_mirror(encseq, err) != 0)
      haserr = true;
  }
  if (!haserr)
  {
    unsigned int threadcount;
#ifdef GT_THREADS_ENABLED
    const unsigned int threads = gt_jobs;
#else
    const unsigned int threads = 1U;
#endif
    if (eqlen)
    {
      GtBUstate_spmeq **state_table
        = gt_malloc(sizeof (*state_table) * threads);

      for (threadcount = 0; threadcount < threads; threadcount++)
      {
        state_table[threadcount]
          = gt_spmfind_eqlen_state_new(encseq,
                (GtUword)arguments->minmatchlength,
                (GtUword)arguments->w_maxsize, arguments->elimtrans,
                arguments->showspm, gt_str_get(arguments->encseqinput),
                threadcount, default_logger, verbose_logger, err);
      }
      if (storefirstcodes_getencseqkmers_twobitencoding(encseq, kmersize,
            arguments->numofparts, arguments->maximumspace,
            arguments->minmatchlength, false, false,
            arguments->onlyallfirstcodes, 5U, arguments->phase2extra,
            arguments->radixsmall, arguments->radixparts,
            gt_spmfind_eqlen_process, gt_spmfind_eqlen_process_end,
            state_table, verbose_logger, err)
            != 0)
      {
        haserr = true;
      }
      for (threadcount = 0; threadcount < threads; threadcount++)
      {
        total_nof_irr_spm +=
          gt_spmfind_eqlen_nof_irr_spm(state_table[threadcount]);
        total_nof_trans_spm +=
          gt_spmfind_eqlen_nof_trans_spm(state_table[threadcount]);
        gt_spmfind_eqlen_state_delete(state_table[threadcount]);
      }
      gt_free(state_table);
    }
    else
    {
      GtBUstate_spmvar **state_table
        = gt_malloc(sizeof (*state_table) * threads);

      for (threadcount = 0; threadcount < threads; threadcount++)
      {
        state_table[threadcount]
           = gt_spmfind_varlen_state_new(encseq,
                  (GtUword)arguments->minmatchlength,
                  (GtUword)arguments->w_maxsize, arguments->elimtrans,
                  arguments->showspm, gt_str_get(arguments->encseqinput),
                  threadcount, default_logger, verbose_logger, err);
      }
      if (storefirstcodes_getencseqkmers_twobitencoding(encseq, kmersize,
            arguments->numofparts, arguments->maximumspace,
            arguments->minmatchlength, false, false,
            arguments->onlyallfirstcodes, 5U, arguments->phase2extra,
            arguments->radixsmall, arguments->radixparts,
            gt_spmfind_varlen_process, gt_spmfind_varlen_process_end,
            state_table, verbose_logger, err)
          != 0)
      {
        haserr = true;
      }
      for (threadcount = 0; threadcount < threads; threadcount++)
      {
        gt_spmfind_varlen_state_delete(state_table[threadcount]);
        total_nof_irr_spm +=
          gt_spmfind_varlen_nof_irr_spm(state_table[threadcount]);
        total_nof_trans_spm +=
          gt_spmfind_varlen_nof_trans_spm(state_table[threadcount]);
      }
      gt_free(state_table);
    }
  }
  if (!haserr)
  {
    gt_logger_log(default_logger, "number of %ssuffix-prefix matches = "GT_WU"",
        arguments->elimtrans ? "irreducible " : "", total_nof_irr_spm);
    gt_logger_log(default_logger, "average %sSPM/read = %.2f",
        arguments->elimtrans ? "irreducible " : "", (float)total_nof_irr_spm /
        (arguments->singlestrand ? gt_encseq_num_of_sequences(encseq)
        : GT_DIV2(gt_encseq_num_of_sequences(encseq))));
    if (arguments->elimtrans)
      gt_logger_log(default_logger, "number of transitive suffix-prefix "
          "matches = "GT_WU"", total_nof_trans_spm);
  }
  gt_logger_delete(default_logger);
  gt_logger_delete(verbose_logger);
  gt_encseq_delete(encseq);
  gt_encseq_loader_delete(el);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r12
movq %rcx, %rbx
testq %r8, %r8
je 0x3d1a3
movq %r12, %rdi
callq 0x89eb7
testb %al, %al
jne 0x3d709
testq %rbx, %rbx
je 0x3d6db
movzbl 0x3(%rbx), %edi
movq %rbx, 0x10(%rsp)
movq 0x3facf4(%rip), %rbx    # 0x437eb0
movq (%rbx), %rdx
xorl $0x1, %edi
leaq 0x2a970b(%rip), %r14    # 0x2e68d4
movq %r14, %rsi
callq 0x92b50
leaq 0x2b704a(%rip), %rsi    # 0x2f4222
movq %rax, 0x20(%rsp)
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
movq 0x10(%rsp), %rax
movzbl 0x2(%rax), %edi
movq (%rbx), %rdx
movq 0x10(%rsp), %rbx
movq %r14, %rsi
callq 0x92b50
leaq 0x2b558c(%rip), %rsi    # 0x2f2793
movq %rax, 0x30(%rsp)
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
movl 0x8(%rbx), %eax
cmpl $0x20, %eax
pushq $0x20
popq %rcx
cmovbl %eax, %ecx
movl %ecx, 0x3c(%rsp)
callq 0x791cd
movq %rax, %r13
movq %rax, %rdi
callq 0x7cece
movq %r13, %rdi
callq 0x7d046
movq 0x28(%rbx), %rdi
callq 0xad1fa
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x7921d
movq %rax, %r15
pushq $-0x1
popq %r14
testq %rax, %rax
je 0x3d6a5
movq %r15, %rdi
callq 0x81d17
movl %eax, %r14d
cmpb $0x1, (%rbx)
movq %r15, 0x8(%rsp)
jne 0x3d289
movq %r13, 0x40(%rsp)
movl $0x0, 0x1c(%rsp)
jmp 0x3d2b6
testq %r15, %r15
sete %bl
movq %r15, %rdi
movq %r12, %rsi
callq 0x7d4ca
testl %eax, %eax
setne %al
orb %bl, %al
je 0x3d2ad
xorl %ebp, %ebp
xorl %r12d, %r12d
jmp 0x3d5ae
movl %eax, 0x1c(%rsp)
movq %r13, 0x40(%rsp)
leaq 0x3fbb0b(%rip), %rax    # 0x438dc8
movl (%rax), %eax
cmpl $0x2, %r14d
jne 0x3d34e
movq %r12, (%rsp)
movl %eax, %eax
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rdi
leaq 0x2b6cec(%rip), %rsi    # 0x2f3fcf
movl $0x118, %edx            # imm = 0x118
callq 0x93160
movq %rax, %r14
xorl %ebx, %ebx
cmpq %rbx, 0x28(%rsp)
je 0x3d3d2
movq 0x10(%rsp), %rax
movl 0x8(%rax), %r12d
movl 0x10(%rax), %r15d
movzbl 0x1(%rax), %r13d
movzbl 0x4(%rax), %ebp
movq 0x28(%rax), %rdi
callq 0xad1fa
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %r13d, %ecx
movl %ebp, %r8d
movq %rax, %r9
pushq (%rsp)
pushq 0x38(%rsp)
pushq 0x30(%rsp)
pushq %rbx
callq 0x17bbf7
addq $0x20, %rsp
movq %rax, (%r14,%rbx,8)
incq %rbx
jmp 0x3d2f2
movq %r12, (%rsp)
movl %eax, %eax
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rdi
leaq 0x2b6c67(%rip), %rsi    # 0x2f3fcf
movl $0x13b, %edx            # imm = 0x13B
callq 0x93160
movq %rax, %r14
xorl %ebx, %ebx
cmpq %rbx, 0x28(%rsp)
je 0x3d4a3
movq 0x10(%rsp), %rax
movl 0x8(%rax), %r15d
movl 0x10(%rax), %r12d
movzbl 0x1(%rax), %ebp
movzbl 0x4(%rax), %r13d
movq 0x28(%rax), %rdi
callq 0xad1fa
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movl %r13d, %r8d
movq %rax, %r9
pushq (%rsp)
pushq 0x38(%rsp)
pushq 0x30(%rsp)
pushq %rbx
callq 0x17c05a
addq $0x20, %rsp
movq %rax, (%r14,%rbx,8)
incq %rbx
jmp 0x3d377
movq 0x10(%rsp), %r9
movl 0x8(%r9), %r8d
movl 0xc(%r9), %edx
movq 0x18(%r9), %rcx
movzbl 0x58(%r9), %eax
movq 0x20(%r9), %rsi
movzbl 0x50(%r9), %edi
movl 0x54(%r9), %r9d
subq $0x60, %rsp
movq 0x60(%rsp), %r10
movq %r10, 0x50(%rsp)
movq 0x90(%rsp), %r10
movq %r10, 0x48(%rsp)
movq %r14, 0x40(%rsp)
leaq 0x13f457(%rip), %r10    # 0x17c873
movq %r10, 0x38(%rsp)
leaq 0x13ee14(%rip), %r10    # 0x17c23c
movq %r10, 0x30(%rsp)
movl %r9d, 0x28(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %eax, 0x8(%rsp)
andl $0x0, (%rsp)
movl $0x5, 0x10(%rsp)
xorl %r15d, %r15d
movq 0x68(%rsp), %rdi
movl 0x9c(%rsp), %esi
xorl %r9d, %r9d
callq 0x157860
addq $0x60, %rsp
movl %eax, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x40(%rsp), %r13
cmpq %r15, 0x28(%rsp)
je 0x3d570
movq (%r14,%r15,8), %rdi
callq 0x17c0c8
addq %rax, %rbp
movq (%r14,%r15,8), %rdi
callq 0x17c0b6
addq %rax, %r12
movq (%r14,%r15,8), %rdi
callq 0x17c0d0
incq %r15
jmp 0x3d472
movq 0x10(%rsp), %r9
movl 0x8(%r9), %r8d
movl 0xc(%r9), %edx
movq 0x18(%r9), %rcx
movzbl 0x58(%r9), %eax
movq 0x20(%r9), %rsi
movzbl 0x50(%r9), %edi
movl 0x54(%r9), %r9d
subq $0x60, %rsp
movq 0x60(%rsp), %r10
movq %r10, 0x50(%rsp)
movq 0x90(%rsp), %r10
movq %r10, 0x48(%rsp)
movq %r14, 0x40(%rsp)
leaq 0x13f445(%rip), %r10    # 0x17c932
movq %r10, 0x38(%rsp)
leaq 0x13f43e(%rip), %r10    # 0x17c937
movq %r10, 0x30(%rsp)
movl %r9d, 0x28(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %eax, 0x8(%rsp)
andl $0x0, (%rsp)
movl $0x5, 0x10(%rsp)
xorl %r15d, %r15d
movq 0x68(%rsp), %rdi
movl 0x9c(%rsp), %esi
xorl %r9d, %r9d
callq 0x157860
addq $0x60, %rsp
movl %eax, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x40(%rsp), %r13
cmpq %r15, 0x28(%rsp)
je 0x3d58a
movq (%r14,%r15,8), %rdi
callq 0x17c232
movq (%r14,%r15,8), %rdi
callq 0x17c0ae
addq %rax, %rbp
movq (%r14,%r15,8), %rdi
callq 0x17c09c
addq %rax, %r12
incq %r15
jmp 0x3d543
testl %ebx, %ebx
setne %bl
orb 0x1c(%rsp), %bl
leaq 0x2b6a4f(%rip), %rsi    # 0x2f3fcf
movq %r14, %rdi
movl $0x136, %edx            # imm = 0x136
jmp 0x3d5a2
testl %ebx, %ebx
setne %bl
orb 0x1c(%rsp), %bl
leaq 0x2b6a35(%rip), %rsi    # 0x2f3fcf
movq %r14, %rdi
movl $0x159, %edx            # imm = 0x159
callq 0x936f9
movl %ebx, %eax
movq 0x8(%rsp), %r15
testb %al, %al
pushq $-0x1
popq %r14
jne 0x3d6a5
leaq 0x2b6cad(%rip), %rbx    # 0x2f426e
movq 0x10(%rsp), %r15
cmpb $0x0, 0x1(%r15)
leaq 0x32cf9e(%rip), %r14    # 0x36a570
movq %r14, %rdx
cmovneq %rbx, %rdx
leaq 0x2b6c66(%rip), %rsi    # 0x2f4246
movq 0x20(%rsp), %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x92e71
cmpb $0x0, 0x1(%r15)
cmovneq %rbx, %r14
testq %rbp, %rbp
js 0x3d604
cvtsi2ss %rbp, %xmm0
jmp 0x3d619
movq %rbp, %rax
shrq %rax
andl $0x1, %ebp
orq %rax, %rbp
cvtsi2ss %rbp, %xmm0
addss %xmm0, %xmm0
movss %xmm0, (%rsp)
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
movb (%rbx), %bpl
movq %r15, %rdi
callq 0x705a1
xorb $0x1, %bpl
movl %ebp, %ecx
shrq %cl, %rax
testq %rax, %rax
js 0x3d648
cvtsi2ss %rax, %xmm0
jmp 0x3d65d
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movss (%rsp), %xmm1
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
leaq 0x2b6c0a(%rip), %rsi    # 0x2f427b
movq 0x20(%rsp), %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0x92e71
cmpb $0x1, 0x1(%rbx)
movl $0x0, %r14d
jne 0x3d6a5
leaq 0x2b6c02(%rip), %rsi    # 0x2f4295
xorl %r14d, %r14d
movq 0x20(%rsp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x92e71
movq 0x20(%rsp), %rdi
callq 0x92fd0
movq 0x30(%rsp), %rdi
callq 0x92fd0
movq %r15, %rdi
callq 0x735fd
movq %r13, %rdi
callq 0x79f01
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3fa886(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2a7927(%rip), %rsi    # 0x2e5013
leaq 0x30af60(%rip), %rdx    # 0x348653
leaq 0x2b6b0b(%rip), %rcx    # 0x2f4205
leaq 0x2b68ce(%rip), %r8     # 0x2f3fcf
movl $0xf2, %r9d
jmp 0x3d735
movq 0x3fa858(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2a78f9(%rip), %rsi    # 0x2e5013
leaq 0x2a7a9e(%rip), %rdx    # 0x2e51bf
leaq 0x2b6add(%rip), %rcx    # 0x2f4205
leaq 0x2b68a0(%rip), %r8     # 0x2f3fcf
movl $0xf1, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nopl (%rax)