// File: /workspace/github_cpp_makefile_star2_O1/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 0x205a73(%rip), %xmm0   # 0x21546c
movups %xmm0, 0x1c(%rsp)
movups 0x205a5b(%rip), %xmm0   # 0x215460
movups %xmm0, 0x10(%rsp)
movups 0x205a3f(%rip), %xmm0   # 0x215450
movups %xmm0, (%rsp)
callq 0x2e406
movups 0xc7e2b(%rip), %xmm0    # 0xd784c
movups %xmm0, 0x1c(%rsp)
movups 0xc7e13(%rip), %xmm0    # 0xd7840
movups %xmm0, 0x10(%rsp)
movups 0xc7df7(%rip), %xmm0    # 0xd7830
movups %xmm0, (%rsp)
callq 0x2e0dc
movq 0x205aef(%rip), %rbx    # 0x215538
leaq 0x205ae8(%rip), %r14    # 0x215538
cmpq %r14, %rbx
je 0xfb0f
movq 0x10(%rbx), %r12
movq %r12, %rdi
callq 0xe54a
testb %al, %al
je 0xfb07
cmpb $0x1, 0xd(%r12)
jne 0xfb07
leaq 0x38(%r12), %r13
leaq 0xd8(%r12), %r15
movl $0x84, %edx
movq %r15, %rdi
leaq 0x20570b(%rip), %rsi    # 0x2151a0
callq 0x86a0
movsd 0x10(%r12), %xmm0
movss 0x18(%r12), %xmm1
movsd 0x28(%r12), %xmm2
movss 0x30(%r12), %xmm3
movss 0x34(%r12), %xmm4
movsd 0x1c(%r12), %xmm5
movss 0x24(%r12), %xmm6
movl 0x170(%r12), %eax
movl $0x50, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %eax, %edi
callq 0x446b1
leaq -0x104(%rbp), %r12
movq %r12, %rdi
callq 0x21d42
movl $0x84, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x86a0
movq (%rbx), %rbx
jmp 0xfa50
callq 0x2e3d8
callq 0x2e486
movups 0x20597c(%rip), %xmm0   # 0x21549c
movups %xmm0, 0x1c(%rsp)
movups 0x205964(%rip), %xmm0   # 0x215490
movups %xmm0, 0x10(%rsp)
movups 0x205948(%rip), %xmm0   # 0x215480
movups %xmm0, (%rsp)
callq 0x2e406
leaq 0x205768(%rip), %rsi    # 0x2152b0
movl $0x10, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl 0x2057d7(%rip), %eax    # 0x215330
movl %eax, 0x80(%rsp)
callq 0x22413
movl 0x2058f9(%rip), %eax    # 0x215464
movl %eax, -0x70(%rbp)
movups 0x2058df(%rip), %xmm0   # 0x215454
movaps %xmm0, -0x80(%rbp)
xorps %xmm1, %xmm1
cvtsi2ssl 0x205584(%rip), %xmm1 # 0x215108
movl 0x205582(%rip), %eax    # 0x21510c
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
negl %eax
xorps %xmm2, %xmm2
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]
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x774f3
callq 0x22456
callq 0x2e486
movups 0x205893(%rip), %xmm0   # 0x21546c
movups %xmm0, 0x1c(%rsp)
movups 0x20587b(%rip), %xmm0   # 0x215460
movups %xmm0, 0x10(%rsp)
movups 0x20585f(%rip), %xmm0   # 0x215450
movups %xmm0, (%rsp)
callq 0x2e406
leaq 0x2057bf(%rip), %rbx    # 0x2153c0
movl $0x10, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x20582b(%rip), %eax    # 0x215440
movl %eax, 0x80(%rsp)
callq 0x22413
xorps %xmm0, %xmm0
cvtsi2ssl 0x2054dc(%rip), %xmm0 # 0x215108
movss 0x89500(%rip), %xmm1    # 0x99134
movaps %xmm1, %xmm2
divss %xmm0, %xmm2
leaq -0x104(%rbp), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x2054bf(%rip), %xmm0 # 0x21510c
movss %xmm2, (%rax)
divss %xmm0, %xmm1
movss %xmm1, 0x4(%rax)
movl 0x2057ec(%rip), %edx    # 0x21544c
movl $0x10, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x2057cc(%rip), %ecx    # 0x215440
movl %ecx, 0x80(%rsp)
movl %edx, %edi
movq %rax, %rsi
movl $0x2, %edx
callq 0x22517
movl 0x205804(%rip), %eax    # 0x215494
movl %eax, -0x50(%rbp)
movups 0x2057ea(%rip), %xmm0   # 0x215484
movaps %xmm0, -0x60(%rbp)
xorps %xmm1, %xmm1
cvtsi2ssl 0x20545f(%rip), %xmm1 # 0x215108
movl 0x20545d(%rip), %eax    # 0x21510c
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
negl %eax
xorps %xmm2, %xmm2
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 $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x774f3
callq 0x22456
callq 0x2e486
movups 0x2057ce(%rip), %xmm0   # 0x2154cc
movups %xmm0, 0x1c(%rsp)
movups 0x2057b6(%rip), %xmm0   # 0x2154c0
movups %xmm0, 0x10(%rsp)
movups 0x20579a(%rip), %xmm0   # 0x2154b0
movups %xmm0, (%rsp)
callq 0x2e406
movl $0x10, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x20570d(%rip), %eax    # 0x215440
movl %eax, 0x80(%rsp)
callq 0x22413
movl 0x20574f(%rip), %eax    # 0x215494
movl %eax, -0x30(%rbp)
xorps %xmm1, %xmm1
cvtsi2ssl 0x2053b5(%rip), %xmm1 # 0x215108
movups 0x20572a(%rip), %xmm0   # 0x215484
xorl %eax, %eax
subl 0x2053aa(%rip), %eax    # 0x21510c
movaps %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
xorps %xmm3, %xmm3
cvtsi2ssl 0x20573d(%rip), %xmm3 # 0x2154b8
xorps %xmm0, %xmm0
cvtsi2ssl 0x205736(%rip), %xmm0 # 0x2154bc
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 $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x774f3
callq 0x22456
callq 0x2e486
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq