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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5d4a4a
mov eax, dword fs:[0]
push eax
sub esp, 0x13c
mov eax, dword [0x6229a0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x120], edi
mov eax, dword [ebp + 8]
lea esi, [edi + 0x3c]
push esi
mov dword [ebp - 0x130], eax
mov dword [ebp - 0x144], esi
mov dword [ebp - 0x148], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, edi
mov dword [ebp - 4], 0
mov byte [edi + 0xccc], 0
call fcn.005103e0
mov eax, dword [0x667214]
push 0
test eax, eax
je 0x51b498
push 0x5e57b4
lea ecx, [edi + 0x5c]
push ecx
push 0
call eax
push str.DirectDrawCreateEx
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51b68f
mov ecx, dword [edi + 0x5c]
lea eax, [edi + 0x58]
push eax
push 0x5e57a4
push ecx
mov edx, dword [ecx]
call dword [edx]
push str.QueryrInterface_IID_IDirectDraw
push eax
mov ecx, edi
mov dword [ebp - 0x124], eax
call fcn.0051a5a0
test al, al
je 0x51b4aa
mov edi, 2
jmp 0x51c2e4
lea eax, [edi + 0x58]
push eax
push 0
call dword [0x667210]
mov dword [ebp - 0x124], eax
push dword [ebp - 0x130]
mov ecx, edi
call fcn.00513120
test al, al
je 0x51b4d2
mov eax, dword [edi + 0x34]
cmp byte [eax + 0xaa], 0
je 0x51b4d2
mov ecx, dword [edi + 0x2c]
mov eax, dword [ecx]
call dword [eax + 0x160]
lea eax, [ebp - 0x118]
push eax
push dword [ebp - 0x130]
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [ebp - 0x130]
lea edx, [edi + 0x74]
mov dword [edi + 0xcd0], eax
mov eax, dword [edi + 0x2c]
mov dword [ebp - 0x134], edx
mov ecx, dword [eax + 0xa8]
mov dword [edi + 0x6c], ecx
mov eax, dword [eax + 0xac]
push eax
push ecx
mov ecx, edx
mov dword [edi + 0x70], eax
call fcn.004f7230
mov edi, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0
call edi
mov ecx, dword [ebp - 0x120]
push 1
mov dword [ecx + 0x7c], eax
call edi
mov edi, dword [ebp - 0x120]
push eax
push dword [edi + 0x7c]
lea ecx, [edi + 0x84]
mov dword [edi + 0x80], eax
call fcn.004f7230
mov eax, dword [edi + 0x6c]
mov edx, dword [edi + 0x2c]
mov ecx, dword [edi + 0x78]
mov dword [edi + 0x90], eax
mov eax, dword [edi + 0x70]
mov dword [edi + 0x94], eax
mov eax, dword [edi + 0x74]
mov dword [edi + 0x9c], ecx
mov dword [edi + 0x98], eax
mov eax, dword [edx + 0x328]
movd xmm0, eax
cvtdq2ps xmm0, xmm0
mulss xmm0, dword [0x5e661c]
cvttss2si ecx, xmm0
mov dword [ebp - 0x128], ecx
mov ecx, dword [edx + 0x32c]
movd xmm0, ecx
cvtdq2ps xmm0, xmm0
divss xmm0, dword [0x5e2b98]
cvttss2si edx, xmm0
mov dword [ebp - 0x12c], edx
cmp eax, ecx
jne 0x51b5bc
mov dword [ebp - 0x1c], 0
jmp 0x51b618
mov edx, ecx
lea ecx, [eax + eax*8]
shl edx, 4
cmp ecx, edx
jle 0x51b5f3
mov ecx, dword [ebp - 0x12c]
shl ecx, 4
sub eax, ecx
mov dword [ebp - 0x18], ecx
mov ecx, dword [edi + 0x2c]
cdq
sub eax, edx
mov dword [ebp - 0x1c], 0
sar eax, 1
mov dword [ebp - 0x20], eax
mov eax, dword [ecx + 0x32c]
mov dword [ebp - 0x14], eax
jmp 0x51b625
mov eax, dword [ebp - 0x128]
mov edx, dword [edi + 0x2c]
lea ecx, [eax + eax*8]
mov eax, dword [edx + 0x32c]
sub eax, ecx
cdq
sub eax, edx
mov edx, dword [edi + 0x2c]
sar eax, 1
mov dword [ebp - 0x1c], eax
mov eax, dword [edx + 0x328]
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], ecx
movups xmm0, xmmword [ebp - 0x20]
mov eax, dword [edi + 0x2c]
movups xmmword [edi + 0xa0], xmm0
movups xmm0, xmmword [edi + 0xa0]
movups xmmword [eax + 0x5a4], xmm0
mov eax, dword [edi + 0x2c]
push dword [edi + 0x78]
push dword [edi + 0x74]
mov eax, dword [eax + 0xb0]
push dword [edi + 0x70]
mov dword [edi + 0xb0], eax
push dword [edi + 0x6c]
mov al, byte [ebp + 0xc]
push str.Application_requests__4lu_x__4lu___2d:_2d__n
mov byte [edi + 0xcd4], al
mov byte [edi + 0xd08], 0
call fcn.004f01a0
add esp, 0x14
mov ecx, edi
push str.DirectDrawCreate
push dword [ebp - 0x124]
call fcn.0051a5a0
test al, al
je 0x51b699
mov edi, 2
jmp 0x51c2e4
cmp byte [ebp + 0xc], 0
je 0x51ba27
mov eax, dword [edi + 0x2c]
push dword [eax + 0x5bc]
push dword [eax + 0x5b8]
push str.Hack_aspect_is_____________________2d:_2d__n
call fcn.004f01a0
mov eax, dword [edi + 0x2c]
add esp, 0xc
cmp byte [eax + 0x5b4], 0
je 0x51b899
add eax, 0x5b8
lea ecx, [edi + 0x74]
push eax
mov dword [ebp - 0x128], eax
call fcn.00500590
test al, al
je 0x51b899
mov esi, dword [ebp - 0x128]
mov ecx, dword [edi + 0x70]
mov byte [edi + 0x8c], 1
mov eax, dword [esi]
imul eax, ecx
cdq
idiv dword [esi + 4]
mov dword [edi + 0x94], ecx
mov dword [edi + 0x90], eax
mov eax, dword [esi]
mov ecx, dword [esi + 4]
mov esi, dword [ebp - 0x130]
mov dword [edi + 0x98], eax
lea eax, [ebp - 0xd8]
push eax
push esi
mov dword [edi + 0x9c], ecx
call dword [sym.imp.USER32.dll_GetWindowInfo]
lea eax, [ebp - 0x20]
push eax
push esi
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x13c], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x138], eax
lea eax, [ebp - 0x13c]
push eax
push esi
call dword [sym.imp.USER32.dll_ClientToScreen]
mov eax, dword [edi + 0x90]
sub eax, dword [edi + 0x6c]
mov ecx, dword [ebp - 0x13c]
mov edi, dword [edi + 0x94]
mov esi, dword [ebp - 0x120]
cdq
push dword [ebp - 0xb0]
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, edi
mov dword [ebp - 0x128], ecx
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x120]
push 0
push dword [ebp - 0xb4]
sub eax, dword [ecx + 0x70]
mov ecx, dword [ebp - 0x138]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [ebp - 0x128]
add eax, dword [esi + 0x90]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], ecx
lea eax, [edi + ecx]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x20]
sub eax, ecx
push 0
push eax
mov eax, dword [ebp - 0x18]
sub eax, edx
push eax
xor eax, eax
test ecx, ecx
cmovs ecx, eax
test edx, edx
push ecx
cmovs edx, eax
push edx
push dword [ebp - 0x130]
call dword [sym.imp.USER32.dll_MoveWindow]
mov edi, esi
mov eax, dword [edi + 0x2c]
mov al, byte [eax + 0x5a0]
mov dword [edi + 0xa4], 0
mov esi, dword [ebp - 0x144]
test al, al
je 0x51b874
mov ecx, dword [ebp - 0x120]
mov esi, dword [ebp - 0x134]
mov edi, dword [edi + 0x90]
mov eax, dword [ecx + 0x98]
mov edx, dword [ecx + 0x94]
mov dword [esi], eax
mov eax, esi
mov dword [ecx + 0x6c], edi
mov dword [ecx + 0x70], edx
mov ecx, dword [ecx + 0x9c]
mov dword [eax + 4], ecx
mov eax, dword [ebp - 0x120]
mov dword [eax + 0xa8], edi
mov edi, eax
mov dword [edi + 0xac], edx
lea esi, [edi + 0x3c]
mov dword [edi + 0xa0], 0
jmp 0x51b899
mov eax, dword [edi + 0x70]
mov ecx, dword [edi + 0x6c]
mov dword [edi + 0xac], eax
mov eax, dword [edi + 0x90]
sub eax, ecx
mov dword [edi + 0xa8], ecx
cdq
sub eax, edx
sar eax, 1
mov dword [edi + 0xa0], eax
push dword [edi + 0x9c]
push dword [edi + 0x98]
push dword [edi + 0x94]
push dword [edi + 0x90]
push str.Window_is_____________4lu_x__4lu___2d:_2d__n
call fcn.004f01a0
add esp, 0x14
lea eax, [edi + 0x58]
mov dword [ebp - 0x124], eax
mov eax, dword [eax]
push 8
push dword [ebp - 0x130]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x50]
push 0x7c
lea eax, [ebp - 0x9c]
push 0
push eax
call fcn.0059d800
add esp, 0xc
mov dword [ebp - 0x9c], 0x7c
cmp byte [edi + 0x38], 0
mov ecx, 0x2200
mov eax, 0x200
mov dword [ebp - 0x98], 1
cmovne eax, ecx
mov dword [ebp - 0x88], 1
mov dword [ebp - 0x34], eax
mov ecx, edi
push 0
lea eax, [edi + 0x60]
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00512540
cmp eax, 0x88760091
je 0x51bf92
push str.CreateSurface_Windowed_Primary
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51be91
push 0x7c
lea eax, [ebp - 0x9c]
push 0
push eax
call fcn.0059d800
add esp, 0xc
mov dword [ebp - 0x9c], 0x7c
cmp byte [edi + 0x38], 0
mov ecx, 0x6040
mov eax, 0x840
mov dword [ebp - 0x98], 7
cmovne eax, ecx
mov ecx, edi
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x6c]
mov dword [ebp - 0x90], eax
mov eax, dword [edi + 0x70]
mov dword [ebp - 0x94], eax
lea eax, [edi + 0x68]
push 0
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00512540
push str.CreateSurface_Windowed_DrawSurface
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51be91
mov eax, dword [edi + 0x58]
lea edx, [ebp - 0x11c]
push 0
push edx
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x10]
push str.CreateClipper_Windowed
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51bd1b
mov eax, dword [ebp - 0x11c]
push dword [ebp - 0x130]
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x20]
test eax, eax
js 0x51ba16
mov eax, dword [edi + 0x60]
push dword [ebp - 0x11c]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x70]
mov eax, dword [ebp - 0x11c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
jmp 0x51bd76
push dword [edi + 0x88]
push dword [edi + 0x84]
push dword [edi + 0x80]
push dword [edi + 0x7c]
push str.Desktop_is____________4lu_x__4lu___2d:_2d__n
call fcn.004f01a0
add esp, 0x14
cmp byte [edi + 0x38], 0
je 0x51bb34
lea eax, [edi + 0x84]
push eax
lea ecx, [edi + 0x74]
call fcn.00500590
test al, al
je 0x51bb34
mov eax, dword [edi + 0x7c]
mov ecx, dword [edi + 0x84]
mov edx, dword [edi + 0x70]
mov dword [edi + 0x90], eax
mov eax, dword [edi + 0x80]
mov dword [edi + 0x94], eax
mov dword [ebp - 0x124], eax
mov eax, dword [edi + 0x88]
mov dword [edi + 0x9c], eax
mov dword [ebp - 0x134], eax
mov eax, dword [edi + 0x2c]
mov byte [edi + 0x8c], 1
mov dword [edi + 0x98], ecx
mov dword [ebp - 0x140], edx
mov cl, byte [eax + 0x5a0]
mov eax, dword [ebp - 0x124]
mov dword [edi + 0xac], eax
mov dword [edi + 0xa4], 0
test cl, cl
je 0x51bb0b
mov ecx, dword [edi + 0x84]
mov esi, dword [ebp - 0x134]
imul edx, ecx
mov dword [edi + 0x74], ecx
mov ecx, dword [edi + 0x7c]
mov dword [edi + 0x78], esi
mov dword [edi + 0xa8], ecx
mov eax, edx
mov dword [edi + 0xa0], 0
cdq
idiv esi
lea esi, [edi + 0x3c]
mov dword [edi + 0x6c], eax
jmp 0x51bb34
mov eax, dword [edi + 0x6c]
imul eax, dword [ebp - 0x124]
mov ecx, dword [edi + 0x7c]
cdq
idiv dword [ebp - 0x140]
sub ecx, eax
mov dword [edi + 0xa8], eax
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
mov dword [edi + 0xa0], eax
push dword [edi + 0x9c]
push dword [edi + 0x98]
push dword [edi + 0x94]
push dword [edi + 0x90]
push str.Display_is____________4lu_x__4lu___2d:_2d__n
call fcn.004f01a0
add esp, 0x14
lea eax, [edi + 0x58]
mov dword [ebp - 0x124], eax
mov eax, dword [eax]
push 0x11
push dword [ebp - 0x130]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x50]
push str.SetCooperativeLevel_FullScreen
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
je 0x51bb8d
mov edi, 4
jmp 0x51c2e4
push dword [edi + 0xb0]
mov eax, dword [edi + 0x58]
push dword [edi + 0x94]
push dword [edi + 0x90]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x54]
push str.SetDisplayMode_FullScreen
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
je 0x51bbc3
mov edi, 5
jmp 0x51c2e4
push 0x7c
lea eax, [ebp - 0x9c]
push 0
push eax
call fcn.0059d800
add esp, 0xc
mov dword [ebp - 0x9c], 0x7c
cmp byte [edi + 0x38], 0
mov ecx, 0x2218
mov eax, 0x218
mov dword [ebp - 0x98], 0x21
cmovne eax, ecx
mov dword [ebp - 0x88], 1
mov dword [ebp - 0x34], eax
mov ecx, edi
push 0
lea eax, [edi + 0x60]
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00512540
push str.CreateSurface_FullScreen_Primary
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51be91
mov ecx, dword [edi + 0x60]
lea edx, [edi + 0x64]
push edx
mov dword [ebp - 0x138], 4
lea edx, [ebp - 0x138]
push edx
mov eax, dword [ecx]
push ecx
call dword [eax + 0x30]
push str.GetAttachedSurface
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51be91
cmp byte [edi + 0x8c], al
je 0x51bc80
push dword [edi + 0x60]
mov ecx, edi
call fcn.00510630
push dword [edi + 0x64]
mov ecx, edi
call fcn.00510630
push 0x7c
lea eax, [ebp - 0x9c]
push 0
push eax
call fcn.0059d800
add esp, 0xc
mov dword [ebp - 0x9c], 0x7c
cmp byte [edi + 0x38], 0
mov ecx, 0x6040
mov eax, 0x840
mov dword [ebp - 0x98], 7
cmovne eax, ecx
mov ecx, edi
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x6c]
mov dword [ebp - 0x90], eax
mov eax, dword [edi + 0x70]
mov dword [ebp - 0x94], eax
lea eax, [edi + 0x68]
push 0
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00512540
push str.CreateSurface_FullScreen_DrawSurface
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51be91
mov eax, dword [edi + 0x58]
lea edx, [ebp - 0x11c]
push 0
push edx
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x10]
push str.CreateClipper_FullScreen
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
je 0x51bd25
mov edi, 1
jmp 0x51c2e4
mov eax, dword [ebp - 0x11c]
push dword [ebp - 0x130]
push 0
mov ecx, dword [eax]
push eax
call dword [ecx + 0x20]
test eax, eax
js 0x51bd4c
mov eax, dword [edi + 0x60]
push dword [ebp - 0x11c]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x70]
mov eax, dword [ebp - 0x11c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x359], 0
jne 0x51bd76
mov eax, dword [edi + 0x58]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x28]
lea eax, [edi + 0x58]
mov dword [ebp - 0x124], eax
push dword [edi + 0x78]
push dword [edi + 0x74]
push dword [edi + 0x70]
push dword [edi + 0x6c]
push str.Draw_buffer_is________4lu_x__4lu___2d:_2d__n
call fcn.004f01a0
mov eax, dword [ebp - 0x124]
lea edx, [edi + 0xb4]
add esp, 0x14
mov ecx, dword [eax]
push edx
push ecx
mov eax, dword [ecx]
call dword [eax + 0x3c]
test eax, eax
js 0x51bdd3
mov ecx, dword [edi + 0xb4]
cmp ecx, 0x3c
jb 0x51bdd3
cmp ecx, 0x64
jbe 0x51bdec
mov eax, dword [edi + 0x2c]
mov ecx, 0x64
mov byte [eax + 0x581], 1
mov dword [edi + 0xb4], 0x64
jmp 0x51bdec
mov eax, dword [edi + 0x2c]
mov ecx, 0x3c
mov byte [eax + 0x581], 1
mov dword [edi + 0xb4], 0x3c
xor edx, edx
mov eax, 0x3e8
div ecx
push 0x7c
mov dword [edi + 0xb8], eax
lea eax, [ebp - 0x9c]
push 0
push eax
call fcn.0059d800
mov eax, dword [edi + 0xcec]
add esp, 0xc
mov dword [ebp - 0x90], eax
mov ecx, edi
mov eax, dword [edi + 0xcf0]
mov dword [ebp - 0x94], eax
lea eax, [edi + 0xd0c]
push 0
push eax
lea eax, [ebp - 0x9c]
mov dword [ebp - 0x9c], 0x7c
push eax
mov dword [ebp - 0x98], 7
mov dword [ebp - 0x34], 0x840
call fcn.00512540
push str.CreateSurface_OldCursorArea
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
jne 0x51be91
push 0
lea eax, [edi + 0xd10]
mov ecx, edi
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00512540
push str.CreateSurface_NewCursorArea
push eax
mov ecx, edi
call fcn.0051a5a0
test al, al
je 0x51be9b
mov edi, 3
jmp 0x51c2e4
push 0xe8
call fcn.0059b742
add esp, 4
mov dword [ebp - 0x138], eax
mov byte [ebp - 4], 1
test eax, eax
je 0x51bec2
push edi
mov ecx, eax
call fcn.004fee10
mov ecx, eax
jmp 0x51bec4
xor ecx, ecx
push dword [edi + 0xd0c]
mov dword [edi + 0xd14], ecx
mov eax, dword [ecx]
mov byte [ebp - 4], 0
call dword [eax + 0xc4]
mov ecx, dword [edi + 0xd14]
push 0
push 0
mov eax, dword [ecx]
call dword [eax + 0x80]
push 0xe8
call fcn.0059b742
add esp, 4
mov dword [ebp - 0x138], eax
mov byte [ebp - 4], 2
test eax, eax
je 0x51bf15
push edi
mov ecx, eax
call fcn.004fee10
mov ecx, eax
jmp 0x51bf17
xor ecx, ecx
push dword [edi + 0xd10]
mov dword [edi + 0xd18], ecx
mov eax, dword [ecx]
mov byte [ebp - 4], 0
call dword [eax + 0xc4]
mov ecx, dword [edi + 0xd18]
push 0
push 0
mov eax, dword [ecx]
call dword [eax + 0x80]
cmp dword [edi + 0x60], 0
je 0x51c275
push 0x64
lea eax, [ebp - 0x100]
push 0
push eax
call fcn.0059d800
mov ecx, dword [edi + 0x60]
lea edx, [ebp - 0x108]
add esp, 0xc
mov dword [ebp - 0x108], 0x6c
mov dword [ebp - 0x104], 0x1006
mov eax, dword [ecx]
push edx
push ecx
call dword [eax + 0x58]
mov eax, dword [ebp - 0xb4]
cmp eax, 0x10
je 0x51bf9c
cmp eax, 0x20
je 0x51bf9c
mov edi, 6
jmp 0x51c2e4
mov ecx, dword [ebp - 0xa8]
mov edx, dword [ebp - 0xac]
mov dword [edi + 4], eax
mov eax, dword [ebp - 0xb0]
mov dword [edi + 0x10], ecx
mov ecx, 0x20
mov dword [edi + 8], eax
mov dword [edi + 0xc], edx
nop
shr eax, cl
test al, 1
je 0x51bfc9
mov dword [edi + 0x20], ecx
mov eax, edx
shr eax, cl
test al, 1
je 0x51bfd4
mov dword [edi + 0x24], ecx
mov eax, dword [ebp - 0xa8]
shr eax, cl
test al, 1
je 0x51bfe3
mov dword [edi + 0x28], ecx
sub ecx, 1
mov eax, dword [ebp - 0xb0]
jns 0x51bfc0
mov edx, dword [edi + 0x24]
mov eax, dword [edi + 0x28]
mov ecx, dword [edi + 0x20]
sub eax, edx
mov dword [ebp - 0x140], eax
sub ecx, edx
mov eax, 1
mov dword [ebp - 0x128], ecx
sub eax, edx
mov dword [ebp - 0x12c], 0x20
mov dword [ebp - 0x138], eax
mov esi, eax
add ecx, edx
cmp ecx, 0x20
jge 0x51c039
mov eax, dword [ebp - 0xb0]
shr eax, cl
test eax, eax
je 0x51c039
lea eax, [esi + edx]
mov dword [edi + 0x14], eax
cmp edx, 0x20
jge 0x51c052
mov eax, dword [ebp - 0xac]
mov ecx, edx
shr eax, cl
test eax, eax
je 0x51c052
lea eax, [esi + edx]
mov dword [edi + 0x18], eax
mov ecx, dword [ebp - 0x140]
add ecx, edx
cmp ecx, 0x20
jge 0x51c071
mov eax, dword [ebp - 0xa8]
shr eax, cl
test eax, eax
je 0x51c071
lea eax, [esi + edx]
mov dword [edi + 0x1c], eax
mov ecx, dword [ebp - 0x128]
inc edx
sub dword [ebp - 0x12c], 1
jne 0x51c020
push dword [edi + 0xc0]
call fcn.0059b72f
push dword [edi + 0xc4]
call fcn.0059b72f
push dword [edi + 0xc8]
call fcn.0059b72f
mov ecx, dword [edi + 0x14]
mov esi, 1
mov edx, esi
mov eax, esi
shl edx, cl
mov ecx, dword [edi + 0x18]
dec edx
shl eax, cl
mov ecx, dword [edi + 0x1c]
dec eax
shl esi, cl
xor ecx, ecx
mov dword [ebp - 0x12c], eax
dec esi
lea eax, [edx*2 + 1]
mov dword [ebp - 0x140], edx
mov dword [ebp - 0x138], eax
mov edx, 4
mul edx
mov dword [ebp - 0x124], esi
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0059b726
mov dword [edi + 0xc0], eax
xor ecx, ecx
mov eax, dword [ebp - 0x12c]
mov edx, 4
lea eax, [eax*2 + 1]
mov dword [ebp - 0x128], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0059b726
mov dword [edi + 0xc4], eax
xor ecx, ecx
lea eax, [esi*2 + 1]
mov edx, 4
mov dword [ebp - 0x134], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0059b726
xor edx, edx
mov dword [edi + 0xc8], eax
add esp, 0x18
cmp dword [ebp - 0x138], edx
jle 0x51c17f
mov esi, dword [ebp - 0x140]
mov eax, dword [edi + 0xc0]
cmp edx, esi
mov ecx, esi
cmovl ecx, edx
mov dword [eax + edx*4], ecx
inc edx
lea eax, [esi*2 + 1]
cmp edx, eax
jl 0x51c163
xor edx, edx
cmp dword [ebp - 0x128], edx
jle 0x51c1ac
mov esi, dword [ebp - 0x12c]
nop
mov eax, dword [edi + 0xc4]
cmp edx, esi
mov ecx, esi
cmovl ecx, edx
mov dword [eax + edx*4], ecx
inc edx
lea eax, [esi*2 + 1]
cmp edx, eax
jl 0x51c190
xor edx, edx
cmp dword [ebp - 0x134], edx
jle 0x51c1dc
mov esi, dword [ebp - 0x124]
nop dword [eax]
mov eax, dword [edi + 0xc8]
cmp edx, esi
mov ecx, esi
cmovl ecx, edx
mov dword [eax + edx*4], ecx
inc edx
lea eax, [esi*2 + 1]
cmp edx, eax
jl 0x51c1c0
lea eax, [edi + 0x4cc]
xor esi, esi
mov dword [ebp - 0x11c], eax
nop word [eax + eax]
mov ecx, dword [edi + 8]
mov eax, 0x80808081
imul ecx, esi
mul ecx
mov eax, dword [ebp - 0x11c]
shr edx, 7
and edx, dword [edi + 8]
mov dword [eax - 0x400], edx
mov eax, dword [ebp - 0x120]
mov edi, dword [eax + 0xc]
mov ecx, edi
imul ecx, esi
mov eax, 0x80808081
mul ecx
mov eax, dword [ebp - 0x11c]
shr edx, 7
and edx, edi
mov dword [eax], edx
mov eax, dword [ebp - 0x120]
mov edi, dword [eax + 0x10]
mov ecx, edi
imul ecx, esi
mov eax, 0x80808081
inc esi
mul ecx
mov eax, dword [ebp - 0x11c]
shr edx, 7
and edx, edi
mov edi, dword [ebp - 0x120]
mov dword [eax + 0x400], edx
add eax, 4
mov dword [ebp - 0x11c], eax
cmp esi, 0x100
jl 0x51c1f0
mov esi, dword [ebp - 0x144]
movzx eax, byte [edi + 0xce4]
mov ecx, edi
push eax
call fcn.0052c090
cmp byte [edi + 0x38], 0
je 0x51c2d5
mov ecx, dword [edi + 0x30]
push edi
call fcn.0051c840
test al, al
jne 0x51c2d5
push 0xf
push str.3D_init_error:
lea ecx, [edi + 0xd1c]
call fcn.0040c5a0
cmp dword [0x620a10], 0x10
lea ecx, [edi + 0xd1c]
push dword [0x620a0c]
mov eax, 0x6209fc
cmovae eax, dword [0x6209fc]
push eax
call fcn.00404bf0
mov edi, 7
jmp 0x51c2e4
inc dword [edi + 0xce8]
mov byte [edi + 0xccc], 1
xor edi, edi
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0059b734
mov esp, ebp
pop ebp
ret 8