Function at 0x502ef8
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
mov edi, ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x503248
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
mov byte [eax], 0
mov eax, edi
call fcn.00404acc
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xa4]
call fcn.004c1970
mov esi, eax
test esi, esi
je 0x503220
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
call fcn.0042c7cc
xor eax, eax
push ebp
push 0x503219
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
mov eax, dword [eax + 0xc]
call fcn.0042b9d0
mov ebx, eax
neg ebx
mov eax, dword [ebp - 4]
fild dword [eax + 0xc]
mov eax, dword [ebp - 4]
fild dword [eax + 0x10]
fdivp st(1)
fstp xword [ebp - 0x18]
wait
mov dword [ebp - 0x1c], ebx
fild dword [ebp - 0x1c]
fld xword [ebp - 0x18]
fdivp st(1)
mov eax, dword [ebp - 4]
fld xword [eax + 0x30]
faddp st(1)
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x4c]
mov edx, dword [ebp - 4]
sub eax, dword [edx + 0x44]
inc eax
mov dword [ebp - 0x20], eax
fild dword [ebp - 0x20]
fdivrp st(1)
call fcn.00402d00
mov ebx, eax
cmp esi, ebx
jge 0x502fbf
mov ebx, esi
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
call fcn.004ffd08
cmp ebx, eax
jge 0x503200
jmp 0x502fee
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0xa4]
mov eax, esi
call fcn.004c1970
mov edx, eax
dec edx
mov eax, esi
call fcn.004c18e0
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xa4]
call fcn.004c1970
cmp ebx, eax
jl 0x502fd4
test ebx, ebx
jle 0x503020
mov edx, ebx
dec edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xa4]
call fcn.004c183c
sub eax, 2
jae 0x503020
mov eax, dword [ebp - 8]
mov byte [eax], 1
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
mov edx, ebx
call fcn.004ffd10
mov ebx, eax
push edi
xor edx, edx
mov eax, ebx
call fcn.004ffb14
push dword [eax + 4]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
call fcn.00404c80
pop edx
sub eax, edx
inc eax
push eax
xor edx, edx
mov eax, ebx
call fcn.004ffb14
mov edx, dword [eax + 4]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
pop ecx
call fcn.00404e1c
mov eax, dword [ebp - 8]
cmp byte [eax], 0
je 0x503090
mov eax, dword [edi]
call fcn.00404c80
test eax, eax
jle 0x503090
mov eax, dword [edi]
cmp word [eax], 0x20
jne 0x503090
mov eax, edi
mov ecx, 1
mov edx, 1
call fcn.00404e68
xor edx, edx
mov eax, ebx
call fcn.004ffb14
push dword [eax + 4]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
call fcn.00404c80
pop edx
sub eax, edx
inc eax
push eax
xor edx, edx
mov eax, ebx
call fcn.004ffb14
mov edx, dword [eax + 4]
mov eax, dword [ebp - 4]
add eax, 0x5c
pop ecx
call fcn.00404e68
lea edx, [ebp - 0x24]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xa4]
call fcn.004c1d10
mov eax, dword [ebp - 0x24]
call fcn.00404c80
mov esi, eax
cmp esi, 2
jle 0x50311c
mov eax, dword [ebp - 4]
cmp byte [eax + 0xa8], 0
je 0x50311c
lea edx, [ebp - 0x28]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xa4]
call fcn.004c1d10
mov eax, dword [ebp - 0x28]
cmp word [eax + esi*2 - 6], 0x2d
jne 0x50311c
mov eax, dword [ebp - 4]
add eax, 0x5c
mov edx, 0x50325c
call fcn.00404c8c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
cmp byte [eax + 4], 0
je 0x503200
xor edx, edx
mov eax, ebx
call fcn.004ffb14
test byte [eax + 0x10], 1
je 0x503149
mov ecx, dword [edi]
mov eax, edi
mov edx, 0x503264
call fcn.00404cec
xor edx, edx
mov eax, ebx
call fcn.004ffb14
test byte [eax + 0x10], 2
je 0x503166
mov ecx, dword [edi]
mov eax, edi
mov edx, 0x503270
call fcn.00404cec
xor edx, edx
mov eax, ebx
call fcn.004ffb14
test byte [eax + 0x10], 4
je 0x503183
mov ecx, dword [edi]
mov eax, edi
mov edx, 0x50327c
call fcn.00404cec
xor edx, edx
mov eax, ebx
call fcn.004ffb14
mov eax, dword [eax + 0x14]
call fcn.0042b26c
mov ebx, eax
mov eax, ebx
and eax, 0xff0000
test eax, eax
jns 0x5031a6
add eax, 0xffff
sar eax, 0x10
mov edx, ebx
and edx, 0xff
shl edx, 0x10
add eax, edx
and ebx, 0xff00
add eax, ebx
mov ebx, eax
push 0x50328c
lea ecx, [ebp - 0x34]
mov edx, 6
mov eax, ebx
call fcn.004094c4
push dword [ebp - 0x34]
push 0x5032a4
lea eax, [ebp - 0x30]
mov edx, 3
call fcn.00404740
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 0x2c]
call fcn.00404c60
mov edx, dword [ebp - 0x2c]
mov ecx, dword [edi]
mov eax, edi
call fcn.00404cec
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x503220
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
call fcn.0042cba0
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x50324f
lea eax, [ebp - 0x34]
mov edx, 2
call fcn.004043d4
lea eax, [ebp - 0x2c]
mov edx, 3
call fcn.00404ae4
ret