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

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xfffffff0
mov ebx, eax
mov esi, dword [0x688a9c]
cmp dword [esi], 0
je 0x503421
mov eax, dword [0x689120]
cmp byte [eax], 0
je 0x502db1
mov eax, ebx
call fcn.0050d798
test al, al
je 0x502db1
mov eax, ebx
call fcn.0050d734
test al, al
je 0x502db1
mov eax, dword [0x68826c]
cmp byte [eax], 0
jne 0x502db1
mov eax, ebx
call fcn.005021b4
mov eax, dword [0x688b88]
cmp dword [eax], 0
jl 0x5032b8
mov eax, ebx
call fcn.0050d798
test al, al
je 0x5032b8
mov eax, ebx
call fcn.0050d734
test al, al
je 0x5032b8
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
mov edx, dword [0x688b88]
cmp eax, dword [edx]
jne 0x502dff
mov edx, dword [0x688a78]
mov edx, dword [edx]
mov ecx, dword [esi]
cmp edx, dword [ecx + 0x10]
je 0x5032b8
mov dword [esp], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], eax
mov edi, dword [0x688b88]
mov edi, dword [edi]
mov ebp, dword [0x688a78]
mov ebp, dword [ebp]
push ebp
mov ecx, edi
mov edx, dword [esp + 8]
mov eax, dword [esp + 4]
call fcn.005b2550
mov byte [esp + 0xc], al
mov eax, dword [0x68918c]
movzx eax, byte [eax]
sub al, 1
jb 0x502e4f
je 0x503088
sub al, 5
je 0x503203
jmp 0x5032b8
mov eax, dword [esi]
call fcn.0059de38
mov dword [esp + 8], eax
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], eax
movzx ecx, byte [esp + 0xc]
mov edx, 2
mov eax, ebx
call fcn.0050d8a4
test al, al
je 0x503078
cmp dword [esp + 8], 0
jle 0x503078
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xc]
call fcn.005b2418
mov byte [esp + 0xf], 0
mov ecx, dword [esp + 4]
mov edx, dword [esp]
mov eax, dword [0x694598]
call fcn.0052c0b4
test al, al
jne 0x503044
mov byte [esp + 0xe], 0
mov byte [esp + 0xd], 0
cmp byte [esp + 0xe], 0
jne 0x502f06
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], eax
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xc]
call fcn.005b2418
mov ecx, dword [esp + 4]
mov edx, dword [esp]
mov eax, ebx
call fcn.00507190
test al, al
je 0x502f06
mov byte [esp + 0xf], 1
cmp byte [esp + 0xf], 0
jne 0x502fbe
mov ecx, dword [esp + 4]
mov edx, dword [esp]
mov eax, dword [0x694598]
call fcn.0052c0fc
test al, al
jne 0x502fbe
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], eax
movzx eax, byte [esp + 0xc]
call fcn.005b2c74
mov byte [esp + 0xd], al
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xd]
call fcn.005b2418
mov ecx, dword [esp + 4]
mov edx, dword [esp]
mov eax, dword [0x6945ac]
call fcn.005230dc
test al, al
jne 0x502fb9
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], eax
movzx eax, byte [esp + 0xc]
call fcn.005b2c84
mov byte [esp + 0xd], al
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xd]
call fcn.005b2418
mov ecx, dword [esp + 4]
mov edx, dword [esp]
mov eax, dword [0x6945ac]
call fcn.005230dc
test al, al
je 0x502fbe
mov byte [esp + 0xe], 1
jmp 0x502fbe
mov byte [esp + 0xe], 1
cmp byte [esp + 0xe], 0
je 0x502ff9
mov eax, dword [esp + 4]
push eax
movzx eax, byte [esp + 0x11]
push eax
push 0
push 0
push 0
push 0
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
mov dx, 2
call fcn.0059c9e4
call sub.kernel32.dll_GetTickCount
mov edx, dword [0x688758]
mov dword [edx], eax
jmp 0x5032b8
push ebp
mov eax, dword [esi]
mov edx, dword [eax + 0x10]
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
mov ecx, edi
call fcn.005b2550
mov edx, dword [esi]
cmp al, byte [edx + 0x14]
je 0x503034
mov edx, dword [esi]
mov edx, dword [edx + 0x10]
push edx
movzx eax, al
push eax
push 0
push 0
push 0
push 0
mov eax, dword [esi]
mov ecx, dword [eax + 0xc]
mov eax, dword [esi]
mov dx, 1
call fcn.0059c908
mov eax, dword [0x688b88]
mov dword [eax], 0xffffffff
jmp 0x5032b8
mov eax, dword [esp + 4]
push eax
movzx eax, byte [esp + 0x10]
push eax
push 0
push 0
push 0
push 0
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
mov dx, 2
call fcn.0059c9e4
call sub.kernel32.dll_GetTickCount
mov edx, dword [0x688758]
mov dword [edx], eax
jmp 0x5032b8
mov eax, dword [0x688b88]
mov dword [eax], 0xffffffff
jmp 0x5032b8
mov eax, dword [esi]
call fcn.0059de5c
mov dword [esp + 8], eax
mov eax, dword [esi]
cmp byte [eax + 0x1c], 0
je 0x503151
push ebp
mov ecx, edi
mov edx, dword [esp + 8]
mov eax, dword [esp + 4]
call fcn.005b23a4
cmp eax, 3
jl 0x502e4f
cmp dword [esp + 8], 0
jle 0x502e4f
movzx ecx, byte [esp + 0xc]
mov edx, 5
mov eax, ebx
call fcn.0050d8a4
test al, al
je 0x503141
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xc]
call fcn.005b24e4
mov eax, dword [esp]
push eax
mov eax, dword [esp + 8]
push eax
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
mov eax, dword [esi]
mov edx, dword [eax + 0xc]
mov eax, dword [0x694598]
call fcn.0052bc64
test al, al
je 0x502e4f
mov eax, dword [esp + 4]
push eax
movzx eax, byte [esp + 0x10]
push eax
push 0
push 0
push 0
push 0
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
mov dx, 5
call fcn.0059c9e4
call sub.kernel32.dll_GetTickCount
mov edx, dword [0x688758]
mov dword [edx], eax
jmp 0x5032b8
mov eax, dword [0x688b88]
mov dword [eax], 0xffffffff
jmp 0x5032b8
push ebp
mov ecx, edi
mov edx, dword [esp + 8]
mov eax, dword [esp + 4]
call fcn.005b23a4
cmp eax, 2
jl 0x502e4f
cmp dword [esp + 8], 0
jle 0x502e4f
movzx ecx, byte [esp + 0xc]
mov edx, 4
mov eax, ebx
call fcn.0050d8a4
test al, al
je 0x5031f3
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xc]
call fcn.005b2478
mov eax, dword [esp]
push eax
mov eax, dword [esp + 8]
push eax
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
mov eax, dword [esi]
mov edx, dword [eax + 0xc]
mov eax, dword [0x694598]
call fcn.0052bdcc
test al, al
je 0x502e4f
mov eax, dword [esp + 4]
push eax
movzx eax, byte [esp + 0x10]
push eax
push 0
push 0
push 0
push 0
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
mov dx, 4
call fcn.0059c9e4
call sub.kernel32.dll_GetTickCount
mov edx, dword [0x688758]
mov dword [edx], eax
jmp 0x5032b8
mov eax, dword [0x688b88]
mov dword [eax], 0xffffffff
jmp 0x5032b8
mov eax, dword [esi]
call fcn.0059de5c
mov dword [esp + 8], eax
push ebp
mov ecx, edi
mov edx, dword [esp + 8]
mov eax, dword [esp + 4]
call fcn.005b23a4
cmp eax, 2
jl 0x502e4f
cmp dword [esp + 8], 0
jle 0x502e4f
movzx ecx, byte [esp + 0xc]
mov edx, 6
mov eax, ebx
call fcn.0050d8a4
test al, al
je 0x5032ad
lea ecx, [esp + 4]
mov edx, esp
movzx eax, byte [esp + 0xc]
call fcn.005b2478
mov eax, dword [esp]
push eax
mov eax, dword [esp + 8]
push eax
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
mov eax, dword [esi]
mov edx, dword [eax + 0xc]
mov eax, dword [0x694598]
call fcn.0052bd9c
test al, al
je 0x502e4f
mov eax, dword [esp + 4]
push eax
movzx eax, byte [esp + 0x10]
push eax
push 0
push 0
push 0
push 0
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
mov dx, 6
call fcn.0059c9e4
call sub.kernel32.dll_GetTickCount
mov edx, dword [0x688758]
mov dword [edx], eax
jmp 0x5032b8
mov eax, dword [0x688b88]
mov dword [eax], 0xffffffff
mov eax, dword [0x688b88]
mov dword [eax], 0xffffffff
mov eax, dword [esi]
mov eax, dword [eax + 0x3c8]
test eax, eax
jle 0x503421
mov dword [ebx + 0x3b4], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x3d4]
mov dword [ebx + 0x3b8], eax
mov eax, dword [esi]
mov eax, dword [eax + 0x3c8]
cmp eax, 0x18
jne 0x503322
mov edx, dword [esi]
mov edx, dword [edx + 0x3d0]
push edx
mov edx, dword [esi]
mov edx, dword [edx + 0x3d4]
push edx
mov edx, dword [esi]
mov edx, dword [edx + 0x3d8]
push edx
mov edx, dword [esi]
mov ecx, dword [edx + 0x3cc]
mov edx, eax
mov eax, ebx
call fcn.0050bd38
jmp 0x503375
cmp eax, 3
jne 0x503352
mov eax, dword [esi]
mov eax, dword [eax + 0x3d0]
push eax
mov eax, dword [esi]
mov eax, dword [eax + 0x3d4]
push eax
mov eax, dword [esi]
mov ecx, dword [eax + 0x3cc]
mov eax, dword [esi]
mov edx, dword [eax + 0x3dc]
mov eax, ebx
call fcn.0050bc10
jmp 0x503375
mov edx, dword [esi]
mov edx, dword [edx + 0x3d0]
push edx
mov edx, dword [esi]
mov edx, dword [edx + 0x3d4]
push edx
mov edx, dword [esi]
mov ecx, dword [edx + 0x3cc]
mov edx, eax
mov eax, ebx
call fcn.0050bca0
mov eax, dword [esi]
xor edx, edx
mov dword [eax + 0x3c8], edx
mov eax, dword [0x6890bc]
cmp dword [eax], 0xffffffff
je 0x5033cc
mov eax, dword [0x6890bc]
mov eax, dword [eax]
mov edx, dword [esi]
sub eax, dword [edx + 0xc]
cdq
xor eax, edx
sub eax, edx
cmp eax, 8
jge 0x5033b5
mov eax, dword [0x688f34]
mov eax, dword [eax]
mov edx, dword [esi]
sub eax, dword [edx + 0x10]
cdq
xor eax, edx
sub eax, edx
cmp eax, 8
jl 0x5033cc
mov eax, dword [0x689150]
mov eax, dword [eax]
call fcn.0056c560
mov eax, dword [0x6890bc]
mov dword [eax], 0xffffffff
mov eax, dword [0x6890f0]
cmp dword [eax], 0xffffffff
je 0x503421
mov eax, dword [0x6890f0]
mov eax, dword [eax]
mov edx, dword [esi]
sub eax, dword [edx + 0xc]
cdq
xor eax, edx
sub eax, edx
cmp eax, 8
jge 0x503402
mov eax, dword [0x688f74]
mov eax, dword [eax]
mov edx, dword [esi]
sub eax, dword [edx + 0x10]
cdq
xor eax, edx
sub eax, edx
cmp eax, 8
jl 0x503421
mov eax, dword [0x688de8]
mov eax, dword [eax]
mov eax, dword [eax + 0x4c0]
xor edx, edx
call fcn.00493bf0
mov eax, dword [0x6890f0]
mov dword [eax], 0xffffffff
add esp, 0x10
pop ebp
pop edi
pop esi
pop ebx
ret