// File: /workspace/github_cpp_makefile_star2_O1/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
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x18(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
callq 0x50aa
leaq 0x30(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x50aa
leaq 0x48(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x50aa
movl 0x4(%rbx), %r15d
movl 0x10(%rbx), %eax
incl %r15d
cltd
idivl %r15d
movl %eax, %r13d
movl 0x14(%rbx), %eax
cltd
idivl %r15d
movl %eax, %r12d
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movslq %r13d, %rcx
cltq
movq %rax, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
orq %rcx, %rax
js 0x45f6
testl %r13d, %r13d
sete %al
testl %r12d, %r12d
sete %cl
orb %al, %cl
movb %cl, 0xf(%rsp)
jne 0x438a
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
idivq 0x10(%rsp)
cmpq 0x18(%rsp), %rax
jl 0x4615
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
movq 0x18(%rsp), %rdx
imulq %rdx, %rsi
leaq 0x20(%rsp), %rdi
movq %rsi, 0x80(%rsp)
callq 0x5216
movq %rbx, 0x70(%rsp)
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x78(%rsp)
cmpq %rcx, %rax
je 0x44f3
movl %r13d, %ecx
movq %rcx, 0x90(%rsp)
movl %r12d, %ebp
movl %r13d, 0x3c(%rsp)
movq %rax, 0x88(%rsp)
movq (%rax), %r14
testl %r13d, %r13d
jle 0x444d
xorl %ebx, %ebx
movl %r12d, %r13d
testl %r12d, %r12d
jle 0x443d
xorl %r12d, %r12d
movl %ebx, %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %r14, %r8
callq 0x49cc
movq 0x28(%rsp), %rax
cmpq %rbx, %rax
jle 0x45a9
cmpq %r12, 0x30(%rsp)
jle 0x45a9
imulq %r12, %rax
shlq $0x3, %rax
addq 0x20(%rsp), %rax
movsd %xmm0, (%rax,%rbx,8)
incq %r12
cmpq %r12, %rbp
jne 0x43fa
incq %rbx
cmpq 0x90(%rsp), %rbx
movl %r13d, %r12d
jne 0x43ef
cmpb $0x0, 0xf(%rsp)
jne 0x4470
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
idivq 0x10(%rsp)
cmpq 0x18(%rsp), %rax
jl 0x45c8
movq %r14, %rdi
movq 0x80(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x5216
leaq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x4fd2
movl 0x3c(%rsp), %r13d
movq 0x58(%rsp), %rax
movq (%r14), %rcx
movq %rcx, 0x58(%rsp)
movq %rax, (%r14)
movq 0x60(%rsp), %rax
movq 0x8(%r14), %rcx
movq %rcx, 0x60(%rsp)
movq %rax, 0x8(%r14)
movq 0x68(%rsp), %rax
movq 0x10(%r14), %rcx
movq %rcx, 0x68(%rsp)
movq %rax, 0x10(%r14)
movq 0x58(%rsp), %rdi
callq 0x3320
movq 0x88(%rsp), %rax
addq $0x8, %rax
cmpq 0x78(%rsp), %rax
jne 0x43dd
movq 0x1bace(%rip), %rdi     # 0x1ffc8
leaq 0x11b90(%rip), %rsi     # 0x16091
movl $0xd, %edx
callq 0x32f0
movq 0x70(%rsp), %rbx
movl 0x10(%rbx), %esi
movq 0x1baae(%rip), %rdi     # 0x1ffc8
callq 0x3490
leaq 0x1274d(%rip), %rsi     # 0x16c73
movl $0x1, %edx
movq %rax, %rdi
callq 0x32f0
movl %r13d, 0x10(%rbx)
movq 0x1ba8a(%rip), %rdi     # 0x1ffc8
leaq 0x11b4c(%rip), %rsi     # 0x16091
movl $0xd, %edx
callq 0x32f0
movl 0x10(%rbx), %esi
movq 0x1ba6f(%rip), %rdi     # 0x1ffc8
callq 0x3490
leaq 0x1270e(%rip), %rsi     # 0x16c73
movl $0x1, %edx
movq %rax, %rdi
callq 0x32f0
movl %r12d, 0x14(%rbx)
movq 0x20(%rsp), %rdi
callq 0x3320
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4597
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11ee3(%rip), %rdi     # 0x16493
leaq 0x11f11(%rip), %rsi     # 0x164c8
leaq 0x11f33(%rip), %rcx     # 0x164f1
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0
movl $0x8, %edi
callq 0x3130
movq 0x1b9e7(%rip), %rcx     # 0x1ffc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x1b9e9(%rip), %rsi     # 0x1ffd0
movq 0x1b9ba(%rip), %rdx     # 0x1ffa8
movq %rax, %rdi
callq 0x3480
leaq 0x120b0(%rip), %rdi     # 0x166ad
leaq 0x12238(%rip), %rsi     # 0x1683c
leaq 0x1225a(%rip), %rcx     # 0x16865
movl $0x11d, %edx            # imm = 0x11D
callq 0x31a0
movl $0x8, %edi
callq 0x3130
movq 0x1b99a(%rip), %rcx     # 0x1ffc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x1b99c(%rip), %rsi     # 0x1ffd0
movq 0x1b96d(%rip), %rdx     # 0x1ffa8
movq %rax, %rdi
callq 0x3480
jmp 0x4647
jmp 0x4647
movq %rax, %rbx
jmp 0x465f
jmp 0x4652
jmp 0x4652
jmp 0x4652
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0x3320
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4676
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0