// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_readjoiner_cgraph.c
// Function: gt_readjoiner_cgraph_runner
static int gt_readjoiner_cgraph_runner(GT_UNUSED int argc,
    GT_UNUSED const char **argv, GT_UNUSED int parsed_args,
    void *tool_arguments, GtError *err)
{
  GtReadjoinerCgraphArguments *arguments = tool_arguments;
  GtLogger *verbose_logger, *default_logger;
  const char *readset = gt_str_get(arguments->readset);
  int had_err = 0;
  GtContigsGraph *cg = NULL;
  FILE *cjl_i_fp = NULL, *cjl_o_fp = NULL, *j_fp = NULL, *rlt_fp = NULL,
       *di_fp = NULL;

  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 cgraph");
  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);

  GT_READJOINER_CGRAPH_GET_FP(cjl_i_fp, readset,
      GT_READJOINER_SUFFIX_CJ_I_LINKS, "r");
  GT_READJOINER_CGRAPH_GET_FP(cjl_o_fp, readset,
      GT_READJOINER_SUFFIX_CJ_O_LINKS, "r");
  GT_READJOINER_CGRAPH_GET_FP(j_fp, readset,
      GT_READJOINER_SUFFIX_JUNCTIONS, "r");
  GT_READJOINER_CGRAPH_GET_FP(rlt_fp, readset,
      GT_READJOINER_SUFFIX_READSLIBRARYTABLE, "r");
  GT_READJOINER_CGRAPH_GET_FP(di_fp, readset,
      GT_READJOINER_SUFFIX_DEPTHINFO, "r");
  if (!had_err)
  {
    cg = gt_contigs_graph_new(cjl_i_fp, cjl_o_fp, j_fp, rlt_fp, di_fp, err);
    if (cg == NULL)
      had_err = -1;
  }
  if (cjl_i_fp != NULL)
    gt_fa_fclose(cjl_i_fp);
  if (cjl_o_fp != NULL)
    gt_fa_fclose(cjl_o_fp);
  if (j_fp != NULL)
    gt_fa_fclose(j_fp);
  if (rlt_fp != NULL)
    gt_fa_fclose(rlt_fp);
  if (di_fp != NULL)
    gt_fa_fclose(di_fp);
  if (!had_err && arguments->smp1)
  {
    gt_contigs_graph_simplify(cg, false);
    if (arguments->ext)
      gt_contigs_graph_extend_contigs(cg, true);
  }
  if (!had_err && arguments->smp2)
  {
    gt_contigs_graph_simplify(cg, true);
    if (arguments->ext)
      gt_contigs_graph_extend_contigs(cg, false);
  }
  if (!had_err && arguments->dotdel)
    gt_contigs_graph_enable_dot_show_deleted(cg);
  if (!had_err && arguments->dot)
  {
    FILE *dot_fp = NULL;
    GT_READJOINER_CGRAPH_GET_FP(dot_fp, readset,
        GT_READJOINER_SUFFIX_CG_DOT, "w");
    if (!had_err)
    {
      GtFile *dot_gtfile;
      dot_gtfile = gt_file_new_from_fileptr(dot_fp);
      gt_contigs_graph_show_dot(cg, dot_gtfile);
      gt_file_delete_without_handle(dot_gtfile);
    }
    if (dot_fp != NULL)
      gt_fa_fclose(dot_fp);
  }
  if (!had_err)
  {
    GtUword nofcnums = gt_str_array_size(arguments->subgraph);
    if (nofcnums > 0)
    {
      FILE *dot_fp = NULL;
      GtUword i, *cnums;
      const char *cnum_str;
      cnums = gt_malloc(sizeof (*cnums) * nofcnums);
      for (i = 0; i < nofcnums && !had_err; i++)
      {
        cnum_str = gt_str_array_get(arguments->subgraph, i);
        if (sscanf(cnum_str, ""GT_WU"", cnums + i) != 1)
        {
          gt_error_set(err, "argument of option -subgraph is invalid");
          had_err = -1;
        }
      }
      GT_READJOINER_CGRAPH_GET_FP(dot_fp, readset,
          GT_READJOINER_SUFFIX_CG_SUB_DOT, "w");
      if (!had_err)
      {
        GtFile *dot_gtfile;
        dot_gtfile = gt_file_new_from_fileptr(dot_fp);
        had_err = gt_contigs_graph_show_dot_subgraph(cg, dot_gtfile, cnums,
            nofcnums, arguments->subgraph_depth, err);
        gt_file_delete_without_handle(dot_gtfile);
      }
      if (dot_fp != NULL)
        gt_fa_fclose(dot_fp);
      gt_free(cnums);
    }
  }
  if (!had_err)
  {
    FILE *paths_fp = NULL;
    GT_READJOINER_CGRAPH_GET_FP(paths_fp, readset,
        GT_READJOINER_SUFFIX_CG_PATHS, "w");
    if (!had_err)
      gt_contigs_graph_output_paths(cg, paths_fp);
    if (paths_fp != NULL)
      gt_fa_fclose(paths_fp);
  }
  gt_contigs_graph_delete(cg);
  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 $0x38, %rsp
