// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/path.c
// Function: asg_stat
void asg_stat(asg_t *asg, FILE *fo)
{
    uint64_t i, nv, n_vtx, n_seg, max_deg, tot_seg_len, n_link, n_arc, tot_deg;
    asmg_t *g;

    n_vtx = n_seg = max_deg = tot_seg_len = n_link = n_arc = tot_deg = 0;
    g = asg->asmg;
    for (i = 0; i < asg->n_seg; ++i) {
        if (g->vtx[i].del) continue;
        tot_seg_len += asg->seg[i].len;
        ++n_seg;
    }
    fprintf(fo, "Number of segments: %lu\n", n_seg);
    fprintf(fo, "Total segment length: %lu\n", tot_seg_len);
    if (n_seg) fprintf(fo, "Average segment length: %.3f\n", (double) tot_seg_len / n_seg);

    for (i = 0; i < g->n_arc; ++i) {
        if (!g->arc[i].del) {
            ++n_arc;
            if (!g->arc[i].comp)
                ++n_link;
        }
    }
    fprintf(fo, "Number of links: %lu\n", n_link);
    fprintf(fo, "Number of arcs: %lu\n", n_arc);

    n_vtx = asmg_vtx_n(g);
    for (i = 0; i < n_vtx; ++i) {
        nv = asmg_arc_n1(g, i);
        if (nv > max_deg)
            max_deg = nv;
        tot_deg += nv;
    }
    fprintf(fo, "Max degree: %lu\n", max_deg);
    if (n_seg > 0) fprintf(fo, "Average degree: %.3f\n", (double) tot_deg / n_seg / 2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xbf6f
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xbf3a
jmp 0xbf61
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xbf0c
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x17b60(%rip), %rsi     # 0x23ade
movb $0x0, %al
callq 0x2290
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x17b63(%rip), %rsi     # 0x23af7
movb $0x0, %al
callq 0x2290
cmpq $0x0, -0x30(%rbp)
je 0xbff7
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %xmm0
movaps 0x175be(%rip), %xmm3    # 0x23570
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x175c2(%rip), %xmm2    # 0x23580
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x30(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x17b22(%rip), %rsi     # 0x23b12
movb $0x1, %al
callq 0x2290
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0xc070
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
imulq $0x30, -0x18(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xc060
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
imulq $0x30, -0x18(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xc05e
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xc060
jmp 0xc062
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xbfff
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0x17ab1(%rip), %rsi     # 0x23b30
movb $0x0, %al
callq 0x2290
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x17ab1(%rip), %rsi     # 0x23b46
movb $0x0, %al
callq 0x2290
movq -0x60(%rbp), %rax
movq (%rax), %rax
shlq %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0xc0f9
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5ba0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0xc0df
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xc0b2
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x17a53(%rip), %rsi     # 0x23b5b
movb $0x0, %al
callq 0x2290
cmpq $0x0, -0x30(%rbp)
jbe 0xc177
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %xmm0
movaps 0x1744a(%rip), %xmm3    # 0x23570
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x1744e(%rip), %xmm2    # 0x23580
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x30(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0x173b3(%rip), %xmm1    # 0x23518
divsd %xmm1, %xmm0
leaq 0x179fc(%rip), %rsi     # 0x23b6c
movb $0x1, %al
callq 0x2290
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)