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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd8
mov dword [ebp - 4], eax
cmp dword [0x567470], 0
je 0x502369
cmp dword [0x569198], 0
jl 0x50222f
mov eax, dword [ebp - 4]
call fcn.00509a44
test al, al
je 0x50222f
mov eax, dword [ebp - 4]
call fcn.005099e8
test al, al
je 0x50222f
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
cmp eax, dword [0x569198]
jne 0x501e21
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
cmp eax, dword [0x5691a4]
je 0x50222f
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
mov dword [ebp - 8], eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
mov dword [ebp - 0xc], eax
mov eax, dword [0x569198]
mov dword [ebp - 0x18], eax
mov eax, dword [0x5691a4]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.004f21ec
mov byte [ebp - 0x21], al
mov al, byte [0x5691e0]
sub al, 1
jb 0x501e72
je 0x5020b4
jmp 0x50222f
mov eax, dword [0x567470]
call fcn.004f4eb8
mov dword [ebp - 0x20], eax
xor ecx, ecx
mov cl, byte [ebp - 0x21]
mov edx, 0xbc3
mov eax, dword [ebp - 4]
call fcn.00509cd8
test al, al
je 0x5020a5
cmp dword [ebp - 0x20], 0
jle 0x5020a5
lea ecx, [ebp - 0xc]
lea edx, [ebp - 8]
mov al, byte [ebp - 0x21]
call fcn.004f1eb4
mov byte [ebp - 0x24], 1
mov byte [ebp - 0x25], 0
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [0x567408]
call fcn.004edccc
test al, al
jne 0x502073
mov byte [ebp - 0x24], 0
mov byte [ebp - 0x22], 0
cmp byte [ebp - 0x24], 0
jne 0x501f1b
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
mov dword [ebp - 8], eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
mov dword [ebp - 0xc], eax
lea ecx, [ebp - 0xc]
lea edx, [ebp - 8]
mov al, byte [ebp - 0x21]
call fcn.004f1eb4
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
call fcn.005058e4
test al, al
je 0x501f1b
mov byte [ebp - 0x25], 1
cmp byte [ebp - 0x25], 0
jne 0x501fd5
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [0x567408]
call fcn.004edd10
test al, al
jne 0x501fd5
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
mov dword [ebp - 8], eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
mov dword [ebp - 0xc], eax
xor eax, eax
mov al, byte [ebp - 0x21]
call fcn.004f2b30
mov byte [ebp - 0x22], al
lea ecx, [ebp - 0xc]
lea edx, [ebp - 8]
mov al, byte [ebp - 0x22]
call fcn.004f1eb4
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [0x567468]
call fcn.004e8d90
test al, al
jne 0x501fd1
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
mov dword [ebp - 8], eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
mov dword [ebp - 0xc], eax
xor eax, eax
mov al, byte [ebp - 0x21]
call fcn.004f2b58
mov byte [ebp - 0x22], al
lea ecx, [ebp - 0xc]
lea edx, [ebp - 8]
mov al, byte [ebp - 0x22]
call fcn.004f1eb4
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [0x567468]
call fcn.004e8d90
test al, al
je 0x501fd5
mov byte [ebp - 0x24], 1
jmp 0x501fd5
mov byte [ebp - 0x24], 1
cmp byte [ebp - 0x24], 0
je 0x50200d
mov eax, dword [ebp - 0xc]
push eax
xor eax, eax
mov al, byte [ebp - 0x22]
push eax
push 0
push 0
push 0
push 0
mov ecx, dword [ebp - 8]
mov dx, 0xbc3
mov eax, dword [0x567470]
call fcn.004f3ef0
call sub.kernel32.dll_GetTickCount_1
mov dword [0x569064], eax
jmp 0x50222f
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [0x567470]
movzx edx, word [eax + 0xa]
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
mov ecx, dword [ebp - 0x18]
call fcn.004f21ec
mov byte [ebp - 0x23], al
mov eax, dword [0x567470]
mov al, byte [eax + 0x10]
cmp al, byte [ebp - 0x23]
je 0x50222f
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
push eax
xor eax, eax
mov al, byte [ebp - 0x23]
push eax
push 0
push 0
push 0
push 0
mov eax, dword [0x567470]
movzx ecx, word [eax + 8]
mov dx, 0xbc2
mov eax, dword [0x567470]
call fcn.004f3e30
jmp 0x50222f
mov eax, dword [ebp - 0xc]
push eax
xor eax, eax
mov al, byte [ebp - 0x21]
push eax
push 0
push 0
push 0
push 0
mov ecx, dword [ebp - 8]
mov dx, 0xbc3
mov eax, dword [0x567470]
call fcn.004f3ef0
call sub.kernel32.dll_GetTickCount_1
mov dword [0x569064], eax
jmp 0x50222f
mov dword [0x569198], 0xffffffff
jmp 0x50222f
cmp dword [0x5691e4], 1
jge 0x5020d7
cmp byte [0x580959], 0
jbe 0x502224
cmp byte [0x56d132], 0
jbe 0x502224
mov eax, dword [0x567470]
call fcn.004f4ed0
mov dword [ebp - 0x20], eax
mov eax, dword [0x567470]
cmp byte [eax + 0x22], 0
jbe 0x5020f5
mov byte [ebp - 0x26], 3
jmp 0x5020f9
mov byte [ebp - 0x26], 2
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.004f1e7c
xor edx, edx
mov dl, byte [ebp - 0x26]
cmp eax, edx
jl 0x502215
cmp dword [ebp - 0x20], 0
jle 0x502215
xor ecx, ecx
mov cl, byte [ebp - 0x21]
mov edx, 0xbc5
mov eax, dword [ebp - 4]
call fcn.00509cd8
test al, al
je 0x502209
mov eax, dword [ebp - 8]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [0x567470]
cmp byte [eax + 0x22], 0
jbe 0x502163
lea ecx, [ebp - 0xc]
lea edx, [ebp - 8]
mov al, byte [ebp - 0x21]
call fcn.004f1f70
jmp 0x502171
lea ecx, [ebp - 0xc]
lea edx, [ebp - 8]
mov al, byte [ebp - 0x21]
call fcn.004f2038
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [0x567470]
movzx ecx, word [eax + 0xa]
mov eax, dword [0x567470]
movzx edx, word [eax + 8]
mov eax, dword [0x567408]
call fcn.004edc18
test al, al
je 0x5021f8
mov eax, dword [0x567470]
cmp byte [eax + 0x22], 0
jbe 0x5021c9
mov eax, dword [ebp - 0xc]
push eax
xor eax, eax
mov al, byte [ebp - 0x21]
push eax
push 0
push 0
push 0
push 0
mov ecx, dword [ebp - 8]
mov dx, 0xbc1
mov eax, dword [0x567470]
call fcn.004f3ef0
jmp 0x5021ec
mov eax, dword [ebp - 0xc]
push eax
xor eax, eax
mov al, byte [ebp - 0x21]
push eax
push 0
push 0
push 0
push 0
mov ecx, dword [ebp - 8]
mov dx, 0xbc5
mov eax, dword [0x567470]
call fcn.004f3ef0
call sub.kernel32.dll_GetTickCount_1
mov dword [0x569064], eax
jmp 0x50222f
mov eax, dword [ebp - 0x10]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0xc], eax
jmp 0x501e72
mov dword [0x569198], 0xffffffff
jmp 0x50222f
mov dword [0x569198], 0xffffffff
jmp 0x501e72
inc dword [0x5691e4]
jmp 0x501e72
mov dword [0x569198], 0xffffffff
mov eax, dword [0x567470]
cmp word [eax + 0x298], 0
jbe 0x502369
mov eax, dword [0x567470]
movzx eax, word [eax + 0x298]
mov edx, dword [ebp - 4]
mov dword [edx + 0x50c], eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0x29a]
mov edx, dword [ebp - 4]
mov dword [edx + 0x510], eax
mov eax, dword [0x567470]
cmp word [eax + 0x298], 0xbc9
jne 0x5022cc
mov eax, dword [0x567470]
mov eax, dword [eax + 0x2a0]
push eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0x29a]
push eax
mov eax, dword [0x567470]
mov eax, dword [eax + 0x2a4]
push eax
mov eax, dword [0x567470]
mov ecx, dword [eax + 0x29c]
mov eax, dword [0x567470]
movzx edx, word [eax + 0x298]
mov eax, dword [ebp - 4]
call fcn.00508160
jmp 0x502304
mov eax, dword [0x567470]
mov eax, dword [eax + 0x2a0]
push eax
mov eax, dword [0x567470]
movzx eax, word [eax + 0x29a]
push eax
mov eax, dword [0x567470]
mov ecx, dword [eax + 0x29c]
mov eax, dword [0x567470]
movzx edx, word [eax + 0x298]
mov eax, dword [ebp - 4]
call fcn.00508088
mov eax, dword [0x567470]
mov word [eax + 0x298], 0
cmp dword [0x569204], 0xffffffff
je 0x502369
mov eax, dword [0x567470]
movzx eax, word [eax + 8]
push eax
mov eax, dword [0x569204]
pop edx
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp eax, 8
jge 0x502353
mov eax, dword [0x567470]
movzx eax, word [eax + 0xa]
push eax
mov eax, dword [0x569208]
pop edx
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp eax, 8
jl 0x502369
mov eax, dword [0x52a298]
mov eax, dword [eax]
call fcn.004c1618
mov dword [0x569204], 0xffffffff
mov esp, ebp
pop ebp
ret