// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/rdj-contigs-graph.c
// Function: gt_contigs_graph_show_dot_subgraph
int gt_contigs_graph_show_dot_subgraph(GtContigsGraph *cg,
    GtFile *outfp, GtUword *cnums, GtUword nofcnums,
    GtUword maxdepth, GtError *err)
{
  GtArray *stack;
  struct { GtUword v, d; } to_add, *current;
  GtUword next, cnum, i, v, d;
  GtContigsGraphSpmEdge *edge;
  unsigned int dir;

  stack = gt_array_new(sizeof (to_add));
  for (cnum = 0; cnum < cg->nof_v; cnum++)
  {
    cg->v_m[cnum].selected = false;
    cg->v_m[cnum].processed = false;
  }
  for (i = 0; i < nofcnums; i++)
  {
    cnum = cnums[i];
    if (cnum >= cg->nof_v)
    {
      gt_error_set(err, "Error by context output for contig "GT_WU": "
          "number of contigs is "GT_WU"", cnum, cg->nof_v);
      gt_array_delete(stack);
      return -1;
    }
    to_add.v = cnum;
    cg->v_m[cnum].selected = true;
    to_add.d = 1UL;
    gt_array_add(stack, to_add);
  }
  gt_file_xprintf(outfp, GT_CONTIGS_GRAPH_DOT_HEADER);
  for (next = 0; next < gt_array_size(stack); next++)
  {
    current = gt_array_get(stack, next);
    v = current->v;
    d = current->d;
    gt_contigs_graph_show_dot_for_contig(cg, v, outfp);
    cg->v_m[v].processed = true;
    to_add.d = d + 1UL;
    for (dir = 0; dir < 2U; dir++)
    {
      for (GT_CONTIGS_GRAPH_EACH_SPM_EDGE(cg, v, dir, edge))
      {
        if (cg->dot_show_deleted || !edge->deleted)
        {
          if (!cg->v_m[edge->dest].selected)
          {
            if (d < maxdepth)
            {
              to_add.v = (GtUword)edge->dest;
              gt_array_add(stack, to_add);
              cg->v_m[edge->dest].selected = true;
            }
            else
            {
              gt_file_xprintf(outfp, "  %u [style=invisible];\n", edge->dest);
            }
          }
        }
      }
    }
  }
  gt_array_delete(stack);
  gt_file_xprintf(outfp, GT_CONTIGS_GRAPH_DOT_FOOTER);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, 0x30(%rsp)
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
movl $0x10, %edi
callq 0xd214c
movq %rax, %r14
cmpq $0x0, (%r12)
je 0x1c7dc7
xorl %eax, %eax
movq 0x38(%r12), %rcx
andb $-0x5, (%rcx,%rax)
movq 0x38(%r12), %rcx
andb $-0x9, (%rcx,%rax)
incq %rax
cmpq (%r12), %rax
jb 0x1c7dac
testq %rbp, %rbp
je 0x1c7e11
xorl %ebx, %ebx
movq (%r13,%rbx,8), %rdx
movq (%r12), %rcx
cmpq %rcx, %rdx
jae 0x1c7f80
movq %rdx, 0x18(%rsp)
movq 0x38(%r12), %rax
orb $0x4, (%rax,%rdx)
movq $0x1, 0x20(%rsp)
movl $0x10, %edx
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xd2410
incq %rbx
cmpq %rbx, %rbp
jne 0x1c7dce
leaq 0x1e5568(%rip), %rsi    # 0x3ad380
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xfee51
movq %r14, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x1c7f61
xorl %ebx, %ebx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %rbx, 0x28(%rsp)
movq %rbx, %rsi
callq 0xd2207
movq (%rax), %r13
movq 0x8(%rax), %rbp
movq %r12, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
callq 0x1c6d12
movq 0x38(%r12), %rax
orb $0x8, (%rax,%r13)
leaq 0x1(%rbp), %rax
movq %rax, 0x20(%rsp)
movb $0x1, %r14b
xorl %ebx, %ebx
movq 0x18(%r12,%rbx,8), %rax
movq (%rax,%r13,8), %r15
movq 0x8(%rax,%r13,8), %rax
shrq $0x10, %r15
shrq $0x10, %rax
cmpq %rax, %r15
jae 0x1c7f2e
shlq $0x3, %r15
addq 0x80(%r12,%rbx,8), %r15
cmpb $0x0, 0xa8(%r12)
jne 0x1c7eb8
testb $0x40, 0x7(%r15)
jne 0x1c7f07
movq 0x38(%r12), %rax
movl (%r15), %edx
testb $0x4, (%rax,%rdx)
jne 0x1c7f07
cmpq 0x30(%rsp), %rbp
jae 0x1c7ef4
movq %rdx, 0x18(%rsp)
movl $0x10, %edx
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xd2410
movq 0x38(%r12), %rax
movl (%r15), %ecx
orb $0x4, (%rax,%rcx)
jmp 0x1c7f07
movq 0x8(%rsp), %rdi
leaq 0x1e5a14(%rip), %rsi    # 0x3ad914
xorl %eax, %eax
callq 0xfee51
addq $0x8, %r15
movq 0x18(%r12,%rbx,8), %rax
movq 0x8(%rax,%r13,8), %rax
shrq $0xd, %rax
andq $-0x8, %rax
addq 0x80(%r12,%rbx,8), %rax
cmpq %rax, %r15
jb 0x1c7ea6
movl $0x1, %ebx
testb $0x1, %r14b
movl $0x0, %r14d
jne 0x1c7e7b
movq 0x28(%rsp), %rbx
incq %rbx
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xd24e0
cmpq %rax, %rbx
jb 0x1c7e3c
movq %r14, %rdi
callq 0xd2938
leaq 0x1e9f61(%rip), %rsi    # 0x3b1ed1
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xfee51
xorl %eax, %eax
jmp 0x1c7f9e
leaq 0x1e594c(%rip), %rsi    # 0x3ad8d3
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
movq %r14, %rdi
callq 0xd2938
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq