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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
sub esp, 0x10
push ebx
push esi
mov esi, dword [eax*4 + 0x20a514c]
push edi
test eax, eax
js 0x5168bc
cmp eax, 0x1194
jge 0x5168bc
cmp dword [esi + 4], 3
jne 0x5168bc
cmp word [esi + 0x78], 1
jne 0x51656e
cmp byte [esi + 0xa], 0
jg 0x5168bc
cmp byte [esi + 0x9c0], 0
jne 0x5168bc
cmp byte [esi + 0x7a], 0
je 0x5168bc
cmp byte [esi + 0x214], 0
jne 0x5168bc
push eax
call fcn.004748f0
test eax, eax
jne 0x5168bc
mov eax, dword [ebp + 8]
movsx ebx, word [esi + 0x144]
movsx edx, word [esi + 0x146]
movzx edi, byte [eax + 3]
movzx eax, byte [eax + 4]
shl edi, 8
or edi, eax
movzx eax, byte [esi + 0x149]
imul ecx, eax, 0x15d38
test ebx, ebx
js 0x5165f6
cmp ebx, dword [ecx + 0xd2f384]
jge 0x5165f6
test edx, edx
js 0x5165f6
mov eax, dword [ecx + 0xd2f388]
cmp edx, eax
jge 0x5165f6
imul eax, edx
add eax, dword [ecx + 0xd2f380]
test byte [eax + ebx], 1
je 0x5165f6
push edi
push esi
call fcn.00517b30
test al, al
je 0x5168bc
push edi
push esi
call fcn.00489910
cmp al, 1
je 0x5168bc
cmp word [esi + 0x78], 1
jne 0x51663f
push edi
push esi
call fcn.005088c0
mov edi, eax
test edi, edi
je 0x5168bc
movzx ecx, word [edi + 8]
push ecx
push esi
call fcn.00508250
test al, al
je 0x5168bc
movzx eax, word [edi + 8]
push eax
push esi
call fcn.005086c0
test al, al
jmp 0x516654
mov eax, dword [esi + 0x324]
lea ecx, [edi + edi*4]
lea edi, [eax + ecx*4]
mov eax, 0xffff
cmp word [edi + 8], ax
je 0x5168bc
movzx eax, word [edi + 6]
cmp eax, 5
je 0x5166a3
cmp eax, 8
je 0x5166a3
cmp eax, 9
je 0x5166a3
cmp eax, 0xa
je 0x5166a3
cmp eax, 0xc
je 0x5166a3
cmp eax, 0xd
je 0x5166a3
cmp eax, 0xe
je 0x5166a3
cmp eax, 0x18
je 0x5166a3
cmp eax, 0x2f
je 0x5166a3
cmp eax, 0x32
je 0x5166a3
cmp eax, 0x34
je 0x5166a3
cmp eax, 0x37
je 0x5166a3
cmp eax, 0x4e
jne 0x5168bc
cmp word [esi + 0x78], 1
jne 0x51675e
movzx eax, word [esi + 0x328]
test ax, ax
je 0x5168bc
cmp ax, word [edi + 8]
jne 0x5168bc
movzx ecx, word [esi + 0x32a]
lea eax, [ecx + 1]
mov word [esi + 0x32a], ax
cmp ecx, 5
jae 0x5168bc
cmp word [edi + 6], 0x18
jne 0x51675e
mov ecx, dword [esi + 0x390]
movzx eax, word [ecx + 4]
mov edx, eax
mov ebx, eax
test ax, ax
js 0x5168bc
mov eax, 0x2000
cmp dx, ax
jge 0x5168bc
movzx eax, word [ecx + 0x110]
mov ecx, eax
test ax, ax
js 0x5168bc
mov eax, 0x2000
cmp cx, ax
jge 0x5168bc
lea eax, [ebx - 0x800]
mov edx, 0x1ff
cmp ax, dx
ja 0x5168bc
mov eax, 0x800
cmp cx, ax
jl 0x5168bc
mov eax, 0xa00
cmp cx, ax
jge 0x5168bc
mov edx, dword [ebp + 8]
mov ebx, 5
cmp byte [edx + 8], bl
lea eax, [edx + 8]
movzx ecx, byte [eax]
cmova ecx, ebx
mov dword [ebp + 0xc], eax
mov byte [eax], cl
cmp dword [0xbdccbc], 1
mov dword [ebp - 4], 0
je 0x516796
mov al, byte [esi + 0x5a8]
and al, 0xc0
cmp al, 0x80
jne 0x5167f1
lea eax, [edx + 8]
mov ebx, eax
lea ecx, [esi + 0xc0]
movzx eax, word [edi + 6]
push eax
mov dword [ebp + 0xc], ebx
call fcn.00434330
test al, al
je 0x5167ee
cmp dword [0xbda898], 0
mov eax, dword [sym.imp.KERNEL32.dll_GetTickCount]
je 0x5167d5
mov dword [ebp + 0xc], ebx
call eax
sub eax, dword [esi + 0x714]
cmp eax, dword [0xbda89c]
jbe 0x5167ee
mov eax, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 4], 1
call eax
mov edx, dword [ebp + 8]
mov dword [esi + 0x714], eax
mov eax, ebx
mov dword [ebp + 0xc], eax
jmp 0x5167f4
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0
mov dword [ebp - 0xc], 0
jbe 0x5168bc
lea eax, [edx + 9]
mov dword [ebp + 8], eax
nop word [eax + eax]
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
or ecx, eax
cmp ecx, 0x1194
jae 0x5168a0
cmp word [esi + 0x78], 1
mov ebx, dword [ecx*4 + 0x20a514c]
jne 0x516860
movsx eax, word [ebx + 0x146]
push eax
movsx eax, word [ebx + 0x144]
push eax
movsx eax, word [esi + 0x146]
push eax
movsx eax, word [esi + 0x144]
push eax
movzx eax, word [edi + 8]
push eax
call fcn.005080e0
test al, al
je 0x5168a0
cmp byte [ebp + 0x10], 0
je 0x51686c
mov byte [ebp - 8], 1
jmp 0x516875
cmp word [edi + 6], 0x37
sete byte [ebp - 8]
push dword [ebp - 4]
mov ecx, 0x57ac4c
push 0
push 0
push 1
push dword [ebp - 8]
push edi
push ebx
push esi
call fcn.00406af0
cmp dword [ebp - 4], 0
je 0x5168a0
push 1
push dword [ebx]
push 0x3b
push esi
call fcn.00517480
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
add dword [ebp + 8], 3
inc ecx
mov dword [ebp - 0xc], ecx
movzx eax, byte [eax]
cmp ecx, eax
mov eax, dword [ebp + 8]
jl 0x516810
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc