// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-contigs-graph.c
// Function: gt_contigs_graph_find_path_end
void gt_contigs_graph_find_path_end(GtContigsGraphPathEndInfo *info,
    GtArrayGtContigsGraphPathElem *path, GtContigsGraph *cg,
    GtUword cnum, unsigned int incoming, bool use_only_internal)
{
  bool extended = false;
  gt_assert(cg->v_spm[incoming][cnum].deg == (uint64_t)1);
  info->cnum = cnum;
  info->dir = incoming;
  info->t = GT_CONTIGS_GRAPH_JUNCTION;
  info->depth = 0;
  gt_log_log("find_path_end(cnum="GT_WU", incoming=%u)", cnum, incoming);
  path->nextfreeGtContigsGraphPathElem = 0;
  do {
    GtContigsGraphSpmEdge *edge;
    GtContigsGraphPathElem *elem;
    GT_GETNEXTFREEINARRAY(elem, path, GtContigsGraphPathElem,
      GT_CONTIGS_GRAPH_PATHELEM_INC);
    if (incoming == 1U)
      elem->dest = info->cnum;
    edge = gt_contigs_graph_find_only_spm_edge(cg, info->cnum, info->dir);
    info->depth++;
    info->dest = info->cnum;
    info->cnum = (GtUword)edge->dest;
    elem->extended = extended;
    if (incoming == 0)
    {
      elem->dest = info->cnum;
      elem->dir = info->dir;
    }
    info->dir = GT_CONTIGS_GRAPH_VALID_PATH_DIR(info->dir, edge->reverse);
    if (incoming == 1U)
      elem->dir = GT_CONTIGS_GRAPH_OTHER_DIR(info->dir);
    if (info->cnum == cnum || cg->v_m[info->cnum].visited)
    {
      info->t = GT_CONTIGS_GRAPH_CIRCULAR;
      break;
    }
    if (cg->v_spm[GT_CONTIGS_GRAPH_OTHER_DIR(info->dir)][
        info->cnum].deg != (uint64_t)1)
    {
      extended = true;
      if (use_only_internal)
        break;
    }
    cg->v_m[info->cnum].visited = true;
  } while (cg->v_spm[info->dir][info->cnum].deg == (uint64_t)1);
  if (cg->v_spm[info->dir][info->cnum].deg == 0)
  {
    if (cg->v_spm[GT_CONTIGS_GRAPH_OTHER_DIR(info->dir)][
        info->cnum].deg == (uint64_t)1)
      info->t = GT_CONTIGS_GRAPH_SINGLE_END;
    else
    {
      gt_assert(cg->v_spm[GT_CONTIGS_GRAPH_OTHER_DIR(info->dir)][
          info->cnum].deg > (uint64_t)1);
      info->t = GT_CONTIGS_GRAPH_MULTIPLE_END;
    }
  }
  info->dir = GT_CONTIGS_GRAPH_OTHER_DIR(info->dir);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, %eax
movq 0x18(%rdx,%rax,8), %rax
cmpw $0x1, (%rax,%rcx,8)
jne 0x177d2d
movl %r8d, %r15d
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq %rcx, (%rdi)
movl %r8d, 0x18(%rdi)
andl $0x0, 0x1c(%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x1d5dbe(%rip), %rdi    # 0x34d930
xorl %r12d, %r12d
movq %rcx, %rsi
movl %r8d, %edx
xorl %eax, %eax
callq 0x92a82
andq $0x0, 0x10(%r13)
movq %rbp, 0x10(%rsp)
movq 0x8(%r13), %rsi
cmpq %rsi, 0x10(%r13)
jae 0x177b9c
movq (%r13), %rbp
jmp 0x177bc7
addq $0x100, %rsi            # imm = 0x100
movq %rsi, 0x8(%r13)
movq (%r13), %rdi
shlq $0x4, %rsi
leaq 0x1d59db(%rip), %rdx    # 0x34d591
movl $0x35e, %ecx            # imm = 0x35E
callq 0x93472
movq %rax, %rbp
movq %rax, (%r13)
testq %rbp, %rbp
je 0x177cf5
movq 0x10(%r13), %rax
leaq 0x1(%rax), %rcx
shlq $0x4, %rax
addq %rax, %rbp
movq %rcx, 0x10(%r13)
movq (%rbx), %rsi
cmpl $0x1, %r15d
jne 0x177bf0
movq %rsi, (%rbp)
movl 0x18(%rbx), %edx
movq %r14, %rdi
callq 0x1773b5
incq 0x10(%rbx)
movl %r12d, %edx
andb $0x1, %dl
movq (%rbx), %rcx
movq %rcx, 0x8(%rbx)
movl (%rax), %ecx
movq %rcx, (%rbx)
movb %dl, 0xc(%rbp)
movl 0x18(%rbx), %edx
testl %r15d, %r15d
jne 0x177c23
movq %rcx, (%rbp)
movl %edx, 0x8(%rbp)
testl %edx, %edx
setne %dl
btl $0x1d, 0x4(%rax)
setae %al
xorb %dl, %al
movzbl %al, %esi
xorb $0x1, %al
movzbl %al, %eax
movl %eax, 0x18(%rbx)
cmpl $0x1, %r15d
jne 0x177c46
movl %esi, 0x8(%rbp)
movq 0x10(%rsp), %rbp
cmpq %rbp, %rcx
je 0x177ca4
movq 0x38(%r14), %rdx
movb (%rdx,%rcx), %dil
testb $0x10, %dil
jne 0x177ca4
movq 0x18(%r14,%rsi,8), %rsi
movzwl (%rsi,%rcx,8), %esi
cmpq $0x1, %rsi
setne %r8b
testb %r8b, 0xc(%rsp)
jne 0x177cab
cmpl $0x1, %esi
movzbl %r12b, %r12d
pushq $0x1
popq %rax
cmovnel %eax, %r12d
orb $0x10, %dil
movb %dil, (%rdx,%rcx)
movl 0x18(%rbx), %eax
movq 0x18(%r14,%rax,8), %rdx
movq (%rbx), %rcx
cmpw $0x1, (%rdx,%rcx,8)
je 0x177b8c
jmp 0x177cab
movl $0x3, 0x1c(%rbx)
movl %eax, %edx
movq 0x18(%r14,%rdx,8), %rdx
cmpw $0x0, (%rdx,%rcx,8)
jne 0x177cdc
xorl %edx, %edx
testl %eax, %eax
sete %dl
movq 0x18(%r14,%rdx,8), %rdx
movzwl (%rdx,%rcx,8), %ecx
cmpl $0x1, %ecx
je 0x177cd9
testl %ecx, %ecx
je 0x177d5b
pushq $0x2
popq %rcx
movl %ecx, 0x1c(%rbx)
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2c026c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16d30d(%rip), %rsi    # 0x2e5013
leaq 0x1d5c48(%rip), %rdx    # 0x34d955
leaq 0x1d5bfd(%rip), %rcx    # 0x34d911
leaq 0x1d5876(%rip), %r8     # 0x34d591
movl $0x35e, %r9d            # imm = 0x35E
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2c0234(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16d2d5(%rip), %rsi    # 0x2e5013
leaq 0x1d5b9f(%rip), %rdx    # 0x34d8e4
leaq 0x1d5bc5(%rip), %rcx    # 0x34d911
leaq 0x1d583e(%rip), %r8     # 0x34d591
movl $0x353, %r9d            # imm = 0x353
jmp 0x177d21
movq 0x2c0206(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16d2a7(%rip), %rsi    # 0x2e5013
leaq 0x1d5c0e(%rip), %rdx    # 0x34d981
leaq 0x1d5b97(%rip), %rcx    # 0x34d911
leaq 0x1d5810(%rip), %r8     # 0x34d591
movl $0x384, %r9d            # imm = 0x384
jmp 0x177d21