// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/rdj-strgraph.c
// Function: gt_strgraph_find_connecting_path
int gt_strgraph_find_connecting_path(GtStrgraph *strgraph, GtUword from,
    GtStrgraphVtype from_vt, GtUword to, GtStrgraphVtype to_vt,
    GtUword minlen, GtUword maxlen, bool first_path_only,
    const char *indexname, const char *suffix,
    GtLogger *logger, GtError *err)
{
  int had_err = 0;

  if (from >= (GtUword)GT_STRGRAPH_NOFREADS(strgraph))
  {
    had_err = -1;
    gt_error_set(err, "Can't search path from read "GT_WU" "
        "because the readset has "FormatGtStrgraphVnum" reads", from,
        GT_STRGRAPH_NOFREADS(strgraph));
  }
  if (to >= (GtUword)GT_STRGRAPH_NOFREADS(strgraph))
  {
    had_err = -1;
    gt_error_set(err, "Can't search path from read "GT_WU" "
        "because the readset has "FormatGtStrgraphVnum" reads", to,
        GT_STRGRAPH_NOFREADS(strgraph));
  }
  if (!had_err)
  {
    GtStrgraphVnumAndDepth vd;
    GtStrgraphVEdgenum nofedges, nofedges_sum = 0;
    GtStrgraphVnum i;
    GtContigsWriter *cw;
    GtFile *outfp;
    GtStr *complete_suffix;
    bool unreachable = false;
    int found = -1;

    /* check if "to" is reachable */
    if (to_vt == GT_STRGRAPH_VTYPE_B || to_vt == GT_STRGRAPH_VTYPE_A)
    {
      nofedges = GT_STRGRAPH_V_NOFEDGES(strgraph, GT_STRGRAPH_V_B(to));
      nofedges_sum = nofedges;
      if (nofedges == 0)
      {
        gt_logger_log(logger, "Destination read has no edges from B vertex");
        if (to_vt == GT_STRGRAPH_VTYPE_B)
          unreachable = true;
      }
    }
    if (to_vt == GT_STRGRAPH_VTYPE_E || to_vt == GT_STRGRAPH_VTYPE_A)
    {
      nofedges = GT_STRGRAPH_V_NOFEDGES(strgraph, GT_STRGRAPH_V_E(to));
      nofedges_sum += nofedges;
      if (nofedges == 0)
      {
        gt_logger_log(logger, "Destination read has no edges from E vertex");
        if (to_vt == GT_STRGRAPH_VTYPE_E || nofedges_sum == 0)
          unreachable = true;
      }
    }
    if (unreachable)
    {
      gt_logger_log(logger, "Destination read unreachable");
      return 0;
    }

    gt_assert(strgraph->encseq != NULL);
    gt_assert(gt_encseq_is_mirrored(strgraph->encseq));
    complete_suffix = gt_str_new();
    gt_str_append_char(complete_suffix, '.');
    gt_str_append_uword(complete_suffix, from);
    gt_str_append_char(complete_suffix, '.');
    gt_str_append_uword(complete_suffix, to);
    gt_str_append_cstr(complete_suffix, suffix);
    outfp = gt_strgraph_get_file(indexname, gt_str_get(complete_suffix),
        true, false);
    gt_logger_log(logger, "Connecting paths output filename: %s%s", indexname,
        gt_str_get(complete_suffix));
    cw = gt_contigs_writer_new(strgraph->encseq, outfp);
    gt_contigs_writer_enable_complete_path_output(cw);

    /* reset vertex marks */
    for (i = 0; i < GT_STRGRAPH_NOFVERTICES(strgraph); i++)
      GT_STRGRAPH_V_SET_MARK(strgraph, i, GT_STRGRAPH_V_VACANT);

    vd.d = GT_STRGRAPH_SEQLEN(strgraph, from);

    /* disallow returning to origin read in any orientation
       (however, from == to should still work) */
    GT_STRGRAPH_V_SET_MARK(strgraph, GT_STRGRAPH_V_B(from),
        GT_STRGRAPH_V_MARKED);
    GT_STRGRAPH_V_SET_MARK(strgraph, GT_STRGRAPH_V_E(from),
        GT_STRGRAPH_V_MARKED);

    /* search path from B vertex */
    if (from_vt == GT_STRGRAPH_VTYPE_B || from_vt == GT_STRGRAPH_VTYPE_A)
    {
      vd.v = GT_STRGRAPH_V_B(from);
      nofedges = GT_STRGRAPH_V_NOFEDGES(strgraph, vd.v);
      if (nofedges == 0)
        gt_logger_log(logger, "Origin read has no edges from B vertex");
      else
      {
        gt_logger_log(logger, "Computing paths starting from B vertex...");
        found = gt_strgraph_find_connecting_path_from_vertex(strgraph, vd,
            nofedges, to, to_vt, minlen, maxlen, first_path_only, cw, logger);
      }
    }

    if ((from_vt == GT_STRGRAPH_VTYPE_E || from_vt == GT_STRGRAPH_VTYPE_A) &&
        ((found != 0) || !first_path_only))
    {
      /* search path from E vertex */
      vd.v = GT_STRGRAPH_V_E(from);
      nofedges = GT_STRGRAPH_V_NOFEDGES(strgraph, vd.v);
      if (nofedges == 0)
        gt_logger_log(logger, "Origin read has no edges from E vertex");
      else
      {
        gt_logger_log(logger, "Computing paths starting from E vertex...");
        gt_strgraph_find_connecting_path_from_vertex(strgraph, vd, nofedges,
            to, to_vt, minlen, maxlen, first_path_only, cw, logger);
      }
    }
    gt_str_delete(complete_suffix);
    gt_contigs_writer_delete(cw);
    gt_file_delete(outfp);
  }
  return had_err;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq 0x138(%rsp), %rax
movq 0x130(%rsp), %rax
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rax
movb 0x118(%rsp), %al
movq 0x110(%rsp), %r10
movq %rdi, 0xe8(%rsp)
movq %rsi, 0xe0(%rsp)
movl %edx, 0xdc(%rsp)
movq %rcx, 0xd0(%rsp)
movl %r8d, 0xcc(%rsp)
movq %r9, 0xc0(%rsp)
andb $0x1, %al
movb %al, 0xbf(%rsp)
movl $0x0, 0xb8(%rsp)
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rcx
movq 0x80(%rcx), %rcx
shrq %rcx
cmpq %rcx, %rax
jb 0x2974e6
movl $0xffffffff, 0xb8(%rsp) # imm = 0xFFFFFFFF
movq 0x138(%rsp), %rdi
movq 0xe0(%rsp), %rdx
movq 0xe8(%rsp), %rax
movq 0x80(%rax), %rcx
shrq %rcx
leaq 0x2eb2f2(%rip), %rsi    # 0x5827d1
movb $0x0, %al
callq 0xd88c0
movq 0xd0(%rsp), %rax
movq 0xe8(%rsp), %rcx
movq 0x80(%rcx), %rcx
shrq %rcx
cmpq %rcx, %rax
jb 0x297540
movl $0xffffffff, 0xb8(%rsp) # imm = 0xFFFFFFFF
movq 0x138(%rsp), %rdi
movq 0xd0(%rsp), %rdx
movq 0xe8(%rsp), %rax
movq 0x80(%rax), %rcx
shrq %rcx
leaq 0x2eb298(%rip), %rsi    # 0x5827d1
movb $0x0, %al
callq 0xd88c0
cmpl $0x0, 0xb8(%rsp)
jne 0x297c39
movq $0x0, 0x98(%rsp)
movb $0x0, 0x77(%rsp)
movl $0xffffffff, 0x70(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0xcc(%rsp)
je 0x29757f
cmpl $0x2, 0xcc(%rsp)
jne 0x297617
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xd0(%rsp), %rsi
shlq %rsi
addq $0x1, %rsi
callq 0x290730
movq %rax, 0x68(%rsp)
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xd0(%rsp), %rsi
shlq %rsi
callq 0x290730
movq %rax, %rcx
movq 0x68(%rsp), %rax
subq %rcx, %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x297615
movq 0x130(%rsp), %rdi
leaq 0x2eb216(%rip), %rsi    # 0x582813
movb $0x0, %al
callq 0xe7cd0
cmpl $0x0, 0xcc(%rsp)
jne 0x297613
movb $0x1, 0x77(%rsp)
jmp 0x297615
jmp 0x297617
cmpl $0x1, 0xcc(%rsp)
je 0x29762f
cmpl $0x2, 0xcc(%rsp)
jne 0x2976e2
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xd0(%rsp), %rsi
shlq %rsi
addq $0x1, %rsi
addq $0x1, %rsi
callq 0x290730
movq %rax, 0x60(%rsp)
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xd0(%rsp), %rsi
shlq %rsi
addq $0x1, %rsi
callq 0x290730
movq %rax, %rcx
movq 0x60(%rsp), %rax
subq %rcx, %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq 0x98(%rsp), %rax
movq %rax, 0x98(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x2976e0
movq 0x130(%rsp), %rdi
leaq 0x2eb182(%rip), %rsi    # 0x58283f
movb $0x0, %al
callq 0xe7cd0
cmpl $0x1, 0xcc(%rsp)
je 0x2976d9
cmpq $0x0, 0x98(%rsp)
jne 0x2976de
movb $0x1, 0x77(%rsp)
jmp 0x2976e0
jmp 0x2976e2
testb $0x1, 0x77(%rsp)
je 0x29770f
movq 0x130(%rsp), %rdi
leaq 0x2eb173(%rip), %rsi    # 0x58286b
movb $0x0, %al
callq 0xe7cd0
movl $0x0, 0xf4(%rsp)
jmp 0x297c47
jmp 0x297711
movq 0xe8(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x297757
movq 0x3a487a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x27e8e3(%rip), %rsi    # 0x516013
leaq 0x2ea8d7(%rip), %rdx    # 0x58200e
leaq 0x2eb14a(%rip), %rcx    # 0x582888
leaq 0x2ea8fb(%rip), %r8     # 0x582040
movl $0x735, %r9d            # imm = 0x735
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x297759
jmp 0x29775b
movq 0xe8(%rsp), %rax
movq (%rax), %rdi
callq 0xc2ec0
testb $0x1, %al
jne 0x2977a7
movq 0x3a482a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x27e893(%rip), %rsi    # 0x516013
leaq 0x2eb122(%rip), %rdx    # 0x5828a9
leaq 0x2eb0fa(%rip), %rcx    # 0x582888
leaq 0x2ea8ab(%rip), %r8     # 0x582040
movl $0x736, %r9d            # imm = 0x736
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2977a9
callq 0x11d4a0
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
movl $0x2e, %esi
callq 0x11da70
movq 0x78(%rsp), %rdi
movq 0xe0(%rsp), %rsi
callq 0x11d930
movq 0x78(%rsp), %rdi
movl $0x2e, %esi
callq 0x11da70
movq 0x78(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x11d930
movq 0x78(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0x11d550
movq 0x120(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x78(%rsp), %rdi
callq 0x11dee0
movq 0x48(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2909a0
movq %rax, 0x80(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x78(%rsp), %rdi
callq 0x11dee0
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rdx
movq %rax, %rcx
leaq 0x2eb05f(%rip), %rsi    # 0x5828d1
movb $0x0, %al
callq 0xe7cd0
movq 0xe8(%rsp), %rax
movq (%rax), %rdi
movq 0x80(%rsp), %rsi
callq 0x281a00
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
callq 0x281bd0
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq 0xe8(%rsp), %rcx
cmpq 0x80(%rcx), %rax
jae 0x2978fe
movq 0xe8(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0x90(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2907d0
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x2978b2
movq 0xe8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0x297920
movq 0xe8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x29793d
movq 0xe8(%rsp), %rax
movq (%rax), %rdi
movq 0xe0(%rsp), %rsi
callq 0xb09f0
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xe8(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0xe0(%rsp), %rsi
shlq %rsi
movl $0x3, %edx
callq 0x2907d0
movq 0xe8(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0xe0(%rsp), %rsi
shlq %rsi
addq $0x1, %rsi
movl $0x3, %edx
callq 0x2907d0
cmpl $0x0, 0xdc(%rsp)
je 0x2979a8
cmpl $0x2, 0xdc(%rsp)
jne 0x297ac8
movq 0xe0(%rsp), %rax
shlq %rax
movq %rax, 0xa8(%rsp)
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xa8(%rsp), %rsi
addq $0x1, %rsi
callq 0x290730
movq %rax, 0x38(%rsp)
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xa8(%rsp), %rsi
callq 0x290730
movq %rax, %rcx
movq 0x38(%rsp), %rax
subq %rcx, %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x297a2f
movq 0x130(%rsp), %rdi
leaq 0x2eaed5(%rip), %rsi    # 0x5828f8
movb $0x0, %al
callq 0xe7cd0
jmp 0x297ac6
movq 0x130(%rsp), %rdi
leaq 0x2eaee1(%rip), %rsi    # 0x58291f
movb $0x0, %al
callq 0xe7cd0
movq 0xe8(%rsp), %rdi
movq 0xa0(%rsp), %rcx
movq 0xd0(%rsp), %r8
movl 0xcc(%rsp), %r9d
movq 0xc0(%rsp), %r14
movq 0x110(%rsp), %rbx
movb 0xbf(%rsp), %r11b
movq 0x88(%rsp), %r10
movq 0x130(%rsp), %rax
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
andb $0x1, %r11b
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movzbl %r11b, %r11d
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x297c60
movl %eax, 0x70(%rsp)
jmp 0x297ac8
cmpl $0x1, 0xdc(%rsp)
je 0x297ae0
cmpl $0x2, 0xdc(%rsp)
jne 0x297c15
cmpl $0x0, 0x70(%rsp)
jne 0x297af5
testb $0x1, 0xbf(%rsp)
jne 0x297c15
movq 0xe0(%rsp), %rax
shlq %rax
addq $0x1, %rax
movq %rax, 0xa8(%rsp)
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xa8(%rsp), %rsi
addq $0x1, %rsi
callq 0x290730
movq %rax, 0x30(%rsp)
movq 0xe8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xa8(%rsp), %rsi
callq 0x290730
movq %rax, %rcx
movq 0x30(%rsp), %rax
subq %rcx, %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x297b80
movq 0x130(%rsp), %rdi
leaq 0x2eadd5(%rip), %rsi    # 0x582949
movb $0x0, %al
callq 0xe7cd0
jmp 0x297c13
movq 0x130(%rsp), %rdi
leaq 0x2eade1(%rip), %rsi    # 0x582970
movb $0x0, %al
callq 0xe7cd0
movq 0xe8(%rsp), %rdi
movq 0xa0(%rsp), %rcx
movq 0xd0(%rsp), %r8
movl 0xcc(%rsp), %r9d
movq 0xc0(%rsp), %r14
movq 0x110(%rsp), %rbx
movb 0xbf(%rsp), %r11b
movq 0x88(%rsp), %r10
movq 0x130(%rsp), %rax
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
andb $0x1, %r11b
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movzbl %r11b, %r11d
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x297c60
jmp 0x297c15
movq 0x78(%rsp), %rdi
callq 0x11f560
movq 0x88(%rsp), %rdi
callq 0x281cf0
movq 0x80(%rsp), %rdi
callq 0xde430
movl 0xb8(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)