// File: /workspace/github_c_makefile_star2_O3/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, %rbp
movq %rcx, %r15
movq 0x8(%rcx), %rdi
callq 0x11b0a1
movq %rax, 0x28(%rsp)
testq %rbp, %rbp
je 0xb6960
movq %rbp, %rdi
callq 0xfcc32
testb %al, %al
jne 0xb6e38
movzbl 0x1(%r15), %edi
movq 0x40256c(%rip), %r14    # 0x4b8ed8
movq (%r14), %rdx
xorl $0x1, %edi
leaq 0x28ff5b(%rip), %rbx    # 0x3468d4
movq %rbx, %rsi
callq 0x103e40
leaq 0x29c9b0(%rip), %rsi    # 0x353338
movq %rax, %r13
movq %rax, %rdi
xorl %eax, %eax
callq 0x103fe1
movq %r15, (%rsp)
movzbl (%r15), %edi
movq (%r14), %rdx
movq %rbx, %rsi
callq 0x103e40
movq %rax, %r12
leaq 0x29bdd1(%rip), %rsi    # 0x352783
movq %rax, %rdi
xorl %eax, %eax
callq 0x103fe1
leaq 0x29bdd9(%rip), %rsi    # 0x35279c
movq %r12, %rdi
movq 0x28(%rsp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0x103fe1
leaq 0x29c971(%rip), %rsi    # 0x35334d
leaq 0x2a4472(%rip), %rdx    # 0x35ae55
leaq 0x29c783(%rip), %rcx    # 0x35316d
movq %r15, %rdi
movl $0xa1, %r8d
movq %rbp, %r9
callq 0xfcf97
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xb6b0f
movq %rax, %rbx
leaq 0x29c93e(%rip), %rsi    # 0x353352
leaq 0x2a443a(%rip), %rdx    # 0x35ae55
leaq 0x29c74b(%rip), %rcx    # 0x35316d
movq %r15, %rdi
movl $0xa3, %r8d
movq %rbp, %r9
callq 0xfcf97
testq %rax, %rax
je 0xb6b13
movq %rax, %r14
movq %r12, 0x10(%rsp)
leaq 0x29c90c(%rip), %rsi    # 0x353357
leaq 0x2a4403(%rip), %rdx    # 0x35ae55
leaq 0x29c714(%rip), %rcx    # 0x35316d
movq %r15, %rdi
movl $0xa5, %r8d
movq %rbp, %r9
callq 0xfcf97
movq %rax, 0x30(%rsp)
testq %rax, %rax
movq %r13, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
je 0xb6b2b
leaq 0x29c8d3(%rip), %rsi    # 0x35335c
leaq 0x2a43c5(%rip), %rdx    # 0x35ae55
leaq 0x29c6d6(%rip), %rcx    # 0x35316d
movq %r15, %rdi
movl $0xa7, %r8d
movq %rbp, %r9
callq 0xfcf97
testq %rax, %rax
movq (%rsp), %r13
je 0xb6b42
movq %rax, %r12
leaq 0x29c8a2(%rip), %rsi    # 0x353361
leaq 0x2a438f(%rip), %rdx    # 0x35ae55
leaq 0x29c6a0(%rip), %rcx    # 0x35316d
movq %r15, %rdi
movl $0xa9, %r8d
movq %rbp, %r9
callq 0xfcf97
testq %rax, %rax
je 0xb6b52
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rcx
movq %rax, %r8
movq %rbp, %r9
callq 0x1c6527
movq %rax, %rbp
testq %rax, %rax
setne %al
movq %rax, 0x8(%rsp)
jmp 0xb6b60
xorl %ebp, %ebp
jmp 0xb6b23
movq %rbx, %rdi
callq 0xfd018
xorl %ebp, %ebp
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq %r13, %r15
jmp 0xb6e0e
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%rsp), %r13
jmp 0xb6b60
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
jmp 0xb6b5d
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0xfd018
movq %r14, %rdi
callq 0xfd018
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xb6b7f
callq 0xfd018
testq %r12, %r12
movq 0x20(%rsp), %rbx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
je 0xb6b97
movq %r12, %rdi
callq 0xfd018
testq %r15, %r15
je 0xb6ba4
movq %r15, %rdi
callq 0xfd018
cmpb $0x0, 0x8(%rsp)
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r12
je 0xb6e0e
cmpb $0x1, 0x3(%r13)
jne 0xb6bde
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1c7455
cmpb $0x1, 0x6(%r13)
jne 0xb6bde
movq %rbp, %rdi
movl $0x1, %esi
callq 0x1c7b37
cmpb $0x1, 0x4(%r13)
jne 0xb6c03
movq %rbp, %rdi
movl $0x1, %esi
callq 0x1c7455
cmpb $0x1, 0x6(%r13)
jne 0xb6c03
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1c7b37
cmpb $0x1, 0x5(%r13)
jne 0xb6c12
movq %rbp, %rdi
callq 0x1c6255
cmpb $0x1, 0x2(%r13)
jne 0xb6c73
leaq 0x29c746(%rip), %rsi    # 0x353366
leaq 0x2dc98e(%rip), %rdx    # 0x3935b5
leaq 0x29c53f(%rip), %rcx    # 0x35316d
movq 0x28(%rsp), %rdi
movl $0xcc, %r8d
movq %rbx, %r9
callq 0xfcf97
testq %rax, %rax
je 0xb6e0e
movq %rax, %rbx
movq %rax, %rdi
callq 0xfed85
movq %rax, %r14
movq %rbp, %rdi
movq %rax, %rsi
callq 0x1c6c94
movq %r14, %rdi
callq 0xfec16
movq %rbx, %rdi
callq 0xfd018
movq %rbp, (%rsp)
movq 0x10(%r13), %rdi
callq 0x11c131
testq %rax, %rax
je 0xb6d85
movq %rax, %r14
leaq (,%rax,8), %rdi
leaq 0x29c4d2(%rip), %rsi    # 0x35316d
movl $0xdf, %edx
callq 0x104226
movq %rax, %rbx
movl $0x1, %ebp
leaq 0x305308(%rip), %r15    # 0x3bbfbc
movq %rax, %r12
leaq -0x1(%rbp), %rsi
movq 0x10(%r13), %rdi
callq 0x11bfb3
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
jne 0xb6dd3
cmpq %r14, %rbp
jae 0xb6cee
incq %rbp
addq $0x8, %r12
cmpl $0x1, %eax
je 0xb6cb7
leaq 0x29c6a1(%rip), %rsi    # 0x353396
leaq 0x2dc8b9(%rip), %rdx    # 0x3935b5
leaq 0x29c46a(%rip), %rcx    # 0x35316d
movq 0x28(%rsp), %rdi
movl $0xea, %r8d
movq 0x20(%rsp), %rbp
movq %rbp, %r9
callq 0xfcf97
testq %rax, %rax
je 0xb6de6
movq %rax, %r15
movq %rax, %rdi
callq 0xfed85
movq %rax, %r12
movq 0x18(%r13), %r8
movq (%rsp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %rbp, %r9
callq 0x1c7d72
movl %eax, %r14d
movq %r12, %rdi
callq 0xfec16
movq %r15, %rdi
callq 0xfd018
leaq 0x29c408(%rip), %rsi    # 0x35316d
movq %rbx, %rdi
movl $0xf5, %edx
callq 0x1045eb
testl %r14d, %r14d
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r12
jne 0xb6e0a
leaq 0x29c616(%rip), %rsi    # 0x3533a2
leaq 0x2dc822(%rip), %rdx    # 0x3935b5
leaq 0x29c3d3(%rip), %rcx    # 0x35316d
movq 0x28(%rsp), %rdi
movl $0xfc, %r8d
movq 0x20(%rsp), %r9
callq 0xfcf97
testq %rax, %rax
je 0xb6e04
movq %rax, %rbx
movq (%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0x1c60bc
movq %rbx, %rdi
callq 0xfd018
xorl %r14d, %r14d
jmp 0xb6e0e
leaq 0x29c594(%rip), %rsi    # 0x35336e
movq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
leaq 0x29c380(%rip), %rsi    # 0x35316d
movq %rbx, %rdi
movl $0xf5, %edx
callq 0x1045eb
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r12
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq (%rsp), %rbp
movq %rbp, %rdi
callq 0x1c6ba6
movq %r15, %rdi
callq 0x1040e0
movq %r12, %rdi
callq 0x1040e0
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1d84f
nopl (%rax)