// File: KellerMartins[P]PDS2-Pacman/source/graphics/rendering.cpp
// Function: RenderManager::RenderBloom()
void RenderBloom(){
        //Render vertical pass
        BeginTextureMode(_vBlurRT);
            BeginShaderMode(_blurPass);

                Vector4 pixelSize4 = {0, (1.0f/_blurRT.texture.height)/2.0f, 0, 1.0f/_blurRT.texture.height};
                SetShaderValue(_blurPass, _blurPassPixelSizeLoc, (const float*) &pixelSize4, 4);
                SetShaderValuei(_blurPass, _blurPassBlurQualityLoc, (const int*) &_blurQuality, 1);

                Rectangle src = (Rectangle){ 0, 0, (float)_blurRT.texture.width, (float)-_blurRT.texture.height };
                Rectangle dest = (Rectangle){ 0, 0, (float)_vBlurRT.texture.width, (float)_vBlurRT.texture.height };
                DrawTexturePro(_blurRT.texture, src, dest, (Vector2){ 0, 0 }, 0,  WHITE);

            EndShaderMode();
        EndTextureMode();

        //Render horizontal pass
        BeginTextureMode(_blurRT);
            BeginShaderMode(_blurPass);

                pixelSize4 = (Vector4){(1.0f/_vBlurRT.texture.width)/2.0f, 0, 1.0f/_vBlurRT.texture.width,0};
                SetShaderValue(_blurPass, _blurPassPixelSizeLoc, (const float*) &pixelSize4, 4);
                SetShaderValuei(_blurPass, _blurPassBlurQualityLoc, (const int*) &_blurQuality, 1);

                src = (Rectangle){ 0, 0, (float)_vBlurRT.texture.width, (float)-_vBlurRT.texture.height };
                dest = (Rectangle){ 0, 0, (float)_blurRT.texture.width, (float)_blurRT.texture.height };
                DrawTexturePro(_vBlurRT.texture, src, dest, (Vector2){ 0, 0 }, 0,  WHITE);
            EndShaderMode();
        EndTextureMode();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5a0, %rsp            # imm = 0x5A0
movups 0x20d152(%rip), %xmm0   # 0x226534
movups %xmm0, -0x14(%rbp)
movups 0x20d13b(%rip), %xmm0   # 0x226528
movaps %xmm0, -0x20(%rbp)
movups 0x20d120(%rip), %xmm0   # 0x226518
movaps %xmm0, -0x30(%rbp)
movups -0x14(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x1c(%rax)
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3a4c6
leaq 0x20cd4e(%rip), %rsi    # 0x226170
movq %rsi, -0x4c0(%rbp)
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x518(%rbp)
movl $0x84, %edx
movq %rdx, -0x4b8(%rbp)
callq 0x96e0
movq -0x518(%rbp), %rsi
movq %rsp, %rax
movl $0x10, %ecx
movq %rcx, -0x4b0(%rbp)
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl -0x38(%rbp), %ecx
movl %ecx, 0x80(%rax)
callq 0x2e4d3
movq -0x4c0(%rbp), %rsi
movq -0x4b8(%rbp), %rdx
movl $0x0, -0xd0(%rbp)
cvtsi2ssl 0x20d066(%rip), %xmm2 # 0x2264f8
movss 0x8bb76(%rip), %xmm0    # 0xa5010
movss %xmm0, -0x4e4(%rbp)
movaps %xmm0, %xmm1
divss %xmm2, %xmm1
movss 0x8bd2f(%rip), %xmm2    # 0xa51e0
movss %xmm2, -0x4e8(%rbp)
mulss %xmm2, %xmm1
movss %xmm1, -0xcc(%rbp)
movl $0x0, -0xc8(%rbp)
cvtsi2ssl 0x20d021(%rip), %xmm1 # 0x2264f8
divss %xmm1, %xmm0
movss %xmm0, -0xc4(%rbp)
leaq -0x158(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x96e0
movq -0x510(%rbp), %rsi
movq -0x4b0(%rbp), %rcx
movl 0x20cf7e(%rip), %eax    # 0x226488
movl %eax, -0x504(%rbp)
movq %rsp, %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl -0x504(%rbp), %edi
movl -0xd8(%rbp), %ecx
movl %ecx, 0x80(%rax)
leaq -0xd0(%rbp), %rsi
movq %rsi, -0x4d0(%rbp)
movl $0x4, %edx
movl %edx, -0x4d4(%rbp)
callq 0x2e5d7
movq -0x4c0(%rbp), %rsi
movq -0x4b8(%rbp), %rdx
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x96e0
movq -0x500(%rbp), %rsi
movq -0x4b0(%rbp), %rcx
movl 0x20cf0e(%rip), %eax    # 0x22648c
movl %eax, -0x4f4(%rbp)
movq %rsp, %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl -0x4f4(%rbp), %edi
movl -0x160(%rbp), %ecx
movl %ecx, 0x80(%rax)
leaq 0x20cbc6(%rip), %rsi    # 0x22616c
movq %rsi, -0x498(%rbp)
movl $0x1, %edx
movl %edx, -0x49c(%rbp)
callq 0x2e69a
movl $0x0, -0x1f0(%rbp)
movl $0x0, -0x1ec(%rbp)
cvtsi2ssl 0x20cf1b(%rip), %xmm0 # 0x2264f4
movss %xmm0, -0x1e8(%rbp)
movl 0x20cf11(%rip), %eax    # 0x2264f8
negl %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x1e4(%rbp)
movl $0x0, -0x200(%rbp)
movl $0x0, -0x1fc(%rbp)
cvtsi2ssl 0x20cf0f(%rip), %xmm0 # 0x226520
movss %xmm0, -0x1f8(%rbp)
cvtsi2ssl 0x20cf03(%rip), %xmm0 # 0x226524
movss %xmm0, -0x1f4(%rbp)
movl 0x20ced1(%rip), %eax    # 0x226500
movl %eax, -0x210(%rbp)
movups 0x20ceb4(%rip), %xmm0   # 0x2264f0
movaps %xmm0, -0x220(%rbp)
movups -0x1f0(%rbp), %xmm0
movaps %xmm0, -0x230(%rbp)
movups -0x200(%rbp), %xmm0
movaps %xmm0, -0x240(%rbp)
movl $0x0, -0x248(%rbp)
movl $0x0, -0x244(%rbp)
movb $-0x1, -0x24c(%rbp)
movb $-0x1, -0x24b(%rbp)
movb $-0x1, -0x24a(%rbp)
movb $-0x1, -0x249(%rbp)
movsd -0x230(%rbp), %xmm0
movsd -0x228(%rbp), %xmm1
movsd -0x240(%rbp), %xmm2
movsd -0x238(%rbp), %xmm3
movsd -0x248(%rbp), %xmm4
movl -0x24c(%rbp), %edi
movl -0x210(%rbp), %ecx
movq %rsp, %rax
movl %ecx, 0x10(%rax)
movaps -0x220(%rbp), %xmm5
movups %xmm5, (%rax)
xorps %xmm5, %xmm5
callq 0x835b3
callq 0x2e516
callq 0x3a546
movups 0x20ce1c(%rip), %xmm0   # 0x226508
movups %xmm0, -0x264(%rbp)
movups 0x20ce02(%rip), %xmm0   # 0x2264fc
movaps %xmm0, -0x270(%rbp)
movups 0x20cde4(%rip), %xmm0   # 0x2264ec
movaps %xmm0, -0x280(%rbp)
movups -0x264(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x1c(%rax)
movaps -0x280(%rbp), %xmm0
movaps -0x270(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3a4c6
movq -0x4c0(%rbp), %rsi
movq -0x4b8(%rbp), %rdx
leaq -0x308(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x96e0
movq -0x4f0(%rbp), %rsi
movq -0x4b0(%rbp), %rcx
movq %rsp, %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl -0x288(%rbp), %ecx
movl %ecx, 0x80(%rax)
callq 0x2e4d3
movss -0x4e8(%rbp), %xmm2
movss -0x4e4(%rbp), %xmm0
movq -0x4c0(%rbp), %rsi
movq -0x4b8(%rbp), %rdx
cvtsi2ssl 0x20cd7a(%rip), %xmm3 # 0x226520
movaps %xmm0, %xmm1
divss %xmm3, %xmm1
mulss %xmm2, %xmm1
movss %xmm1, -0x318(%rbp)
movl $0x0, -0x314(%rbp)
cvtsi2ssl 0x20cd55(%rip), %xmm1 # 0x226520
divss %xmm1, %xmm0
movss %xmm0, -0x310(%rbp)
movl $0x0, -0x30c(%rbp)
movups -0x318(%rbp), %xmm0
movaps %xmm0, -0xd0(%rbp)
leaq -0x3a0(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x96e0
movq -0x4e0(%rbp), %rsi
movl -0x4d4(%rbp), %edx
movq -0x4b0(%rbp), %rcx
movl 0x20cc6c(%rip), %eax    # 0x226488
movl %eax, -0x4c4(%rbp)
movq %rsp, %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq -0x4d0(%rbp), %rsi
movl -0x4c4(%rbp), %edi
movl -0x320(%rbp), %ecx
movl %ecx, 0x80(%rax)
callq 0x2e5d7
movq -0x4c0(%rbp), %rsi
movq -0x4b8(%rbp), %rdx
leaq -0x428(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x96e0
movq -0x4b0(%rbp), %rcx
movq -0x4a8(%rbp), %rsi
movl -0x49c(%rbp), %edx
movl 0x20cc08(%rip), %eax    # 0x22648c
movl %eax, -0x490(%rbp)
movq %rsp, %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq -0x498(%rbp), %rsi
movl -0x490(%rbp), %edi
movl -0x3a8(%rbp), %ecx
movl %ecx, 0x80(%rax)
callq 0x2e69a
movl $0x0, -0x438(%rbp)
movl $0x0, -0x434(%rbp)
cvtsi2ssl 0x20cc53(%rip), %xmm0 # 0x226520
movss %xmm0, -0x430(%rbp)
movl 0x20cc49(%rip), %eax    # 0x226524
negl %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x42c(%rbp)
movups -0x438(%rbp), %xmm0
movaps %xmm0, -0x1f0(%rbp)
movl $0x0, -0x448(%rbp)
movl $0x0, -0x444(%rbp)
cvtsi2ssl 0x20cbe1(%rip), %xmm0 # 0x2264f4
movss %xmm0, -0x440(%rbp)
cvtsi2ssl 0x20cbd5(%rip), %xmm0 # 0x2264f8
movss %xmm0, -0x43c(%rbp)
movups -0x448(%rbp), %xmm0
movaps %xmm0, -0x200(%rbp)
movl 0x20cbed(%rip), %eax    # 0x22652c
movl %eax, -0x450(%rbp)
movups 0x20cbd0(%rip), %xmm0   # 0x22651c
movaps %xmm0, -0x460(%rbp)
movaps -0x1f0(%rbp), %xmm0
movaps %xmm0, -0x470(%rbp)
movaps -0x200(%rbp), %xmm0
movaps %xmm0, -0x480(%rbp)
movl $0x0, -0x488(%rbp)
movl $0x0, -0x484(%rbp)
movb $-0x1, -0x48c(%rbp)
movb $-0x1, -0x48b(%rbp)
movb $-0x1, -0x48a(%rbp)
movb $-0x1, -0x489(%rbp)
movsd -0x470(%rbp), %xmm0
movsd -0x468(%rbp), %xmm1
movsd -0x480(%rbp), %xmm2
movsd -0x478(%rbp), %xmm3
movsd -0x488(%rbp), %xmm4
movl -0x48c(%rbp), %edi
movl -0x450(%rbp), %ecx
movq %rsp, %rax
movl %ecx, 0x10(%rax)
movups -0x460(%rbp), %xmm5
movups %xmm5, (%rax)
xorps %xmm5, %xmm5
callq 0x835b3
callq 0x2e516
callq 0x3a546
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
nop