// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/sphere_approx.cc
// Function: AtomCluster::sphere_spiral(double, double)
void AtomCluster::sphere_spiral(double n, double shift){
        double golden_angle = PI * (3.0-sqrt(5));

        for (int i = 0; i<n; i++){
                double theta = golden_angle * i;
                double z_shift = (1-(1/n))*(1-((2*i)/(n-1)));
                double z_sq = z_shift * z_shift;
                double radius = sqrt(1-z_sq);
                double x_shift = radius * cos(theta);
                double y_shift = radius * sin(theta);

                ATOM new_sphere = translate_sphere(center, shift * x_shift, shift * y_shift, shift * z_shift, 1, 1, 1);
                atom_vector.push_back(new_sphere);
        }
        atom_vector.push_back(center);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movapd %xmm1, 0x40(%rsp)
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x8f258
movsd 0xc23ce(%rip), %xmm1    # 0x151360
movapd %xmm1, %xmm2
movsd 0x8(%rsp), %xmm0
divsd %xmm0, %xmm2
addsd 0xbe0b0(%rip), %xmm2    # 0x14d058
movsd %xmm2, 0x28(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
leaq 0xa0(%rbx), %r12
leaq 0x120(%rbx), %rbp
leaq 0x138(%rbx), %rax
movq %rax, 0x20(%rsp)
movapd 0x40(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x100(%rsp)
movl $0x1, %r13d
xorl %r14d, %r14d
leaq 0x120(%rsp), %rax
movq %rax, (%rsp)
xorpd %xmm3, %xmm3
mulsd 0xc6d2a(%rip), %xmm3    # 0x155d30
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
divsd 0x30(%rsp), %xmm0
movsd 0xbe03c(%rip), %xmm2    # 0x14d058
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
mulsd 0x28(%rsp), %xmm1
movsd %xmm1, 0x38(%rsp)
mulsd %xmm1, %xmm1
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
ucomisd 0xc230c(%rip), %xmm0    # 0x151350
movsd %xmm3, 0x10(%rsp)
jb 0x8f052
sqrtsd %xmm0, %xmm0
jmp 0x8f05d
callq 0x4350
movsd 0x10(%rsp), %xmm3
movapd %xmm0, 0x50(%rsp)
movapd %xmm3, %xmm0
callq 0x4800
movapd %xmm0, 0x110(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4100
movaps %xmm0, 0x10(%rsp)
movups (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movupd 0x20(%r12), %xmm2
movups 0x30(%r12), %xmm3
movaps %xmm0, 0x60(%rsp)
movapd %xmm1, 0x70(%rsp)
movapd %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xe0(%rbx), %rsi
movq 0xe8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0xf3ce
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x100(%rbx), %rsi
movq 0x108(%rbx), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rdi
callq 0xf3ce
movb 0x10(%rbp), %al
movb %al, 0x50(%r15)
movups (%rbp), %xmm0
movups %xmm0, 0x40(%r15)
leaq 0x120(%rsp), %r15
movq %r15, %rdi
callq 0x51264
movsd 0x38(%rsp), %xmm1
mulsd 0x40(%rsp), %xmm1
movapd 0x50(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd 0x110(%rsp), %xmm2
unpcklpd 0x10(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
mulpd %xmm0, %xmm2
mulpd 0x100(%rsp), %xmm2
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x150(%rsp)
addpd 0x60(%rsp), %xmm2
addsd 0x70(%rsp), %xmm1
movapd %xmm2, 0x120(%rsp)
movsd %xmm1, 0x130(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x8f1c0
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x8f1e5
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0xe9a8
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x8f217
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x8f23c
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x4470
cvtsi2sd %r13d, %xmm3
incl %r13d
addl $0x2, %r14d
movsd 0x8(%rsp), %xmm0
ucomisd %xmm3, %xmm0
ja 0x8effe
leaq 0x138(%rbx), %rdi
addq $0xa0, %rbx
movq %rbx, %rsi
callq 0xe9a8
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x8f2c4
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x8f2c4
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq %rax, (%rsp)
jmp 0x8f2bb
movq %rax, %rbx
movq (%rsp), %rdi
callq 0x2f5e8
movq %rbx, %rdi
callq 0x4780