// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-strgraph.c
// Function: gt_strgraph_gfa_show
static void gt_strgraph_gfa_show(const GtStrgraph *strgraph,
    const char *indexname, GtGfaVersion version, GtFile *outfp)
{
  GtUword sn1, sn2;
  GtStrgraphVnum i, v2;
  GtUword sl2, spm_len;
  GtStrgraphVEdgenum j;
  bool is_e1, is_e2;
  GtError *err;
  int had_err = 0;
  GtGfaWriter *gw = NULL;

  err = gt_error_new();
  gt_assert(strgraph->encseq != NULL);
  gw = gt_gfa_writer_new(outfp, strgraph->encseq, version);
  had_err = gt_gfa_writer_show_header(gw, (GtUword)
      strgraph->minmatchlen, indexname, false, false, err);
  if (!had_err)
    had_err = gt_gfa_writer_show_segments(gw, err);
  for (i = 0; i < GT_STRGRAPH_NOFVERTICES(strgraph) && !had_err; i++)
  {
    if (GT_STRGRAPH_V_OUTDEG(strgraph, i) > 0)
    {
      sn1 = GT_STRGRAPH_V_READNUM(i);
      is_e1 = GT_STRGRAPH_V_IS_E(i);
      for (j = 0; j < GT_STRGRAPH_V_NOFEDGES(strgraph, i) && !had_err; j++)
      {
        if (!GT_STRGRAPH_EDGE_IS_REDUCED(strgraph, i, j))
        {
          v2 = GT_STRGRAPH_EDGE_DEST(strgraph, i, j);
          sn2 = GT_STRGRAPH_V_READNUM(v2);
          sl2 = (GtUword)GT_STRGRAPH_SEQLEN(strgraph, sn2);
          spm_len = sl2 - (GtUword)GT_STRGRAPH_EDGE_LEN(strgraph, i, j);
          is_e2 = GT_STRGRAPH_V_IS_E(v2);
          if ((is_e1 && is_e2 && (sn1 >= sn2)) ||
              (!is_e1 && !is_e2 && (sn1 > sn2)) ||
              (is_e1 && !is_e2 && (sn1 >= sn2)) ||
              (!is_e1 &&  is_e2 && (sn1 > sn2)))
          {
            /* other E->B / B->E cases, as well as all B-B
               are not considered to avoid double output */
            gt_spmproc_show_gfa(sn1, sn2, spm_len, is_e1, is_e2, gw);
          }
        }
      }
    }
  }
  if (had_err)
  {
    fprintf(stderr, "%s", gt_error_get(err));
    exit(EXIT_FAILURE);
  }
  gt_gfa_writer_delete(gw);
  gt_error_delete(err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x89da4
movq (%r14), %rsi
testq %rsi, %rsi
je 0x1850bc
movq %rax, %r12
movq %r15, %rdi
movl %ebp, %edx
callq 0x15d938
movq 0x30(%r14), %rsi
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x15d98a
testl %eax, %eax
jne 0x185097
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x15da42
movl %eax, 0x2c(%rsp)
testl %eax, %eax
jne 0x185097
xorl %r15d, %r15d
pushq $-0x1
popq %rbp
movq %r12, 0x38(%rsp)
cmpq 0x80(%r14), %r15
jae 0x185070
movq 0x70(%r14), %rdi
movq %r15, %rsi
callq 0x17ffcd
testq %rax, %rax
je 0x185068
movq %r15, %rax
shrq %rax
movq %rax, 0x20(%rsp)
testb $0x1, %r15b
sete 0xf(%rsp)
leaq 0x1(%r15), %rax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movq %r15, 0x10(%rsp)
movq 0x60(%r14), %rdi
movq 0x30(%rsp), %rsi
callq 0x17ffcd
movq %rax, %rbx
movq 0x60(%r14), %rdi
movq %r15, %rsi
callq 0x17ffcd
subq %rax, %rbx
cmpq %rbx, %r12
jae 0x185059
movq 0x60(%r14), %rdi
movq 0x88(%r14), %rbx
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %rbx, %rdi
callq 0x17ffcd
movq %rax, %rbx
movq 0x90(%r14), %rdi
callq 0x28a939
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %rbx, %rax
shrq %rax
cmpq 0x90(%r14), %rax
je 0x185049
movq 0x60(%r14), %rdi
movq 0x88(%r14), %rbx
movq 0x10(%rsp), %rsi
movq %rsi, %r13
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %rbx, %rdi
callq 0x17ffcd
movq %rax, %r15
movq 0x80(%r14), %rdi
callq 0x28a939
pushq $-0x1
popq %rbx
movl %eax, %ecx
shll %cl, %ebx
notl %ebx
movq 0x90(%r14), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shll %cl, %ebx
movslq %ebx, %rbx
andq %r15, %rbx
movq 0x90(%r14), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shrq %cl, %rbx
movq %rbx, %r15
shrq %r15
movq 0x8(%r14), %rax
testq %rax, %rax
jne 0x184f86
movq (%r14), %rdi
movq %r15, %rsi
callq 0x75173
movq %rax, 0x40(%rsp)
movq 0x60(%r14), %rdi
movq 0x88(%r14), %rbp
movq %r13, %rsi
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %rbp, %rdi
callq 0x17ffcd
movq %rax, %rbp
movq 0x90(%r14), %rdi
callq 0x28a939
pushq $-0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
testb $0x1, %r13b
je 0x18500d
movl %ebx, %eax
andl $0x1, %eax
je 0x18500d
cmpq %r15, 0x20(%rsp)
jb 0x18500d
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %rax, %rbp
shrq %rbp
movq 0x40(%rsp), %rdx
subq %rbp, %rdx
andl $0x1, %ebx
movq 0x10(%rsp), %rax
movl %eax, %ecx
andl $0x1, %ecx
movq 0x20(%rsp), %rdi
movq %r15, %rsi
movl %ebx, %r8d
movq 0x18(%rsp), %r9
callq 0x15dc23
jmp 0x185049
movq 0x10(%rsp), %rax
movl %eax, %esi
orl %ebx, %esi
cmpq %r15, 0x20(%rsp)
setb %cl
seta %al
setbe %dil
orb %sil, %dil
testb $0x1, %dil
je 0x184fd4
movb 0xf(%rsp), %sil
orb %bl, %sil
orb %cl, %sil
testb $0x1, %sil
je 0x184fd4
movb 0xf(%rsp), %cl
andb %bl, %cl
andb %al, %cl
jne 0x184fd4
incq %r12
movq 0x10(%rsp), %r15
pushq $-0x1
popq %rbp
jmp 0x184e90
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %r12
jmp 0x184e49
incq %r15
jmp 0x184e49
cmpl $0x0, 0x2c(%rsp)
jne 0x185097
movq 0x18(%rsp), %rdi
callq 0x15dd7a
movq %r12, %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8a045
movq 0x2b2eca(%rip), %rax    # 0x437f68
movq (%rax), %rbx
movq %r12, %rdi
callq 0x89f41
movq %rax, %rdi
movq %rbx, %rsi
callq 0x17870
pushq $0x1
popq %rdi
callq 0x178f0
movq 0x2b2ea5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x15ff46(%rip), %rsi    # 0x2e5013
leaq 0x1ca66f(%rip), %rdx    # 0x34f743
leaq 0x1cb8ac(%rip), %rcx    # 0x350987
leaq 0x1ca693(%rip), %r8     # 0x34f775
movl $0x803, %r9d            # imm = 0x803
xorl %eax, %eax
callq 0x17a50
callq 0x17390