// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/path.c
// Function: path_sort
void path_sort(path_v *paths)
{
    // sort by wlen -> len -> circ -> nv
    qsort(paths->a, paths->n, sizeof(path_t), pcmpfunc);

    size_t i;
    double b_ll, b_cl;
    b_ll = b_cl = .0;
    for (i = 0 ; i < paths->n; ++i) {
        if (!paths->a[i].circ && paths->a[i].wlen > b_ll)
            b_ll = paths->a[i].wlen;
        if (paths->a[i].circ && paths->a[i].wlen > b_cl)
            b_cl = paths->a[i].wlen;
    }
    if (b_cl >= b_ll)
        b_ll = DBL_MAX;
    // find best
    for (i = 0 ; i < paths->n; ++i) {
        if (!paths->a[i].circ && paths->a[i].wlen >= b_ll)
            paths->a[i].best = 1;
        if (paths->a[i].circ && paths->a[i].wlen >= b_cl)
            paths->a[i].best = 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x30, %edx
leaq 0x1f9(%rip), %rcx       # 0x8e80
callq 0x20c0
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x8d70
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x8d09
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x8d09
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x8d5d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0x8d5d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x8d5f
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x8ca4
movsd -0x20(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jb 0x8d89
movsd 0x1a714(%rip), %xmm0    # 0x23498
movsd %xmm0, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x8e6d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x8dfe
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
ucomisd -0x18(%rbp), %xmm0
jb 0x8dfe
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x8e5a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
ucomisd -0x20(%rbp), %xmm0
jb 0x8e5a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x8(%rax)
jmp 0x8e5c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x8d91
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)