// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_readjoiner_asqg.c
// Function: gt_readjoiner_asqg_runner
static int gt_readjoiner_asqg_runner(GT_UNUSED int argc,
    GT_UNUSED const char **argv, GT_UNUSED int parsed_args,
    void *tool_arguments, GtError *err)
{
  GtReadjoinerAsqgArguments *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_ASQG_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 asqg");
  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);

  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_asqg_show_current_space(GT_READJOINER_ASQG_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_ASQG_MSG_CNT, stdout);
    gt_logger_log(default_logger, GT_READJOINER_ASQG_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_asqg_show_current_space(GT_READJOINER_ASQG_MSG_CNT);
  }
  if (!arguments->sg)
  {
    GtStr *filename = NULL;
    GtFile *file = NULL;
    GtAsqgWriter *aw = NULL;
    if (had_err == 0)
    {
      filename = gt_str_clone(arguments->readset);
      gt_str_append_cstr(filename, arguments->gz ?
          GT_READJOINER_SUFFIX_SG_ASQG_GZ : GT_READJOINER_SUFFIX_SG_ASQG);
      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)
    {
      aw = gt_asqg_writer_new(file, reads);
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_ASQG_MSG_VERTICES,
            stdout);
      gt_logger_log(default_logger, GT_READJOINER_ASQG_MSG_VERTICES);
      had_err = gt_asqg_writer_show_header(aw, 0.0,
          (GtUword)arguments->minmatchlength,
          gt_str_get(arguments->readset), false, false, err);
    }
    if (had_err == 0)
    {
      had_err = gt_asqg_writer_show_vertices(aw, err);
      gt_readjoiner_asqg_show_current_space(GT_READJOINER_ASQG_MSG_VERTICES);
    }
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_ASQG_MSG_EDGES, stdout);
      gt_logger_log(default_logger, GT_READJOINER_ASQG_MSG_EDGES);
      had_err = gt_readjoiner_asqg_use_spmfiles(gt_spmproc_show_asqg,
          aw, readset, arguments->minmatchlength, arguments->nspmfiles,
          contained, err);
      gt_readjoiner_asqg_show_current_space(GT_READJOINER_ASQG_MSG_EDGES);
    }
    gt_str_delete(filename);
    gt_file_delete(file);
    gt_asqg_writer_delete(aw);
  }
  else
  {
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_ASQG_MSG_COUNT, stdout);
      gt_logger_log(default_logger, GT_READJOINER_ASQG_MSG_COUNT);
      strgraph = gt_strgraph_new(nreads);
      had_err = gt_readjoiner_asqg_use_spmfiles(gt_spmproc_strgraph_count,
          strgraph, readset, arguments->minmatchlength, arguments->nspmfiles,
          contained, err);
      gt_readjoiner_asqg_show_current_space(GT_READJOINER_ASQG_MSG_COUNT);
    }
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_ASQG_MSG_INSERT, stdout);
      gt_logger_log(default_logger, GT_READJOINER_ASQG_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_asqg_show_current_space(GT_READJOINER_ASQG_MSG_INSERT);
    }
    if (had_err == 0)
    {
      if (gt_showtime_enabled())
        gt_timer_show_progress(timer, GT_READJOINER_ASQG_MSG_OUTPUT, stdout);
      gt_logger_log(default_logger, GT_READJOINER_ASQG_MSG_OUTPUT);
      gt_strgraph_set_encseq(strgraph, reads);
      gt_strgraph_show(strgraph, arguments->gz ? GT_STRGRAPH_ASQG_GZ :
          GT_STRGRAPH_ASQG, gt_str_get(arguments->readset),
          arguments->gz ? GT_READJOINER_SUFFIX_SG_ASQG_GZ :
          GT_READJOINER_SUFFIX_SG_ASQG, false);
      gt_readjoiner_asqg_show_current_space(GT_READJOINER_ASQG_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, %rbx
movq %rcx, %r12
andq $0x0, 0x38(%rsp)
movq 0x8(%rcx), %rdi
callq 0xad1fa
movq %rax, %r15
callq 0xaaf34
testb %al, %al
je 0x38239
leaq 0x2bfeec(%rip), %rdi    # 0x2f810b
callq 0xaf4a5
movq %rax, %rbp
movq %rax, %rdi
callq 0xaf4d6
movq %rbp, %rdi
callq 0xafc4b
jmp 0x3823b
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x38250
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x38944
movq %rbx, 0x20(%rsp)
movzbl 0x1(%r12), %edi
movq 0x3ffc4e(%rip), %r14    # 0x437eb0
movq (%r14), %rdx
xorl $0x1, %edi
leaq 0x2ae665(%rip), %rbx    # 0x2e68d4
movq %rbx, %rsi
callq 0x92b50
leaq 0x2ba502(%rip), %rsi    # 0x2f2780
movq %rax, 0x30(%rsp)
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
movzbl (%r12), %edi
movq (%r14), %rdx
movq %rbx, %rsi
callq 0x92b50
movq %rax, %r14
leaq 0x2ba4ec(%rip), %rsi    # 0x2f2793
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x2ba4f4(%rip), %rsi    # 0x2f27ac
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x92e71
movl 0x4(%r12), %edx
testl %edx, %edx
je 0x382df
leaq 0x2ba4e9(%rip), %rsi    # 0x2f27be
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 %r15, 0x58(%rsp)
movq %r15, %rsi
movq 0x20(%rsp), %rdx
callq 0x7921d
movq %rax, %r15
movq %rax, %rdi
callq 0x705a1
movq %rax, 0x50(%rsp)
testq %r15, %r15
je 0x38916
movq %r15, %rdi
callq 0x81d17
movl %eax, %r13d
leaq 0x2bfdd4(%rip), %rdi    # 0x2f810b
callq 0x38972
movl %r13d, 0x40(%rsp)
cmpl $0x2, %r13d
movq %rbx, 0x60(%rsp)
movq %r15, 0x48(%rsp)
jne 0x3836a
cmpb $0x0, 0x11(%r12)
movq %rbp, %r13
movq 0x30(%rsp), %rbp
je 0x385aa
jmp 0x384ae
movq %r14, 0x18(%rsp)
movq %r12, %r14
movq 0x8(%r12), %rdi
callq 0xad442
movq %rax, %r12
callq 0xaaf34
testb %al, %al
je 0x383a1
movq 0x3ffb21(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2ba43c(%rip), %rsi    # 0x2f27d5
movq %rbp, %rdi
callq 0xaf86f
movq %rbp, 0x28(%rsp)
leaq 0x2ba428(%rip), %rsi    # 0x2f27d5
movq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x2ba434(%rip), %rsi    # 0x2f27f4
movq %r12, %rdi
callq 0xacbfb
movq %r12, %rdi
callq 0xad1fa
pushq $0x1
popq %r15
leaq 0x38(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rax, %rdi
movl %r15d, %esi
movq 0x20(%rsp), %r8
callq 0x172354
movl %eax, %ebx
leaq 0x2ba3ff(%rip), %rbp    # 0x2f27f6
leaq 0x68(%rsp), %r13
cmpl 0x14(%r14), %r15d
jae 0x38471
testl %ebx, %ebx
jne 0x38471
movq %r12, %rdi
callq 0xad357
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0xacd13
movq %r12, %rdi
pushq $0x2e
popq %rsi
callq 0xaced9
movq %r12, %rdi
movl %r15d, %esi
callq 0xad151
movq %r12, %rdi
movq %rbp, %rsi
callq 0xacbfb
movq %r12, %rdi
callq 0xad1fa
movq %rax, %rdi
xorl %esi, %esi
leaq 0x38(%rsp), %rdx
movq %r13, %rcx
movq 0x20(%rsp), %r8
callq 0x172354
movl %eax, %ebx
movq 0x70(%rsp), %rax
cmpq 0x68(%rsp), %rax
jne 0x388de
incl %r15d
jmp 0x383fc
movq %r12, %rdi
callq 0xae103
leaq 0x2ba355(%rip), %rdi    # 0x2f27d5
callq 0x38972
movq %r14, %r12
cmpb $0x0, 0x11(%r14)
je 0x3858c
testl %ebx, %ebx
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %r14
je 0x384ae
xorl %r12d, %r12d
jmp 0x387dc
movq %r14, 0x18(%rsp)
movq %r12, %r15
callq 0xaaf34
testb %al, %al
je 0x384d8
movq 0x3ff9ea(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2ba375(%rip), %rsi    # 0x2f2845
movq %r13, %rdi
callq 0xaf86f
leaq 0x2ba366(%rip), %r14    # 0x2f2845
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x92e71
movq 0x50(%rsp), %rdi
callq 0x17f8d9
movq %rax, %r12
movl 0x4(%r15), %ecx
movl 0x14(%r15), %r8d
movq 0x38(%rsp), %r9
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0x14819a(%rip), %rdi    # 0x1806b0
movq %r12, %rsi
movq 0x58(%rsp), %rdx
callq 0x38a31
movl %eax, %ebx
movq %r14, %rdi
callq 0x38972
testl %ebx, %ebx
jne 0x387d7
callq 0xaaf34
testb %al, %al
je 0x38557
movq 0x3ff96b(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2ba31a(%rip), %rsi    # 0x2f2869
movq %r13, %rdi
callq 0xaf86f
leaq 0x2ba30b(%rip), %rsi    # 0x2f2869
xorl %ebx, %ebx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x92e71
cmpl $0x2, 0x40(%rsp)
jne 0x386f1
xorl %r14d, %r14d
movq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0x75173
movq %rax, %rbx
jmp 0x386f6
testl %ebx, %ebx
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %r14
je 0x385aa
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x3869d
movq 0x8(%r12), %rdi
callq 0xad442
movq %rax, %r15
leaq 0x2ba23d(%rip), %rax    # 0x2f27fb
leaq 0x2ba23f(%rip), %rsi    # 0x2f2804
cmpb $0x0, 0x10(%r12)
cmovneq %rax, %rsi
movq %r15, %rdi
callq 0xacbfb
movq %r12, 0x50(%rsp)
movzbl 0x10(%r12), %ebx
movq %r15, %rdi
callq 0xad1fa
leaq 0x2fb31d(%rip), %rdx    # 0x33390e
movl %ebx, %edi
movq %rax, %rsi
movq 0x20(%rsp), %rcx
callq 0x8cea6
testq %rax, %rax
je 0x38697
movq %rax, %r12
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x133450
movq %rax, 0x40(%rsp)
callq 0xaaf34
testb %al, %al
je 0x38640
movq 0x3ff882(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2ba1d2(%rip), %rsi    # 0x2f280a
movq %r13, %rdi
callq 0xaf86f
movq %r13, 0x28(%rsp)
leaq 0x2ba1be(%rip), %rsi    # 0x2f280a
movq %rbp, %rdi
xorl %eax, %eax
callq 0x92e71
movq 0x50(%rsp), %rax
movl 0x4(%rax), %ebx
movq 0x8(%rax), %rdi
callq 0xad1fa
xorps %xmm0, %xmm0
movq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq 0x20(%rsp), %r13
movq %r13, %r9
callq 0x13347b
testl %eax, %eax
je 0x386c4
movl %eax, %ebx
movq 0x28(%rsp), %r13
jmp 0x3869f
pushq $-0x1
popq %rbx
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %r15, %rdi
callq 0xae103
movq %r12, %rdi
callq 0x8da06
movq %rbp, %rdi
callq 0x13370a
xorl %r12d, %r12d
movq 0x30(%rsp), %rbp
jmp 0x387dc
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1334f1
movl %eax, %ebx
leaq 0x2ba132(%rip), %rdi    # 0x2f280a
callq 0x38972
testl %ebx, %ebx
je 0x38855
movq 0x28(%rsp), %r13
movq 0x40(%rsp), %rbp
jmp 0x3869f
movq 0x48(%rsp), %r14
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x17f988
movl 0x4(%r15), %esi
movl 0x14(%r15), %r9d
movq 0x38(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x2bb7dd(%rip), %rax    # 0x2f3eff
movq %rax, (%rsp)
movq %r12, %rdi
xorl %edx, %edx
movq 0x58(%rsp), %r8
callq 0x180db5
movl %eax, %ebx
leaq 0x2ba12b(%rip), %rdi    # 0x2f2869
callq 0x38972
testl %ebx, %ebx
jne 0x387d7
callq 0xaaf34
testb %al, %al
je 0x3876d
movq 0x3ff755(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2ba129(%rip), %rsi    # 0x2f288e
movq %r13, %rdi
callq 0xaf86f
leaq 0x2ba11a(%rip), %rsi    # 0x2f288e
xorl %ebx, %ebx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x92e71
movq %r12, %rdi
movq 0x48(%rsp), %rsi
callq 0x1811ac
movq %rbp, %r14
movzbl 0x10(%r15), %ebp
addl $0x5, %ebp
movq 0x8(%r15), %rdi
callq 0xad1fa
leaq 0x2ba053(%rip), %rdx    # 0x2f27fb
leaq 0x2ba055(%rip), %rcx    # 0x2f2804
cmpb $0x0, 0x10(%r15)
cmovneq %rdx, %rcx
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rbp
movq %rax, %rdx
xorl %r8d, %r8d
callq 0x183f19
leaq 0x2ba0bc(%rip), %rdi    # 0x2f288e
callq 0x38972
movq 0x18(%rsp), %r14
callq 0xaaf34
testb %al, %al
movq 0x48(%rsp), %r15
je 0x38804
movq 0x3ff6bf(%rip), %rax    # 0x437eb0
movq (%rax), %rsi
movq %r13, %rdi
callq 0xafb49
movq %r13, %rdi
callq 0xafc5b
movq 0x38(%rsp), %rdi
leaq 0x2b9dc8(%rip), %rsi    # 0x2f25d8
movl $0x156, %edx            # imm = 0x156
callq 0x936f9
movq %r12, %rdi
callq 0x17fc58
movq 0x60(%rsp), %rdi
callq 0x79f01
movq %r15, %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 0x28(%rsp), %r13
je 0x38881
movq 0x3ff641(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b9fb0(%rip), %rsi    # 0x2f2829
movq %r13, %rdi
callq 0xaf86f
leaq 0x2b9fa1(%rip), %r14    # 0x2f2829
movq 0x30(%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x92e71
movq 0x50(%rsp), %rax
movl 0x4(%rax), %ecx
movl 0x14(%rax), %r8d
movq 0x38(%rsp), %r9
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0xfadb1(%rip), %rdi     # 0x133669
movq 0x40(%rsp), %rbp
movq %rbp, %rsi
movq 0x58(%rsp), %rdx
callq 0x38a31
movl %eax, %ebx
movq %r14, %rdi
callq 0x38972
movq 0x18(%rsp), %r14
jmp 0x3869f
movq 0x3ff683(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2ac724(%rip), %rsi    # 0x2e5013
leaq 0x2ba5c7(%rip), %rdx    # 0x2f2ebd
leaq 0x2b9e69(%rip), %rcx    # 0x2f2766
leaq 0x2b9cd4(%rip), %r8     # 0x2f25d8
movl $0xf7, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x3ff64b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2ac6ec(%rip), %rsi    # 0x2e5013
leaq 0x3146e3(%rip), %rdx    # 0x34d011
leaq 0x2b9e31(%rip), %rcx    # 0x2f2766
leaq 0x2b9c9c(%rip), %r8     # 0x2f25d8
movl $0xdf, %r9d
jmp 0x3890a
movq 0x3ff61d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2ac6be(%rip), %rsi    # 0x2e5013
leaq 0x2ac863(%rip), %rdx    # 0x2e51bf
leaq 0x2b9e03(%rip), %rcx    # 0x2f2766
leaq 0x2b9c6e(%rip), %r8     # 0x2f25d8
movl $0xce, %r9d
jmp 0x3890a