Function at 0x502258
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
mov dword [ebp - 0x24], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp byte [eax + 0xd4], 0
je 0x5022ea
call fcn.00406bb0
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xe0]
cdq
sub dword [esp], eax
sbb dword [esp + 4], edx
pop eax
pop edx
cmp edx, 0
jne 0x50229d
cmp eax, 0x3e8
jbe 0x5022a9
jmp 0x50229f
jle 0x5022a9
mov eax, dword [ebp - 4]
mov byte [eax + 0xd4], 0
call fcn.00406bb0
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xe4]
cdq
sub dword [esp], eax
sbb dword [esp + 4], edx
pop eax
pop edx
cmp edx, 0
jne 0x5022d1
cmp eax, 0x28
jbe 0x5022ea
jmp 0x5022d3
jle 0x5022ea
mov eax, dword [ebp - 4]
inc dword [eax + 0xdc]
call fcn.00406bb0
mov edx, dword [ebp - 4]
mov dword [edx + 0xe4], eax
mov eax, dword [ebp - 4]
cmp byte [eax + 0xd4], 0
je 0x5024c4
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xd8]
cdq
xor eax, edx
sub eax, edx
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], 1
mov eax, dword [0x52b860]
mov eax, dword [eax]
cmp eax, dword [ebp - 4]
jne 0x502327
mov dword [ebp - 0x1c], 0x18
jmp 0x50233e
mov eax, dword [ebp - 4]
cmp byte [eax + 0xe], 0
je 0x502337
xor eax, eax
mov dword [ebp - 0x1c], eax
jmp 0x50233e
mov dword [ebp - 0x1c], 0xc
cmp dword [ebp - 0x1c], 0x18
jne 0x50234d
mov dword [ebp - 0x20], 0xc
jmp 0x502354
mov dword [ebp - 0x20], 8
mov eax, dword [ebp - 4]
cmp dword [eax + 0xd8], 0
jle 0x502380
mov edx, dword [ebp - 0x1c]
add edx, 0x3f3
mov eax, dword [0x52ba54]
mov eax, dword [eax]
mov eax, dword [eax + 0x33c]
call fcn.0048af20
mov dword [ebp - 0x18], eax
jmp 0x50239e
mov edx, dword [ebp - 0x1c]
add edx, 0x3f2
mov eax, dword [0x52ba54]
mov eax, dword [eax]
mov eax, dword [eax + 0x33c]
call fcn.0048af20
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x50240d
lea edx, [ebp - 0x34]
mov eax, dword [ebp - 0x18]
call fcn.00484cb8
lea eax, [ebp - 0x34]
push eax
mov eax, dword [ebp - 0x18]
push eax
push 1
mov eax, dword [ebp - 0x18]
call fcn.00484f18
sar eax, 1
jns 0x5023c8
adc eax, 0
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0xb4]
sub edx, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xdc]
add eax, eax
add edx, eax
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 4]
add ecx, dword [eax + 0x108]
mov eax, dword [ebp - 4]
add ecx, dword [eax + 0xec]
sub ecx, 0xa
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xdc]
add eax, eax
sub ecx, eax
mov eax, dword [ebp - 8]
call fcn.004846b0
cmp dword [ebp - 0xc], 0
jl 0x5024c4
push ebp
lea eax, [ebp - 0xc]
call fcn.005021b4
pop ecx
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x14]
add edx, dword [ebp - 0x1c]
mov eax, dword [0x52ba54]
mov eax, dword [eax]
mov eax, dword [eax + 0x33c]
call fcn.0048af20
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x5024b7
lea edx, [ebp - 0x34]
mov eax, dword [ebp - 0x18]
call fcn.00484cb8
lea eax, [ebp - 0x34]
push eax
mov eax, dword [ebp - 0x18]
push eax
push 1
mov eax, dword [ebp - 0x18]
call fcn.00484f18
sar eax, 1
jns 0x502469
adc eax, 0
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0xb4]
sub edx, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xdc]
add eax, eax
add edx, eax
mov eax, dword [ebp - 0x10]
imul eax, dword [ebp - 0x20]
add edx, eax
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 4]
add ecx, dword [eax + 0x108]
mov eax, dword [ebp - 4]
add ecx, dword [eax + 0xec]
sub ecx, 0xa
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xdc]
add eax, eax
sub ecx, eax
mov eax, dword [ebp - 8]
call fcn.004846b0
inc dword [ebp - 0x10]
cmp dword [ebp - 0xc], 0
jge 0x502417
mov esp, ebp
pop ebp
ret 4