// File: KellerMartins[P]PDS2-Pacman/source/graphics/rendering.cpp
// Function: RenderManager::Init(int, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Init(int screenWidth, int screenHeight, bool fullscreen, std::string windowTitle){
        if(fullscreen)
            ToggleFullscreen();

        #ifdef NDEBUG
        SetTraceLog(0);
        ShowLogo();
        #else
        SetTraceLog(LOG_DEBUG|LOG_ERROR|LOG_WARNING|LOG_INFO);
        #endif
        
        SetConfigFlags(FLAG_MSAA_4X_HINT);
        InitWindow(screenWidth, screenHeight, windowTitle.c_str());
        
        Image icon = LoadImage("assets/interface/pacman_icon.png");         
        SetWindowIcon(icon);
        UnloadImage(icon);

        #ifdef NDEBUG
        SetTargetFPS(60);
        #else
        SetTargetFPS(0);
        #endif
        
        LoadShaders();
        SetResolution(screenWidth, screenHeight);

        Image blackImg = GenImageColor(2,2,BLACK);
        _blackTexture = LoadTextureFromImage(blackImg);
        UnloadImage(blackImg);

        _maskTexture = LoadTexture(MASK_TEXTURE_PATH);

        _isInitialized = true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rcx, -0xe0(%rbp)
movb %dl, %al
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq %rcx, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x1767e
callq 0x39778
movl $0xf, %edi
callq 0x892a3
movl $0x20, %edi
callq 0x3b8dd
movq -0xe0(%rbp), %rdi
movl -0x4(%rbp), %eax
movl %eax, -0xe8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xe4(%rbp)
callq 0x9360
movl -0xe8(%rbp), %edi
movl -0xe4(%rbp), %esi
movq %rax, %rdx
callq 0x39615
leaq -0x30(%rbp), %rdi
leaq 0x8dc01(%rip), %rsi     # 0xa52d0
callq 0x7b50c
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x48(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x3981e
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x60(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x7bd61
xorl %edi, %edi
callq 0x3b3e2
callq 0x17890
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x179d0
movb $0x0, -0x7c(%rbp)
movb $0x0, -0x7b(%rbp)
movb $0x0, -0x7a(%rbp)
movb $-0x1, -0x79(%rbp)
movl -0x7c(%rbp), %ecx
leaq -0x78(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0x821cc
movq -0x78(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x7bc8c
movq -0x90(%rbp), %rax
movq %rax, 0x20ed67(%rip)    # 0x226544
movq -0x88(%rbp), %rax
movq %rax, 0x20ed61(%rip)    # 0x22654c
movl -0x80(%rbp), %eax
movl %eax, 0x20ed60(%rip)    # 0x226554
movq -0x78(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xc0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x7bd61
leaq -0xd4(%rbp), %rdi
leaq 0x8dd0c(%rip), %rsi     # 0xa5554
callq 0x7bbcd
movq -0xd4(%rbp), %rax
movq %rax, 0x20ecfd(%rip)    # 0x226558
movq -0xcc(%rbp), %rax
movq %rax, 0x20ecf7(%rip)    # 0x226560
movl -0xc4(%rbp), %eax
movl %eax, 0x20ecf3(%rip)    # 0x226568
movb $0x1, 0x20e8e4(%rip)    # 0x226160
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)