movq %r8, %r12
movq %rcx, %r13
movq 0x8(%rcx), %rdi
callq 0xad1fa
movq %rax, 0x20(%rsp)
testq %r12, %r12
je 0x3a0e1
movq %r12, %rdi
callq 0x89eb7
testb %al, %al
jne 0x3a5ac
movzbl 0x1(%r13), %edi
movq 0x3fddc3(%rip), %r14    # 0x437eb0
movq (%r14), %rdx
xorl $0x1, %edi
leaq 0x2ac7da(%rip), %rbx    # 0x2e68d4
movq %rbx, %rsi
callq 0x92b50
movq %rax, %r15
leaq 0x2b923c(%rip), %rsi    # 0x2f3348
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
movzbl (%r13), %edi
movq (%r14), %rdx
movq %rbx, %rsi
callq 0x92b50
movq %rax, %rbp
leaq 0x2b8663(%rip), %rsi    # 0x2f2793
movq %rax, %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x2b866b(%rip), %rsi    # 0x2f27ac
movq %rbp, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x92e71
leaq 0x2b9203(%rip), %rsi    # 0x2f335d
leaq 0x2c0ccc(%rip), %rdx    # 0x2fae2d
leaq 0x2b9015(%rip), %rcx    # 0x2f317d
movq %r14, %rdi
movl $0xa1, %r8d
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
je 0x3a44b
movq %rax, %rbx
movq %rbp, 0x30(%rsp)
leaq 0x2b91d1(%rip), %rsi    # 0x2f3362
leaq 0x2c0c95(%rip), %rdx    # 0x2fae2d
leaq 0x2b8fde(%rip), %rcx    # 0x2f317d
movq %r14, %rdi
movl $0xa3, %r8d
movq %r12, %r9
callq 0x8a449
movq %rax, 0x10(%rsp)
testq %rax, %rax
movq %r12, (%rsp)
movq %r15, 0x28(%rsp)
je 0x3a289
leaq 0x2b9199(%rip), %rsi    # 0x2f3367
leaq 0x2c0c58(%rip), %rdx    # 0x2fae2d
leaq 0x2b8fa1(%rip), %rcx    # 0x2f317d
movq %r14, %rdi
movl $0xa5, %r8d
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
je 0x3a289
movq %rax, %rbp
leaq 0x2b916c(%rip), %rsi    # 0x2f336c
leaq 0x2c0c26(%rip), %rdx    # 0x2fae2d
leaq 0x2b8f6f(%rip), %rcx    # 0x2f317d
movq %r14, %rdi
movl $0xa7, %r8d
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
je 0x3a474
movq %r12, %r9
movq %rax, %r12
leaq 0x2b913c(%rip), %rsi    # 0x2f3371
leaq 0x2c0bf1(%rip), %rdx    # 0x2fae2d
leaq 0x2b8f3a(%rip), %rcx    # 0x2f317d
movq %r14, %rdi
movl $0xa9, %r8d
movq %r9, %r14
callq 0x8a449
testq %rax, %rax
je 0x3a59b
movq %rax, %r15
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %rax, %r8
movq %r14, %r9
callq 0x1768fe
movq %rax, %r14
testq %rax, %rax
setne %al
movq %rax, 0x8(%rsp)
jmp 0x3a29d
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x8a4fd
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a2b4
callq 0x8a4fd
testq %rbp, %rbp
je 0x3a2c1
movq %rbp, %rdi
callq 0x8a4fd
testq %r12, %r12
movq 0x20(%rsp), %rbx
je 0x3a2d3
movq %r12, %rdi
callq 0x8a4fd
testq %r15, %r15
movq 0x30(%rsp), %rbp
je 0x3a2e5
movq %r15, %rdi
callq 0x8a4fd
cmpb $0x0, 0x8(%rsp)
movq 0x28(%rsp), %r15
movq (%rsp), %r12
je 0x3a456
cmpb $0x1, 0x3(%r13)
jne 0x3a31c
movq %r14, %rdi
xorl %esi, %esi
callq 0x177a3c
cmpb $0x1, 0x6(%r13)
jne 0x3a31c
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x178300
cmpb $0x1, 0x4(%r13)
jne 0x3a33f
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x177a3c
cmpb $0x1, 0x6(%r13)
jne 0x3a33f
movq %r14, %rdi
xorl %esi, %esi
callq 0x178300
cmpb $0x1, 0x5(%r13)
jne 0x3a34e
movq %r14, %rdi
callq 0x1765b0
cmpb $0x1, 0x2(%r13)
jne 0x3a3b7
leaq 0x2b901a(%rip), %rsi    # 0x2f3376
leaq 0x2f95ab(%rip), %rdx    # 0x33390e
leaq 0x2b8e13(%rip), %rcx    # 0x2f317d
movq %rbx, %rdi
movl $0xcc, %r8d
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
je 0x3a456
movq %rax, %rbx
movq %rax, %rdi
callq 0x8d2a4
movq %r14, %r12
movq %rax, %r14
movq %r12, %rdi
movq %rax, %rsi
callq 0x177170
movq %r14, %rdi
movq %r12, %r14
movq (%rsp), %r12
callq 0x8d080
movq %rbx, %rdi
callq 0x8a4fd
movq %r14, 0x18(%rsp)
movq 0x10(%r13), %rdi
callq 0xae61c
testq %rax, %rax
je 0x3a51e
movq %rax, %r14
leaq (,%rax,8), %rdi
leaq 0x2b8d9d(%rip), %rsi    # 0x2f317d
movl $0xdf, %edx
callq 0x93160
movq %rax, %rbp
leaq 0x32201a(%rip), %r15    # 0x35c40e
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq %r14, %rbx
jae 0x3a45e
testl %r12d, %r12d
jne 0x3a45e
movq 0x10(%r13), %rdi
movq %rbx, %rsi
callq 0xae386
xorl %r12d, %r12d
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x177b0
cmpl $0x1, %eax
je 0x3a442
movq (%rsp), %rdi
leaq 0x2b8f47(%rip), %rsi    # 0x2f337e
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r12
incq %rbx
addq $0x8, %rbp
jmp 0x3a3fe
pushq $-0x1
popq %rbx
xorl %r14d, %r14d
jmp 0x3a572
pushq $-0x1
popq %rbx
jmp 0x3a572
pushq $-0x1
popq %rbx
testl %r12d, %r12d
je 0x3a488
movq 0x30(%rsp), %rbp
movq (%rsp), %r12
jmp 0x3a4ff
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0x3a29a
leaq 0x2b8f17(%rip), %rsi    # 0x2f33a6
leaq 0x2f9478(%rip), %rdx    # 0x33390e
leaq 0x2b8ce0(%rip), %rcx    # 0x2f317d
movq 0x20(%rsp), %rdi
movl $0xea, %r8d
movq (%rsp), %r12
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
movq 0x30(%rsp), %rbp
je 0x3a4ff
movq %rax, %r15
movq %rax, %rdi
callq 0x8d2a4
movq %rax, %r12
movq 0x18(%r13), %r8
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rcx
movq (%rsp), %r9
callq 0x178526
movl %eax, %ebx
movq %r12, %rdi
movq (%rsp), %r12
callq 0x8d080
movq %r15, %rdi
callq 0x8a4fd
leaq 0x2b8c77(%rip), %rsi    # 0x2f317d
movq 0x10(%rsp), %rdi
movl $0xf5, %edx
callq 0x936f9
testl %ebx, %ebx
movq 0x28(%rsp), %r15
jne 0x3a56d
leaq 0x2b8e8d(%rip), %rsi    # 0x2f33b2
leaq 0x2f93e2(%rip), %rdx    # 0x33390e
leaq 0x2b8c4a(%rip), %rcx    # 0x2f317d
movq 0x20(%rsp), %rdi
movl $0xfc, %r8d
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
je 0x3a56a
movq %rax, %rbx
movq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x1763d0
movq %rbx, %rdi
callq 0x8a4fd
xorl %ebx, %ebx
jmp 0x3a572
pushq $-0x1
popq %rbx
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x177082
movq %r15, %rdi
callq 0x92fd0
movq %rbp, %rdi
callq 0x92fd0
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
jmp 0x3a29a
movq 0x3fd9b5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2aaa56(%rip), %rsi    # 0x2e5013
leaq 0x2aabfb(%rip), %rdx    # 0x2e51bf
leaq 0x2b8d61(%rip), %rcx    # 0x2f332c
leaq 0x2b8bab(%rip), %r8     # 0x2f317d
movl $0x97, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390