// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movq %r8, %r12
movq %rcx, %r14
testq %r8, %r8
je 0xbbc5a
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0xbc187
testq %r14, %r14
je 0xbc182
movzbl 0x3(%r14), %edi
movq 0x408279(%rip), %rbx    # 0x4c3ee8
movq (%rbx), %rdx
xorl $0x1, %edi
movq %r14, 0x8(%rsp)
leaq 0x293c53(%rip), %r15    # 0x34f8d4
movq %r15, %rsi
callq 0x108ed0
movq %rax, %r13
leaq 0x2a15b7(%rip), %rsi    # 0x35d24a
movq %rax, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x8(%rsp), %rax
movzbl 0x2(%rax), %edi
movq (%rbx), %rdx
movq %r15, %rsi
movq 0x8(%rsp), %r14
callq 0x108ed0
movq %rax, %r15
leaq 0x29fafb(%rip), %rsi    # 0x35b7bb
movq %rax, %rdi
xorl %eax, %eax
callq 0x10906e
movl 0x8(%r14), %eax
cmpl $0x20, %eax
movl $0x20, %ecx
cmovbl %eax, %ecx
movl %ecx, 0x34(%rsp)
callq 0xf36ef
movq %rax, %rbx
movq %rax, %rdi
callq 0xf6920
movq %rbx, %rdi
callq 0xf69cc
movq 0x28(%r14), %rdi
callq 0x120d23
movq %rbx, 0x48(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, 0x10(%rsp)
movq %r12, %rdx
callq 0xf374b
movq %rax, %r12
xorl %ebp, %ebp
testq %rax, %rax
sete %al
movl %eax, 0x4(%rsp)
je 0xbbd37
movq %r12, %rdi
callq 0xfac0f
cmpl $0x2, %eax
sete %bl
jmp 0xbbd37
testq %r12, %r12
je 0xbbd64
cmpb $0x0, (%r14)
jne 0xbbd64
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0xf6aed
testl %eax, %eax
movl 0x4(%rsp), %eax
movb %al, %bpl
movl $0x1, %eax
cmovel %ebp, %eax
movl %eax, 0x4(%rsp)
cmpb $0x0, 0x4(%rsp)
movq %r15, 0x18(%rsp)
movq %r12, 0x28(%rsp)
je 0xbbd7f
xorl %r12d, %r12d
xorl %ebp, %ebp
jmp 0xbc052
leaq 0x409092(%rip), %rax    # 0x4c4e18
movl (%rax), %r14d
leaq (,%r14,8), %rdi
testb $0x1, %bl
movq %r13, 0x40(%rsp)
leaq 0x2a1257(%rip), %rsi    # 0x35cff7
je 0xbbee3
movl $0x118, %edx            # imm = 0x118
callq 0x1092b2
movq %rax, 0x38(%rsp)
testq %r14, %r14
movq 0x8(%rsp), %r15
movq %r14, %rbp
je 0xbbe2a
xorl %ebx, %ebx
movl 0x8(%r15), %r12d
movl 0x10(%r15), %eax
movq %rax, 0x20(%rsp)
movzbl 0x1(%r15), %r13d
movq %rbp, %r14
movzbl 0x4(%r15), %ebp
movq 0x28(%r15), %rdi
callq 0x120d23
movq 0x28(%rsp), %rdi
movq %r12, %rsi
movq 0x20(%rsp), %rdx
movl %r13d, %ecx
movq 0x40(%rsp), %r13
movl %ebp, %r8d
movq %r14, %rbp
movq %rax, %r9
pushq 0x10(%rsp)
pushq 0x20(%rsp)
pushq %r13
pushq %rbx
callq 0x1d4167
addq $0x20, %rsp
movq 0x38(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %r14
jne 0xbbdc4
movl 0x8(%r15), %r8d
movl 0xc(%r15), %edx
movq 0x18(%r15), %rcx
movzbl 0x58(%r15), %eax
movzbl 0x50(%r15), %r10d
movl 0x54(%r15), %r11d
subq $0x8, %rsp
leaq 0x118fdd(%rip), %rbx    # 0x1d4e2c
leaq 0x118a36(%rip), %r14    # 0x1d488c
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
movl 0x3c(%rsp), %esi
xorl %r9d, %r9d
pushq 0x18(%rsp)
pushq 0x28(%rsp)
pushq 0x50(%rsp)
pushq %rbx
pushq %r14
pushq %r11
pushq %r10
pushq 0x20(%r15)
pushq $0x5
pushq %rax
pushq $0x0
callq 0x1b3679
addq $0x60, %rsp
testl %eax, %eax
movzbl 0x4(%rsp), %eax
movl $0x1, %ecx
cmovel %eax, %ecx
movl %ecx, 0x4(%rsp)
testq %rbp, %rbp
je 0xbc015
movq %rbp, %r14
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x38(%rsp), %r15
movq (%r15,%rbx,8), %rdi
callq 0x1d46d0
addq %rax, %r12
movq (%r15,%rbx,8), %rdi
callq 0x1d46be
addq %rax, %rbp
movq (%r15,%rbx,8), %rdi
callq 0x1d46d8
incq %rbx
cmpq %rbx, %r14
jne 0xbbeb5
jmp 0xbc01c
movl $0x13b, %edx            # imm = 0x13B
callq 0x1092b2
movq %rax, 0x20(%rsp)
testq %r14, %r14
movq 0x8(%rsp), %r15
movq %r14, %rbp
je 0xbbf63
xorl %ebx, %ebx
movq %rbp, 0x50(%rsp)
movl 0x8(%r15), %r14d
movl 0x10(%r15), %r12d
movzbl 0x1(%r15), %ebp
movzbl 0x4(%r15), %r13d
movq 0x28(%r15), %rdi
callq 0x120d23
movq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq 0x50(%rsp), %rbp
movl %r13d, %r8d
movq 0x40(%rsp), %r13
movq %rax, %r9
pushq 0x10(%rsp)
pushq 0x20(%rsp)
pushq %r13
pushq %rbx
callq 0x1d4662
addq $0x20, %rsp
movq 0x20(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %rbp
jne 0xbbf06
movl 0x8(%r15), %r8d
movl 0xc(%r15), %edx
movq 0x18(%r15), %rcx
movzbl 0x58(%r15), %eax
movzbl 0x50(%r15), %r10d
movl 0x54(%r15), %r11d
subq $0x8, %rsp
leaq 0x1190bf(%rip), %rbx    # 0x1d5047
leaq 0x1190bd(%rip), %r14    # 0x1d504c
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
movl 0x3c(%rsp), %esi
xorl %r9d, %r9d
pushq 0x18(%rsp)
pushq 0x28(%rsp)
pushq 0x38(%rsp)
pushq %rbx
pushq %r14
pushq %r11
pushq %r10
pushq 0x20(%r15)
pushq $0x5
pushq %rax
pushq $0x0
callq 0x1b3679
addq $0x60, %rsp
testl %eax, %eax
movzbl 0x4(%rsp), %eax
movl $0x1, %ecx
cmovel %eax, %ecx
movl %ecx, 0x4(%rsp)
testq %rbp, %rbp
je 0xbc02d
movq %rbp, %r14
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x20(%rsp), %r15
movq (%r15,%rbx,8), %rdi
callq 0x1d4882
movq (%r15,%rbx,8), %rdi
callq 0x1d46b6
addq %rax, %r12
movq (%r15,%rbx,8), %rdi
callq 0x1d46a4
addq %rax, %rbp
incq %rbx
cmpq %rbx, %r14
jne 0xbbfea
jmp 0xbc034
xorl %ebp, %ebp
movq 0x38(%rsp), %r15
leaq 0x2a0fd4(%rip), %rsi    # 0x35cff7
movq %r15, %rdi
movl $0x136, %edx            # imm = 0x136
jmp 0xbc043
xorl %ebp, %ebp
movq 0x20(%rsp), %r15
leaq 0x2a0fbc(%rip), %rsi    # 0x35cff7
movq %r15, %rdi
movl $0x159, %edx            # imm = 0x159
callq 0x109670
movq 0x8(%rsp), %r14
movq 0x18(%rsp), %r15
cmpb $0x0, 0x4(%rsp)
jne 0xbc148
leaq 0x2a1232(%rip), %rbx    # 0x35d296
cmpb $0x0, 0x1(%r14)
leaq 0x317820(%rip), %r15    # 0x3d3890
movq %r15, %rdx
cmovneq %rbx, %rdx
leaq 0x2a11f0(%rip), %rsi    # 0x35d26e
movq %r13, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x10906e
cmpb $0x0, 0x1(%r14)
cmovneq %rbx, %r15
testq %r12, %r12
js 0xbc0a0
cvtsi2ss %r12, %xmm0
jmp 0xbc0b6
movq %r12, %rax
shrq %rax
andl $0x1, %r12d
orq %rax, %r12
cvtsi2ss %r12, %xmm0
addss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb (%rax), %r14b
movq 0x28(%rsp), %rdi
callq 0xec1e8
xorb $0x1, %r14b
movl %r14d, %ecx
shrq %cl, %rax
testq %rax, %rax
js 0xbc0e7
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0xbc0ff
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movss 0x10(%rsp), %xmm1
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x2a118c(%rip), %rsi    # 0x35d2a3
movq %r13, %rdi
movq %r15, %rdx
movb $0x1, %al
callq 0x10906e
movq 0x8(%rsp), %rax
cmpb $0x1, 0x1(%rax)
movq 0x18(%rsp), %r15
jne 0xbc148
leaq 0x2a1182(%rip), %rsi    # 0x35d2bd
movq %r13, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10906e
movq %r13, %rdi
callq 0x10916a
movq %r15, %rdi
callq 0x10916a
movq 0x28(%rsp), %rdi
callq 0xee90c
movq 0x48(%rsp), %rdi
callq 0xf424d
movzbl 0x4(%rsp), %eax
negl %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1e035
callq 0x1dffc