// File: Luthaf[P]zeopp/sphere_approx.cc
// Function: AtomCluster::translate_rhombi(double, int)
void AtomCluster::translate_rhombi(double shift, int i){
	double golden_ratio = (1+sqrt(5))/2.0;
	double ratio_square = golden_ratio * golden_ratio;
	double ratio_cube = ratio_square * golden_ratio;
	double length = sqrt(2+(ratio_cube*ratio_cube));
	double scale = 1.0/length;

	double scaled_shift = shift * scale;
	double scaled_ratio = scaled_shift * golden_ratio;
	double scaled_cube = scaled_shift * ratio_cube;
	double scaled_square = scaled_shift * ratio_square;
	double scaled_plus = scaled_shift * (2.0 + golden_ratio);

	plusMinus_all(scaled_shift, scaled_shift, scaled_cube, i);
	plusMinus_all(scaled_cube, scaled_shift, scaled_shift, i+8);
	plusMinus_all(scaled_shift, scaled_cube, scaled_shift, i+16);
	plusMinus_all(scaled_square, scaled_ratio, 2.0*scaled_ratio, i+24);
	plusMinus_all(2.0*scaled_ratio, scaled_square, scaled_ratio, i+32);
	plusMinus_all(scaled_ratio, 2.0*scaled_ratio, scaled_square, i+40);
	plusMinus_xz(scaled_plus, scaled_square, i+48);
	plusMinus_xy(scaled_square, scaled_plus, i+52);
	plusMinus_yz(scaled_square, scaled_plus, i+56);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x5, %edi
callq 0x94d40
movaps %xmm0, %xmm1
movsd 0xf7eaf(%rip), %xmm0    # 0x1f2050
addsd %xmm1, %xmm0
movsd 0xf7e9b(%rip), %xmm1    # 0x1f2048
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0xf7e5e(%rip), %xmm1    # 0x1f2048
addsd %xmm1, %xmm0
callq 0x53f0
movq -0x70(%rbp), %rdi
movsd %xmm0, -0x38(%rbp)
movsd 0xf7e4c(%rip), %xmm0    # 0x1f2050
divsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x48(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x48(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x48(%rbp), %xmm0
movsd 0xf7df1(%rip), %xmm1    # 0x1f2048
addsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
movl -0x14(%rbp), %esi
callq 0xfb3b0
movq -0x70(%rbp), %rdi
movsd -0x58(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
movl -0x14(%rbp), %esi
addl $0x8, %esi
callq 0xfb3b0
movq -0x70(%rbp), %rdi
movsd -0x48(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
movl -0x14(%rbp), %esi
addl $0x10, %esi
callq 0xfb3b0
movq -0x70(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd 0xf7d7a(%rip), %xmm2    # 0x1f2048
mulsd -0x50(%rbp), %xmm2
movl -0x14(%rbp), %esi
addl $0x18, %esi
callq 0xfb3b0
movq -0x70(%rbp), %rdi
movsd 0xf7d5e(%rip), %xmm0    # 0x1f2048
mulsd -0x50(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
movsd -0x50(%rbp), %xmm2
movl -0x14(%rbp), %esi
addl $0x20, %esi
callq 0xfb3b0
movq -0x70(%rbp), %rdi
movsd -0x50(%rbp), %xmm0
movsd 0xf7d33(%rip), %xmm1    # 0x1f2048
mulsd -0x50(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
movl -0x14(%rbp), %esi
addl $0x28, %esi
callq 0xfb3b0
movq -0x70(%rbp), %rdi
movsd -0x68(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
movl -0x14(%rbp), %esi
addl $0x30, %esi
callq 0xfab70
movq -0x70(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movl -0x14(%rbp), %esi
addl $0x34, %esi
callq 0xfa750
movq -0x70(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movl -0x14(%rbp), %esi
addl $0x38, %esi
callq 0xfaf90
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)