// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rcx, %r12
movq 0x8(%rcx), %rdi
callq 0x120d23
testq %r12, %r12
je 0xb8f47
movq %rax, %rbp
testq %r13, %r13
je 0xb8a43
movq %r13, %rdi
callq 0x101a9a
testb %al, %al
jne 0xb8f4c
movzbl 0x1(%r12), %edi
movq 0x40b498(%rip), %r14    # 0x4c3ee8
movq (%r14), %rdx
xorl $0x1, %edi
leaq 0x296e77(%rip), %rbx    # 0x34f8d4
movq %rbx, %rsi
callq 0x108ed0
leaq 0x2a3904(%rip), %rsi    # 0x35c370
xorl %r15d, %r15d
movq %rax, 0x30(%rsp)
movq %rax, %rdi
xorl %eax, %eax
callq 0x10906e
movq %r12, 0x18(%rsp)
movzbl (%r12), %edi
movq (%r14), %rdx
movq %rbx, %rsi
callq 0x108ed0
movq %rax, %rbx
leaq 0x2a2d1e(%rip), %rsi    # 0x35b7bb
movq %rax, %rdi
xorl %eax, %eax
callq 0x10906e
leaq 0x2a2d26(%rip), %rsi    # 0x35b7d4
movq %rbx, 0x28(%rsp)
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10906e
leaq 0x2a38be(%rip), %rsi    # 0x35c385
leaq 0x2ab3fb(%rip), %rdx    # 0x363ec9
leaq 0x2a36d0(%rip), %rcx    # 0x35c1a5
movq %rbp, %rdi
movl $0xa1, %r8d
movq %r13, %r9
callq 0x101dff
movq %rax, %r14
testq %rax, %rax
je 0xb8b20
leaq 0x2a3895(%rip), %rsi    # 0x35c38a
leaq 0x2ab3cd(%rip), %rdx    # 0x363ec9
leaq 0x2a36a2(%rip), %rcx    # 0x35c1a5
movq %rbp, %rdi
movl $0xa3, %r8d
movq %r13, %r9
callq 0x101dff
movq %rax, %r12
testq %rax, %rax
setne %r15b
jmp 0xb8b23
xorl %r12d, %r12d
testb %r15b, %r15b
movq %rbp, 0x8(%rsp)
je 0xb8b5e
leaq 0x2a385b(%rip), %rsi    # 0x35c38f
leaq 0x2ab38e(%rip), %rdx    # 0x363ec9
leaq 0x2a3663(%rip), %rcx    # 0x35c1a5
movq %rbp, %rdi
movl $0xa5, %r8d
movq %r13, %r9
callq 0x101dff
movq %rax, %rbp
testq %rax, %rax
setne %al
jmp 0xb8b62
xorl %ebp, %ebp
xorl %eax, %eax
testb %al, %al
je 0xb8b99
leaq 0x2a3827(%rip), %rsi    # 0x35c394
leaq 0x2ab355(%rip), %rdx    # 0x363ec9
leaq 0x2a362a(%rip), %rcx    # 0x35c1a5
movq 0x8(%rsp), %rdi
movl $0xa7, %r8d
movq %r13, %r9
callq 0x101dff
movq %rax, %r15
testq %rax, %rax
setne %al
jmp 0xb8b9e
xorl %r15d, %r15d
xorl %eax, %eax
testb %al, %al
je 0xb8bd5
leaq 0x2a37f0(%rip), %rsi    # 0x35c399
leaq 0x2ab319(%rip), %rdx    # 0x363ec9
leaq 0x2a35ee(%rip), %rcx    # 0x35c1a5
movq 0x8(%rsp), %rdi
movl $0xa9, %r8d
movq %r13, %r9
callq 0x101dff
movq %rax, %rbx
testq %rax, %rax
setne %al
jmp 0xb8bd9
xorl %ebx, %ebx
xorl %eax, %eax
testb %al, %al
movq %r13, 0x10(%rsp)
je 0xb8c06
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r15, %rcx
movq %rbx, %r8
movq %r13, %r9
callq 0x1cf79b
movq %rax, (%rsp)
testq %rax, %rax
setne %r13b
jmp 0xb8c11
movq $0x0, (%rsp)
xorl %r13d, %r13d
testq %r14, %r14
je 0xb8c1e
movq %r14, %rdi
callq 0x101e80
testq %r12, %r12
je 0xb8c2b
movq %r12, %rdi
callq 0x101e80
testq %rbp, %rbp
je 0xb8c38
movq %rbp, %rdi
callq 0x101e80
testq %r15, %r15
movq 0x18(%rsp), %r12
je 0xb8c4a
movq %r15, %rdi
callq 0x101e80
testq %rbx, %rbx
movq 0x8(%rsp), %rbp
je 0xb8c5c
movq %rbx, %rdi
callq 0x101e80
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %r13b, %r13b
movq (%rsp), %r15
je 0xb8e0e
cmpb $0x1, 0x3(%r12)
jne 0xb8c96
movq %r15, %rdi
xorl %esi, %esi
callq 0x1d06a7
cmpb $0x1, 0x6(%r12)
jne 0xb8c96
movq %r15, %rdi
movl $0x1, %esi
callq 0x1d0da3
testb %r13b, %r13b
je 0xb8e0e
cmpb $0x1, 0x4(%r12)
jne 0xb8cc6
movq %r15, %rdi
movl $0x1, %esi
callq 0x1d06a7
cmpb $0x1, 0x6(%r12)
jne 0xb8cc6
movq %r15, %rdi
xorl %esi, %esi
callq 0x1d0da3
testb %r13b, %r13b
je 0xb8e0e
cmpb $0x1, 0x5(%r12)
jne 0xb8cdf
movq %r15, %rdi
callq 0x1cf4d2
testb %r13b, %r13b
je 0xb8e0e
cmpb $0x1, 0x2(%r12)
movq 0x10(%rsp), %r12
jne 0xb8d5c
leaq 0x2a36a2(%rip), %rsi    # 0x35c39e
leaq 0x2e3d2e(%rip), %rdx    # 0x39ca31
leaq 0x2a349b(%rip), %rcx    # 0x35c1a5
movq %rbp, %rdi
movl $0xcc, %r8d
movq %r12, %r9
callq 0x101dff
movq %rax, %rbx
testq %rax, %rax
je 0xb8d42
movq %rbx, %rdi
callq 0x103c55
movq %rax, %r15
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x1cff34
movq %r15, %rdi
callq 0x103ae6
testq %rbx, %rbx
je 0xb8d4f
movq %rbx, %rdi
callq 0x101e80
testq %rbx, %rbx
movq (%rsp), %r15
je 0xb8e13
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x121e78
testq %rax, %rax
je 0xb8e94
movq %rax, %rbp
movq %r12, %r14
leaq (,%rax,8), %rdi
leaq 0x2a341d(%rip), %rsi    # 0x35c1a5
movl $0xdf, %edx
callq 0x1092b2
movq %rax, %r15
movl $0x1, %r13d
leaq 0x30c88a(%rip), %rbx    # 0x3c562c
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
leaq -0x1(%r13), %rsi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x121cfa
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
je 0xb8de8
movq %r14, %rdi
leaq 0x2a35cb(%rip), %rsi    # 0x35c3a6
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpq %rbp, %r13
jae 0xb8df9
incq %r13
addq $0x8, %r15
testl %r12d, %r12d
je 0xb8daa
testl %r12d, %r12d
je 0xb8ea1
xorl %ebx, %ebx
xorl %eax, %eax
movq %r14, %r12
jmp 0xb8ed5
movq 0x10(%rsp), %r12
testl %r14d, %r14d
jne 0xb8e66
leaq 0x2a35bb(%rip), %rsi    # 0x35c3da
leaq 0x2e3c0b(%rip), %rdx    # 0x39ca31
leaq 0x2a3378(%rip), %rcx    # 0x35c1a5
movq %rbp, %rdi
movl $0xfc, %r8d
movq %r12, %r9
callq 0x101dff
xorl %r14d, %r14d
testq %rax, %rax
sete %r14b
negl %r14d
testq %rax, %rax
je 0xb8e66
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
callq 0x1cf344
movq %rbx, %rdi
callq 0x101e80
movq %r15, %rdi
callq 0x1cfe46
movq 0x30(%rsp), %rdi
callq 0x10916a
movq 0x28(%rsp), %rdi
callq 0x10916a
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
movq 0x8(%rsp), %rbp
jmp 0xb8e13
leaq 0x2a3526(%rip), %rsi    # 0x35c3ce
leaq 0x2e3b82(%rip), %rdx    # 0x39ca31
leaq 0x2a32ef(%rip), %rcx    # 0x35c1a5
movq 0x8(%rsp), %rdi
movl $0xea, %r8d
movq %r14, %r12
movq %r14, %r9
callq 0x101dff
movq %rax, %rbx
testq %rax, %rax
setne %al
movq 0x20(%rsp), %r13
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %al, %al
je 0xb8f18
movq %rbx, %rdi
callq 0x103c55
movq %rax, %r15
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r8
movq (%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
callq 0x1d0fe4
movl %eax, %r14d
movq %r15, %rdi
callq 0x103ae6
testq %rbx, %rbx
je 0xb8f25
movq %rbx, %rdi
callq 0x101e80
leaq 0x2a3279(%rip), %rsi    # 0x35c1a5
movq %r13, %rdi
movl $0xf5, %edx
callq 0x109670
movq 0x8(%rsp), %rbp
movq (%rsp), %r15
jmp 0xb8e13
callq 0x1daf9
callq 0x1dac0
nopl (%rax)