// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_readjoiner_gfa.c
// Function: gt_readjoiner_gfa_runner
static int gt_readjoiner_gfa_runner(GT_UNUSED int argc,
    GT_UNUSED const char **argv, GT_UNUSED int parsed_args,
    void *tool_arguments, GtError *err)
{
  GtReadjoinerGfaArguments *arguments = tool_arguments;
  GtLogger *verbose_logger, *default_logger;
  GtEncseqLoader *el;
  GtEncseq *reads;
  GtTimer *timer = NULL;
  GtStrgraph *strgraph = NULL;
  GtBitsequence *contained = NULL;
  const char *readset = gt_str_get(arguments->readset);
  bool eqlen;
  GtUword nreads;
  int had_err = 0;

  if (gt_showtime_enabled())
  {
    timer = gt_timer_new_with_progress_description(
        GT_READJOINER_GFA_MSG_INIT);
    gt_timer_start(timer);
    gt_timer_show_cpu_time_by_progress(timer);
  }
  gt_assert(arguments);
  gt_error_check(err);
  default_logger = gt_logger_new(!arguments->quiet, GT_LOGGER_DEFLT_PREFIX,
      stdout);
  gt_logger_log(default_logger, "gt readjoiner gfa");
  verbose_logger = gt_logger_new(arguments->verbose, GT_LOGGER_DEFLT_PREFIX,
      stdout);
  gt_logger_log(verbose_logger, "verbose output activated");
  gt_logger_log(verbose_logger, "readset name = %s", readset);
  if (arguments->minmatchlength > 0)
    gt_logger_log(verbose_logger, "SPM length cutoff = %u",
        arguments->minmatchlength);
  if (arguments->gfa1)
    gt_logger_log(verbose_logger, "GFA version = 1.0");
  else
    gt_logger_log(verbose_logger, "GFA version = 2.0");

  el = gt_encseq_loader_new();
  gt_encseq_loader_drop_description_support(el);
  gt_encseq_loader_disable_autosupport(el);
  reads = gt_encseq_loader_load(el, readset, err);
  nreads = gt_encseq_num_of_sequences(reads);
  gt_assert(reads != NULL);
  eqlen = gt_encseq_accesstype_get(reads) == GT_ACCESS_TYPE_EQUALLENGTH;
  gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_INIT);
  if (!eqlen)
  {
    unsigned int i;
    GtUword nofreads;
    GtStr *filename = gt_str_clone(arguments->readset);
    if (gt_showtime_enabled())
      gt_timer_show_progress(timer, GT_READJOINER_GFA_MSG_CNT, stdout);
    gt_logger_log(default_logger, GT_READJOINER_GFA_MSG_CNT);
    gt_str_append_cstr(filename, ".0" GT_READJOINER_SUFFIX_CNTLIST);
    had_err = gt_cntlist_parse(gt_str_get(filename), true, &contained,
        &nofreads, err);
    for (i = 1U; i < arguments->nspmfiles && had_err == 0; i++)
    {
      GtUword nofreads_i;
      gt_str_reset(filename);
      gt_str_append_str(filename, arguments->readset);
      gt_str_append_char(filename, '.');
      gt_str_append_uint(filename, i);
      gt_str_append_cstr(filename, GT_READJOINER_SUFFIX_CNTLIST);
      had_err = gt_cntlist_parse(gt_str_get(filename), false, &contained,
          &nofreads_i, err);
      gt_assert(nofreads == nofreads_i);
    }
    gt_str_delete(filename);
    gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_CNT);
  }
  if (!arguments->sg)
  {
    GtStr *filename = NULL;
    GtFile *file = NULL;
    GtGfaWriter *gw = NULL;
    if (had_err == 0)
    {
      filename = gt_str_clone(arguments->readset);
      gt_str_append_cstr(filename, arguments->gz ?
          GT_READJOINER_SUFFIX_SG_GFA_GZ : GT_READJOINER_SUFFIX_SG_GFA);
      file = gt_file_open(arguments->gz ? GT_FILE_MODE_GZIP :
          GT_FILE_MODE_UNCOMPRESSED, gt_str_get(filename), "w", err);
      if (file == NULL)
        had_err = -1;
    }
    if (had_err == 0)
    {
      gw = gt_gfa_writer_new(file, reads, arguments->gfa1 ?
          GT_GFA_VERSION_1_0 : GT_GFA_VERSION_2_0);
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_GFA_MSG_VERTICES,
            stdout);
      gt_logger_log(default_logger, GT_READJOINER_GFA_MSG_VERTICES);
      had_err = gt_gfa_writer_show_header(gw,
          (GtUword)arguments->minmatchlength,
          gt_str_get(arguments->readset), false, false, err);
    }
    if (had_err == 0)
    {
      had_err = gt_gfa_writer_show_segments(gw, err);
      gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_VERTICES);
    }
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_GFA_MSG_EDGES, stdout);
      gt_logger_log(default_logger, GT_READJOINER_GFA_MSG_EDGES);
      had_err = gt_readjoiner_gfa_use_spmfiles(gt_spmproc_show_gfa,
          gw, readset, arguments->minmatchlength, arguments->nspmfiles,
          contained, err);
      gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_EDGES);
    }
    gt_str_delete(filename);
    gt_file_delete(file);
    gt_gfa_writer_delete(gw);
  }
  else
  {
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_GFA_MSG_COUNT, stdout);
      gt_logger_log(default_logger, GT_READJOINER_GFA_MSG_COUNT);
      strgraph = gt_strgraph_new(nreads);
      had_err = gt_readjoiner_gfa_use_spmfiles(gt_spmproc_strgraph_count,
          strgraph, readset, arguments->minmatchlength, arguments->nspmfiles,
          contained, err);
      gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_COUNT);
    }
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_GFA_MSG_INSERT, stdout);
      gt_logger_log(default_logger, GT_READJOINER_GFA_MSG_INSERT);
      gt_strgraph_allocate_graph(strgraph,
          eqlen ? gt_encseq_seqlength(reads, 0) : 0,
          eqlen ? NULL : reads);
      had_err = gt_strgraph_load_spm_from_file(strgraph,
          (GtUword)arguments->minmatchlength, false,
          contained, readset, arguments->nspmfiles,
          GT_READJOINER_SUFFIX_SPMLIST, err);
      gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_INSERT);
    }
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_GFA_MSG_OUTPUT, stdout);
      gt_logger_log(default_logger, GT_READJOINER_GFA_MSG_OUTPUT);
      gt_strgraph_set_encseq(strgraph, reads);
      gt_strgraph_show(strgraph,
          arguments->gfa1 ?
           (arguments->gz ? GT_STRGRAPH_GFA1_GZ : GT_STRGRAPH_GFA1) :
           (arguments->gz ? GT_STRGRAPH_GFA2_GZ : GT_STRGRAPH_GFA2),
          gt_str_get(arguments->readset),
          arguments->gz ? GT_READJOINER_SUFFIX_SG_GFA_GZ :
          GT_READJOINER_SUFFIX_SG_GFA, false);
      gt_readjoiner_gfa_show_current_space(GT_READJOINER_GFA_MSG_OUTPUT);
    }
  }
  if (gt_showtime_enabled())
  {
    gt_timer_show_progress_final(timer, stdout);
    gt_timer_delete(timer);
  }
  gt_free(contained);
  gt_strgraph_delete(strgraph);
  gt_encseq_loader_delete(el);
  gt_encseq_delete(reads);
  gt_logger_delete(default_logger);
  gt_logger_delete(verbose_logger);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %r15
