// File: icemiliang[P]vot/src/vot/cell.cc
// Function: voro::voronoicell_base::normals_search(std::vector<double, std::allocator<double>>&, int, int, int)
inline void voronoicell_base::normals_search(std::vector<double> &v,int i,int j,int k) {
    ed[i][j]=-1-k;
    int l=cycle_up(ed[i][nu[i]+j],k),m;
    double ux,uy,uz,vx,vy,vz,wx,wy,wz,wmag;
    do {
        m=ed[k][l];ed[k][l]=-1-m;
        ux=pts[3*m]-pts[3*k];
        uy=pts[3*m+1]-pts[3*k+1];
        uz=pts[3*m+2]-pts[3*k+2];

        // Test to see if the length of this edge is above the tolerance
        if(ux*ux+uy*uy+uz*uz>tolerance_sq) {
            while(m!=i) {
                l=cycle_up(ed[k][nu[k]+l],m);
                k=m;m=ed[k][l];ed[k][l]=-1-m;
                vx=pts[3*m]-pts[3*k];
                vy=pts[3*m+1]-pts[3*k+1];
                vz=pts[3*m+2]-pts[3*k+2];

                // Construct the vector product of this edge with
                // the previous one
                wx=uz*vy-uy*vz;
                wy=ux*vz-uz*vx;
                wz=uy*vx-ux*vy;
                wmag=wx*wx+wy*wy+wz*wz;

                // Test to see if this vector product of the
                // two edges is above the tolerance
                if(wmag>tolerance_sq) {

                    // Construct the normal vector and print it
                    wmag=1/sqrt(wmag);
                    v.push_back(wx*wmag);
                    v.push_back(wy*wmag);
                    v.push_back(wz*wmag);

                    // Mark all of the remaining edges of this
                    // face and exit
                    while(m!=i) {
                        l=cycle_up(ed[k][nu[k]+l],m);
                        k=m;m=ed[k][l];ed[k][l]=-1-m;
                    }
                    return;
                }
            }
            v.push_back(0);
            v.push_back(0);
            v.push_back(0);
            return;
        }
        l=cycle_up(ed[k][nu[k]+l],m);
        k=m;
    } while (k!=i);
    v.push_back(0);
    v.push_back(0);
    v.push_back(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl -0x1c(%rbp), %edx
movq 0x20(%rdi), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rdi), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rdi), %rcx
movslq -0x14(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
callq 0x4bf70
movl %eax, -0x20(%rbp)
movq -0xc8(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x24(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
subl -0x24(%rbp), %esi
movq 0x20(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x30(%rax), %rcx
imull $0x3, -0x24(%rbp), %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x30(%rax), %rcx
imull $0x3, -0x1c(%rbp), %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x30(%rax), %rcx
imull $0x3, -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x30(%rax), %rcx
imull $0x3, -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x30(%rax), %rcx
imull $0x3, -0x24(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x30(%rax), %rax
imull $0x3, -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x43aa1(%rip), %xmm1    # 0x940d8
ucomisd %xmm1, %xmm0
jbe 0x50988
jmp 0x50643
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x50932
movq -0xc8(%rbp), %rdi
movq 0x20(%rdi), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rdi), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x24(%rbp), %edx
callq 0x4bf70
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0x20(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movq 0x20(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x24(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
subl -0x24(%rbp), %esi
movq 0x20(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x30(%rax), %rcx
imull $0x3, -0x24(%rbp), %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x30(%rax), %rcx
imull $0x3, -0x1c(%rbp), %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq 0x30(%rax), %rcx
imull $0x3, -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x30(%rax), %rcx
imull $0x3, -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq 0x30(%rax), %rcx
imull $0x3, -0x24(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x30(%rax), %rax
imull $0x3, -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
movsd -0x58(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
movsd -0x30(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x60(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
movsd -0x68(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
movsd 0x438b4(%rip), %xmm1    # 0x940d8
ucomisd %xmm1, %xmm0
jbe 0x5092d
movsd -0x78(%rbp), %xmm0
callq 0xa3d0
movaps %xmm0, %xmm1
movsd 0x3d575(%rip), %xmm0    # 0x8ddb8
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x50300
movq -0x10(%rbp), %rdi
movsd -0x68(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x50300
movq -0x10(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x50300
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x50928
movq -0xc8(%rbp), %rdi
movq 0x20(%rdi), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rdi), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x24(%rbp), %edx
callq 0x4bf70
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0x20(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movq 0x20(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x24(%rbp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl -0x24(%rbp), %edx
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x508ac
jmp 0x50a1d
jmp 0x50643
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x50300
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x50300
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0x50300
jmp 0x50a1d
movq -0xc8(%rbp), %rdi
movq 0x20(%rdi), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rdi), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x24(%rbp), %edx
callq 0x4bf70
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x5054e
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x50300
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x50300
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x50300
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)