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

Disassembly:
mov eax, dword [0x57fbd4]
sub esp, 0x74
push ebx
xor ebx, ebx
push ebp
push esi
cmp eax, ebx
push edi
mov eax, str.windowed
jne 0x50c1ac
mov eax, str.fullscreen
mov ebp, dword [0x57ffa4]
mov edx, dword [0x57ff2c]
cmp ebp, ebx
push eax
mov eax, dword [0x57ff8c]
setne cl
and ecx, 0xff
cmp edx, ebx
setne dl
push eax
mov eax, dword [0x57fba4]
and edx, 0xff
push ecx
mov ecx, dword [0x57fe8c]
push edx
mov edx, dword [0x57fcac]
push eax
mov eax, dword [0x57fe5c]
push ecx
mov ecx, dword [0x57fe44]
push edx
mov edx, dword [0x57fdb4]
push eax
mov eax, dword [0x57fde4]
push ecx
push edx
push eax
push str.Trying_vmode__dx_d__c_d__a_d__z_d__stencil_d__aa_d__3buf_d__vsync_d__refresh_d___s_n
call fcn.00506360
mov ecx, dword [0x5c6924]
add esp, 0x30
cmp ecx, ebx
je 0x50c226
mov edx, dword [ecx]
call dword [edx]
mov dword [0x5c6924], ebx
mov ecx, dword [0x5c6928]
cmp ecx, ebx
je 0x50c23c
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.00508f70
jmp 0x50c265
mov ecx, dword [0x5c741c]
push 0x2c
call fcn.00512c10
cmp eax, ebx
je 0x50c25f
push ebx
push ebx
push ebx
push ebx
mov ecx, eax
call fcn.00508ec0
mov dword [0x5c6928], eax
jmp 0x50c265
mov dword [0x5c6928], ebx
cmp dword [0x5c68e4], ebx
je 0x50c286
cmp dword [0x57fba4], 0x11
jne 0x50c286
push ebx
mov ecx, 0x57fe50
call fcn.00419f60
mov dword [0x57fe5c], eax
mov ecx, dword [0x57fe5c]
mov edx, dword [0x57fe44]
lea eax, [esp + 0x28]
push eax
push ecx
push edx
call fcn.0050c870
mov eax, dword [0x57fe8c]
mov ecx, dword [0x57fcac]
push eax
push ecx
call fcn.0050c910
mov ecx, dword [0x57fba4]
add esp, 0x14
cmp ecx, 0x11
mov dword [esp + 0x18], eax
jne 0x50c2d0
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], 3
jmp 0x50c2dc
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], 1
mov esi, dword [0x5c66bc]
mov edi, dword [0x57ffa4]
xor eax, eax
cmp esi, ebx
mov esi, dword [esp + 0x2c]
setne al
neg edi
sbb edi, edi
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x28]
and edi, reloc.WS2_32.dll_accept
add edi, 0x80000000
xor ebp, ebp
xor edx, edx
cmp eax, esi
setne dl
inc edx
test edx, edx
jle 0x50c861
mov edx, dword [0x57fde4]
mov eax, dword [0x57fdb4]
mov dword [esp + 0x50], edx
mov edx, dword [esp + ebp*4 + 0x28]
mov dword [esp + 0x58], edx
mov edx, dword [0x57ff2c]
mov dword [esp + 0x54], eax
xor eax, eax
cmp edx, ebx
mov edx, dword [esp + 0x10]
setne al
inc eax
mov dword [esp + 0x60], edx
mov edx, dword [0x5c6074]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x68], edx
mov dword [esp + 0x64], eax
mov eax, dword [0x57fbd4]
cmp eax, ebx
mov dword [esp + 0x80], edi
setne dl
and edx, 0xff
mov dword [esp + 0x6c], edx
xor edx, edx
cmp ecx, 0x11
mov ecx, dword [esp + 0x18]
setne dl
mov dword [esp + 0x70], edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x74], ecx
mov ecx, dword [0x57ff8c]
cmp eax, ebx
mov dword [esp + 0x78], edx
mov dword [esp + 0x7c], ecx
je 0x50c3b4
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x80], ebx
cmp dword [0x5c66ec], ebx
je 0x50c3e0
cmp dword [0x5c65fc], ebx
je 0x50c3d9
mov eax, dword [0x5c6614]
mov esi, 0x40
cmp eax, ebx
je 0x50c3e5
mov esi, 0x50
jmp 0x50c3e5
mov esi, 0x80
jmp 0x50c3e5
mov esi, 0x20
mov dword [0x5bb280], ebx
call fcn.00509340
mov edx, dword [0x57fdb4]
mov eax, dword [0x57fde4]
push edx
push eax
call fcn.00506f90
mov eax, dword [0x5bb27c]
add esp, 8
cmp eax, ebx
je 0x50c441
mov ecx, dword [eax]
lea edx, [esp + 0x50]
push edx
push eax
call dword [ecx + 0x38]
cmp eax, ebx
je 0x50c49c
mov ecx, dword [esp + 0x28]
mov esi, dword [esp + 0x2c]
inc ebp
xor eax, eax
cmp ecx, esi
setne al
inc eax
cmp ebp, eax
jge 0x50c861
mov ecx, dword [0x57fba4]
jmp 0x50c31d
lea ebx, [esp + 0x50]
push 0x5bb27c
push ebx
push esi
mov esi, dword [0x5c6074]
mov ecx, dword [0x5bb278]
mov eax, dword [0x5c6644]
push esi
mov esi, dword [0x5c65b4]
xor ebx, ebx
mov edx, dword [ecx]
cmp esi, ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
setne bl
inc ebx
push ebx
push eax
push ecx
call dword [edx + 0x3c]
mov ebx, dword [esp + 0x24]
cmp eax, ebx
je 0x50c486
jmp 0x50c41d
mov edx, dword [0x5bb27c]
mov ecx, 0x5c73f8
push edx
push 0x509310
call fcn.00513010
mov ecx, dword [0x57fde4]
mov eax, dword [0x57fda4]
cmp ecx, eax
mov edx, ecx
jl 0x50c4af
mov edx, eax
mov esi, dword [0x57fda0]
cmp esi, edx
jle 0x50c4bd
mov eax, esi
jmp 0x50c4c3
cmp ecx, eax
jge 0x50c4c3
mov eax, ecx
mov ecx, dword [0x57feac]
mov dword [0x57fd9c], eax
mov eax, dword [0x57fdb4]
cmp eax, ecx
mov edx, eax
jl 0x50c4db
mov edx, ecx
mov esi, dword [0x57fea8]
cmp esi, edx
jle 0x50c4e9
mov eax, esi
jmp 0x50c4ef
cmp eax, ecx
jl 0x50c4ef
mov eax, ecx
mov ecx, dword [0x57fb94]
mov dword [0x57fea4], eax
mov eax, dword [0x57fe44]
cmp eax, ecx
mov edx, eax
jl 0x50c507
mov edx, ecx
mov esi, dword [0x57fb90]
cmp esi, edx
jle 0x50c515
mov eax, esi
jmp 0x50c51b
cmp eax, ecx
jl 0x50c51b
mov eax, ecx
mov ecx, dword [0x57fe34]
mov dword [0x57fb8c], eax
mov eax, dword [0x57fe5c]
cmp eax, ecx
mov edx, eax
jl 0x50c533
mov edx, ecx
mov esi, dword [0x57fe30]
cmp esi, edx
jle 0x50c541
mov eax, esi
jmp 0x50c547
cmp eax, ecx
jl 0x50c547
mov eax, ecx
mov ecx, dword [0x57fe1c]
mov dword [0x57fe2c], eax
mov eax, dword [0x57fcac]
cmp eax, ecx
mov edx, eax
jl 0x50c55f
mov edx, ecx
mov esi, dword [0x57fe18]
cmp esi, edx
jle 0x50c56d
mov eax, esi
jmp 0x50c573
cmp eax, ecx
jl 0x50c573
mov eax, ecx
mov ecx, dword [0x57fe8c]
mov dword [0x57fe14], eax
mov eax, dword [0x57fbc4]
mov edx, ecx
cmp ecx, eax
jl 0x50c58b
mov edx, eax
mov esi, dword [0x57fbc0]
cmp esi, edx
jle 0x50c599
mov eax, esi
jmp 0x50c59f
cmp ecx, eax
jge 0x50c59f
mov eax, ecx
mov dword [0x57fbbc], eax
mov eax, dword [0x57fba4]
push eax
mov ecx, 0x57fe68
call fcn.004150c0
mov edi, dword [0x57fbd4]
mov dword [0x57fe74], eax
cmp edi, ebx
setne al
mov byte [esp + 0x24], al
mov ecx, dword [esp + 0x24]
and ecx, 0xff
push ecx
mov ecx, 0x57fd38
call fcn.004150c0
mov dword [0x57fd44], eax
mov eax, dword [0x57fba4]
mov ecx, 0xd
lea esi, [esp + 0x50]
mov edi, 0x5c68f0
cmp eax, 0x11
rep movsd dword es:[edi], dword [esi]
jne 0x50c77e
cmp dword [0x5c659c], ebx
je 0x50c615
mov eax, dword [0x57fde4]
mov ecx, dword [0x57fdb4]
jmp 0x50c63d
mov edx, dword [0x57fde4]
mov eax, 1
cmp edx, eax
mov ecx, eax
jle 0x50c62c
add eax, eax
cmp eax, edx
jl 0x50c626
mov edx, dword [0x57fdb4]
cmp edx, 1
jle 0x50c63d
add ecx, ecx
cmp ecx, edx
jl 0x50c637
mov esi, dword [0x5c653c]
cmp eax, esi
jl 0x50c649
mov eax, esi
mov edx, eax
cmp ecx, esi
mov dword [0x5c692c], edx
mov eax, ecx
jl 0x50c659
mov eax, esi
mov esi, dword [esp + 0x18]
mov ecx, dword [0x5c6928]
push ebx
push esi
push ebx
push eax
push edx
mov dword [0x5c6930], eax
mov dword [0x5c6924], ecx
call fcn.00508f70
mov eax, dword [0x5c6924]
cmp dword [eax + 8], ebx
jne 0x50c6ce
push str.Failed_to_create_custom_render_target:_falling_over_backwards_n
call fcn.00506360
add esp, 4
mov ecx, 0x57fe68
mov dword [0x5c6924], ebx
mov dword [0x5c692c], ebx
push ebx
mov dword [0x5c6930], ebx
call fcn.004150c0
mov dword [0x57fe74], eax
mov eax, dword [0x5bb27c]
lea ecx, [esp + 0x50]
mov dword [esp + 0x70], 1
mov edx, dword [eax]
push ecx
push eax
call dword [edx + 0x38]
jmp 0x50c78a
mov eax, dword [eax + 8]
lea ecx, [esp + 0x30]
push ecx
push ebx
mov edx, dword [eax]
push eax
call dword [edx + 0x38]
mov eax, dword [esp + 0x30]
cmp eax, 0x15
jne 0x50c715
push str.Yay__Got_alpha_in_custom_render_target_n
call fcn.00506360
add esp, 4
mov ecx, 0x57fe20
push ebx
push str.8__8_8_
call fcn.00414b00
push ebx
push str.8__8_8_
mov ecx, 0x57fe50
call fcn.00414b00
jmp 0x50c78a
cmp eax, 0x16
jne 0x50c78a
push str.Duh__no_alpha_in_custom_render_target_n
call fcn.00506360
mov eax, dword [0x57fe34]
mov edx, dword [0x57fe30]
add esp, 4
xor ecx, ecx
cmp eax, ebx
setg cl
dec ecx
and ecx, eax
cmp edx, ecx
jle 0x50c744
mov eax, edx
jmp 0x50c74e
xor edx, edx
cmp eax, ebx
setg dl
dec edx
and eax, edx
mov dword [0x57fe2c], eax
mov eax, dword [0x57fe64]
mov edx, dword [0x57fe60]
xor ecx, ecx
cmp eax, ebx
setg cl
dec ecx
and ecx, eax
cmp edx, ecx
jg 0x50c776
xor edx, edx
cmp eax, ebx
setg dl
dec edx
and edx, eax
mov dword [0x57fe5c], edx
jmp 0x50c78a
mov dword [0x5c692c], ebx
mov dword [0x5c6930], ebx
call fcn.00507050
call fcn.00505cf0
call fcn.00509380
mov esi, 3
mov eax, dword [0x5bb27c]
push ebx
push 0x3f800000
push 0xff000000
mov ecx, dword [eax]
push 1
push ebx
push ebx
push eax
call dword [ecx + 0x90]
mov eax, dword [0x5bb27c]
push ebx
push ebx
push ebx
mov edx, dword [eax]
push ebx
push eax
call dword [edx + 0x3c]
dec esi
jne 0x50c79e
mov eax, dword [0x57fbd4]
mov byte [0x5c64f4], 1
cmp eax, ebx
mov eax, str.windowed
jne 0x50c7e7
mov eax, str.fullscreen
mov esi, dword [0x57ffa4]
mov ebp, dword [0x57ff2c]
cmp esi, ebx
push eax
mov eax, dword [0x57ff8c]
setne cl
and ecx, 0xff
cmp ebp, ebx
setne dl
push eax
mov eax, dword [0x57fba4]
and edx, 0xff
push ecx
mov ecx, dword [0x57fe8c]
push edx
mov edx, dword [0x57fcac]
push eax
mov eax, dword [0x57fe5c]
push ecx
mov ecx, dword [0x57fe44]
push edx
mov edx, dword [0x57fdb4]
push eax
mov eax, dword [0x57fde4]
push ecx
push edx
push eax
push 0x56a088
call fcn.00506360
add esp, 0x30
mov dword [0x5bb280], 1
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x74
ret
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x74
ret