// File: /workspace/github_c_makefile_star2_O0/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 $0x168, %rsp            # imm = 0x168
movl %edi, 0x164(%rsp)
movq %rsi, 0x158(%rsp)
movl %edx, 0x154(%rsp)
movq %rcx, 0x148(%rsp)
movq %r8, 0x140(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
movq $0x0, 0x130(%rsp)
movq $0x0, 0x128(%rsp)
movb $0x0, 0x113(%rsp)
movq $0x0, 0x108(%rsp)
movq $0x0, 0x100(%rsp)
cmpq $0x0, 0x140(%rsp)
je 0x542e5
movq 0x140(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x542ad
jmp 0x542e5
movq 0x5e7cec(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4c1d55(%rip), %rsi    # 0x516013
leaq 0x4c1efa(%rip), %rdx    # 0x5161bf
leaq 0x4d100a(%rip), %rcx    # 0x5252d6
leaq 0x4d0dcd(%rip), %r8     # 0x5250a0
movl $0xf1, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x542e7
jmp 0x542e9
cmpq $0x0, 0x138(%rsp)
jne 0x5432c
movq 0x5e7ca5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4c1d0e(%rip), %rsi    # 0x516013
leaq 0x526853(%rip), %rdx    # 0x57ab5f
leaq 0x4d0fc3(%rip), %rcx    # 0x5252d6
leaq 0x4d0d86(%rip), %r8     # 0x5250a0
movl $0xf2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x5432e
movq 0x138(%rsp), %rax
movb 0x3(%rax), %al
xorb $-0x1, %al
movq 0x5e7bf6(%rip), %rcx    # 0x63bf38
movq (%rcx), %rdx
movzbl %al, %edi
andl $0x1, %edi
leaq 0x4c359a(%rip), %rsi    # 0x5178ec
callq 0xe7870
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rdi
leaq 0x4d0f85(%rip), %rsi    # 0x5252f3
movb $0x0, %al
callq 0xe7cd0
movq 0x138(%rsp), %rax
movb 0x2(%rax), %al
movq 0x5e7bb1(%rip), %rcx    # 0x63bf38
movq (%rcx), %rdx
leaq 0x4c355b(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0x118(%rsp)
movq 0x118(%rsp), %rdi
leaq 0x4cf451(%rip), %rsi    # 0x523803
movb $0x0, %al
callq 0xe7cd0
movq 0x138(%rsp), %rcx
movl $0x20, %eax
cmpl 0x8(%rcx), %eax
jae 0x543d9
movl $0x20, %eax
movl %eax, 0xe4(%rsp)
jmp 0x543eb
movq 0x138(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
movl %eax, 0x114(%rsp)
callq 0xb7a40
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rdi
callq 0xba570
movq 0x130(%rsp), %rdi
callq 0xba760
movq 0x130(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x138(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq 0xd8(%rsp), %rdi
movq %rax, %rsi
movq 0x140(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0x128(%rsp)
cmpq $0x0, 0x128(%rsp)
jne 0x54474
movb $0x1, 0x113(%rsp)
testb $0x1, 0x113(%rsp)
jne 0x5449a
movq 0x128(%rsp), %rdi
callq 0xc2d90
cmpl $0x2, %eax
sete %al
andb $0x1, %al
movb %al, 0x112(%rsp)
testb $0x1, 0x113(%rsp)
jne 0x544d5
movq 0x138(%rsp), %rax
testb $0x1, (%rax)
jne 0x544d5
movq 0x128(%rsp), %rdi
movq 0x140(%rsp), %rsi
callq 0xbbd00
cmpl $0x0, %eax
je 0x544d3
movb $0x1, 0x113(%rsp)
jmp 0x544d5
testb $0x1, 0x113(%rsp)
jne 0x54ace
leaq 0x5e8e8e(%rip), %rax    # 0x63d378
movl (%rax), %eax
movl %eax, 0xf8(%rsp)
testb $0x1, 0x112(%rsp)
je 0x547e9
movl 0xf8(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x4d0b8b(%rip), %rsi    # 0x5250a0
movl $0x118, %edx            # imm = 0x118
callq 0xe80f0
movq %rax, 0xf0(%rsp)
movl $0x0, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jae 0x5464b
movq 0x128(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x138(%rsp), %rax
movl 0x8(%rax), %eax
movq %rax, 0xc8(%rsp)
movq 0x138(%rsp), %rax
movl 0x10(%rax), %eax
movq %rax, 0xd0(%rsp)
movq 0x138(%rsp), %rax
movb 0x1(%rax), %al
movb %al, 0xbe(%rsp)
movq 0x138(%rsp), %rax
movb 0x4(%rax), %al
movb %al, 0xbf(%rsp)
movq 0x138(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movb 0xbe(%rsp), %cl
movb 0xbf(%rsp), %r8b
movq 0xc0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq %rax, %r9
movl 0xfc(%rsp), %ebx
movq 0x120(%rsp), %r11
movq 0x118(%rsp), %r10
movq 0x140(%rsp), %rax
andb $0x1, %cl
andb $0x1, %r8b
movzbl %cl, %ecx
movzbl %r8b, %r8d
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x288130
movq %rax, %rdx
movq 0xf0(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl 0xfc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xfc(%rsp)
jmp 0x54532
movq 0x128(%rsp), %rdi
movl 0x114(%rsp), %esi
movq 0x138(%rsp), %rax
movl 0xc(%rax), %edx
movq 0x138(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x138(%rsp), %rax
movl 0x8(%rax), %r8d
movq 0x138(%rsp), %rax
movb 0x58(%rax), %r13b
movq 0x138(%rsp), %rax
movq 0x20(%rax), %r12
movq 0x138(%rsp), %rax
movb 0x50(%rax), %r15b
movq 0x138(%rsp), %rax
movl 0x54(%rax), %ebp
movq 0xf0(%rsp), %r11
movq 0x118(%rsp), %r10
movq 0x140(%rsp), %rax
xorl %r9d, %r9d
leaq 0x234512(%rip), %r14    # 0x288be0
leaq 0x23545b(%rip), %rbx    # 0x289b30
andb $0x1, %r13b
andb $0x1, %r15b
movl $0x0, (%rsp)
movzbl %r13b, %r13d
movl %r13d, 0x8(%rsp)
movl $0x5, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movzbl %r15b, %r15d
movl %r15d, 0x20(%rsp)
movl %ebp, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
movq %r11, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movq %rax, 0x50(%rsp)
callq 0x245fc0
cmpl $0x0, %eax
je 0x54732
movb $0x1, 0x113(%rsp)
movl $0x0, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jae 0x547cb
movq 0xf0(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2889d0
addq 0x108(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0xf0(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2889c0
addq 0x100(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0xf0(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2889e0
movl 0xfc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xfc(%rsp)
jmp 0x5473d
movq 0xf0(%rsp), %rdi
leaq 0x4d08c6(%rip), %rsi    # 0x5250a0
movl $0x136, %edx            # imm = 0x136
callq 0xe88c0
jmp 0x54acc
movl 0xf8(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x4d08a3(%rip), %rsi    # 0x5250a0
movl $0x13b, %edx            # imm = 0x13B
callq 0xe80f0
movq %rax, 0xe8(%rsp)
movl $0x0, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jae 0x54933
movq 0x128(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0x138(%rsp), %rax
movl 0x8(%rax), %eax
movq %rax, 0xa8(%rsp)
movq 0x138(%rsp), %rax
movl 0x10(%rax), %eax
movq %rax, 0xb0(%rsp)
movq 0x138(%rsp), %rax
movb 0x1(%rax), %al
movb %al, 0x9e(%rsp)
movq 0x138(%rsp), %rax
movb 0x4(%rax), %al
movb %al, 0x9f(%rsp)
movq 0x138(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movb 0x9e(%rsp), %cl
movb 0x9f(%rsp), %r8b
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq %rax, %r9
movl 0xfc(%rsp), %ebx
movq 0x120(%rsp), %r11
movq 0x118(%rsp), %r10
movq 0x140(%rsp), %rax
andb $0x1, %cl
andb $0x1, %r8b
movzbl %cl, %ecx
movzbl %r8b, %r8d
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x288890
movq %rax, %rdx
movq 0xe8(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl 0xfc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xfc(%rsp)
jmp 0x5481a
movq 0x128(%rsp), %rdi
movl 0x114(%rsp), %esi
movq 0x138(%rsp), %rax
movl 0xc(%rax), %edx
movq 0x138(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x138(%rsp), %rax
movl 0x8(%rax), %r8d
movq 0x138(%rsp), %rax
movb 0x58(%rax), %r13b
movq 0x138(%rsp), %rax
movq 0x20(%rax), %r12
movq 0x138(%rsp), %rax
movb 0x50(%rax), %r15b
movq 0x138(%rsp), %rax
movl 0x54(%rax), %ebp
movq 0xe8(%rsp), %r11
movq 0x118(%rsp), %r10
movq 0x140(%rsp), %rax
xorl %r9d, %r9d
leaq 0x2352fa(%rip), %r14    # 0x289cb0
leaq 0x2352c3(%rip), %rbx    # 0x289c80
andb $0x1, %r13b
andb $0x1, %r15b
movl $0x0, (%rsp)
movzbl %r13b, %r13d
movl %r13d, 0x8(%rsp)
movl $0x5, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movzbl %r15b, %r15d
movl %r15d, 0x20(%rsp)
movl %ebp, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
movq %r11, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movq %rax, 0x50(%rsp)
callq 0x245fc0
cmpl $0x0, %eax
je 0x54a1a
movb $0x1, 0x113(%rsp)
movl $0x0, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jae 0x54ab3
movq 0xe8(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x288bc0
movq 0xe8(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x288990
addq 0x108(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0xe8(%rsp), %rax
movl 0xfc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x288950
addq 0x100(%rsp), %rax
movq %rax, 0x100(%rsp)
movl 0xfc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xfc(%rsp)
jmp 0x54a25
movq 0xe8(%rsp), %rdi
leaq 0x4d05de(%rip), %rsi    # 0x5250a0
movl $0x159, %edx            # imm = 0x159
callq 0xe88c0
jmp 0x54ace
testb $0x1, 0x113(%rsp)
jne 0x54c88
movq 0x120(%rsp), %rdi
movq 0x138(%rsp), %rax
movb 0x1(%rax), %cl
leaq 0x4d0849(%rip), %rax    # 0x52533f
movq %rax, 0x78(%rsp)
leaq 0x548b26(%rip), %rdx    # 0x59d628
movq %rdx, 0x70(%rsp)
testb $0x1, %cl
cmovneq %rax, %rdx
movq 0x108(%rsp), %rcx
leaq 0x4d07fa(%rip), %rsi    # 0x525317
xorl %eax, %eax
callq 0xe7cd0
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x120(%rsp), %rdx
movq %rdx, 0x80(%rsp)
movq 0x138(%rsp), %rdx
movb 0x1(%rdx), %dl
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x88(%rsp)
movq 0x108(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x94(%rsp)
testq %rax, %rax
movss %xmm0, 0x98(%rsp)
js 0x54ba5
movss 0x94(%rsp), %xmm0
movss %xmm0, 0x98(%rsp)
movss 0x98(%rsp), %xmm0
movss %xmm0, 0x6c(%rsp)
movq 0x138(%rsp), %rax
testb $0x1, (%rax)
je 0x54bd5
movq 0x128(%rsp), %rdi
callq 0xa9d50
movq %rax, 0x60(%rsp)
jmp 0x54bea
movq 0x128(%rsp), %rdi
callq 0xa9d50
shrq %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x58(%rsp)
testq %rax, %rax
movss %xmm0, 0x5c(%rsp)
js 0x54c28
movss 0x58(%rsp), %xmm0
movss %xmm0, 0x5c(%rsp)
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rdi
movss 0x6c(%rsp), %xmm0
movss 0x5c(%rsp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x4d06f9(%rip), %rsi    # 0x52534c
movb $0x1, %al
callq 0xe7cd0
movq 0x138(%rsp), %rax
testb $0x1, 0x1(%rax)
je 0x54c86
movq 0x120(%rsp), %rdi
movq 0x100(%rsp), %rdx
leaq 0x4d06e7(%rip), %rsi    # 0x525366
movb $0x0, %al
callq 0xe7cd0
jmp 0x54c88
movq 0x120(%rsp), %rdi
callq 0xe7ed0
movq 0x118(%rsp), %rdi
callq 0xe7ed0
movq 0x128(%rsp), %rdi
callq 0xae070
movq 0x130(%rsp), %rdi
callq 0xb7e50
movb 0x113(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)