// File: /workspace/github_cpp_makefile_star2_O1/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 $0x188, %rsp            # imm = 0x188
movsd %xmm1, 0x38(%rsp)
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movsd %xmm0, 0x10(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x911dc
movsd 0xc23b2(%rip), %xmm1    # 0x1532d0
movapd %xmm1, %xmm2
movsd 0x10(%rsp), %xmm0
divsd %xmm0, %xmm2
addsd 0xbe124(%rip), %xmm2    # 0x14f058
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)
movl $0x1, %r13d
xorl %r15d, %r15d
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
xorpd %xmm3, %xmm3
mulsd 0xc6c50(%rip), %xmm3    # 0x157bd0
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
divsd 0x30(%rsp), %xmm0
movsd 0xbe0c2(%rip), %xmm2    # 0x14f058
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
mulsd 0x28(%rsp), %xmm1
movsd %xmm1, 0x48(%rsp)
mulsd %xmm1, %xmm1
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
ucomisd 0xc2302(%rip), %xmm0    # 0x1532c0
movsd %xmm3, (%rsp)
jb 0x90fcb
sqrtsd %xmm0, %xmm0
jmp 0x90fd5
callq 0x4350
movsd (%rsp), %xmm3
movsd %xmm0, 0x18(%rsp)
movapd %xmm3, %xmm0
callq 0x4800
movsd %xmm0, 0x40(%rsp)
movsd (%rsp), %xmm0
callq 0x4100
movsd %xmm0, (%rsp)
movups (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movupd 0x20(%r12), %xmm2
movupd 0x30(%r12), %xmm3
movaps %xmm0, 0x50(%rsp)
movapd %xmm1, 0x60(%rsp)
movapd %xmm2, 0x70(%rsp)
movapd %xmm3, 0x80(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0xe0(%rbx), %rsi
movq 0xe8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0xf32a
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x100(%rbx), %rsi
movq 0x108(%rbx), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %rdi
callq 0xf32a
movb 0x10(%rbp), %al
movb %al, 0x50(%r14)
movups (%rbp), %xmm0
movups %xmm0, 0x40(%r14)
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
callq 0x5162c
movsd 0x38(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm2
movsd (%rsp), %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm0, %xmm3
movsd 0x40(%rsp), %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm0, %xmm4
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x120(%rsp)
addsd 0x50(%rsp), %xmm4
movsd %xmm4, 0xf0(%rsp)
addsd 0x58(%rsp), %xmm3
addsd 0x60(%rsp), %xmm1
movsd %xmm3, 0xf8(%rsp)
movsd %xmm1, 0x100(%rsp)
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x91141
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x91166
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0xe936
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x91198
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x911bd
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x4470
xorps %xmm3, %xmm3
cvtsi2sd %r13d, %xmm3
incl %r13d
addl $0x2, %r15d
movsd 0x10(%rsp), %xmm0
ucomisd %xmm3, %xmm0
ja 0x90f78
leaq 0x138(%rbx), %rdi
addq $0xa0, %rbx
movq %rbx, %rsi
callq 0xe936
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x9124a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x9124a
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x91240
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0x2f814
movq %rbx, %rdi
callq 0x4780