// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/sphere_approx.cc
// Function: AtomCluster::replaceAtomByCluster(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double)
void AtomCluster::replaceAtomByCluster(string cluster_type, double large_atom_radius){
	double shift = large_atom_radius - smallSphereRadius;

//Type: OCC: Octahedron + cube (15 spheres)
        if (cluster_type == "OCC"){
                for (int i = 0; i<15; i++){
                        atom_vector.push_back(center);
                }
                translate_cube(shift, 0);
                plusMinus_axes(shift, 8);
        }

//Type: FCC = 4 cubes (33 spheres) 
	if (cluster_type == "FCC" || cluster_type == "ACC"){

		//fills vector with spheres positioned at origin
		for (int i = 0; i<32; i++){
			atom_vector.push_back(center);
		}

		//Translate cube vertices for all 4 cubes
		translate_cube(shift, 0);
		rotate_xy_cube(shift, 8);
		rotate_xz_cube(shift, 16);
		rotate_yz_cube(shift, 24);

//Type: ACC = 4 cubes w/ axis spheres (39 spheres)
		if (cluster_type == "ACC"){
			vector <ATOM> axes;
			for (int i = 0; i<6; i++){
				atom_vector.push_back(center);
			}
			plusMinus_axes(shift, 32);
		}
		atom_vector.push_back(center);
	}

//Type: AQC = Axes, quadrants, cube (27 spheres)
//	Spheres along +- axes, 45 degrees from xy, xz, yz axes,
//	and cube with edges aligned to axes 
	else if (cluster_type == "AQC"){
		for (int i = 0; i<27; i++){
			atom_vector.push_back(center);
		}
		translate_axes(shift, 0);
		translate_cube(shift, 18);
	}

//Type: DDH = Dodecahedron (21 spheres); pentagonal faces
	else if (cluster_type == "DDH" || cluster_type == "TIH"){
		for (int i = 0; i<20; i++){
			atom_vector.push_back(center);
		}
		translate_dodecahedron(shift, 0);
//Type: TIH = Truncated icosahedron (33 spheres)
//	dodecahedron w/ center of faces filled w/ spheres
		if (cluster_type == "TIH"){
			vector <ATOM> ico;
			for (int i = 0; i<12; i++){
				atom_vector.push_back(center);
			}
			rotate_icosahedron(shift, 20);
		}
		atom_vector.push_back(center);
	}

//Type: ICH = Icosidodecahedron (31 spheres)
// Quasiregular polyhedron. pentagonal/triangular faces
	else if (cluster_type == "ICH" || cluster_type == "ICC"){
		for (int i = 0; i<30; i++){
			atom_vector.push_back(center);
		}
		translate_icosidodecahedron(shift, 0);
//Type: ICC = Icosidodecahedron w/ center face spheres (43 spheres)
		if (cluster_type == "ICC"){
	//		vector <ATOM> center_spheres;
		//	for (int i = 0; i<atom_vector.size(); i++){
		//		center_spheres.push_back(atom_vector.at(i));
		//	}
			calc_centerSpheres(shift, 0);
		}
		atom_vector.push_back(center);
	}

//Type: RIH = Rhombicosidodecahedron (61 spheres)
// Semiregular polyhedron. Square, pentagonal, triangular faces
	else if (cluster_type == "RIH"){
		for (int i = 0; i<61; i++){
			atom_vector.push_back(center);
		}

		translate_rhombi(shift, 0);
	}
//Type: S4 = 4 spheres in a spiral
        else if (cluster_type == "S4"){
                sphere_spiral(4, shift);
        }
//Type: S10 = 10 spheres in a spiral
        else if (cluster_type == "S10"){
                sphere_spiral(10, shift);
        }
//Type: S20 = 20 spheres in a spiral
        else if (cluster_type == "S20"){
                sphere_spiral(20, shift);
        }
//Type: S30 = 30 spheres in a spiral
        else if (cluster_type == "S30"){
                sphere_spiral(30, shift);
        }
//Type: S40 = 40 spheres in a spiral
        else if (cluster_type == "S40"){
                sphere_spiral(40, shift);
        }
//Type: S50 = 50 spheres in a spiral
        else if (cluster_type == "S50"){
                sphere_spiral(50, shift);
        }
//Type: S100 = 100 spheres in a spiral
        else if (cluster_type == "S100"){
                sphere_spiral(100, shift);
        }
//Type: S500 = 500 spheres in a spiral
        else if (cluster_type == "S500"){
                sphere_spiral(500, shift);
        }
//Type: S1000 = 1000 spheres in a spiral
        else if (cluster_type == "S1000"){
                sphere_spiral(1000, shift);
        }
//Type: S1000 = 1000 spheres in a spiral
        else if (cluster_type == "S10000"){
                sphere_spiral(10000, shift);
        }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
subsd (%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xc948f(%rip), %rsi     # 0x157be8
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8e7ba
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0xf, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
decl %ebp
jne 0x8e778
movsd 0xc93c9(%rip), %xmm0    # 0x157b58
mulsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
xorl %esi, %esi
callq 0x93212
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movl $0x8, %esi
callq 0x8ecfc
leaq 0xc942b(%rip), %rsi     # 0x157bec
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8e965
leaq 0xc9418(%rip), %rsi     # 0x157bf0
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8e965
leaq 0xc9405(%rip), %rsi     # 0x157bf4
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8eb0f
leaq 0xc93f2(%rip), %rsi     # 0x157bf8
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8eaae
leaq 0xc93df(%rip), %rsi     # 0x157bfc
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8eaae
leaq 0xc93cc(%rip), %rsi     # 0x157c00
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8eb70
leaq 0xc93b9(%rip), %rsi     # 0x157c04
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8eb70
leaq 0xc93a6(%rip), %rsi     # 0x157c08
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec1b
leaq 0xc9393(%rip), %rsi     # 0x157c0c
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec59
leaq 0xc937f(%rip), %rsi     # 0x157c0f
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec63
leaq 0xc936c(%rip), %rsi     # 0x157c13
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec6d
leaq 0xc9359(%rip), %rsi     # 0x157c17
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec77
leaq 0xc9346(%rip), %rsi     # 0x157c1b
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec81
leaq 0xc9333(%rip), %rsi     # 0x157c1f
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec8b
leaq 0xc9320(%rip), %rsi     # 0x157c23
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec95
leaq 0xc930e(%rip), %rsi     # 0x157c28
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ec9f
leaq 0xc92fc(%rip), %rsi     # 0x157c2d
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8eca9
leaq 0xc92eb(%rip), %rsi     # 0x157c33
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8eb02
movsd 0xc4c38(%rip), %xmm0    # 0x153598
jmp 0x8ecb1
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0x20, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
decl %ebp
jne 0x8e978
movsd 0xc91c9(%rip), %xmm0    # 0x157b58
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
xorl %esi, %esi
callq 0x93212
movsd 0xc91c3(%rip), %xmm0    # 0x157b78
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm1
movl $0x8, %esi
callq 0x927cc
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl $0xc, %esi
callq 0x91d86
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl $0x10, %esi
callq 0x91340
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl $0x14, %esi
callq 0x927cc
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl $0x18, %esi
callq 0x91340
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl $0x1c, %esi
callq 0x91d86
leaq 0xc9198(%rip), %rsi     # 0x157bf0
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8eaf7
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x6, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
decl %ebp
jne 0x8ea80
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movl $0x20, %esi
callq 0x8ecfc
leaq 0x20(%rsp), %rdi
callq 0xf236
jmp 0x8eaf7
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0x14, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
decl %ebp
jne 0x8eac1
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8fd14
leaq 0xc9115(%rip), %rsi     # 0x157bfc
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ebdc
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x138(%rbx), %r14
leaq 0xa0(%rbx), %r15
movl $0x1b, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0xe936
decl %ebp
jne 0x8eb22
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8fcb2
movsd 0x8(%rsp), %xmm0
mulsd 0xc9009(%rip), %xmm0    # 0x157b58
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
movl $0x12, %esi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x93212
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0x1e, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
decl %ebp
jne 0x8eb83
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8fe1c
leaq 0xc905b(%rip), %rsi     # 0x157c04
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8ebc5
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8fed8
movq %r15, %rdi
movq %r12, %rsi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe936
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0xc, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe936
decl %ebp
jne 0x8ebf4
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movl $0x14, %esi
callq 0x8fda8
jmp 0x8eaa2
leaq 0x138(%rbx), %r14
leaq 0xa0(%rbx), %r15
movl $0x3d, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0xe936
decl %ebp
jne 0x8ec2e
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x90d9a
movsd 0xc492f(%rip), %xmm0    # 0x153590
jmp 0x8ecb1
movsd 0xc5565(%rip), %xmm0    # 0x1541d0
jmp 0x8ecb1
movsd 0xc5583(%rip), %xmm0    # 0x1541f8
jmp 0x8ecb1
movsd 0xc8ef1(%rip), %xmm0    # 0x157b70
jmp 0x8ecb1
movsd 0xc8edf(%rip), %xmm0    # 0x157b68
jmp 0x8ecb1
movsd 0xc8ecd(%rip), %xmm0    # 0x157b60
jmp 0x8ecb1
movsd 0xc03a3(%rip), %xmm0    # 0x14f040
jmp 0x8ecb1
movsd 0xc7ec9(%rip), %xmm0    # 0x156b70
jmp 0x8ecb1
movsd 0xc5a4f(%rip), %xmm0    # 0x154700
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm1
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x90ee8
jmp 0x8ecd1
jmp 0x8ecd1
jmp 0x8ecd1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xf236
movq %rbx, %rdi
callq 0x4780