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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x605ede
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x100
push ebx
push esi
mov esi, ecx
push edi
lea ebx, [esi + 0x3c]
push ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, esi
mov dword [ebp - 4], 0
mov byte [esi + 0xc90], 0
call fcn.004f3530
mov eax, dword [0x656d4c]
test eax, eax
push 0
je 0x501fd6
push 0x612b10
lea edi, [esi + 0x5c]
push edi
push 0
call eax
push str.DirectDrawCreateEx
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x501f91
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 2
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [edi]
mov ecx, dword [eax]
lea ebx, [esi + 0x58]
push ebx
push 0x612b20
push eax
call dword [ecx]
mov edi, eax
push str.QueryrInterface_IID_IDirectDraw
push edi
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x501fe4
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 2
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
lea ebx, [esi + 0x58]
push ebx
push 0
call dword [0x656d48]
mov edi, eax
mov eax, dword [ebp + 8]
push eax
mov ecx, esi
call fcn.00501df0
test al, al
je 0x502008
mov ecx, dword [esi + 0x34]
mov al, byte [ecx + 0x62]
test al, al
je 0x502008
mov ecx, dword [esi + 0x2c]
mov edx, dword [ecx]
call dword [edx + 0x140]
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x10c]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [esi + 0x2c]
mov edx, dword [ebp + 8]
mov dword [esi + 0xc94], edx
mov ecx, dword [eax + 0x48]
mov dword [esi + 0x6c], ecx
mov edx, dword [eax + 0x4c]
mov cl, byte [ebp + 0xc]
mov dword [esi + 0x70], edx
mov eax, dword [eax + 0x50]
push str.DirectDrawCreate
mov byte [esi + 0xc98], cl
push edi
mov ecx, esi
mov dword [esi + 0x74], eax
mov byte [esi + 0xcd0], 0
call fcn.004f3be0
test al, al
jne 0x501fb4
mov al, byte [ebp + 0xc]
test al, al
mov eax, dword [ebx]
je 0x5021de
mov edx, dword [ebp + 8]
mov ecx, dword [eax]
push 8
push edx
push eax
call dword [ecx + 0x50]
xor eax, eax
mov ecx, 0x1f
lea edi, [ebp - 0x90]
rep stosd dword es:[edi], eax
mov al, byte [esi + 0x38]
test al, al
mov dword [ebp - 0x90], 0x7c
mov dword [ebp - 0x8c], 1
mov dword [ebp - 0x28], 0x200
je 0x5020ad
mov dword [ebp - 0x28], 0x2200
push 0
lea eax, [esi + 0x60]
push eax
lea eax, [ebp - 0x90]
push eax
mov ecx, esi
mov dword [ebp - 0x7c], 1
call fcn.004d6a70
cmp eax, 0x88760091
jne 0x5020f1
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 6
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
push str.CreateSurface_Windowed_Primary
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
jne 0x5024ea
xor eax, eax
mov ecx, 0x1f
lea edi, [ebp - 0x90]
rep stosd dword es:[edi], eax
mov al, byte [esi + 0x38]
test al, al
mov dword [ebp - 0x90], 0x7c
mov dword [ebp - 0x8c], 7
mov dword [ebp - 0x28], 0x840
je 0x50213e
mov dword [ebp - 0x28], 0x6040
mov eax, dword [esi + 0x6c]
mov ecx, dword [esi + 0x70]
push 0
lea edx, [esi + 0x68]
mov dword [ebp - 0x84], eax
push edx
lea eax, [ebp - 0x90]
mov dword [ebp - 0x88], ecx
push eax
mov ecx, esi
call fcn.004d6a70
push str.CreateSurface_Windowed_DrawSurface
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x502197
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 3
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebx]
mov edx, dword [eax]
push 0
lea ecx, [ebp + 0xc]
push ecx
push 0
push eax
call dword [edx + 0x10]
push str.CreateClipper_Windowed
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x5023ae
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp + 8]
mov edx, dword [eax]
push 0x11
push ecx
push eax
call dword [edx + 0x50]
push str.SetCooperativeLevel_FullScreen
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x50221d
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 4
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [esi + 0x74]
mov eax, dword [ebx]
mov ecx, dword [eax]
push edx
mov edx, dword [esi + 0x70]
push edx
mov edx, dword [esi + 0x6c]
push edx
push eax
call dword [ecx + 0x54]
push str.SetDisplayMode_FullScreen
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x502264
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 5
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
xor eax, eax
mov ecx, 0x1f
lea edi, [ebp - 0x90]
rep stosd dword es:[edi], eax
mov al, byte [esi + 0x38]
test al, al
mov dword [ebp - 0x90], 0x7c
mov dword [ebp - 0x8c], 0x21
mov dword [ebp - 0x28], 0x218
mov dword [ebp - 0x7c], 1
je 0x5022a3
mov dword [ebp - 0x28], 0x2218
push 0
lea edi, [esi + 0x60]
push edi
lea ecx, [ebp - 0x90]
push ecx
mov ecx, esi
call fcn.004d6a70
push str.CreateSurface_FullScreen_Primary
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
jne 0x5024ea
mov eax, dword [edi]
lea edx, [esi + 0x64]
push edx
lea edx, [ebp - 0x14]
push edx
mov dword [ebp - 0x14], 4
mov ecx, dword [eax]
push eax
call dword [ecx + 0x30]
push str.GetAttachedSurface
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
jne 0x5024a0
xor eax, eax
mov ecx, 0x1f
lea edi, [ebp - 0x90]
rep stosd dword es:[edi], eax
mov al, byte [esi + 0x38]
test al, al
mov dword [ebp - 0x90], 0x7c
mov dword [ebp - 0x8c], 7
mov dword [ebp - 0x28], 0x840
je 0x502330
mov dword [ebp - 0x28], 0x6040
mov ecx, dword [esi + 0x6c]
mov edx, dword [esi + 0x70]
push 0
mov dword [ebp - 0x84], ecx
lea eax, [esi + 0x68]
push eax
lea ecx, [ebp - 0x90]
push ecx
mov ecx, esi
mov dword [ebp - 0x88], edx
call fcn.004d6a70
push str.CreateSurface_FullScreen_DrawSurface
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
jne 0x5024ea
mov eax, dword [ebx]
mov ecx, dword [eax]
push 0
lea edx, [ebp + 0xc]
push edx
push 0
push eax
call dword [ecx + 0x10]
push str.CreateClipper_FullScreen
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x5023ae
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
push edx
push 0
push eax
call dword [ecx + 0x20]
test eax, eax
jl 0x5023ce
mov edx, dword [ebp + 0xc]
mov eax, dword [esi + 0x60]
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x70]
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov ebx, dword [ebx]
mov edx, dword [ebx]
lea edi, [esi + 0x78]
push edi
push ebx
call dword [edx + 0x3c]
test eax, eax
jl 0x5023ec
cmp dword [edi], 0x3c
jae 0x5023fc
mov eax, dword [esi + 0x2c]
mov byte [eax + 0x495], 1
mov dword [edi], 0x3c
mov eax, dword [edi]
cmp eax, 0x3c
jae 0x502415
mov ecx, dword [esi + 0x2c]
mov byte [ecx + 0x495], 1
mov dword [edi], 0x3c
jmp 0x50242a
cmp eax, 0x64
jbe 0x50242a
mov edx, dword [esi + 0x2c]
mov byte [edx + 0x495], 1
mov dword [edi], 0x64
xor edx, edx
mov eax, 0x3e8
div dword [edi]
mov ecx, 0x1f
lea edi, [ebp - 0x90]
push 0
lea edx, [ebp - 0x90]
mov dword [esi + 0x7c], eax
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, dword [esi + 0xcb8]
mov eax, dword [esi + 0xcb4]
lea edi, [esi + 0xcd4]
push edi
mov dword [ebp - 0x88], ecx
push edx
mov ecx, esi
mov dword [ebp - 0x90], 0x7c
mov dword [ebp - 0x8c], 7
mov dword [ebp - 0x28], 0x840
mov dword [ebp - 0x84], eax
call fcn.004d6a70
push str.CreateSurface_OldCursorArea
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x5024c2
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 3
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
push 0
lea ebx, [esi + 0xcd8]
push ebx
lea ecx, [ebp - 0x90]
push ecx
mov ecx, esi
call fcn.004d6a70
push str.CreateSurface_NewCursorArea
push eax
mov ecx, esi
call fcn.004f3be0
test al, al
je 0x50250c
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 3
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
push 0xcc
call fcn.005d0282
add esp, 4
mov dword [ebp + 0xc], eax
test eax, eax
mov byte [ebp - 4], 1
je 0x50252e
push esi
mov ecx, eax
call fcn.004f2990
jmp 0x502530
xor eax, eax
mov ecx, dword [edi]
mov dword [esi + 0xcdc], eax
mov edx, dword [eax]
push ecx
mov ecx, eax
mov byte [ebp - 4], 0
call dword [edx + 0xb4]
mov ecx, dword [esi + 0xcdc]
mov edx, dword [ecx]
push 0
push 0
call dword [edx + 0x78]
push 0xcc
call fcn.005d0282
add esp, 4
mov dword [ebp + 0xc], eax
test eax, eax
mov byte [ebp - 4], 2
je 0x502578
push esi
mov ecx, eax
call fcn.004f2990
jmp 0x50257a
xor eax, eax
mov ecx, dword [ebx]
mov dword [esi + 0xce0], eax
mov edx, dword [eax]
push ecx
mov ecx, eax
mov byte [ebp - 4], 0
call dword [edx + 0xb4]
mov ecx, dword [esi + 0xce0]
mov edx, dword [ecx]
push 0
push 0
call dword [edx + 0x78]
mov edx, dword [esi + 0x60]
test edx, edx
je 0x502a34
xor eax, eax
mov ecx, 0x1b
lea edi, [ebp - 0xfc]
rep stosd dword es:[edi], eax
lea ecx, [ebp - 0xfc]
push ecx
mov dword [ebp - 0xfc], 0x6c
mov dword [ebp - 0xf8], 0x1006
mov eax, dword [edx]
push edx
call dword [eax + 0x58]
mov eax, dword [ebp - 0xa8]
cmp eax, 0x10
je 0x50260d
cmp eax, 0x20
je 0x50260d
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 6
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov ebx, dword [ebp - 0xa4]
mov edi, dword [ebp - 0x9c]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0xa0]
mov dword [esi + 8], ebx
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], edi
mov ecx, 0x20
mov edx, ebx
shr edx, cl
test dl, 1
je 0x50263c
mov dword [esi + 0x20], ecx
mov edx, eax
shr edx, cl
test dl, 1
je 0x502648
mov dword [esi + 0x24], ecx
mov edx, edi
shr edx, cl
test dl, 1
je 0x502654
mov dword [esi + 0x28], ecx
dec ecx
jns 0x502630
mov ecx, dword [esi + 0x28]
mov edi, dword [esi + 0x24]
mov edx, dword [esi + 0x20]
mov eax, 2
add ecx, eax
add edi, eax
mov dword [ebp + 0xc], ecx
add edx, eax
mov dword [ebp + 8], 8
jmp 0x502680
mov ebx, dword [ebp - 0xa4]
lea ecx, [ecx]
lea ecx, [edx - 2]
cmp ecx, 0x20
jge 0x502697
lea ecx, [edx - 2]
shr ebx, cl
test ebx, ebx
je 0x502697
lea ecx, [eax - 1]
mov dword [esi + 0x14], ecx
lea ecx, [edi - 2]
cmp ecx, 0x20
jge 0x5026b4
mov ebx, dword [ebp - 0xa0]
lea ecx, [edi - 2]
shr ebx, cl
test ebx, ebx
je 0x5026b4
lea ecx, [eax - 1]
mov dword [esi + 0x18], ecx
mov ecx, dword [ebp + 0xc]
lea ebx, [ecx - 2]
cmp ebx, 0x20
jge 0x5026d4
mov ebx, dword [ebp - 0x9c]
add ecx, 0xfffffffe
shr ebx, cl
test ebx, ebx
je 0x5026d4
lea ecx, [eax - 1]
mov dword [esi + 0x1c], ecx
lea ecx, [edx - 1]
cmp ecx, 0x20
jge 0x5026ee
mov ebx, dword [ebp - 0xa4]
lea ecx, [edx - 1]
shr ebx, cl
test ebx, ebx
je 0x5026ee
mov dword [esi + 0x14], eax
lea ecx, [edi - 1]
cmp ecx, 0x20
jge 0x502708
mov ebx, dword [ebp - 0xa0]
lea ecx, [edi - 1]
shr ebx, cl
test ebx, ebx
je 0x502708
mov dword [esi + 0x18], eax
mov ecx, dword [ebp + 0xc]
lea ebx, [ecx - 1]
cmp ebx, 0x20
jge 0x502723
mov ebx, dword [ebp - 0x9c]
dec ecx
shr ebx, cl
test ebx, ebx
je 0x502723
mov dword [esi + 0x1c], eax
cmp edx, 0x20
jge 0x50273c
mov ebx, dword [ebp - 0xa4]
mov ecx, edx
shr ebx, cl
test ebx, ebx
je 0x50273c
lea ecx, [eax + 1]
mov dword [esi + 0x14], ecx
cmp edi, 0x20
jge 0x502755
mov ebx, dword [ebp - 0xa0]
mov ecx, edi
shr ebx, cl
test ebx, ebx
je 0x502755
lea ecx, [eax + 1]
mov dword [esi + 0x18], ecx
mov ecx, dword [ebp + 0xc]
cmp ecx, 0x20
jge 0x50276f
mov ebx, dword [ebp - 0x9c]
shr ebx, cl
test ebx, ebx
je 0x50276f
lea ecx, [eax + 1]
mov dword [esi + 0x1c], ecx
lea ecx, [edx + 1]
cmp ecx, 0x20
jge 0x502789
mov ebx, dword [ebp - 0xa4]
shr ebx, cl
test ebx, ebx
je 0x502789
lea ecx, [eax + 2]
mov dword [esi + 0x14], ecx
lea ecx, [edi + 1]
cmp ecx, 0x20
jge 0x5027a3
mov ebx, dword [ebp - 0xa0]
shr ebx, cl
test ebx, ebx
je 0x5027a3
lea ecx, [eax + 2]
mov dword [esi + 0x18], ecx
mov ecx, dword [ebp + 0xc]
inc ecx
cmp ecx, 0x20
jge 0x5027be
mov ebx, dword [ebp - 0x9c]
shr ebx, cl
test ebx, ebx
je 0x5027be
lea ecx, [eax + 2]
mov dword [esi + 0x1c], ecx
mov ebx, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
add ebx, 4
add eax, 4
add edx, 4
add edi, 4
dec ecx
mov dword [ebp + 0xc], ebx
mov dword [ebp + 8], ecx
jne 0x502677
mov edx, dword [esi + 0x84]
push edx
call fcn.005e173e
mov eax, dword [esi + 0x88]
push eax
call fcn.005e173e
mov ecx, dword [esi + 0x8c]
push ecx
call fcn.005e173e
mov ecx, dword [esi + 0x14]
mov edi, 1
shl edi, cl
mov ecx, dword [esi + 0x18]
mov ebx, 1
shl ebx, cl
mov ecx, dword [esi + 0x1c]
mov eax, 1
shl eax, cl
dec edi
lea edx, [edi*8 + 4]
dec ebx
dec eax
push edx
mov dword [ebp + 0xc], eax
call fcn.005d02a6
mov dword [esi + 0x84], eax
lea eax, [ebx*8 + 4]
push eax
call fcn.005d02a6
mov ecx, dword [ebp + 0xc]
lea edx, [ecx*8 + 4]
push edx
mov dword [esi + 0x88], eax
call fcn.005d02a6
mov dword [esi + 0x8c], eax
lea ecx, [edi + edi + 1]
add esp, 0x18
xor eax, eax
test ecx, ecx
jle 0x50288a
mov edi, edi
cmp eax, edi
mov ecx, eax
jl 0x502878
mov ecx, edi
mov edx, dword [esi + 0x84]
mov dword [edx + eax*4], ecx
inc eax
lea ecx, [edi + edi + 1]
cmp eax, ecx
jl 0x502870
lea edx, [ebx + ebx + 1]
xor eax, eax
test edx, edx
jle 0x5028aa
cmp eax, ebx
mov ecx, eax
jl 0x50289c
mov ecx, ebx
mov edi, dword [esi + 0x88]
mov dword [edi + eax*4], ecx
inc eax
cmp eax, edx
jl 0x502894
mov edi, dword [ebp + 0xc]
lea edx, [edi + edi + 1]
xor eax, eax
test edx, edx
jle 0x5028cd
cmp eax, edi
mov ecx, eax
jl 0x5028bf
mov ecx, edi
mov ebx, dword [esi + 0x8c]
mov dword [ebx + eax*4], ecx
inc eax
cmp eax, edx
jl 0x5028b7
mov edi, 2
lea ecx, [esi + 0x490]
mov dword [ebp + 0xc], 0x40
nop
mov eax, dword [esi + 8]
mov edx, eax
lea ebx, [edi - 2]
imul edx, ebx
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, dword [esi + 8]
mov dword [ecx - 0x400], edx
mov edx, dword [esi + 0xc]
imul edx, ebx
mov eax, 0x80808081
mul edx
mov eax, dword [esi + 0xc]
shr edx, 7
and edx, eax
mov dword [ecx], edx
mov edx, dword [esi + 0x10]
imul edx, ebx
mov ebx, dword [esi + 0x10]
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [ecx + 0x400], edx
mov eax, dword [esi + 8]
mov edx, eax
lea ebx, [edi - 1]
imul edx, ebx
mov eax, 0x80808081
mul edx
mov eax, dword [esi + 8]
shr edx, 7
and edx, eax
mov dword [ecx - 0x3fc], edx
mov edx, dword [esi + 0xc]
imul edx, ebx
mov eax, 0x80808081
mul edx
mov eax, dword [esi + 0xc]
shr edx, 7
and edx, eax
mov dword [ecx + 4], edx
mov edx, dword [esi + 0x10]
imul edx, ebx
mov ebx, dword [esi + 0x10]
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [ecx + 0x404], edx
mov ebx, dword [esi + 8]
mov edx, ebx
imul edx, edi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [ecx - 0x3f8], edx
mov ebx, dword [esi + 0xc]
mov edx, ebx
imul edx, edi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [ecx + 8], edx
mov ebx, dword [esi + 0x10]
mov edx, ebx
imul edx, edi
mov eax, 0x80808081
mul edx
shr edx, 7
and edx, ebx
mov dword [ecx + 0x408], edx
mov eax, dword [esi + 8]
mov edx, eax
lea ebx, [edi + 1]
imul edx, ebx
mov eax, 0x80808081
mul edx
mov eax, dword [esi + 8]
shr edx, 7
and edx, eax
mov dword [ecx - 0x3f4], edx
mov edx, dword [esi + 0xc]
imul edx, ebx
mov eax, 0x80808081
mul edx
mov eax, dword [esi + 0xc]
shr edx, 7
and edx, eax
mov dword [ecx + 0xc], edx
mov edx, dword [esi + 0x10]
imul edx, ebx
mov eax, 0x80808081
mul edx
mov eax, dword [esi + 0x10]
shr edx, 7
and edx, eax
mov eax, dword [ebp + 0xc]
mov dword [ecx + 0x40c], edx
add ecx, 0x10
add edi, 4
dec eax
mov dword [ebp + 0xc], eax
jne 0x5028e0
xor eax, eax
mov al, byte [esi + 0xcac]
mov ecx, esi
push eax
call fcn.004f3200
mov al, byte [esi + 0x38]
test al, al
je 0x502aa9
mov ecx, dword [esi + 0x30]
push esi
call fcn.004f4520
test al, al
jne 0x502aa9
push 0x6137af
add esi, 0xce4
push str.3D_init_error:
mov ecx, esi
call fcn.00413300
mov edx, dword [0x68ad9c]
mov eax, dword [0x68ad98]
lea ecx, [ebp + 0xf]
push ecx
push edx
push eax
mov ecx, esi
call fcn.00402c10
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
mov eax, 7
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [esi + 0xcb0]
mov edx, dword [ebp - 0x10]
inc ecx
push edx
mov dword [esi + 0xcb0], ecx
mov byte [esi + 0xc90], 1
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
xor eax, eax
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8