// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_specific_shortest_path(pdq_spec*)
uint32_t get_specific_shortest_path(pdq_spec *p)
{
    uint64_t u, i, nv, w;
    asg_arc_t *av = NULL;
    if(p->v == (uint64_t)-1)
    {
        // reset_pdq(p->pq);
        p->pq->dis.a[p->src] = 0;
        if(p->pre) p->pre[p->src] = (uint32_t)-1;
        push_pdq(p->pq, p->src, 0);
        p->occ = 0;
    }
    if(p->occ >= p->df_occ) return 0;
    
    while (pdq_cnt(*(p->pq)) > 0)
    {
        pop_pdq(p->pq, &(p->v), &w);
        p->pq->vis.a[p->v] = 1;
        if(p->dest && p->dest[p->v] == p->flag) p->occ++;
        if(p->occ > p->df_occ) return 0;

        av = asg_arc_a(p->sg, p->v);
        nv = asg_arc_n(p->sg, p->v);

        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            u = av[i].v;
            w = (uint32_t)av[i].ul;

            if(p->pq->vis.a[u] == 0 && p->pq->dis.a[u] > p->pq->dis.a[p->v] + w)
            {
                p->pq->dis.a[u] = p->pq->dis.a[p->v] + w;
                push_pdq(p->pq, u, p->pq->dis.a[u]);
                if(p->pre) p->pre[u] = p->v;
            }
        }
        if(p->dest && p->dest[p->v] == p->flag) return 1;
        if(!p->dest) return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpq $-0x1, 0x38(%rdi)
je 0x141f49
movq 0x28(%rbx), %r14
jmp 0x141f80
movq (%rbx), %rdi
movq 0x40(%rdi), %rax
movl 0x8(%rbx), %esi
movq $0x0, (%rax,%rsi,8)
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x141f6e
movl $0xffffffff, (%rax,%rsi,4) # imm = 0xFFFFFFFF
movl 0x8(%rbx), %esi
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x141a86
movq $0x0, 0x28(%rbx)
xorl %eax, %eax
cmpq 0x30(%rbx), %r14
jae 0x1420ca
leaq 0x38(%rbx), %rsi
movq %rsi, 0x8(%rsp)
movq (%rbx), %rdi
movq 0x28(%rdi), %rax
cmpq $0x0, (%rax)
je 0x1420c8
leaq 0x10(%rsp), %rdx
callq 0x141b50
movq (%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x10(%rax), %rax
movb $0x1, (%rax,%rcx)
movq 0x18(%rbx), %rcx
testq %rcx, %rcx
je 0x141fe1
movq 0x28(%rbx), %rax
movq 0x38(%rbx), %rdx
movb (%rcx,%rdx), %dl
cmpb 0x20(%rbx), %dl
jne 0x141fe5
incq %rax
movq %rax, 0x28(%rbx)
jmp 0x141fe5
movq 0x28(%rbx), %rax
cmpq 0x30(%rbx), %rax
ja 0x1420c8
movq 0x10(%rbx), %rsi
movq 0x38(%rbx), %rax
movq 0x28(%rsi), %rdx
movq (%rdx,%rax,8), %rax
movq %rax, %rdx
movq 0x10(%rsp), %rbp
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rdx
je 0x1420a2
movq 0x8(%rsi), %rcx
shrq $0x20, %rax
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %r13
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %r15
addq $0xc, %r15
xorl %r14d, %r14d
movq 0x8(%rsp), %rsi
cmpl $0x0, (%r15,%r14)
js 0x142093
movl -0xc(%r15,%r14), %ebp
movl -0x4(%r15,%r14), %r12d
movq (%rbx), %rdi
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax,%r12)
jne 0x142093
movq 0x40(%rdi), %rax
movq (%rsi), %rcx
movq (%rax,%rcx,8), %rdx
addq %rbp, %rdx
cmpq %rdx, (%rax,%r12,8)
jbe 0x142093
movq %rdx, (%rax,%r12,8)
movq %r12, %rsi
callq 0x141a86
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x14208e
movq 0x8(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, (%rax,%r12,4)
jmp 0x142093
movq 0x8(%rsp), %rsi
addq $0x18, %r14
cmpq %r14, %r13
jne 0x142039
movq 0x18(%rbx), %rcx
jmp 0x1420a7
movq 0x8(%rsp), %rsi
movq %rbp, 0x10(%rsp)
movl $0x1, %eax
testq %rcx, %rcx
je 0x1420ca
movq 0x38(%rbx), %rdx
movb (%rcx,%rdx), %cl
cmpb 0x20(%rbx), %cl
jne 0x141f95
jmp 0x1420ca
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq