// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %rdx, %r14
movq %rsi, 0x30(%rsp)
movq (%rdx), %rax
movl 0x4(%rax), %eax
testl %eax, %eax
jle 0x4725
movq %rdi, %r12
cvtsi2ssl (%rdi), %xmm0
movss 0xae1(%rip), %xmm1      # 0x5010
divss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
xorl %ecx, %ecx
movq %rdi, 0x20(%rsp)
movq %rcx, %rbx
incq %rcx
movq %rcx, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0xc43(%rip), %xmm0      # 0x51a4
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xc38(%rip), %rdi       # 0x51a8
movb $0x1, %al
callq 0x2040
movq 0x2a4a(%rip), %rax      # 0x6fc8
movq (%rax), %rdi
callq 0x2170
movq (%r14), %rax
cmpl $0x0, (%rax)
jle 0x4710
movq %rbx, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, 0xc(%rsp)
xorl %edx, %edx
movq %rbx, 0x38(%rsp)
cmpl $0x0, (%r12)
movq %rdx, 0x18(%rsp)
leaq (%rdx,%rdx,2), %r13
leaq 0x3f1a(%rip), %r15      # 0x84d8
movq %r12, %rsi
leaq 0x5298(%rip), %rbx      # 0x9860
jle 0x46b1
xorps %xmm0, %xmm0
cvtsi2ssl 0x18(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
xorl %ebp, %ebp
movq %r14, %r12
movq %r15, %rdi
callq 0x2bde
movss (%rbx), %xmm2
movss 0x4(%rbx), %xmm1
subss %xmm2, %xmm1
mulss %xmm1, %xmm0
addss %xmm2, %xmm0
addss 0x10(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movq %r15, %rdi
callq 0x2bde
movss (%rbx), %xmm2
movss 0x4(%rbx), %xmm1
subss %xmm2, %xmm1
mulss %xmm0, %xmm1
addss %xmm2, %xmm1
addss 0xc(%rsp), %xmm1
movq %rbx, %r14
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movss 0x14(%rsp), %xmm0
callq 0x36e8
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rbx
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0x43b4
movq 0x20(%rsp), %rsi
movq %r12, %r14
movq 0x38(%rsp), %rcx
movq (%r12), %rax
movq 0x8(%rax), %rax
movq (%rax,%rcx,8), %rax
movss (%rax,%r13,4), %xmm2
addss %xmm0, %xmm2
movss %xmm2, (%rax,%r13,4)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss 0x4(%rax,%r13,4), %xmm0
movss %xmm0, 0x4(%rax,%r13,4)
addss 0x8(%rax,%r13,4), %xmm1
movss %xmm1, 0x8(%rax,%r13,4)
incl %ebp
cmpl (%rsi), %ebp
jl 0x45df
movq (%r14), %rax
movq 0x8(%rax), %rax
movq (%rax,%rcx,8), %rax
movss (%rax,%r13,4), %xmm0
movss 0x8(%rsp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, (%rax,%r13,4)
movss 0x4(%rax,%r13,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x4(%rax,%r13,4)
movss 0x8(%rax,%r13,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x8(%rax,%r13,4)
movq 0x18(%rsp), %rdx
incq %rdx
movq (%r14), %rax
movslq (%rax), %rax
cmpq %rax, %rdx
movq %rsi, %r12
jl 0x45a9
movq (%r14), %rax
movslq 0x4(%rax), %rax
movq 0x28(%rsp), %rcx
cmpq %rax, %rcx
jl 0x4540
leaq 0xaa5(%rip), %rdi       # 0x51d1
callq 0x21d0
movq 0x5130(%rip), %rsi      # 0x9868
leaq 0xa7c(%rip), %rdi       # 0x51bb
xorl %eax, %eax
callq 0x2040
movq (%r14), %rdi
callq 0x33a4
movq (%r14), %rdi
callq 0x3466
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq