// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Image.cpp
// Function: Image::blur_pixel(int, int, int)
void Image::blur_pixel(int index_x, int index_y, int blur_size){
    // Original color matrices are not affected. Their blurred averages are
    //     written to post_* matrices
    double red_avg = 0;
    double green_avg = 0;
    double blue_avg = 0;
    int avg_num = 0;
    if (blur_size <= 0) return;

    for (int x=-blur_size; x<=blur_size; x++){
        for (int y=-blur_size; y<=blur_size; y++){
            int x_index = index_x + x;
            if (x_index < 0 || x_index >= image_width){
               continue;
            }
            int y_index = index_y + y;
            if (y_index < 0 || y_index >= image_height){
               continue;
            }
            red_avg += red_pixels(x_index, y_index);
            green_avg += green_pixels(x_index, y_index);
            blue_avg += blue_pixels(x_index, y_index);
            avg_num++;
        }
    }
    if (avg_num > 0){
        post_red_pixels(index_x, index_y) = red_avg / avg_num;
        post_green_pixels(index_x, index_y) = green_avg / avg_num;
        post_blue_pixels(index_x, index_y) = blue_avg / avg_num;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %esi, 0x4(%rsp)
testl %ecx, %ecx
jle 0x49a4
movl %ecx, %r10d
negl %r10d
movl 0x10(%rdi), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rdi), %r9d
movq 0x20(%rdi), %r12
movq 0x28(%rdi), %rax
movq %rax, 0x50(%rsp)
movq 0x18(%rdi), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rdi), %r15
movq 0x40(%rdi), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rdi), %r13
movq 0x58(%rdi), %rbp
movq 0x30(%rdi), %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x48(%rdi), %rax
movq %rax, 0x28(%rsp)
leal 0x1(,%rcx,2), %eax
movl %eax, 0x10(%rsp)
movl %edx, 0x8(%rsp)
subl %ecx, %edx
movl %edx, 0xc(%rsp)
xorl %eax, %eax
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
movq %rcx, 0x20(%rsp)
movq %r10, 0x40(%rsp)
addl 0x4(%rsp), %r10d
setns %cl
cmpl 0x14(%rsp), %r10d
setl %r8b
andb %cl, %r8b
movq 0x38(%rsp), %rcx
leaq (%rcx,%r10,8), %rdx
movq 0x30(%rsp), %rcx
leaq (%rcx,%r10,8), %rdi
movq 0x28(%rsp), %rcx
leaq (%rcx,%r10,8), %r14
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %ecx
testb %r8b, %r8b
je 0x48d7
testl %esi, %esi
js 0x48d7
cmpl %r9d, %esi
jge 0x48d7
cmpq %r10, %r12
jle 0x49b3
movl %esi, %ebx
cmpq %rbx, 0x50(%rsp)
jle 0x49b3
cmpq %r10, %r15
jle 0x49b3
cmpq %rbx, 0x48(%rsp)
jle 0x49b3
cmpq %r10, %r13
jle 0x49b3
cmpq %rbx, %rbp
jle 0x49b3
movq %r12, %r11
imulq %rbx, %r11
addsd (%rdx,%r11,8), %xmm2
movq %r15, %r11
imulq %rbx, %r11
addsd (%rdi,%r11,8), %xmm1
imulq %r13, %rbx
addsd (%r14,%rbx,8), %xmm0
incl %eax
incl %esi
decl %ecx
jne 0x4867
movq 0x40(%rsp), %rsi
leal 0x1(%rsi), %edx
movq 0x20(%rsp), %rcx
cmpl %ecx, %esi
movl %edx, %r10d
jne 0x482b
testl %eax, %eax
movq 0x18(%rsp), %rdi
movl 0x8(%rsp), %edx
jle 0x49a4
cmpl $0x0, 0x4(%rsp)
js 0x49b3
testl %edx, %edx
js 0x49b3
movslq 0x4(%rsp), %rcx
movq 0x68(%rdi), %rsi
cmpq %rcx, %rsi
jle 0x49b3
movslq %edx, %rdx
cmpq %rdx, 0x70(%rdi)
jle 0x49b3
cvtsi2sd %eax, %xmm3
imulq %rdx, %rsi
shlq $0x3, %rsi
addq 0x60(%rdi), %rsi
divsd %xmm3, %xmm2
movsd %xmm2, (%rsi,%rcx,8)
movq 0x80(%rdi), %rax
cmpq %rcx, %rax
jle 0x49b3
cmpq %rdx, 0x88(%rdi)
jle 0x49b3
imulq %rdx, %rax
shlq $0x3, %rax
addq 0x78(%rdi), %rax
divsd %xmm3, %xmm1
movsd %xmm1, (%rax,%rcx,8)
movq 0x98(%rdi), %rax
cmpq %rcx, %rax
jle 0x49b3
cmpq %rdx, 0xa0(%rdi)
jle 0x49b3
divsd %xmm3, %xmm0
imulq %rdx, %rax
shlq $0x3, %rax
addq 0x90(%rdi), %rax
movsd %xmm0, (%rax,%rcx,8)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11ad9(%rip), %rdi     # 0x16493
leaq 0x11b07(%rip), %rsi     # 0x164c8
leaq 0x11b29(%rip), %rcx     # 0x164f1
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0