Function at 0x405a70
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x204
mov eax, dword [0x4c822c]
xor eax, esp
mov dword [esp + 0x200], eax
cmp byte [esp + 0x20c], 0
push ebx
push edi
mov edi, dword [esp + 0x210]
je 0x405aac
push 0
push 0
push 0
push str.DISPLAY
call dword [sym.imp.GDI32.dll_CreateDCA]
mov edi, eax
jmp 0x405aaf
mov edi, dword [edi + 0x14]
mov ebx, dword [0x4c4018]
mov edx, ebx
and edx, 2
mov dword [esp + 0x50], 0x10028
or edx, 0x48
mov eax, ebx
shr edx, 1
mov ecx, edx
or ecx, 2
and eax, 0x100
cmove ecx, edx
mov dword [esp + 0x54], ecx
test bl, 1
je 0x405afa
mov byte [esp + 0x58], 1
mov byte [esp + 0x5a], 0
mov byte [esp + 0x5c], 0
mov byte [esp + 0x5e], 0
mov byte [esp + 0x60], 0
jmp 0x405b16
mov al, bl
mov byte [esp + 0x58], 0
and al, 8
mov byte [esp + 0x5a], 8
mov byte [esp + 0x5c], 8
mov byte [esp + 0x5e], 8
mov byte [esp + 0x60], al
shr ebx, 2
and bl, 1
mov byte [esp + 0x59], 0x18
push esi
mov byte [esp + 0x5f], 0
mov byte [esp + 0x61], 0
mov byte [esp + 0x63], 0
mov byte [esp + 0x65], 0
mov byte [esp + 0x66], bl
mov dword [esp + 0x67], 0
mov word [esp + 0x6b], 0x818
call fcn.004076a0
mov byte [esp + 0x6d], al
mov al, byte [esp + 0x21c]
push 0xc
push edi
mov byte [esp + 0x76], al
mov byte [esp + 0x77], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 0
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov byte [esp + 0x5d], al
lea eax, [esp + 0x54]
push eax
push edi
call dword [sym.imp.GDI32.dll_ChoosePixelFormat]
mov esi, eax
mov eax, dword [0x4c4018]
test al, al
js 0x405bac
test eax, 0x1000
je 0x405e3b
push ebp
call dword [sym.imp.OPENGL32.dll_wglGetCurrentContext]
mov dword [esp + 0x1c], eax
call dword [sym.imp.OPENGL32.dll_wglGetCurrentDC]
mov ecx, dword [sym.imp.USER32.dll_DefWindowProcA]
xorps xmm0, xmm0
mov dword [esp + 0x20], eax
lea eax, [esp + 0x30]
mov dword [esp + 0x34], ecx
mov ecx, dword [0x5330c0]
push eax
movlpd qword [esp + 0x3c], xmm0
movlpd qword [esp + 0x48], xmm0
movlpd qword [esp + 0x50], xmm0
mov dword [esp + 0x44], ecx
mov dword [esp + 0x34], 0x23
mov dword [esp + 0x58], str.FREEGLUT_dummy
call dword [sym.imp.USER32.dll_RegisterClassA]
push 0
push dword [0x5330c0]
push 0
push 0
push 0
push 0
push 0
push 0
push 0x6cf0000
push 0x48eaf3
push str.FREEGLUT_dummy
push 0
call dword [sym.imp.USER32.dll_CreateWindowExA]
mov ebp, eax
push ebp
call dword [sym.imp.USER32.dll_GetDC]
mov ebx, eax
lea eax, [esp + 0x58]
push eax
push esi
push ebx
call dword [sym.imp.GDI32.dll_SetPixelFormat]
push ebx
call dword [sym.imp.OPENGL32.dll_wglCreateContext]
push eax
push ebx
mov dword [esp + 0x2c], eax
call dword [sym.imp.OPENGL32.dll_wglMakeCurrent]
push str.wglGetExtensionsStringARB
call dword [sym.imp.OPENGL32.dll_wglGetProcAddress]
test eax, eax
je 0x405e02
push ebx
call eax
test eax, eax
je 0x405e02
push str.WGL_ARB_multisample
push eax
call fcn.0046dc60
add esp, 8
test eax, eax
je 0x405e02
push str.wglChoosePixelFormatARB
call dword [sym.imp.OPENGL32.dll_wglGetProcAddress]
mov dword [esp + 0x10], eax
test eax, eax
je 0x405e02
movzx eax, byte [esp + 0x61]
mov edx, dword [0x4c4018]
movaps xmm0, xmmword [0x48ebd0]
mov dword [esp + 0x9c], eax
movzx eax, byte [esp + 0x68]
mov dword [esp + 0xa4], eax
movzx eax, byte [esp + 0x6f]
mov dword [esp + 0xac], eax
movzx eax, byte [esp + 0x70]
mov dword [esp + 0xb4], eax
mov eax, edx
shr eax, 1
and eax, 1
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x90], 0x2003
mov dword [esp + 0x94], 0x2027
mov dword [esp + 0x98], 0x2014
mov dword [esp + 0xa0], 0x201b
mov dword [esp + 0xa8], 0x2022
mov dword [esp + 0xb0], 0x2023
mov dword [esp + 0xb8], 0x2011
mov dword [esp + 0xbc], eax
movups xmmword [esp + 0x80], xmm0
and edx, 0x1000
je 0x405d74
mov dword [esp + 0xc0], 0x20a9
mov dword [esp + 0xc4], 1
xor eax, eax
test edx, edx
setne al
lea eax, [eax*8 + 0x40]
mov dword [esp + eax + 0x80], 0x2041
xor eax, eax
test edx, edx
setne al
xor ecx, ecx
test edx, edx
setne cl
lea eax, [eax*8 + 0x44]
mov dword [esp + eax + 0x80], 1
mov eax, dword [0x4c40a0]
lea ecx, [ecx*2 + 0x12]
mov dword [esp + ecx*4 + 0x80], 0x2042
mov dword [esp + ecx*4 + 0x84], eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x1c]
mov dword [esp + ecx*4 + 0x8c], 0
push eax
push 1
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x90]
push eax
push ebx
call dword [esp + 0x28]
test eax, eax
je 0x405e02
cmp dword [esp + 0x14], 0
cmova esi, dword [esp + 0x18]
push dword [esp + 0x1c]
push dword [esp + 0x24]
call dword [sym.imp.OPENGL32.dll_wglMakeCurrent]
push dword [esp + 0x24]
call dword [sym.imp.OPENGL32.dll_wglDeleteContext]
push ebx
push ebp
call dword [sym.imp.USER32.dll_ReleaseDC]
push ebp
call dword [sym.imp.USER32.dll_DestroyWindow]
push dword [0x5330c0]
push str.FREEGLUT_dummy
call dword [sym.imp.USER32.dll_UnregisterClassA]
pop ebp
mov bh, byte [esp + 0x218]
test esi, esi
je 0x405e5f
test bh, bh
jne 0x405e5b
lea eax, [esp + 0x54]
push eax
push esi
push edi
call dword [sym.imp.GDI32.dll_SetPixelFormat]
test eax, eax
je 0x405e5f
mov bl, 1
jmp 0x405e61
xor bl, bl
pop esi
test bh, bh
je 0x405e6d
push edi
call dword [sym.imp.GDI32.dll_DeleteDC]
mov ecx, dword [esp + 0x208]
mov al, bl
pop edi
pop ebx
xor ecx, esp
call fcn.0041598b
add esp, 0x204
ret