// File: /workspace/github_cpp_makefile_star2_O1/hamikm[P]Raytracer/src/arealight.hh
// Function: arealight<double, double, double, 3>::constructorHelper(mvector<double, 3> const&)
void constructorHelper(const mvector<vec_T, dim> &upDirection) {
		// Compute uhat by taking the cross product of the surface normal
		// and the up vector then normalizing.
		uhat = upDirection % norm;
		uhat = uhat.norm();

		// Compute vhat by taking the cross product of the surface normal
		// and uhat then normalizing.
		vhat = norm % uhat;
		vhat = vhat.norm();

		// Compute number of lights.
		int numlights = static_cast<int> (width / horizontalSpacing) *
				static_cast<int> (height / verticalSpacing);

		// Loop over the rows of the lights.
		for(vec_T u = -height / 2; u <= height / 2; u += verticalSpacing) {

			for(vec_T v = -width / 2; v <= width / 2; v += horizontalSpacing) {

				// Compute world coordinates from the local uv coordinates.
				mvector<vec_T, dim> worldpos = uhat * u + vhat * v +
						this->getPos();

				// Construct a point light at the world coordinates with a color
				// scaled so that the combination of all the lights in the area
				// light look like the color passed to the constructor.
				boost::shared_ptr<light<vec_T, color_T, time_T, dim> >
					currLight_sp(
							new light<vec_T, color_T, time_T, dim>(
									this->getColor() / numlights, worldpos));
				lights.push_back(currLight_sp);
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movsd (%rsi), %xmm0
movsd 0x8(%rsi), %xmm1
movsd 0x48(%rdi), %xmm2
movsd 0x10(%rsi), %xmm3
movsd 0x38(%rdi), %xmm4
movsd 0x40(%rdi), %xmm5
movapd %xmm1, %xmm6
mulsd %xmm2, %xmm6
mulsd %xmm0, %xmm2
mulsd %xmm5, %xmm0
mulsd %xmm3, %xmm5
subsd %xmm5, %xmm6
mulsd %xmm4, %xmm3
subsd %xmm2, %xmm3
mulsd %xmm1, %xmm4
subsd %xmm4, %xmm0
leaq 0x88(%rdi), %rsi
movsd %xmm6, 0x88(%rdi)
movsd %xmm3, 0x90(%rdi)
movsd %xmm0, 0x98(%rdi)
leaq -0x98(%rbp), %r14
movq %r14, %rdi
movq %rsi, -0x68(%rbp)
callq 0x4cf0
movq 0x10(%r14), %rax
movq %rax, 0x98(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x88(%rbx)
movsd 0x38(%rbx), %xmm0
movsd 0x40(%rbx), %xmm1
movsd 0x98(%rbx), %xmm2
movsd 0x48(%rbx), %xmm3
movsd 0x90(%rbx), %xmm4
movapd %xmm4, %xmm5
mulsd %xmm3, %xmm5
movsd 0x88(%rbx), %xmm6
mulsd %xmm6, %xmm3
mulsd %xmm1, %xmm6
mulsd %xmm2, %xmm1
subsd %xmm5, %xmm1
mulsd %xmm0, %xmm2
subsd %xmm2, %xmm3
mulsd %xmm0, %xmm4
subsd %xmm6, %xmm4
leaq 0x70(%rbx), %rsi
movsd %xmm1, 0x70(%rbx)
movsd %xmm3, 0x78(%rbx)
movsd %xmm4, 0x80(%rbx)
movq %r14, %rdi
movq %rsi, -0x60(%rbp)
callq 0x4cf0
movq 0x10(%r14), %rax
movq %rax, 0x80(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x70(%rbx)
movsd 0x68(%rbx), %xmm0
movsd 0x2329(%rip), %xmm2     # 0x9048
mulsd %xmm0, %xmm2
movsd 0x22f5(%rip), %xmm1     # 0x9020
mulsd %xmm0, %xmm1
movsd %xmm2, -0x30(%rbp)
ucomisd %xmm2, %xmm1
jb 0x6eca
divsd 0x58(%rbx), %xmm0
cvttsd2si %xmm0, %eax
movsd 0x60(%rbx), %xmm0
divsd 0x50(%rbx), %xmm0
cvttsd2si %xmm0, %ecx
imull %eax, %ecx
leaq 0x20(%rbx), %rax
movq %rax, -0x58(%rbp)
movl %ecx, -0x34(%rbp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0x50(%rbp)
leaq 0xa0(%rbx), %rax
movq %rax, -0x48(%rbp)
movsd 0x229e(%rip), %xmm2     # 0x9020
leaq -0x80(%rbp), %r12
leaq -0x98(%rbp), %r13
movsd 0x60(%rbx), %xmm0
movapd %xmm0, %xmm1
mulsd 0x22aa(%rip), %xmm1     # 0x9048
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x6ea8
movsd %xmm1, -0x40(%rbp)
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
movq -0x68(%rbp), %rsi
movsd -0x30(%rbp), %xmm0
callq 0x6663
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
movq -0x60(%rbp), %rsi
movsd -0x40(%rbp), %xmm0
callq 0x6663
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x65ea
movq %r13, %rdi
movq %r12, %rsi
movq -0x58(%rbp), %rdx
callq 0x65ea
movl $0x38, %edi
callq 0x31c0
cmpl $0x0, -0x34(%rbp)
je 0x6edc
movq %rax, %r14
movsd 0x8(%rbx), %xmm0
movsd 0x10(%rbx), %xmm1
movsd 0x18(%rbx), %xmm2
movsd -0x50(%rbp), %xmm3
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
divsd %xmm3, %xmm2
movsd %xmm0, 0x8(%rax)
movsd %xmm1, 0x10(%rax)
movsd %xmm2, 0x18(%rax)
leaq 0x6d0d(%rip), %rax      # 0xdb58
movq %rax, (%r14)
xorl %r15d, %r15d
movq %r13, %rdi
movl %r15d, %esi
callq 0x5c1a
movsd %xmm0, 0x20(%r14,%r15,8)
incq %r15
cmpq $0x3, %r15
jne 0x6e51
movq %r12, %rdi
movq %r14, %rsi
callq 0x4bca
movq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x71a4
leaq -0x78(%rbp), %rdi
callq 0x581c
movsd -0x40(%rbp), %xmm1
addsd 0x50(%rbx), %xmm1
movsd 0x60(%rbx), %xmm0
movsd 0x217d(%rip), %xmm2     # 0x9020
jmp 0x6d9e
movsd -0x30(%rbp), %xmm1
addsd 0x58(%rbx), %xmm1
movsd 0x68(%rbx), %xmm0
mulsd %xmm2, %xmm0
movsd %xmm1, -0x30(%rbp)
ucomisd %xmm1, %xmm0
jae 0x6d8d
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2bd1(%rip), %rdi      # 0x9ab4
leaq 0x23c9(%rip), %rsi      # 0x92b3
leaq 0x2bcf(%rip), %rcx      # 0x9ac0
movl $0xec, %edx
callq 0x30f0
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x581c
movq %rbx, %rdi
callq 0x32a0
nop