movq %rcx, %r13
andq $0x0, 0x30(%rsp)
movq 0x8(%rcx), %rdi
callq 0xad1fa
movq %rax, %r12
callq 0xaaf34
testb %al, %al
je 0x3b1e1
leaq 0x2bcf49(%rip), %rdi    # 0x2f810b
callq 0xaf4a5
movq %rax, %rbx
movq %rax, %rdi
callq 0xaf4d6
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
callq 0xafc4b
jmp 0x3b1ea
movq $0x0, 0x20(%rsp)
testq %r15, %r15
je 0x3b1ff
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x3b910
movzbl 0x1(%r13), %edi
movq 0x3fcca5(%rip), %r14    # 0x437eb0
movq (%r14), %rdx
xorl $0x1, %edi
leaq 0x2ab6bc(%rip), %rbx    # 0x2e68d4
movq %rbx, %rsi
callq 0x92b50
movq %rax, %rbp
leaq 0x2b85b8(%rip), %rsi    # 0x2f37e2
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
movzbl (%r13), %edi
movq (%r14), %rdx
movq %rbx, %rsi
callq 0x92b50
movq %rax, %r14
leaq 0x2b7545(%rip), %rsi    # 0x2f2793
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x2b754d(%rip), %rsi    # 0x2f27ac
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x92e71
movl 0x4(%r13), %edx
testl %edx, %edx
je 0x3b285
leaq 0x2b7543(%rip), %rsi    # 0x2f27be
movq %r14, %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x2b8568(%rip), %rax    # 0x2f37f4
leaq 0x2b8573(%rip), %rsi    # 0x2f3806
cmpb $0x0, 0x18(%r13)
cmovneq %rax, %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x92e71
callq 0x791cd
movq %rax, %rbx
movq %rax, %rdi
callq 0x7cece
movq %rbx, %rdi
callq 0x7d046
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, 0x28(%rsp)
movq %r15, %rdx
callq 0x7921d
movq %rax, %r15
movq %rax, %rdi
callq 0x705a1
movq %rax, 0x50(%rsp)
testq %r15, %r15
je 0x3b8e2
movq %r12, 0x58(%rsp)
movq %r15, 0x48(%rsp)
movq %r15, %rdi
callq 0x81d17
movl %eax, %r15d
leaq 0x2bce05(%rip), %rdi    # 0x2f810b
callq 0x3b93e
movl %r15d, 0x40(%rsp)
cmpl $0x2, %r15d
movq %rbx, 0x60(%rsp)
jne 0x3b32b
cmpb $0x0, 0x11(%r13)
jne 0x3b468
jmp 0x3b565
movq %r14, 0x18(%rsp)
movq %r13, %r12
movq 0x8(%r13), %rdi
callq 0xad442
movq %rax, %r15
callq 0xaaf34
testb %al, %al
je 0x3b363
movq 0x3fcb61(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b747c(%rip), %rsi    # 0x2f27d5
movq 0x20(%rsp), %rdi
callq 0xaf86f
leaq 0x2b746b(%rip), %rsi    # 0x2f27d5
movq %rbp, 0x38(%rsp)
movq %rbp, %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x2b7474(%rip), %rsi    # 0x2f27f4
movq %r15, %rdi
callq 0xacbfb
movq %r15, %rdi
callq 0xad1fa
pushq $0x1
popq %r13
leaq 0x30(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rax, %rdi
movl %r13d, %esi
movq 0x28(%rsp), %r8
callq 0x172354
movl %eax, %ebx
leaq 0x2b743f(%rip), %rbp    # 0x2f27f6
leaq 0x68(%rsp), %r14
cmpl 0x14(%r12), %r13d
jae 0x3b433
testl %ebx, %ebx
jne 0x3b433
movq %r15, %rdi
callq 0xad357
movq 0x8(%r12), %rsi
movq %r15, %rdi
callq 0xacd13
movq %r15, %rdi
pushq $0x2e
popq %rsi
callq 0xaced9
movq %r15, %rdi
movl %r13d, %esi
callq 0xad151
movq %r15, %rdi
movq %rbp, %rsi
callq 0xacbfb
movq %r15, %rdi
callq 0xad1fa
movq %rax, %rdi
xorl %esi, %esi
leaq 0x30(%rsp), %rdx
movq %r14, %rcx
movq 0x28(%rsp), %r8
callq 0x172354
movl %eax, %ebx
movq 0x70(%rsp), %rax
cmpq 0x68(%rsp), %rax
jne 0x3b8aa
incl %r13d
jmp 0x3b3bc
movq %r15, %rdi
callq 0xae103
leaq 0x2b7393(%rip), %rdi    # 0x2f27d5
callq 0x3b93e
movq %r12, %r13
cmpb $0x0, 0x11(%r12)
je 0x3b54c
testl %ebx, %ebx
movq 0x38(%rsp), %rbp
movq 0x18(%rsp), %r14
jne 0x3b6a0
movq %r14, 0x18(%rsp)
movq %r13, %r12
callq 0xaaf34
testb %al, %al
je 0x3b494
movq 0x3fca30(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b73bb(%rip), %rsi    # 0x2f2845
movq 0x20(%rsp), %rdi
callq 0xaf86f
leaq 0x2b73aa(%rip), %r14    # 0x2f2845
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x92e71
movq 0x50(%rsp), %rdi
callq 0x17f8d9
movq %rax, %r15
movl 0x4(%r12), %ecx
movl 0x14(%r12), %r8d
movq 0x30(%rsp), %r9
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
leaq 0x1451dc(%rip), %rdi    # 0x1806b0
movq %r15, %rsi
movq 0x58(%rsp), %rdx
callq 0x3b9fd
movl %eax, %ebx
movq %r14, %rdi
callq 0x3b93e
testl %ebx, %ebx
jne 0x3b7a0
callq 0xaaf34
testb %al, %al
je 0x3b517
movq 0x3fc9ad(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b735c(%rip), %rsi    # 0x2f2869
movq 0x20(%rsp), %rdi
callq 0xaf86f
leaq 0x2b734b(%rip), %rsi    # 0x2f2869
xorl %ebx, %ebx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x92e71
cmpl $0x2, 0x40(%rsp)
jne 0x3b6a8
xorl %r14d, %r14d
movq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0x75173
movq %rax, %rbx
jmp 0x3b6ad
testl %ebx, %ebx
movq 0x38(%rsp), %rbp
movq 0x18(%rsp), %r14
je 0x3b565
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x3b653
movq 0x8(%r13), %rdi
callq 0xad442
movq %rax, %r15
leaq 0x2b82a0(%rip), %rax    # 0x2f3818
leaq 0x2b82a1(%rip), %rsi    # 0x2f3820
cmpb $0x0, 0x10(%r13)
cmovneq %rax, %rsi
movq %r15, %rdi
callq 0xacbfb
movzbl 0x10(%r13), %ebx
movq %r15, %rdi
callq 0xad1fa
leaq 0x2f836a(%rip), %rdx    # 0x33390e
movl %ebx, %edi
movq %rax, %rsi
movq 0x28(%rsp), %rcx
callq 0x8cea6
testq %rax, %rax
je 0x3b64d
movq %rax, %r12
movq %r15, 0x40(%rsp)
movq %r13, 0x50(%rsp)
movzbl 0x18(%r13), %edx
xorl $0x1, %edx
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x15d938
movq %rax, %r15
callq 0xaaf34
testb %al, %al
je 0x3b605
movq 0x3fc8bf(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b822a(%rip), %rsi    # 0x2f3825
movq 0x20(%rsp), %rdi
callq 0xaf86f
leaq 0x2b8219(%rip), %rsi    # 0x2f3825
movq %rbp, %rdi
xorl %eax, %eax
callq 0x92e71
movq 0x50(%rsp), %rax
movl 0x4(%rax), %ebx
movq 0x8(%rax), %rdi
callq 0xad1fa
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq 0x28(%rsp), %r13
movq %r13, %r9
callq 0x15d98a
testl %eax, %eax
je 0x3b658
movl %eax, %ebx
movq %r15, %r13
jmp 0x3b683
pushq $-0x1
popq %rbx
xorl %r12d, %r12d
xorl %r13d, %r13d
jmp 0x3b688
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x15da42
movl %eax, %ebx
leaq 0x2b81b4(%rip), %rdi    # 0x2f3825
callq 0x3b93e
testl %ebx, %ebx
je 0x3b820
movq 0x38(%rsp), %r13
movq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0xae103
movq %r12, %rdi
callq 0x8da06
movq %r13, %rdi
callq 0x15dd7a
xorl %r15d, %r15d
jmp 0x3b7a5
movq 0x48(%rsp), %r14
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x17f988
movl 0x4(%r12), %esi
movl 0x14(%r12), %r9d
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x2b8824(%rip), %rax    # 0x2f3eff
movq %rax, (%rsp)
movq %r15, %rdi
xorl %edx, %edx
movq 0x58(%rsp), %r8
callq 0x180db5
movl %eax, %ebx
leaq 0x2b7172(%rip), %rdi    # 0x2f2869
callq 0x3b93e
testl %ebx, %ebx
jne 0x3b7a0
callq 0xaaf34
testb %al, %al
je 0x3b728
movq 0x3fc79c(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b8140(%rip), %rsi    # 0x2f385e
movq 0x20(%rsp), %rdi
callq 0xaf86f
leaq 0x2b812f(%rip), %r13    # 0x2f385e
xorl %ebx, %ebx
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x92e71
movq %r15, %rdi
movq 0x48(%rsp), %rsi
callq 0x1811ac
movzbl 0x18(%r12), %eax
movzbl 0x10(%r12), %ecx
xorl $0x1, %eax
movq %rbp, %r14
leal (%rcx,%rax,2), %ebp
addl $0x7, %ebp
movq 0x8(%r12), %rdi
callq 0xad1fa
leaq 0x2b80a4(%rip), %rdx    # 0x2f3818
leaq 0x2b80a5(%rip), %rcx    # 0x2f3820
cmpb $0x0, 0x10(%r12)
cmovneq %rdx, %rcx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rbp
movq %rax, %rdx
xorl %r8d, %r8d
callq 0x183f19
movq %r13, %rdi
callq 0x3b93e
movq 0x18(%rsp), %r14
callq 0xaaf34
testb %al, %al
je 0x3b7cd
movq 0x3fc6fb(%rip), %rax    # 0x437eb0
movq (%rax), %rsi
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0xafb49
movq %r12, %rdi
callq 0xafc5b
movq 0x30(%rsp), %rdi
leaq 0x2b7f19(%rip), %rsi    # 0x2f36f2
movl $0x165, %edx            # imm = 0x165
callq 0x936f9
movq %r15, %rdi
callq 0x17fc58
movq 0x60(%rsp), %rdi
callq 0x79f01
movq 0x48(%rsp), %rdi
callq 0x735fd
movq %rbp, %rdi
callq 0x92fd0
movq %r14, %rdi
callq 0x92fd0
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x18(%rsp)
callq 0xaaf34
testb %al, %al
movq 0x40(%rsp), %r15
je 0x3b84e
movq 0x3fc676(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b7fff(%rip), %rsi    # 0x2f3843
movq 0x20(%rsp), %rdi
callq 0xaf86f
leaq 0x2b7fee(%rip), %r14    # 0x2f3843
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x92e71
movq 0x50(%rsp), %r13
movl 0x4(%r13), %ecx
movl 0x14(%r13), %r8d
movq 0x30(%rsp), %r9
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
leaq 0x12239f(%rip), %rdi    # 0x15dc23
movq 0x38(%rsp), %r13
movq %r13, %rsi
movq 0x58(%rsp), %rdx
callq 0x3b9fd
movl %eax, %ebx
movq %r14, %rdi
callq 0x3b93e
movq 0x18(%rsp), %r14
jmp 0x3b688
movq 0x3fc6b7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2a9758(%rip), %rsi    # 0x2e5013
leaq 0x2b75fb(%rip), %rdx    # 0x2f2ebd
leaq 0x2b7f00(%rip), %rcx    # 0x2f37c9
leaq 0x2b7e22(%rip), %r8     # 0x2f36f2
movl $0x102, %r9d            # imm = 0x102
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x3fc67f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2a9720(%rip), %rsi    # 0x2e5013
leaq 0x311717(%rip), %rdx    # 0x34d011
leaq 0x2b7ec8(%rip), %rcx    # 0x2f37c9
leaq 0x2b7dea(%rip), %r8     # 0x2f36f2
movl $0xea, %r9d
jmp 0x3b8d6
movq 0x3fc651(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2a96f2(%rip), %rsi    # 0x2e5013
leaq 0x2a9897(%rip), %rdx    # 0x2e51bf
leaq 0x2b7e9a(%rip), %rcx    # 0x2f37c9
leaq 0x2b7dbc(%rip), %r8     # 0x2f36f2
movl $0xd5, %r9d
jmp 0x3b8d6