// File: /workspace/github_cpp_makefile_star2_O3/GUI-Graphics[P]cpuraytracing/renderer.cpp
// Function: gui::Renderer::render(gui::Scene const&, gui::Camera&) const
void Renderer::render(const Scene& scene, Camera& camera) const {
		float r = 1.0f / samples;
		for(int i = 0; i < camera.film.height; ++i) {
			printf("\rrendering %5.2f%%", 100.0f * (i + 1) / camera.film.height);
			fflush(stdout);
			for(int j = 0; j < camera.film.width; ++j) {
				for (int k = 0; k < samples; ++k) {
					Ray ray = camera.getRay(j + Math::random(), i + Math::random());
					camera.film.pixels[i][j] += radiance(ray, scene, 0);
				}
				camera.film.pixels[i][j] *= r;
			}
		}

		printf("\nstatistical data:\n");
		printf("num intersects: %lld\n", nIntersects);

		camera.film.gammaCorrection();
		camera.film.writePPM();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r14
movq (%rdx), %rax
movl 0x4(%rax), %eax
testl %eax, %eax
jle 0x4421
movq %rdi, %rbx
cvtsi2ssl (%rdi), %xmm0
movss 0xdc8(%rip), %xmm1      # 0x5010
divss %xmm0, %xmm1
movaps %xmm1, 0x50(%rsp)
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movaps %xmm1, 0x40(%rsp)
xorl %r13d, %r13d
leaq 0x65fc(%rip), %r12      # 0xa860
movq %rdi, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rsi, 0x30(%rsp)
leaq 0x1(%r13), %rcx
movq %rcx, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0xfe6(%rip), %xmm0      # 0x5278
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xfef(%rip), %rdi       # 0x5290
movb $0x1, %al
callq 0x2040
movq 0x3d19(%rip), %rax      # 0x7fc8
movq (%rax), %rdi
callq 0x2170
movq (%r14), %rax
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x4405
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
movl (%rbx), %edx
xorl %edi, %edi
movq %r13, %r8
movss %xmm1, 0x4(%rsp)
movq %r13, 0x38(%rsp)
leaq (%rdi,%rdi,2), %r13
testl %edx, %edx
jle 0x43ca
movq %rdi, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
movss %xmm0, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x51d3(%rip), %r15      # 0x94d8
movq %r15, %rdi
callq 0x2b9c
movss (%r12), %xmm2
movss 0x4(%r12), %xmm1
subss %xmm2, %xmm1
mulss %xmm1, %xmm0
addss %xmm2, %xmm0
addss 0x8(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movq %r15, %rdi
callq 0x2b9c
movss (%r12), %xmm2
movss 0x4(%r12), %xmm1
subss %xmm2, %xmm1
mulss %xmm0, %xmm1
addss %xmm2, %xmm1
addss 0x4(%rsp), %xmm1
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq 0x18(%rsp), %r14
movq %r14, %rsi
movss 0xc(%rsp), %xmm0
callq 0x36a4
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0x4108
movq 0x38(%rsp), %r8
movq (%r14), %rax
movq 0x8(%rax), %rcx
movq (%rcx,%r8,8), %rcx
movsd (%rcx,%r13,4), %xmm2
addps %xmm0, %xmm2
movlps %xmm2, (%rcx,%r13,4)
addss 0x8(%rcx,%r13,4), %xmm1
movss %xmm1, 0x8(%rcx,%r13,4)
incl %ebp
movl (%rbx), %edx
cmpl %edx, %ebp
jl 0x42fe
movl (%rax), %ecx
movq 0x28(%rsp), %rdi
movq 0x8(%rax), %rsi
movq (%rsi,%r8,8), %rsi
movsd (%rsi,%r13,4), %xmm0
mulps 0x40(%rsp), %xmm0
movlps %xmm0, (%rsi,%r13,4)
movss 0x8(%rsi,%r13,4), %xmm0
mulss 0x50(%rsp), %xmm0
movss %xmm0, 0x8(%rsi,%r13,4)
incq %rdi
movslq %ecx, %rsi
cmpq %rsi, %rdi
jl 0x42de
movslq 0x4(%rax), %rax
movq 0x20(%rsp), %r13
cmpq %rax, %r13
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %rbx
jl 0x4273
leaq 0xe91(%rip), %rdi       # 0x52b9
callq 0x21d0
movq 0x6434(%rip), %rsi      # 0xa868
leaq 0xe68(%rip), %rdi       # 0x52a3
xorl %eax, %eax
callq 0x2040
movq (%r14), %rdi
callq 0x335e
movq (%r14), %rdi
callq 0x3424
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq