// File: /workspace/github_cpp_makefile_star2_O3/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 0x5090
leaq 0x30(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x5090
leaq 0x48(%rbx), %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x5090
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 0x45fc
testl %r13d, %r13d
sete %al
testl %r12d, %r12d
sete %cl
orb %al, %cl
movb %cl, 0xf(%rsp)
jne 0x4390
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
idivq 0x10(%rsp)
cmpq 0x18(%rsp), %rax
jl 0x461b
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
movq 0x18(%rsp), %rdx
imulq %rdx, %rsi
leaq 0x20(%rsp), %rdi
movq %rsi, 0x80(%rsp)
callq 0x5204
movq %rbx, 0x70(%rsp)
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x78(%rsp)
cmpq %rcx, %rax
je 0x44f9
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 0x4453
xorl %ebx, %ebx
movl %r12d, %r13d
testl %r12d, %r12d
jle 0x4443
xorl %r12d, %r12d
movl %ebx, %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %r14, %r8
callq 0x49d2
movq 0x28(%rsp), %rax
cmpq %rbx, %rax
jle 0x45af
cmpq %r12, 0x30(%rsp)
jle 0x45af
imulq %r12, %rax
shlq $0x3, %rax
addq 0x20(%rsp), %rax
movsd %xmm0, (%rax,%rbx,8)
incq %r12
cmpq %r12, %rbp
jne 0x4400
incq %rbx
cmpq 0x90(%rsp), %rbx
movl %r13d, %r12d
jne 0x43f5
cmpb $0x0, 0xf(%rsp)
jne 0x4476
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
idivq 0x10(%rsp)
cmpq 0x18(%rsp), %rax
jl 0x45ce
movq %r14, %rdi
movq 0x80(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x5204
leaq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x4fb8
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 0x43e3
movq 0x1bac8(%rip), %rdi     # 0x1ffc8
leaq 0x11b8a(%rip), %rsi     # 0x16091
movl $0xd, %edx
callq 0x32f0
movq 0x70(%rsp), %rbx
movl 0x10(%rbx), %esi
movq 0x1baa8(%rip), %rdi     # 0x1ffc8
callq 0x3490
leaq 0x12747(%rip), %rsi     # 0x16c73
movl $0x1, %edx
movq %rax, %rdi
callq 0x32f0
movl %r13d, 0x10(%rbx)
movq 0x1ba84(%rip), %rdi     # 0x1ffc8
leaq 0x11b46(%rip), %rsi     # 0x16091
movl $0xd, %edx
callq 0x32f0
movl 0x10(%rbx), %esi
movq 0x1ba69(%rip), %rdi     # 0x1ffc8
callq 0x3490
leaq 0x12708(%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 0x459d
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 0x11edd(%rip), %rdi     # 0x16493
leaq 0x11f0b(%rip), %rsi     # 0x164c8
leaq 0x11f2d(%rip), %rcx     # 0x164f1
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0
movl $0x8, %edi
callq 0x3130
movq 0x1b9e1(%rip), %rcx     # 0x1ffc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x1b9e3(%rip), %rsi     # 0x1ffd0
movq 0x1b9b4(%rip), %rdx     # 0x1ffa8
movq %rax, %rdi
callq 0x3480
leaq 0x120aa(%rip), %rdi     # 0x166ad
leaq 0x12232(%rip), %rsi     # 0x1683c
leaq 0x12254(%rip), %rcx     # 0x16865
movl $0x11d, %edx            # imm = 0x11D
callq 0x31a0
movl $0x8, %edi
callq 0x3130
movq 0x1b994(%rip), %rcx     # 0x1ffc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x1b996(%rip), %rsi     # 0x1ffd0
movq 0x1b967(%rip), %rdx     # 0x1ffa8
movq %rax, %rdi
callq 0x3480
jmp 0x464d
jmp 0x464d
movq %rax, %rbx
jmp 0x4665
jmp 0x4658
jmp 0x4658
jmp 0x4658
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0x3320
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x467c
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0