// File: /workspace/github_cpp_makefile_star2_O3/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 0xc95a7(%rip), %rsi     # 0x155d48
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8c802
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0xf, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
decl %ebp
jne 0x8c7c0
movsd 0xc94e1(%rip), %xmm0    # 0x155cb8
mulsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
xorl %esi, %esi
callq 0x91254
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movl $0x8, %esi
callq 0x8cd44
leaq 0xc9543(%rip), %rsi     # 0x155d4c
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8c9ad
leaq 0xc9530(%rip), %rsi     # 0x155d50
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8c9ad
leaq 0xc951d(%rip), %rsi     # 0x155d54
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cb57
leaq 0xc950a(%rip), %rsi     # 0x155d58
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8caf6
leaq 0xc94f7(%rip), %rsi     # 0x155d5c
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8caf6
leaq 0xc94e4(%rip), %rsi     # 0x155d60
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cbb8
leaq 0xc94d1(%rip), %rsi     # 0x155d64
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cbb8
leaq 0xc94be(%rip), %rsi     # 0x155d68
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cc63
leaq 0xc94ab(%rip), %rsi     # 0x155d6c
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cca1
leaq 0xc9497(%rip), %rsi     # 0x155d6f
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccab
leaq 0xc9484(%rip), %rsi     # 0x155d73
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccb5
leaq 0xc9471(%rip), %rsi     # 0x155d77
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccbf
leaq 0xc945e(%rip), %rsi     # 0x155d7b
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccc9
leaq 0xc944b(%rip), %rsi     # 0x155d7f
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccd3
leaq 0xc9438(%rip), %rsi     # 0x155d83
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccdd
leaq 0xc9426(%rip), %rsi     # 0x155d88
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cce7
leaq 0xc9414(%rip), %rsi     # 0x155d8d
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8ccf1
leaq 0xc9403(%rip), %rsi     # 0x155d93
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8cb4a
movsd 0xc4c80(%rip), %xmm0    # 0x151628
jmp 0x8ccf9
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0x20, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
decl %ebp
jne 0x8c9c0
movsd 0xc92e1(%rip), %xmm0    # 0x155cb8
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
xorl %esi, %esi
callq 0x91254
movsd 0xc92db(%rip), %xmm0    # 0x155cd8
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm1
movl $0x8, %esi
callq 0x90824
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl $0xc, %esi
callq 0x8fdde
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl $0x10, %esi
callq 0x8f3ba
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl $0x14, %esi
callq 0x90824
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl $0x18, %esi
callq 0x8f3ba
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movl $0x1c, %esi
callq 0x8fdde
leaq 0xc92b0(%rip), %rsi     # 0x155d50
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8cb3f
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x6, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
decl %ebp
jne 0x8cac8
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movl $0x20, %esi
callq 0x8cd44
leaq 0x20(%rsp), %rdi
callq 0xf2da
jmp 0x8cb3f
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0x14, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
decl %ebp
jne 0x8cb09
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8dd88
leaq 0xc922d(%rip), %rsi     # 0x155d5c
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
je 0x8cc24
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
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 0xe9a8
decl %ebp
jne 0x8cb6a
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8dd26
movsd 0x8(%rsp), %xmm0
mulsd 0xc9121(%rip), %xmm0    # 0x155cb8
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 0x91254
leaq 0x138(%rbx), %r15
leaq 0xa0(%rbx), %r12
movl $0x1e, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
decl %ebp
jne 0x8cbcb
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8de90
leaq 0xc9173(%rip), %rsi     # 0x155d64
movq %r14, %rdi
callq 0x4170
testl %eax, %eax
jne 0x8cc0d
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
callq 0x8df4c
movq %r15, %rdi
movq %r12, %rsi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe9a8
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0xc, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9a8
decl %ebp
jne 0x8cc3c
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movl $0x14, %esi
callq 0x8de1c
jmp 0x8caea
leaq 0x138(%rbx), %r14
leaq 0xa0(%rbx), %r15
movl $0x3d, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0xe9a8
decl %ebp
jne 0x8cc76
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
xorl %esi, %esi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8ee0e
movsd 0xc4977(%rip), %xmm0    # 0x151620
jmp 0x8ccf9
movsd 0xc55cd(%rip), %xmm0    # 0x152280
jmp 0x8ccf9
movsd 0xc55eb(%rip), %xmm0    # 0x1522a8
jmp 0x8ccf9
movsd 0xc9009(%rip), %xmm0    # 0x155cd0
jmp 0x8ccf9
movsd 0xc8ff7(%rip), %xmm0    # 0x155cc8
jmp 0x8ccf9
movsd 0xc8fe5(%rip), %xmm0    # 0x155cc0
jmp 0x8ccf9
movsd 0xc035b(%rip), %xmm0    # 0x14d040
jmp 0x8ccf9
movsd 0xc7f99(%rip), %xmm0    # 0x154c88
jmp 0x8ccf9
movsd 0xc5aaf(%rip), %xmm0    # 0x1527a8
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm1
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8ef5c
jmp 0x8cd19
jmp 0x8cd19
jmp 0x8cd19
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xf2da
movq %rbx, %rdi
callq 0x4780