// File: /workspace/github_c_makefile_star2_O3/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, %rbx
testq %r8, %r8
je 0xb9c05
movq %r12, %rdi
callq 0xfcc32
testb %al, %al
jne 0xba10e
testq %rbx, %rbx
je 0xba109
movzbl 0x3(%rbx), %edi
movq %rbx, 0x18(%rsp)
movq 0x3ff2ba(%rip), %rbx    # 0x4b8ed8
movq (%rbx), %rdx
xorl $0x1, %edi
leaq 0x28cca9(%rip), %r14    # 0x3468d4
movq %r14, %rsi
callq 0x103e40
movq %rax, %r13
leaq 0x29a5d5(%rip), %rsi    # 0x354212
movq %rax, %rdi
xorl %eax, %eax
callq 0x103fe1
movq 0x18(%rsp), %rax
movzbl 0x2(%rax), %edi
movq (%rbx), %rdx
movq 0x18(%rsp), %rbx
movq %r14, %rsi
callq 0x103e40
movq %rax, %rbp
leaq 0x298b19(%rip), %rsi    # 0x352783
movq %rax, %rdi
xorl %eax, %eax
callq 0x103fe1
movl 0x8(%rbx), %eax
cmpl $0x20, %eax
movl $0x20, %ecx
cmovbl %eax, %ecx
movl %ecx, 0x34(%rsp)
callq 0xef0cd
movq %rax, %r15
movq %rax, %rdi
callq 0xf22df
movq %r15, %rdi
callq 0xf238b
movq 0x28(%rbx), %rdi
callq 0x11b0a1
movq %r15, %rdi
movq %rax, %rsi
movq %r12, 0x8(%rsp)
movq %r12, %rdx
callq 0xef129
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
movq %rbp, 0x48(%rsp)
movq %rax, 0x20(%rsp)
je 0xba0d3
movq %rax, %r12
movq %rax, %rdi
callq 0xf64f6
movl %eax, %r14d
cmpb $0x1, (%rbx)
movq %r13, 0x50(%rsp)
movq %r15, 0x38(%rsp)
jne 0xb9cfa
movl $0x0, 0x14(%rsp)
jmp 0xb9d24
testq %r12, %r12
sete %bl
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0xf24ac
testl %eax, %eax
setne %al
orb %bl, %al
je 0xb9d20
xorl %r12d, %r12d
xorl %ebp, %ebp
jmp 0xb9fd1
movl %eax, 0x14(%rsp)
leaq 0x4000ed(%rip), %rax    # 0x4b9e18
movl (%rax), %ebx
movl %ebx, %eax
cmpl $0x2, %r14d
jne 0xb9e69
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rdi
leaq 0x29a272(%rip), %rsi    # 0x353fbf
movl $0x118, %edx            # imm = 0x118
callq 0x104226
movq %rax, %r15
testl %ebx, %ebx
movq 0x18(%rsp), %r14
je 0xb9dc7
xorl %ebx, %ebx
movq %r15, 0x40(%rsp)
movl 0x8(%r14), %r12d
movl 0x10(%r14), %r15d
movzbl 0x1(%r14), %r13d
movzbl 0x4(%r14), %ebp
movq 0x28(%r14), %rdi
callq 0x11b0a1
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq 0x40(%rsp), %r15
movl %r13d, %ecx
movq 0x50(%rsp), %r13
movl %ebp, %r8d
movq 0x48(%rsp), %rbp
movq %rax, %r9
pushq 0x8(%rsp)
pushq %rbp
pushq %r13
pushq %rbx
callq 0x1caf0b
addq $0x20, %rsp
movq %rax, (%r15,%rbx,8)
incq %rbx
cmpq %rbx, 0x28(%rsp)
jne 0xb9d6a
movl 0x8(%r14), %r8d
movl 0xc(%r14), %edx
movq 0x18(%r14), %rcx
movzbl 0x58(%r14), %eax
movzbl 0x50(%r14), %r10d
movl 0x54(%r14), %r11d
subq $0x8, %rsp
leaq 0x111de2(%rip), %rbx    # 0x1cbbce
xorl %r12d, %r12d
movq 0x28(%rsp), %rdi
movl 0x3c(%rsp), %esi
xorl %r9d, %r9d
pushq 0x10(%rsp)
pushq %rbp
pushq %r15
pushq %rbx
pushq 0x3ff0e7(%rip)          # 0x4b8ef0
pushq %r11
pushq %r10
pushq 0x20(%r14)
pushq $0x5
pushq %rax
pushq $0x0
callq 0x1aaae5
addq $0x60, %rsp
testl %eax, %eax
setne 0x8(%rsp)
movq 0x28(%rsp), %r14
testq %r14, %r14
je 0xb9f91
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%r15,%rbx,8), %rdi
callq 0x1cb476
addq %rax, %r12
movq (%r15,%rbx,8), %rdi
callq 0x1cb464
addq %rax, %rbp
movq (%r15,%rbx,8), %rdi
callq 0x1cb47e
incq %rbx
cmpq %rbx, %r14
jne 0xb9e3b
jmp 0xb9f93
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rdi
leaq 0x29a142(%rip), %rsi    # 0x353fbf
movl $0x13b, %edx            # imm = 0x13B
callq 0x104226
movq %rax, %r15
testl %ebx, %ebx
movq 0x18(%rsp), %r14
je 0xb9ef6
xorl %ebx, %ebx
movq %r15, 0x40(%rsp)
movl 0x8(%r14), %r15d
movl 0x10(%r14), %r12d
movzbl 0x1(%r14), %ebp
movzbl 0x4(%r14), %r13d
movq 0x28(%r14), %rdi
callq 0x11b0a1
movq 0x20(%rsp), %rdi
movq %r15, %rsi
movq 0x40(%rsp), %r15
movq %r12, %rdx
movl %ebp, %ecx
movq 0x48(%rsp), %rbp
movl %r13d, %r8d
movq 0x50(%rsp), %r13
movq %rax, %r9
pushq 0x8(%rsp)
pushq %rbp
pushq %r13
pushq %rbx
callq 0x1cb408
addq $0x20, %rsp
movq %rax, (%r15,%rbx,8)
incq %rbx
cmpq %rbx, 0x28(%rsp)
jne 0xb9e9a
movl 0x8(%r14), %r8d
movl 0xc(%r14), %edx
movq 0x18(%r14), %rcx
movzbl 0x58(%r14), %eax
movzbl 0x50(%r14), %r10d
movl 0x54(%r14), %r11d
subq $0x8, %rsp
leaq 0x111ece(%rip), %rbx    # 0x1cbde9
xorl %r12d, %r12d
movq 0x28(%rsp), %rdi
movl 0x3c(%rsp), %esi
xorl %r9d, %r9d
pushq 0x10(%rsp)
pushq %rbp
pushq %r15
pushq %rbx
pushq 0x3ff028(%rip)          # 0x4b8f60
pushq %r11
pushq %r10
pushq 0x20(%r14)
pushq $0x5
pushq %rax
pushq $0x0
callq 0x1aaae5
addq $0x60, %rsp
testl %eax, %eax
setne 0x8(%rsp)
movq 0x28(%rsp), %r14
testq %r14, %r14
je 0xb9fac
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%r15,%rbx,8), %rdi
callq 0x1cb628
movq (%r15,%rbx,8), %rdi
callq 0x1cb45c
addq %rax, %r12
movq (%r15,%rbx,8), %rdi
callq 0x1cb44a
addq %rax, %rbp
incq %rbx
cmpq %rbx, %r14
jne 0xb9f66
jmp 0xb9fae
xorl %ebp, %ebp
movb 0x8(%rsp), %bl
orb 0x14(%rsp), %bl
leaq 0x29a01d(%rip), %rsi    # 0x353fbf
movq %r15, %rdi
movl $0x136, %edx            # imm = 0x136
jmp 0xb9fc5
xorl %ebp, %ebp
movb 0x8(%rsp), %bl
orb 0x14(%rsp), %bl
leaq 0x29a002(%rip), %rsi    # 0x353fbf
movq %r15, %rdi
movl $0x159, %edx            # imm = 0x159
callq 0x1045eb
movl %ebx, %eax
movq 0x38(%rsp), %r15
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %al, %al
jne 0xba0d3
leaq 0x29a278(%rip), %rbx    # 0x35425e
movq 0x18(%rsp), %r15
cmpb $0x0, 0x1(%r15)
leaq 0x310179(%rip), %r14    # 0x3ca170
movq %r14, %rdx
cmovneq %rbx, %rdx
leaq 0x29a231(%rip), %rsi    # 0x354236
movq %r13, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x103fe1
cmpb $0x0, 0x1(%r15)
cmovneq %rbx, %r14
testq %r12, %r12
js 0xba027
cvtsi2ss %r12, %xmm0
jmp 0xba03d
movq %r12, %rax
shrq %rax
andl $0x1, %r12d
orq %rax, %r12
cvtsi2ss %r12, %xmm0
addss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movq 0x18(%rsp), %rbx
movb (%rbx), %r15b
movq 0x20(%rsp), %rdi
callq 0xe7bac
xorb $0x1, %r15b
movl %r15d, %ecx
shrq %cl, %rax
testq %rax, %rax
js 0xba06e
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0xba086
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movq 0x38(%rsp), %r15
movss 0x8(%rsp), %xmm1
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x29a1c8(%rip), %rsi    # 0x35426b
movq %r13, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0x103fe1
cmpb $0x1, 0x1(%rbx)
movl $0x0, %r14d
jne 0xba0d3
leaq 0x29a1c2(%rip), %rsi    # 0x354285
xorl %r14d, %r14d
movq %r13, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x103fe1
movq %r13, %rdi
callq 0x1040e0
movq 0x48(%rsp), %rdi
callq 0x1040e0
movq 0x20(%rsp), %rdi
callq 0xea375
movq %r15, %rdi
callq 0xefbe3
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1dd1b
callq 0x1dce2
nop