// File: /workspace/github_cpp_makefile_star2_O2/IsaacLaw12[P]RayTracer/./src/Image.cpp
// Function: Image::apply_anti_alias()
void Image::apply_anti_alias(){
    std::vector<Eigen::MatrixXd*> image;
    image.push_back(&red_pixels);
    image.push_back(&green_pixels);
    image.push_back(&blue_pixels);

    int scale = anti_alias + 1;
    int new_width = image_width / scale;
    int new_height = image_height / scale;

    Eigen::MatrixXd scaled_down = Eigen::MatrixXd();
    scaled_down.resize(new_width, new_height);
    for (Eigen::MatrixXd* cur: image){
        for (int x=0; x<new_width; x++){
            for (int y=0; y<new_height; y++){
                scaled_down(x, y) = get_anti_alias_val(x, y, scale, cur);
            }
        }
        // Assign scaled down values to image
        cur->resize(new_width, new_height);
        *cur = Eigen::MatrixXd(scaled_down);
    }
    std::cout << "Image_width: " << image_width << "\n";
    image_width = new_width;
    std::cout << "Image_width: " << image_width << "\n";
    image_height = new_height;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
leaq 0x18(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
callq 0x4d24
leaq 0x30(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x4d24
leaq 0x48(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x4d24
movl 0x4(%rbx), %r15d
movl 0x10(%rbx), %eax
incl %r15d
cltd
idivl %r15d
movl %eax, %r14d
movl 0x14(%rbx), %eax
cltd
idivl %r15d
movl %eax, %ebp
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movslq %r14d, %rsi
movslq %eax, %rdx
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
callq 0x458e
movq %rbx, 0x60(%rsp)
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rax, 0x78(%rsp)
xorl %eax, %eax
testl %ebp, %ebp
movl %ebp, 0x4(%rsp)
movl %ebp, %r13d
cmovlel %eax, %r13d
testl %r14d, %r14d
movl %r14d, (%rsp)
movl %r14d, %edx
cmovlel %eax, %edx
movq %rdx, 0x88(%rsp)
leaq 0x20(%rsp), %r14
cmpq 0x78(%rsp), %rcx
je 0x4159
movq %rcx, 0x80(%rsp)
movq (%rcx), %rbx
xorl %ebp, %ebp
cmpq 0x88(%rsp), %rbp
je 0x40eb
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x40e6
movl %ebp, %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %rbx, %r8
callq 0x44ac
movsd %xmm0, 0x90(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x4544
movsd 0x90(%rsp), %xmm0
movsd %xmm0, (%rax)
incq %r12
jmp 0x40a8
incq %rbp
jmp 0x409b
movq %rbx, %rdi
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x458e
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x4c18
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, (%rbx)
movq 0x10(%rsp), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rbx)
movq 0x18(%rsp), %rax
movq 0x10(%rbx), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x10(%rbx)
movq 0x8(%rsp), %rdi
callq 0x3300
movq 0x80(%rsp), %rcx
addq $0x8, %rcx
jmp 0x4083
movq 0x25e60(%rip), %rdi     # 0x29fc0
leaq 0x13f22(%rip), %rsi     # 0x18089
callq 0x32a0
movq 0x60(%rsp), %rbx
movl 0x4(%rsp), %ebp
movl (%rsp), %r14d
movl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x3470
leaq 0x15042(%rip), %rsi     # 0x191cd
movq %rax, %rdi
callq 0x32a0
movl %r14d, 0x10(%rbx)
movq 0x25e22(%rip), %rdi     # 0x29fc0
leaq 0x13ee4(%rip), %rsi     # 0x18089
callq 0x32a0
movl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x3470
leaq 0x15011(%rip), %rsi     # 0x191cd
movq %rax, %rdi
callq 0x32a0
movl %ebp, 0x14(%rbx)
movq 0x20(%rsp), %rdi
callq 0x3300
leaq 0x40(%rsp), %rdi
callq 0x4cf0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x41f1
jmp 0x41f1
movq %rax, %rbx
jmp 0x4209
jmp 0x41fc
jmp 0x41fc
jmp 0x41fc
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0x3300
leaq 0x40(%rsp), %rdi
callq 0x4cf0
movq %rbx, %rdi
callq 0x3490
nop