// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_encseq2spm.c
// Function: gt_encseq2spm_runner
static int gt_encseq2spm_runner(GT_UNUSED int argc,
                                GT_UNUSED const char **argv,
                                GT_UNUSED int parsed_args,
                                void *tool_arguments,
                                GtError *err)
{
  GtEncseq2spmArguments *arguments = tool_arguments;
  GtEncseqLoader *el = NULL;
  GtEncseq *encseq = NULL;
  bool haserr = false;

  gt_error_check(err);
  gt_assert(arguments);
  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)
  {
    if (arguments->singlestrand)
    {
      gt_error_set(err,"option -singlestand is not implemented");
      haserr = true;
    } else
    {
      if (gt_encseq_mirror(encseq, err) != 0)
      {
        haserr = true;
      }
    }
  }

  if (!haserr && arguments->singlescan > 0)
  {
    GtTimer *timer = NULL;

    if (gt_showtime_enabled())
    {
      char *outmsg;

      switch (arguments->singlescan)
      {
        case 1:
          outmsg = "to run fast scanning";
          break;
        case 2:
          outmsg = "to run fast scanning with check";
          break;
        case 3:
          outmsg = "to run fast scanning with output";
          break;
        case 4:
          outmsg = "to run old scanning code";
          break;
        default:
          gt_error_set(err,"argument %u to option -singlescan not allowed",
                       arguments->singlescan);
          haserr = true;
      }
      if (!haserr)
      {
        timer = gt_timer_new_with_progress_description(outmsg);
        gt_timer_start(timer);
      }
    }
    if (!haserr)
    {
      unsigned int kmersize = 0;
      haserr = gt_encseq2spm_kmersize(arguments, &kmersize, err);
      if (!haserr)
      {
        if (arguments->singlescan == 4U)
        {
          gt_rungetencseqkmers(encseq,kmersize);
        } else
        {
          if (arguments->singlescan > 0)
          {
            gt_firstcode_runkmerscan(encseq,arguments->singlescan - 1,kmersize,
                arguments->minmatchlength);
          }
        }
      }
    }
    if (timer != NULL)
    {
      gt_timer_show_progress_final(timer, stdout);
      gt_timer_delete(timer);
    }
  }
  if (!haserr && arguments->singlescan == 0)
  {
    GtLogger *logger;
    const GtReadmode readmode = GT_READMODE_FORWARD;
    GtBUstate_spmsk **spmsk_states = NULL;
    unsigned int kmersize, threadcount;

#ifdef GT_THREADS_ENABLED
    const unsigned int threads = gt_jobs;
#else
    const unsigned int threads = 1U;
#endif

    if (arguments->countspms || arguments->outputspms)
    {
      spmsk_states = gt_malloc(sizeof (*spmsk_states) * threads);
      for (threadcount = 0; threadcount < threads; threadcount++)
      {
        spmsk_states[threadcount]
          = gt_spmsk_inl_new(encseq,
                             readmode,
                             (GtUword) arguments->minmatchlength,
                             arguments->countspms,
                             arguments->outputspms,
                             gt_str_get(arguments->encseqinput));
      }
    }
    logger = gt_logger_new(arguments->verbose,GT_LOGGER_DEFLT_PREFIX, stdout);
    haserr = gt_encseq2spm_kmersize(arguments, &kmersize, err);
    if (!haserr)
    {
      if (storefirstcodes_getencseqkmers_twobitencoding(encseq,
                                                      kmersize,
                                                      arguments->numofparts,
                                                      arguments->maximumspace,
                                                      arguments->minmatchlength,
                                     /* use false */  arguments->checksuftab,
                                     /* use false */  arguments->onlyaccum,
                                     /* use false */  arguments->
                                                            onlyallfirstcodes,
                                     /* use 5U */     arguments->
                                                            addbscache_depth,
                                     /* specify the extra space needed for
                                        the function processing the interval */
                                                      arguments->phase2extra,
                                     /* use true */   arguments->radixlarge ?
                                                        false : true,
                                     /* use 2 without threads and
                                        use 1 with threads */
                                                      arguments->radixparts,
                                                      spmsk_states != NULL
                                                        ? gt_spmsk_inl_process
                                                        : NULL,
                                                      gt_spmsk_inl_process_end,
                                                      spmsk_states,
                                                      logger,
                                                      err) != 0)
      {
        haserr = true;
      }
    }
    if (spmsk_states != NULL)
    {
      GtUword countmatches = 0;

      for (threadcount = 0; threadcount < threads; threadcount++)
      {
        countmatches += gt_spmsk_inl_delete(spmsk_states[threadcount]);
      }
      if (arguments->countspms)
      {
        printf("number of suffix-prefix matches="GT_WU"\n",countmatches);
      }
      gt_free(spmsk_states);
    }
    gt_logger_delete(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 $0x128, %rsp            # imm = 0x128
movl %edi, 0x124(%rsp)
movq %rsi, 0x118(%rsp)
movl %edx, 0x114(%rsp)
movq %rcx, 0x108(%rsp)
movq %r8, 0x100(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq $0x0, 0xf0(%rsp)
movq $0x0, 0xe8(%rsp)
movb $0x0, 0xe7(%rsp)
cmpq $0x0, 0x100(%rsp)
je 0x2d4bd
movq 0x100(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2d485
jmp 0x2d4bd
movq 0x60eb14(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4e8b7d(%rip), %rsi    # 0x516013
leaq 0x4e8d22(%rip), %rdx    # 0x5161bf
leaq 0x4ee630(%rip), %rcx    # 0x51bad4
leaq 0x4ee215(%rip), %r8     # 0x51b6c0
movl $0x135, %r9d            # imm = 0x135
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d4bf
jmp 0x2d4c1
cmpq $0x0, 0xf8(%rsp)
jne 0x2d504
movq 0x60eacd(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4e8b36(%rip), %rsi    # 0x516013
leaq 0x54d67b(%rip), %rdx    # 0x57ab5f
leaq 0x4ee5e9(%rip), %rcx    # 0x51bad4
leaq 0x4ee1ce(%rip), %r8     # 0x51b6c0
movl $0x136, %r9d            # imm = 0x136
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d506
callq 0xb7a40
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xba570
movq 0xf0(%rsp), %rdi
callq 0xba760
movq 0xf0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0xf8(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movq 0x90(%rsp), %rdi
movq %rax, %rsi
movq 0x100(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
jne 0x2d581
movb $0x1, 0xe7(%rsp)
testb $0x1, 0xe7(%rsp)
jne 0x2d5df
movq 0xf8(%rsp), %rax
testb $0x1, 0x1(%rax)
je 0x2d5b9
movq 0x100(%rsp), %rdi
leaq 0x4ee541(%rip), %rsi    # 0x51bae9
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0xe7(%rsp)
jmp 0x2d5dd
movq 0xe8(%rsp), %rdi
movq 0x100(%rsp), %rsi
callq 0xbbd00
cmpl $0x0, %eax
je 0x2d5db
movb $0x1, 0xe7(%rsp)
jmp 0x2d5dd
jmp 0x2d5df
testb $0x1, 0xe7(%rsp)
jne 0x2d7c7
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x14(%rax)
jbe 0x2d7c7
movq $0x0, 0xd8(%rsp)
callq 0x11aa90
testb $0x1, %al
jne 0x2d619
jmp 0x2d6e8
movq 0xf8(%rsp), %rax
movl 0x14(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x88(%rsp)
subl $0x3, %eax
ja 0x2d691
movq 0x88(%rsp), %rax
leaq 0x4ee06c(%rip), %rcx    # 0x51b6b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4ee4bc(%rip), %rax    # 0x51bb10
movq %rax, 0xd0(%rsp)
jmp 0x2d6ba
leaq 0x4ee4c0(%rip), %rax    # 0x51bb25
movq %rax, 0xd0(%rsp)
jmp 0x2d6ba
leaq 0x4ee4cf(%rip), %rax    # 0x51bb45
movq %rax, 0xd0(%rsp)
jmp 0x2d6ba
leaq 0x4ee4df(%rip), %rax    # 0x51bb66
movq %rax, 0xd0(%rsp)
jmp 0x2d6ba
movq 0x100(%rsp), %rdi
movq 0xf8(%rsp), %rax
movl 0x14(%rax), %edx
leaq 0x4ee4d4(%rip), %rsi    # 0x51bb7f
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0xe7(%rsp)
testb $0x1, 0xe7(%rsp)
jne 0x2d6e6
movq 0xd0(%rsp), %rdi
callq 0x1213a0
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x1213f0
jmp 0x2d6e8
testb $0x1, 0xe7(%rsp)
jne 0x2d796
movl $0x0, 0xcc(%rsp)
movq 0xf8(%rsp), %rdi
movq 0x100(%rsp), %rdx
leaq 0xcc(%rsp), %rsi
callq 0x2dbd0
andb $0x1, %al
movb %al, 0xe7(%rsp)
testb $0x1, 0xe7(%rsp)
jne 0x2d794
movq 0xf8(%rsp), %rax
cmpl $0x4, 0x14(%rax)
jne 0x2d755
movq 0xe8(%rsp), %rdi
movl 0xcc(%rsp), %esi
callq 0x245f60
jmp 0x2d792
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x14(%rax)
jbe 0x2d790
movq 0xe8(%rsp), %rdi
movq 0xf8(%rsp), %rax
movl 0x14(%rax), %esi
subl $0x1, %esi
movl 0xcc(%rsp), %edx
movq 0xf8(%rsp), %rax
movl 0x8(%rax), %ecx
callq 0x243430
jmp 0x2d792
jmp 0x2d794
jmp 0x2d796
cmpq $0x0, 0xd8(%rsp)
je 0x2d7c5
movq 0xd8(%rsp), %rdi
movq 0x60e788(%rip), %rax    # 0x63bf38
movq (%rax), %rsi
callq 0x121d70
movq 0xd8(%rsp), %rdi
callq 0x121f00
jmp 0x2d7c7
testb $0x1, 0xe7(%rsp)
jne 0x2db81
movq 0xf8(%rsp), %rax
cmpl $0x0, 0x14(%rax)
jne 0x2db81
movl $0x0, 0xbc(%rsp)
movq $0x0, 0xb0(%rsp)
leaq 0x60fb73(%rip), %rax    # 0x63d378
movl (%rax), %eax
movl %eax, 0xa4(%rsp)
movq 0xf8(%rsp), %rax
testb $0x1, 0x7(%rax)
jne 0x2d82e
movq 0xf8(%rsp), %rax
testb $0x1, 0x3(%rax)
je 0x2d91b
movl 0xa4(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x4ede7e(%rip), %rsi    # 0x51b6c0
movl $0x198, %edx            # imm = 0x198
callq 0xe80f0
movq %rax, 0xb0(%rsp)
movl $0x0, 0xa8(%rsp)
movl 0xa8(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jae 0x2d919
movq 0xe8(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0xf8(%rsp), %rax
movl 0x8(%rax), %eax
movq %rax, 0x78(%rsp)
movq 0xf8(%rsp), %rax
movb 0x7(%rax), %al
movb %al, 0x6f(%rsp)
movq 0xf8(%rsp), %rax
movb 0x3(%rax), %al
movb %al, 0x87(%rsp)
movq 0xf8(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movb 0x6f(%rsp), %cl
movq 0x70(%rsp), %rdi
movq 0x78(%rsp), %rdx
movq %rax, %r9
movb 0x87(%rsp), %al
xorl %esi, %esi
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0x240390
movq %rax, %rdx
movq 0xb0(%rsp), %rax
movl 0xa8(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl 0xa8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa8(%rsp)
jmp 0x2d85f
jmp 0x2d91b
movq 0xf8(%rsp), %rax
movb 0x2(%rax), %al
movq 0x60e60b(%rip), %rcx    # 0x63bf38
movq (%rcx), %rdx
leaq 0x4e9fb5(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0xc0(%rsp)
movq 0xf8(%rsp), %rdi
movq 0x100(%rsp), %rdx
leaq 0xac(%rsp), %rsi
callq 0x2dbd0
andb $0x1, %al
movb %al, 0xe7(%rsp)
testb $0x1, 0xe7(%rsp)
jne 0x2dac6
movq 0xe8(%rsp), %rdi
movl 0xac(%rsp), %esi
movq 0xf8(%rsp), %rax
movl 0xc(%rax), %edx
movq 0xf8(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0xf8(%rsp), %rax
movl 0x8(%rax), %r8d
movq 0xf8(%rsp), %rax
movb (%rax), %al
movb %al, 0x6e(%rsp)
movq 0xf8(%rsp), %rax
movb 0x4(%rax), %r10b
movq 0xf8(%rsp), %rax
movb 0x5(%rax), %r11b
movq 0xf8(%rsp), %rax
movl 0x18(%rax), %ebp
movq 0xf8(%rsp), %rax
movq 0x28(%rax), %r14
movq 0xf8(%rsp), %rax
movb 0x6(%rax), %bl
movl $0x1, %eax
xorl %r9d, %r9d
testb $0x1, %bl
cmovnel %r9d, %eax
cmpl $0x0, %eax
setne %bl
movq 0xf8(%rsp), %rax
movl 0x10(%rax), %r15d
movq 0xb0(%rsp), %r9
xorl %eax, %eax
movl %eax, %r12d
leaq 0x212b94(%rip), %rax    # 0x2405c0
cmpq $0x0, %r9
cmovneq %rax, %r12
movq 0xb0(%rsp), %r13
movq 0xc0(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x100(%rsp), %rax
movq %rsp, %r9
movq %r9, 0x58(%rsp)
movq %rax, 0x50(%r9)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%r9)
movb 0x6e(%rsp), %al
movq %r13, 0x40(%r9)
leaq 0x2138cb(%rip), %r13    # 0x241340
movq %r13, 0x38(%r9)
movq %r12, 0x30(%r9)
movl %r15d, 0x28(%r9)
movq %r14, 0x18(%r9)
movl %ebp, 0x10(%r9)
movzbl %bl, %ebx
andl $0x1, %ebx
movl %ebx, 0x20(%r9)
movzbl %r11b, %r11d
andl $0x1, %r11d
movl %r11d, 0x8(%r9)
movzbl %r10b, %r10d
andl $0x1, %r10d
movl %r10d, (%r9)
movzbl %al, %r9d
andl $0x1, %r9d
callq 0x245fc0
cmpl $0x0, %eax
je 0x2dac4
movb $0x1, 0xe7(%rsp)
jmp 0x2dac6
cmpq $0x0, 0xb0(%rsp)
je 0x2db74
movq $0x0, 0x98(%rsp)
movl $0x0, 0xa8(%rsp)
movl 0xa8(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jae 0x2db37
movq 0xb0(%rsp), %rax
movl 0xa8(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2404b0
addq 0x98(%rsp), %rax
movq %rax, 0x98(%rsp)
movl 0xa8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa8(%rsp)
jmp 0x2daec
movq 0xf8(%rsp), %rax
testb $0x1, 0x7(%rax)
je 0x2db5b
movq 0x98(%rsp), %rsi
leaq 0x4ee059(%rip), %rdi    # 0x51bbad
movb $0x0, %al
callq 0x19070
movq 0xb0(%rsp), %rdi
leaq 0x4edb56(%rip), %rsi    # 0x51b6c0
movl $0x1d2, %edx            # imm = 0x1D2
callq 0xe88c0
movq 0xc0(%rsp), %rdi
callq 0xe7ed0
movq 0xe8(%rsp), %rdi
callq 0xae070
movq 0xf0(%rsp), %rdi
callq 0xb7e50
movb 0xe7(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)