// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/RenderImage.cpp
// Function: RenderImage::render_tile(image_tile)
void RenderImage::render_tile(image_tile img_t){
    Eigen::Vector3d ray_pt, ray_dir, color, ampl;
    Ray ray;
    double t_value = 0;
    for (int i=img_t.x; i<img_t.x + img_t.x_len; i++){
        for (int j=img_t.y; j<img_t.y + img_t.y_len; j++){
            ray_pt = scene->get_camera().get_pixel_position(i, j);
            ray_dir = (ray_pt - scene->get_camera().get_eye()).normalized();
            ray = Ray(ray_pt, ray_dir);
            color << 0,0,0;
            ampl << 1,1,1;
            ray_trace(ray, color, ampl, scene->get_recursion(), t_value);
            scene->get_image().write_pixel(i, j, color);
            scene->get_image().write_t_value(i, j, t_value);
        }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xf8(%rsp), %rdi
callq 0x15be0
movq $0x0, 0x58(%rsp)
testl %ebx, %ebx
jle 0xc56a
movq %rbx, %rax
movq %r14, %rdx
shrq $0x20, %rdx
movq %rbx, %rcx
addl %r14d, %eax
movl %eax, 0x50(%rsp)
shrq $0x20, %rcx
movq %rcx, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
leal (%rcx,%rdx), %eax
movl %eax, 0x54(%rsp)
movq %rsp, %r12
movl $0x1, %ebx
movabsq $0x3ff0000000000000, %rbp # imm = 0x3FF0000000000000
movq 0x60(%rsp), %rax
movl %eax, %r13d
cmpl $0x0, 0x68(%rsp)
jle 0xc55c
movq (%r15), %rdi
callq 0xed76
movq %r12, %rdi
movq %rax, %rsi
movl %r14d, %edx
movl %r13d, %ecx
callq 0x5506
movaps (%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movq (%r15), %rdi
callq 0xed76
movq %r12, %rdi
movq %rax, %rsi
callq 0x55d8
movsd 0x70(%rsp), %xmm5
movapd 0x90(%rsp), %xmm4
movapd %xmm4, %xmm0
subpd (%rsp), %xmm0
movapd %xmm0, %xmm1
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
movapd %xmm5, %xmm1
subsd 0x10(%rsp), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
ucomisd 0xabc0(%rip), %xmm2     # 0x16f20
jbe 0xc376
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
sqrtpd %xmm2, %xmm2
divsd %xmm2, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movapd %xmm4, 0xe0(%rsp)
movsd %xmm5, 0xf0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movsd %xmm1, 0xd0(%rsp)
movq %r12, %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x15bf0
movsd (%rsp), %xmm0
movsd %xmm0, 0xf8(%rsp)
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x100(%rsp)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x110(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, 0x118(%rsp)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x128(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, (%rsp)
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %rax, 0x78(%rsp)
movq %rax, 0x48(%rsp)
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x5b22
movq $0x0, 0x40(%rsp)
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x5b22
movq 0x18(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq $0x3, %rax
jne 0xc5a2
cmpq $0x1, 0x10(%rsp)
jne 0xc5a2
leaq 0x130(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %rbp, 0x130(%rsp)
movq %rbp, 0x48(%rsp)
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x5b22
movq %rbp, 0x40(%rsp)
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x5b22
movq 0x18(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq $0x3, %rax
jne 0xc5a2
cmpq $0x1, 0x10(%rsp)
jne 0xc5a2
movq (%r15), %rdi
callq 0xed8c
movq %r15, %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x130(%rsp), %rcx
movl %eax, %r8d
leaq 0x58(%rsp), %r9
callq 0xc5c2
movq (%r15), %rdi
callq 0xed7c
movups 0x78(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x88(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movq %rax, %rdi
movl %r14d, %esi
movl %r13d, %edx
leaq 0xa0(%rsp), %rcx
callq 0x3ca2
movq (%r15), %rdi
callq 0xed7c
movsd 0x58(%rsp), %xmm0
movq %rax, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x3d40
incl %r13d
cmpl 0x54(%rsp), %r13d
jl 0xc2d2
incl %r14d
cmpl 0x50(%rsp), %r14d
jl 0xc2bf
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc582
jmp 0xc582
jmp 0xc582
movq 0x18(%rsp), %rcx
addq 0x8(%rsp), %rcx
cmpq $0x3, %rcx
jne 0xc5a2
cmpq $0x1, 0x10(%rsp)
jne 0xc5a2
movq %rax, %rdi
callq 0x34b0
leaq 0xa39f(%rip), %rdi      # 0x16948
leaq 0xa436(%rip), %rsi      # 0x169e6
leaq 0xa459(%rip), %rcx      # 0x16a10
movl $0x78, %edx
callq 0x31a0
nop