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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov dword [ebp - 4], 0
push dword [ebp + 8]
call fcn.0058301f
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x58300f
cmp dword [ebp + 0xc], 3
jne 0x582d9a
call fcn.005830bf
mov dword [0xaf3566], 0
jmp 0x582fb4
cmp dword [ebp + 0xc], 1
jne 0x582eda
mov ebx, dword [0xaf355a]
call fcn.00558d32
push ebx
push ecx
mov eax, dword [ebp - 4]
dec eax
jns 0x582dc4
push 4
call fcn.0079ceca
add esp, 4
pop ecx
pop ebx
cmp eax, ecx
jl 0x582dd7
push 1
call fcn.0079ceca
add esp, 4
shl eax, 2
add ebx, eax
mov ebx, dword [ebx]
add ebx, 0x1c
mov dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
cmp dword [ebx], 0
jne 0x582e42
mov eax, dword [ebp + 0x10]
cmp dword [0xaf356a], eax
jne 0x582e09
mov eax, 0
jmp 0x583019
mov eax, dword [ebp + 0x10]
mov dword [0xaf356a], eax
call fcn.005830bf
mov eax, dword [ebp - 4]
mov dword [0xaf3566], eax
mov eax, dword [ebp + 8]
mov dword [0xaf356e], eax
push 0
mov ebx, 0x308
call sub.kernel32.dll_GetTickCount
add esp, 4
mov dword [0xaf3572], eax
jmp 0x582ed5
mov ebx, dword [0xaf355a]
call fcn.00558d32
push ebx
push ecx
mov eax, dword [ebp - 4]
dec eax
jns 0x582e62
push 4
call fcn.0079ceca
add esp, 4
pop ecx
pop ebx
cmp eax, ecx
jl 0x582e75
push 1
call fcn.0079ceca
add esp, 4
shl eax, 2
add ebx, eax
mov ebx, dword [ebx]
add ebx, 0x1c
mov dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
cmp dword [ebx], 2
jne 0x582ed5
mov eax, dword [ebp + 0x10]
cmp dword [0xaf356a], eax
jne 0x582ea7
mov eax, 0
jmp 0x583019
mov eax, dword [ebp + 0x10]
mov dword [0xaf356a], eax
cmp dword [0xaf3576], 0
je 0x582ed5
call fcn.005830bf
mov dword [0xaf3566], 0
mov dword [0xaf356e], 0
jmp 0x582fb4
cmp dword [ebp + 0xc], 2
jne 0x582fb4
mov ebx, dword [0xaf355a]
call fcn.00558d32
push ebx
push ecx
mov eax, dword [ebp - 4]
dec eax
jns 0x582f04
push 4
call fcn.0079ceca
add esp, 4
pop ecx
pop ebx
cmp eax, ecx
jl 0x582f17
push 1
call fcn.0079ceca
add esp, 4
shl eax, 2
add ebx, eax
mov ebx, dword [ebx]
add ebx, 0x1c
mov dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
cmp dword [ebx], 1
je 0x582f80
mov ebx, dword [0xaf355a]
call fcn.00558d32
push ebx
push ecx
mov eax, dword [ebp - 4]
dec eax
jns 0x582f50
push 4
call fcn.0079ceca
add esp, 4
pop ecx
pop ebx
cmp eax, ecx
jl 0x582f63
push 1
call fcn.0079ceca
add esp, 4
shl eax, 2
add ebx, eax
mov ebx, dword [ebx]
add ebx, 0x1c
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp - 0x10]
cmp dword [ebx], 2
je 0x582f80
xor eax, eax
jmp 0x582f85
mov eax, 1
test eax, eax
je 0x582fb4
mov eax, dword [ebp - 4]
mov dword [0xaf3566], eax
mov eax, dword [ebp + 8]
mov dword [0xaf356e], eax
push 0
mov ebx, 0x308
call sub.kernel32.dll_GetTickCount
add esp, 4
mov dword [0xaf3572], eax
mov ebx, dword [0xaf355a]
call fcn.00558d32
push ebx
push ecx
mov eax, dword [ebp - 4]
dec eax
jns 0x582fd4
push 4
call fcn.0079ceca
add esp, 4
pop ecx
pop ebx
cmp eax, ecx
jl 0x582fe7
push 1
call fcn.0079ceca
add esp, 4
shl eax, 2
add ebx, eax
mov ebx, dword [ebx]
add ebx, 8
mov dword [ebp - 8], ebx
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
mov ebx, dword [ebp - 8]
push dword [ebx]
call fcn.0055f7c5
jmp 0x583019
mov eax, 0
jmp 0x583019
mov esp, ebp
pop ebp
ret 0x10