// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/path.c
// Function: dbscan_cluster
static int dbscan_cluster(clust_dp_t *dps, int n_dps, double eps, double v_eps)
{
    if (n_dps <= 0) return 0;
    
    qsort(dps, n_dps, sizeof(clust_dp_t), dpVal_cmpfunc);
    
    int i, n;
    double vals;
    dps[0].clust = 0;
    vals = dps[0].val;
    n = 1;
    for (i = 1; i < n_dps; ++i) {
        if (dps[i].val <= dps[i-1].val * (1 + eps) &&
                dps[i].val <= vals / n * (1 + v_eps)) {
            dps[i].clust = dps[i-1].clust;
            vals += dps[i].val;
            n += 1;
        } else {
            dps[i].clust = dps[i-1].clust + 1;
            vals = dps[i].val;
            n = 1;
        }
    }
    
    int n_clust = dps[n_dps-1].clust + 1;
    
    qsort(dps, n_dps, sizeof(clust_dp_t), dpIdx_cmpfunc);

    return n_clust;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x113eb
movl $0x0, -0x4(%rbp)
jmp 0x115a2
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rsi
movl $0x30, %edx
leaq 0x3c1(%rip), %rcx       # 0x117c0
callq 0x20c0
movq -0x10(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x1, -0x30(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x11566
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm1
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd 0x1203c(%rip), %xmm2    # 0x234a8
addsd -0x20(%rbp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1150a
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm1
movsd -0x38(%rbp), %xmm0
cvtsi2sdl -0x30(%rbp), %xmm2
divsd %xmm2, %xmm0
movsd 0x11fff(%rip), %xmm2    # 0x234a8
addsd -0x28(%rbp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1150a
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x11556
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x11558
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1142b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rsi
movl $0x30, %edx
leaq 0x289(%rip), %rcx       # 0x11820
callq 0x20c0
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)