// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movb %r9b, %al
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movl %r8d, 0x24(%rsp)
andb $0x1, %al
movb %al, 0x23(%rsp)
movb $0x0, 0x22(%rsp)
movq 0x30(%rsp), %rax
movl 0x24(%rsp), %ecx
movq 0x18(%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x1, %rax
je 0x27fd06
movq 0x3bc2cb(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x296334(%rip), %rsi    # 0x516013
leaq 0x30039e(%rip), %rdx    # 0x580084
leaq 0x3003c4(%rip), %rcx    # 0x5800b1
leaq 0x30003d(%rip), %r8     # 0x57fd31
movl $0x353, %r9d            # imm = 0x353
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27fd08
movq 0x28(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movl 0x24(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x40(%rsp), %rax
movl $0x0, 0x1c(%rax)
movq 0x40(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rsi
movl 0x24(%rsp), %edx
leaq 0x300386(%rip), %rdi    # 0x5800d0
movb $0x0, %al
callq 0xe7740
movq 0x38(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0x27fd60
jmp 0x27fd62
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x38(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x27fe0d
movq $0x100, 0x8(%rsp)       # imm = 0x100
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
jbe 0x27fdc8
movq 0x3bc209(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x296272(%rip), %rsi    # 0x516013
leaq 0x2993ff(%rip), %rdx    # 0x5191a7
leaq 0x300302(%rip), %rcx    # 0x5800b1
leaq 0x2fff7b(%rip), %r8     # 0x57fd31
movl $0x35e, %r9d            # imm = 0x35E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27fdca
movq 0x8(%rsp), %rcx
movq 0x38(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rax
movq (%rax), %rdi
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rsi
shlq $0x4, %rsi
leaq 0x2fff39(%rip), %rdx    # 0x57fd31
movl $0x35e, %ecx            # imm = 0x35E
callq 0xe8540
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
jmp 0x27fe0f
movq 0x38(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x27fe52
movq 0x3bc17f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2961e8(%rip), %rsi    # 0x516013
leaq 0x3002c3(%rip), %rdx    # 0x5800f5
leaq 0x300278(%rip), %rcx    # 0x5800b1
leaq 0x2ffef1(%rip), %r8     # 0x57fd31
movl $0x35e, %r9d            # imm = 0x35E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27fe54
jmp 0x27fe56
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
cmpl $0x1, 0x24(%rsp)
jne 0x27fe95
movq 0x40(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
movq 0x40(%rsp), %rax
movl 0x18(%rax), %edx
callq 0x27ed40
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, %ecx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movb 0x22(%rsp), %cl
movq 0x10(%rsp), %rax
andb $0x1, %cl
movb %cl, 0xc(%rax)
cmpl $0x0, 0x24(%rsp)
jne 0x27ff1d
movq 0x40(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movl 0x18(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x40(%rsp), %rax
cmpl $0x0, 0x18(%rax)
setne %al
andb $0x1, %al
movzbl %al, %edx
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
shrl $0x1d, %eax
andl $0x1, %eax
andb $0x1, %al
movzbl %al, %esi
movl $0x1, %ecx
xorl %eax, %eax
cmpl %esi, %edx
cmovel %eax, %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x18(%rax)
cmpl $0x1, 0x24(%rsp)
jne 0x27ff79
movq 0x40(%rsp), %rax
movl 0x18(%rax), %edx
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovel %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rax
cmpq 0x28(%rsp), %rax
je 0x27ffa5
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movb (%rax,%rcx), %al
shrb $0x4, %al
andb $0x1, %al
testb $0x1, %al
je 0x27ffb6
movq 0x40(%rsp), %rax
movl $0x3, 0x1c(%rax)
jmp 0x28004a
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movl 0x18(%rcx), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movl %ecx, %ecx
movq 0x18(%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x1, %rax
je 0x27ffff
movb $0x1, 0x22(%rsp)
testb $0x1, 0x23(%rsp)
je 0x27fffd
jmp 0x28004a
jmp 0x27ffff
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movb (%rax,%rcx), %dl
andb $-0x11, %dl
orb $0x10, %dl
movb %dl, (%rax,%rcx)
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movl 0x18(%rcx), %ecx
movq 0x18(%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x1, %rax
je 0x27fd5e
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movl 0x18(%rcx), %ecx
movq 0x18(%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpl $0x0, %eax
jne 0x280144
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movl 0x18(%rcx), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movl %ecx, %ecx
movq 0x18(%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x1, %rax
jne 0x2800c1
movq 0x40(%rsp), %rax
movl $0x1, 0x1c(%rax)
jmp 0x280142
jmp 0x2800c3
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movl 0x18(%rcx), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movl %ecx, %ecx
movq 0x18(%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x1, %rax
ja 0x280134
movq 0x3bbe9d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x295f06(%rip), %rsi    # 0x516013
leaq 0x30000d(%rip), %rdx    # 0x580121
leaq 0x2fff96(%rip), %rcx    # 0x5800b1
leaq 0x2ffc0f(%rip), %r8     # 0x57fd31
movl $0x384, %r9d            # imm = 0x384
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x280136
movq 0x40(%rsp), %rax
movl $0x2, 0x1c(%rax)
jmp 0x280144
movq 0x40(%rsp), %rax
movl 0x18(%rax), %edx
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovel %eax, %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x18(%rax)
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)