// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-strgraph.c
// Function: gt_strgraph_add_edge_to_connecting_path
static int gt_strgraph_add_edge_to_connecting_path(GtStrgraph *strgraph,
    GtStrgraphVnum from, GtStrgraphVEdgenum j, GtUword goal_sn,
    GtStrgraphVtype goal_vt, GtUword current_length, GtUword minlen,
    GtUword maxlen, GtArray *path, bool first_path_only,
    GtUword *count_too_long, GtUword *count_too_short, GtUword *count_found,
    GtUword *count_circular, GtUword *count_redundant, GtContigsWriter *cw,
    GtLogger *logger)
{
  GtStrgraphVnumAndDepth wl;
  GtStrgraphVEdgenum e;
  wl.v = GT_STRGRAPH_EDGE_DEST(strgraph, from, j);
  wl.d = GT_STRGRAPH_EDGE_LEN(strgraph, from, j);
  current_length += wl.d;
  if (current_length > maxlen)
  {
    (*count_too_long)++;
    return -1;
  }
  if ((GT_STRGRAPH_V_READNUM(wl.v) == goal_sn) &&
      ((goal_vt == GT_STRGRAPH_VTYPE_A) ||
       ((goal_vt == GT_STRGRAPH_VTYPE_E) && GT_STRGRAPH_V_IS_E(wl.v)) ||
       ((goal_vt == GT_STRGRAPH_VTYPE_B) && GT_STRGRAPH_V_IS_B(wl.v))))
  {
    if (current_length <= minlen)
    {
      (*count_too_short)++;
      return -1;
    }
    else
    {
      (*count_found)++;
      gt_array_add(path, wl);
      gt_logger_log(logger, "Path found, length: "GT_WU, current_length);
      gt_strgraph_output_connecting_path(strgraph, path, cw);
      gt_array_pop(path);
      return 0;
    }
  }
  if (GT_STRGRAPH_V_MARK(strgraph, wl.v) == GT_STRGRAPH_V_MARKED)
  {
    (*count_circular)++;
    return -1;
  }
  else if (GT_STRGRAPH_V_MARK(strgraph, wl.v) == GT_STRGRAPH_V_INPLAY)
  {
    (*count_redundant)++;
    return -1;
  }
  else
  {
    int found = -1;
    GT_STRGRAPH_V_SET_MARK(strgraph, wl.v, GT_STRGRAPH_V_MARKED);
    for (e = 0; e < GT_STRGRAPH_V_NOFEDGES(strgraph, wl.v); e++)
    {
      if (!GT_STRGRAPH_EDGE_IS_REDUCED(strgraph, wl.v, e))
      {
        int retcode;
        gt_array_add(path, wl);
        retcode = gt_strgraph_add_edge_to_connecting_path(strgraph, wl.v, e,
            goal_sn, goal_vt, current_length, minlen, maxlen, path,
            first_path_only, count_too_long, count_too_short, count_found,
            count_circular, count_redundant, cw, logger);
        gt_array_pop(path);
        if (retcode == 0)
        {
          if (first_path_only)
            return retcode;
          found = retcode;
        }
      }
    }
    GT_STRGRAPH_V_SET_MARK(strgraph, wl.v, GT_STRGRAPH_V_INPLAY);
    return found;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movl %r8d, 0x4(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
movq 0x88(%rbx), %r14
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %r14, %rdi
callq 0x17ffcd
movq %rax, %rbp
movq 0x80(%rbx), %rdi
callq 0x28a939
pushq $-0x1
popq %r15
movl %r15d, %r14d
movl %eax, %ecx
shll %cl, %r14d
notl %r14d
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shll %cl, %r14d
movslq %r14d, %r14
andq %rbp, %r14
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shrq %cl, %r14
movq %r14, 0x8(%rsp)
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %rbp
movq %r13, %rsi
callq 0x17ffcd
addq %rax, %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x17ffcd
movq %rax, %r12
movq 0x90(%rbx), %rdi
callq 0x28a939
movl %eax, %ecx
shll %cl, %r15d
notl %r15d
addl %r15d, %r15d
movslq %r15d, %r13
andq %r12, %r13
shrq %r13
movq %r13, 0x10(%rsp)
addq 0x18(%rsp), %r13
cmpq 0x68(%rsp), %r13
jbe 0x18747f
movq 0x80(%rsp), %rax
incq (%rax)
jmp 0x187578
movq 0x70(%rsp), %rbp
movq %r14, %rax
shrq %rax
movq 0x20(%rsp), %rcx
cmpq %rcx, %rax
movl 0x4(%rsp), %eax
jne 0x187542
testl %eax, %eax
je 0x187538
cmpl $0x2, %eax
je 0x1874bc
cmpl $0x1, %eax
jne 0x187542
testb $0x1, %r14b
je 0x187542
cmpq 0x60(%rsp), %r13
jbe 0x18752b
movq 0x90(%rsp), %rax
incq (%rax)
leaq 0x8(%rsp), %rsi
pushq $0x10
popq %rdx
movq %rbp, %rdi
callq 0x5851d
leaq 0x1c93eb(%rip), %rsi    # 0x3508d0
movq 0xb0(%rsp), %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x92e71
movq %rbp, %rdi
callq 0x586a4
movq %rax, %r14
movq %rbp, %rdi
xorl %esi, %esi
callq 0x581aa
movq (%rax), %rsi
testb $0x1, %sil
jne 0x1876f3
shrq %rsi
notq %rsi
addq 0x80(%rbx), %rsi
jmp 0x1876f6
movq 0x88(%rsp), %rax
jmp 0x187477
testb $0x1, %r14b
je 0x1874bc
movq 0x98(%rsp), %r12
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x17ffcd
cmpl $0x3, %eax
je 0x187574
movq 0xa0(%rsp), %r12
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x17ffcd
cmpl $0x1, %eax
jne 0x18758e
incq (%r12)
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb 0x78(%rsp), %r15b
movq 0x58(%rbx), %rdi
pushq $0x3
popq %rdx
movq %r14, %rsi
callq 0x180026
xorl %ebp, %ebp
movzbl %r15b, %eax
movq %rax, 0x18(%rsp)
pushq $-0x1
popq %r12
movq 0x18(%rsp), %r15
movq 0x60(%rbx), %rdi
incq %r14
movq %r14, %rsi
callq 0x17ffcd
movq %rax, %r14
movq 0x60(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0x17ffcd
subq %rax, %r14
cmpq %r14, %rbp
jae 0x1876dd
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %r14
movq 0x8(%rsp), %rsi
callq 0x17ffcd
leaq (%rax,%rbp), %rsi
movq %r14, %rdi
callq 0x17ffcd
movq %rax, %r14
movq 0x90(%rbx), %rdi
callq 0x28a939
pushq $-0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %r14, %rax
shrq %rax
cmpq 0x90(%rbx), %rax
je 0x1876d0
movq 0x70(%rsp), %rdi
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x5851d
movq 0x8(%rsp), %rsi
subq $0x8, %rsp
movq %rbx, %rdi
movq %rbp, %rdx
movq 0x28(%rsp), %rcx
movl 0xc(%rsp), %r8d
movq %r13, %r9
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
pushq %r15
pushq %r14
pushq 0xb8(%rsp)
pushq 0xb8(%rsp)
callq 0x18738b
addq $0x60, %rsp
movl %eax, %r14d
movq 0x70(%rsp), %rdi
callq 0x58247
testl %r14d, %r14d
sete %al
cmovel %r14d, %r12d
testb %r15b, %al
jne 0x187756
incq %rbp
movq 0x8(%rsp), %r14
jmp 0x1875b6
movq 0x58(%rbx), %rdi
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x180026
jmp 0x18757c
shrq %rsi
movq 0xa8(%rsp), %r15
movq %r15, %rdi
callq 0x178e88
pushq $0x1
popq %r12
cmpq %r14, %r12
jae 0x187746
movq %rbp, %rdi
movq %r12, %rsi
callq 0x581aa
movq (%rax), %rsi
testb $0x1, %sil
jne 0x187732
shrq %rsi
notq %rsi
addq 0x80(%rbx), %rsi
jmp 0x187735
shrq %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x178c88
incq %r12
jmp 0x18770a
movq %r15, %rdi
callq 0x17899d
movq %rbp, %rdi
callq 0x58247
xorl %r12d, %r12d
jmp 0x18757c