// File: /workspace/github_cpp_makefile_star2_O2/KellerMartins[P]PDS2-Pacman/source/graphics/rendering.cpp
// Function: RenderManager::RenderBaseEffect()
void RenderBaseEffect(){
        //Render mask to _baseRT
        BeginTextureMode(_baseRT);    
            BeginMode3D(camera);  
                for(Object3D* m : _objectsToRender){
                    if(!m->HasModel() || !m->shouldRender) continue;

                    m->model.material.shader = _maskShader;
                    DrawModelEx(m->model, m->position, m->rotationAxis,m->rotationAngle,m->scale, m->model.material.maps[MAP_DIFFUSE].color);
                    m->model.material.shader = GetShaderDefault();
                } 
            EndMode3D();
        EndTextureMode();

        //Apply outline shader in _baseRT and copy to _tempRT        
        BeginTextureMode(_tempRT);
            BeginShaderMode(_outlineFilter);
                DrawTexturePro(_baseRT.texture, (Rectangle){ 0, 0, (float)_screenWidth, (float)-_screenHeight }, 
                                                (Rectangle){ 0, 0, (float)_screenWidth, (float)_screenHeight }, (Vector2){ 0, 0 }, 0,  WHITE);
            EndShaderMode();
        EndTextureMode();

        //Apply bicubic filter and copy from _tempRT to _baseRT
        BeginTextureMode(_baseRT);
            BeginShaderMode(_copyRTShader);

            Vector2 pixelSize = {1.0f/_screenWidth, 1.0f/_screenHeight};
            SetShaderValue(_copyRTShader, _copyRTPixelSizeLoc, (const float*) &pixelSize, 2);

            DrawTexturePro(_tempRT.texture, (Rectangle){ 0, 0, (float)_screenWidth, (float)-_screenHeight }, 
                                            (Rectangle){ 0, 0, (float)_screenWidth, (float)_screenHeight }, (Vector2){ 0, 0 }, 0,  WHITE);

            EndShaderMode();
        EndTextureMode();

        //Apply bicubic filter, downsample and copy _tempRT to _blurRT
        BeginTextureMode(_blurRT);
            BeginShaderMode(_copyRTShader);
            DrawTexturePro(_tempRT.texture, (Rectangle){ 0, 0, (float)_screenWidth, (float)-_screenHeight }, 
                                            (Rectangle){ 0, 0, (float)_blurRT.texture.width, 
                                                               (float)_blurRT.texture.height }, 
                                            (Vector2){ 0, 0 }, 0,  WHITE);
            EndShaderMode();
        EndTextureMode();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movups 0x20549b(%rip), %xmm0   # 0x21448c
movups %xmm0, 0x1c(%rsp)
movups 0x205483(%rip), %xmm0   # 0x214480
movups %xmm0, 0x10(%rsp)
movups 0x205467(%rip), %xmm0   # 0x214470
movups %xmm0, (%rsp)
callq 0x2d84e
movups 0xc7853(%rip), %xmm0    # 0xd686c
movups %xmm0, 0x1c(%rsp)
movups 0xc783b(%rip), %xmm0    # 0xd6860
movups %xmm0, 0x10(%rsp)
movups 0xc781f(%rip), %xmm0    # 0xd6850
movups %xmm0, (%rsp)
callq 0x2d524
leaq 0x205517(%rip), %r15    # 0x214558
movq %r15, %r14
movq (%r14), %r14
cmpq %r15, %r14
je 0xf0ee
movq 0x10(%r14), %r13
movq %r13, %rdi
callq 0xdcda
testb %al, %al
je 0xf044
cmpb $0x1, 0xd(%r13)
jne 0xf044
leaq 0x38(%r13), %rbx
leaq 0xd8(%r13), %r12
movl $0x84, %edx
movq %r12, %rdi
leaq 0x20513f(%rip), %rsi    # 0x2141c0
callq 0x8690
movsd 0x10(%r13), %xmm0
movss 0x18(%r13), %xmm1
movsd 0x28(%r13), %xmm2
movss 0x30(%r13), %xmm3
movss 0x34(%r13), %xmm4
movsd 0x1c(%r13), %xmm5
movss 0x24(%r13), %xmm6
movl 0x170(%r13), %eax
pushq $0x50
popq %rcx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %eax, %edi
callq 0x43af9
leaq -0x104(%rbp), %rbx
movq %rbx, %rdi
callq 0x2118a
movl $0x84, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8690
jmp 0xf044
callq 0x2d820
callq 0x2d8ce
movups 0x2053bd(%rip), %xmm0   # 0x2144bc
movups %xmm0, 0x1c(%rsp)
movups 0x2053a5(%rip), %xmm0   # 0x2144b0
movups %xmm0, 0x10(%rsp)
movups 0x205389(%rip), %xmm0   # 0x2144a0
movups %xmm0, (%rsp)
callq 0x2d84e
leaq 0x2051a9(%rip), %rsi    # 0x2142d0
movl $0x84, %ecx
movq %rsp, %rdi
rep  movsb (%rsi), %es:(%rdi)
callq 0x2185b
movl 0x205348(%rip), %eax    # 0x214484
movl %eax, -0x70(%rbp)
movups 0x20532e(%rip), %xmm0   # 0x214474
movaps %xmm0, -0x80(%rbp)
cvtsi2ssl 0x204fd6(%rip), %xmm1 # 0x214128
movl 0x204fd4(%rip), %eax    # 0x21412c
cvtsi2ss %eax, %xmm0
negl %eax
cvtsi2ss %eax, %xmm2
movl -0x70(%rbp), %eax
movl %eax, 0x10(%rsp)
movaps -0x80(%rbp), %xmm3
movups %xmm3, (%rsp)
movaps %xmm1, %xmm3
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
pushq $-0x1
popq %rbx
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
movl %ebx, %edi
callq 0x7693b
callq 0x2189e
callq 0x2d8ce
movups 0x2052eb(%rip), %xmm0   # 0x21448c
movups %xmm0, 0x1c(%rsp)
movups 0x2052d3(%rip), %xmm0   # 0x214480
movups %xmm0, 0x10(%rsp)
movups 0x2052b7(%rip), %xmm0   # 0x214470
movups %xmm0, (%rsp)
callq 0x2d84e
leaq 0x205217(%rip), %r14    # 0x2143e0
movl $0x84, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsb (%rsi), %es:(%rdi)
callq 0x2185b
cvtsi2ssl 0x204f45(%rip), %xmm0 # 0x214128
movss 0x88f49(%rip), %xmm1    # 0x98134
movaps %xmm1, %xmm2
divss %xmm0, %xmm2
leaq -0x104(%rbp), %rax
cvtsi2ssl 0x204f2b(%rip), %xmm0 # 0x21412c
movss %xmm2, (%rax)
divss %xmm0, %xmm1
movss %xmm1, 0x4(%rax)
movl 0x205257(%rip), %r8d    # 0x21446c
movl $0x84, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsb (%rsi), %es:(%rdi)
pushq $0x2
popq %rdx
movl %r8d, %edi
movq %rax, %rsi
callq 0x2195f
movl 0x20527e(%rip), %eax    # 0x2144b4
movl %eax, -0x50(%rbp)
movups 0x205264(%rip), %xmm0   # 0x2144a4
movaps %xmm0, -0x60(%rbp)
cvtsi2ssl 0x204edc(%rip), %xmm1 # 0x214128
movl 0x204eda(%rip), %eax    # 0x21412c
cvtsi2ss %eax, %xmm0
negl %eax
cvtsi2ss %eax, %xmm2
movl -0x50(%rbp), %eax
movl %eax, 0x10(%rsp)
movaps -0x60(%rbp), %xmm3
movups %xmm3, (%rsp)
movaps %xmm1, %xmm3
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
movl %ebx, %edi
callq 0x7693b
callq 0x2189e
callq 0x2d8ce
movups 0x205254(%rip), %xmm0   # 0x2144ec
movups %xmm0, 0x1c(%rsp)
movups 0x20523c(%rip), %xmm0   # 0x2144e0
movups %xmm0, 0x10(%rsp)
movups 0x205220(%rip), %xmm0   # 0x2144d0
movups %xmm0, (%rsp)
callq 0x2d84e
movl $0x84, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsb (%rsi), %es:(%rdi)
callq 0x2185b
movl 0x2051e3(%rip), %eax    # 0x2144b4
movl %eax, -0x30(%rbp)
cvtsi2ssl 0x204e4c(%rip), %xmm1 # 0x214128
movups 0x2051c1(%rip), %xmm0   # 0x2144a4
xorl %eax, %eax
subl 0x204e41(%rip), %eax    # 0x21412c
movaps %xmm0, -0x40(%rbp)
cvtsi2ss %eax, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtsi2ssl 0x2051da(%rip), %xmm3 # 0x2144d8
cvtsi2ssl 0x2051d6(%rip), %xmm0 # 0x2144dc
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
movl -0x30(%rbp), %eax
movl %eax, 0x10(%rsp)
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
movl %ebx, %edi
callq 0x7693b
callq 0x2189e
callq 0x2d8ce
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq