// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/path.c
// Function: path_stats
void path_stats(asg_t *asg, path_v *paths, FILE *fo)
{
    uint32_t i, j, n;
    int nd_i, nd_n, nd_l, nd_w;
    uint64_t max_l;
    double max_wl;
    path_t path;

    nd_n = 0;
    max_l = 0;
    max_wl = .0;
    for (i = 0; i < paths->n; ++i) {
        if (paths->a[i].nv > nd_n)
            nd_n = paths->a[i].nv;
        if (paths->a[i].len > max_l)
            max_l = paths->a[i].len;
        if (paths->a[i].wlen > max_wl)
            max_wl = paths->a[i].wlen;
    }
    nd_i = floor(log10(fabs(paths->n))) + 1;
    nd_n = floor(log10(fabs(nd_n))) + 1;
    nd_l = floor(log10(fabs(max_l))) + 1;
    nd_w = floor(log10(fabs(max_wl))) + 3;

    for (i = 0; i < paths->n; ++i) {
        path = paths->a[i];
        n = path.nv;
        fprintf(fo, "%c %-*u %s %-*u %-*u %-*.1f %.3f %s%c", path.best? '*' : '#', nd_i, i, path.circ? "circle" : "linear",
                nd_n, n, nd_l, path.len, nd_w, path.wlen, path.srcc, asg->seg[path.v[0]>>1].name, "+-"[path.v[0]&1]);
        for (j = 1; j < n; ++j)
            fprintf(fo, ",%s%c", asg->seg[path.v[j]>>1].name, "+-"[path.v[j]&1]);
        fprintf(fo, "\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x9da6
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
cmpl -0x4c(%rbp), %eax
jle 0x9d28
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
cmpq -0x60(%rbp), %rax
jbe 0x9d5c
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0x9d96
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x9d98
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x9cdc
movq -0x30(%rbp), %rax
movq (%rax), %xmm0
movaps 0x197bb(%rip), %xmm1    # 0x23570
movaps %xmm1, -0xc0(%rbp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x197b8(%rip), %xmm1    # 0x23580
movaps %xmm1, -0xb0(%rbp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movapd 0x1977a(%rip), %xmm1    # 0x23560
movaps %xmm1, -0xe0(%rbp)
pand %xmm1, %xmm0
callq 0x2270
callq 0x23e0
movaps -0xe0(%rbp), %xmm1
movsd 0x1969e(%rip), %xmm2    # 0x234a8
movsd %xmm2, -0xc8(%rbp)
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x48(%rbp)
cvtsi2sdl -0x4c(%rbp), %xmm0
pand %xmm1, %xmm0
callq 0x2270
callq 0x23e0
movsd -0xc8(%rbp), %xmm3
movaps -0xc0(%rbp), %xmm2
movaps -0xb0(%rbp), %xmm1
addsd %xmm3, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x4c(%rbp)
movq -0x60(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movaps 0x196f0(%rip), %xmm1    # 0x23560
pand %xmm1, %xmm0
callq 0x2270
callq 0x23e0
movsd 0x19622(%rip), %xmm1    # 0x234a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x50(%rbp)
movsd -0x68(%rbp), %xmm0
movaps 0x196c3(%rip), %xmm1    # 0x23560
pand %xmm1, %xmm0
callq 0x2270
callq 0x23e0
movsd 0x1960d(%rip), %xmm1    # 0x234c0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xa05e
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x3c(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
leaq -0x98(%rbp), %rdi
movl $0x30, %edx
callq 0x22c0
movl -0x90(%rbp), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rdi
movl -0x90(%rbp), %ecx
shrl $0x1f, %ecx
movl $0x23, %edx
movl $0x2a, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movl -0x48(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl -0x90(%rbp), %esi
shrl $0x1e, %esi
andl $0x1, %esi
leaq 0x19528(%rip), %r9      # 0x23465
leaq 0x19861(%rip), %rax     # 0x237a5
cmpl $0x0, %esi
cmovneq %rax, %r9
movl -0x4c(%rbp), %r12d
movl -0x44(%rbp), %r15d
movl -0x50(%rbp), %r14d
movl -0x80(%rbp), %ebx
movl -0x54(%rbp), %r11d
movsd -0x78(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rsi
movl (%rsi), %esi
shrl %esi
movl %esi, %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movq (%rax), %r10
movq -0x88(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x197de(%rip), %rax     # 0x2377c
movsbl (%rax,%rsi), %eax
leaq 0x197d6(%rip), %rsi     # 0x2377f
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movb $0x2, %al
callq 0x2290
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x44(%rbp), %eax
jae 0xa03e
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rcx
movl -0x40(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x88(%rbp), %rax
movl -0x40(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1975b(%rip), %rax     # 0x2377c
movsbl (%rax,%rcx), %ecx
leaq 0x19780(%rip), %rsi     # 0x237ac
movb $0x0, %al
callq 0x2290
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9fd7
movq -0x38(%rbp), %rdi
leaq 0x19257(%rip), %rsi     # 0x232a0
movb $0x0, %al
callq 0x2290
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x9ec5
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop