// File: /workspace/github_cpp_makefile_star2_O3/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 0x2059cb(%rip), %xmm0   # 0x21546c
movups %xmm0, 0x1c(%rsp)
movups 0x2059b3(%rip), %xmm0   # 0x215460
movups %xmm0, 0x10(%rsp)
movups 0x205997(%rip), %xmm0   # 0x215450
movups %xmm0, (%rsp)
callq 0x2e48a
movups 0xc7d83(%rip), %xmm0    # 0xd784c
movups %xmm0, 0x1c(%rsp)
movups 0xc7d6b(%rip), %xmm0    # 0xd7840
movups %xmm0, 0x10(%rsp)
movups 0xc7d4f(%rip), %xmm0    # 0xd7830
movups %xmm0, (%rsp)
callq 0x2e160
movq 0x205a47(%rip), %rbx    # 0x215538
leaq 0x205a40(%rip), %r14    # 0x215538
cmpq %r14, %rbx
je 0xfbb7
movq 0x10(%rbx), %r12
movq %r12, %rdi
callq 0xe5fa
testb %al, %al
je 0xfbaf
cmpb $0x1, 0xd(%r12)
jne 0xfbaf
leaq 0x38(%r12), %r13
leaq 0xd8(%r12), %r15
movl $0x84, %edx
movq %r15, %rdi
leaq 0x205663(%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 0x44735
leaq -0x104(%rbp), %r12
movq %r12, %rdi
callq 0x21dc6
movl $0x84, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x86a0
movq (%rbx), %rbx
jmp 0xfaf8
callq 0x2e45c
callq 0x2e50a
movups 0x2058d4(%rip), %xmm0   # 0x21549c
movups %xmm0, 0x1c(%rsp)
movups 0x2058bc(%rip), %xmm0   # 0x215490
movups %xmm0, 0x10(%rsp)
movups 0x2058a0(%rip), %xmm0   # 0x215480
movups %xmm0, (%rsp)
callq 0x2e48a
leaq 0x2056c0(%rip), %rsi    # 0x2152b0
movl $0x10, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl 0x20572f(%rip), %eax    # 0x215330
movl %eax, 0x80(%rsp)
callq 0x22497
movl 0x205851(%rip), %eax    # 0x215464
movl %eax, -0x70(%rbp)
movups 0x205837(%rip), %xmm0   # 0x215454
movaps %xmm0, -0x80(%rbp)
xorps %xmm1, %xmm1
cvtsi2ssl 0x2054dc(%rip), %xmm1 # 0x215108
movl 0x2054da(%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 0x77577
callq 0x224da
callq 0x2e50a
movups 0x2057eb(%rip), %xmm0   # 0x21546c
movups %xmm0, 0x1c(%rsp)
movups 0x2057d3(%rip), %xmm0   # 0x215460
movups %xmm0, 0x10(%rsp)
movups 0x2057b7(%rip), %xmm0   # 0x215450
movups %xmm0, (%rsp)
callq 0x2e48a
leaq 0x205717(%rip), %rbx    # 0x2153c0
movl $0x10, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x205783(%rip), %eax    # 0x215440
movl %eax, 0x80(%rsp)
callq 0x22497
xorps %xmm0, %xmm0
cvtsi2ssl 0x205434(%rip), %xmm0 # 0x215108
movss 0x89458(%rip), %xmm1    # 0x99134
movaps %xmm1, %xmm2
divss %xmm0, %xmm2
leaq -0x104(%rbp), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x205417(%rip), %xmm0 # 0x21510c
movss %xmm2, (%rax)
divss %xmm0, %xmm1
movss %xmm1, 0x4(%rax)
movl 0x205744(%rip), %edx    # 0x21544c
movl $0x10, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x205724(%rip), %ecx    # 0x215440
movl %ecx, 0x80(%rsp)
movl %edx, %edi
movq %rax, %rsi
movl $0x2, %edx
callq 0x2259b
movl 0x20575c(%rip), %eax    # 0x215494
movl %eax, -0x50(%rbp)
movups 0x205742(%rip), %xmm0   # 0x215484
movaps %xmm0, -0x60(%rbp)
xorps %xmm1, %xmm1
cvtsi2ssl 0x2053b7(%rip), %xmm1 # 0x215108
movl 0x2053b5(%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 0x77577
callq 0x224da
callq 0x2e50a
movups 0x205726(%rip), %xmm0   # 0x2154cc
movups %xmm0, 0x1c(%rsp)
movups 0x20570e(%rip), %xmm0   # 0x2154c0
movups %xmm0, 0x10(%rsp)
movups 0x2056f2(%rip), %xmm0   # 0x2154b0
movups %xmm0, (%rsp)
callq 0x2e48a
movl $0x10, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x205665(%rip), %eax    # 0x215440
movl %eax, 0x80(%rsp)
callq 0x22497
movl 0x2056a7(%rip), %eax    # 0x215494
movl %eax, -0x30(%rbp)
xorps %xmm1, %xmm1
cvtsi2ssl 0x20530d(%rip), %xmm1 # 0x215108
movups 0x205682(%rip), %xmm0   # 0x215484
xorl %eax, %eax
subl 0x205302(%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 0x205695(%rip), %xmm3 # 0x2154b8
xorps %xmm0, %xmm0
cvtsi2ssl 0x20568e(%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 0x77577
callq 0x224da
callq 0x2e50a
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq