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

Disassembly:
push ebx
push esi
push edi
add esp, 0xffffffc0
mov edi, edx
mov ebx, eax
mov esi, dword [0x52b69c]
mov byte [esp], 0
test ebx, ebx
je 0x516477
call sub.KERNEL32.DLL_GetTickCount
xor edx, edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [0x52baf0]
cmp byte [eax], 0
je 0x516477
cmp dword [esi + 0x12], 2
jb 0x516477
mov eax, ebx
call fcn.00515f48
test al, al
je 0x516477
cmp ebx, dword [esi + 0x4b]
jne 0x516477
lea edx, [esp + 0x10]
mov eax, dword [0x52b970]
mov eax, dword [eax + 0x74]
add eax, ebx
mov ecx, 0xc
call fcn.0051b2b4
fstp st(0)
lea edx, [esi + 0x23]
lea eax, [esp + 0x10]
call fcn.00517178
mov ecx, eax
mov eax, ecx
cdq
push edx
push eax
lea eax, [edi + 1]
xor edx, edx
cmp edx, dword [esp + 4]
jne 0x516264
cmp eax, dword [esp]
pop edx
pop eax
jb 0x516271
jmp 0x516268
pop edx
pop eax
jl 0x516271
mov byte [esp], 1
jmp 0x516477
cmp byte [esi + 0x22], 2
je 0x5162c8
lea ecx, [esp + 0x28]
mov edx, edi
dec edx
mov eax, ebx
call fcn.00515f8c
fld dword [esp + 0x28]
fcomp dword [0x516484]
fnstsw ax
sahf
jne 0x5162a7
fld dword [esp + 0x30]
fcomp dword [0x516484]
fnstsw ax
sahf
je 0x516477
push dword [esp + 0x30]
push dword [esp + 0x2c]
call fcn.0051f89c
mov edx, 0x3e8
mov eax, 2
call fcn.005160e4
jmp 0x5163dd
fld dword [esp + 0x10]
call fcn.00402c0c
push edx
push eax
fld dword [esp + 0x24]
call fcn.00402c0c
cmp edx, dword [esp + 4]
jne 0x5162e5
cmp eax, dword [esp]
pop edx
pop eax
jne 0x51630e
fld dword [esp + 0x18]
call fcn.00402c0c
push edx
push eax
fld dword [esp + 0x2c]
call fcn.00402c0c
cmp edx, dword [esp + 4]
jne 0x516306
cmp eax, dword [esp]
pop edx
pop eax
je 0x5163dd
mov eax, dword [esp + 0x10]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x24], eax
lea edx, [esi + 0x23]
lea eax, [esp + 0x10]
call fcn.00517178
mov ecx, eax
mov eax, ecx
cdq
push edx
push eax
lea eax, [edi + 1]
xor edx, edx
cmp edx, dword [esp + 4]
jne 0x51634d
cmp eax, dword [esp]
pop edx
pop eax
jb 0x51635a
jmp 0x516351
pop edx
pop eax
jl 0x51635a
mov byte [esp], 1
jmp 0x516477
lea ecx, [esp + 0x28]
mov edx, edi
dec edx
mov eax, ebx
call fcn.00515f8c
fld dword [esp + 0x28]
fcomp dword [0x516484]
fnstsw ax
sahf
jne 0x51638a
fld dword [esp + 0x30]
fcomp dword [0x516484]
fnstsw ax
sahf
je 0x516477
mov eax, dword [0x52b6cc]
cmp dword [eax + 0x22], 1
jne 0x5163c1
mov eax, dword [0x52b6cc]
cmp byte [eax + 0x11], 0
je 0x5163c1
fld dword [esp + 0x18]
call fcn.00402c0c
push eax
fld dword [esp + 0x14]
call fcn.00402c0c
pop edx
call fcn.00517208
test al, al
je 0x516477
push dword [esp + 0x30]
push dword [esp + 0x2c]
call fcn.0051f89c
mov edx, 0x3e8
mov eax, 2
call fcn.005160e4
fld dword [esp + 0x34]
call fcn.00402c0c
push edx
push eax
fld dword [esi + 0x23]
call fcn.00402c0c
cmp edx, dword [esp + 4]
jne 0x5163f9
cmp eax, dword [esp]
pop edx
pop eax
jne 0x51641d
fld dword [esp + 0x3c]
call fcn.00402c0c
push edx
push eax
fld dword [esi + 0x2b]
call fcn.00402c0c
cmp edx, dword [esp + 4]
jne 0x516419
cmp eax, dword [esp]
pop edx
pop eax
je 0x516443
mov eax, dword [esi + 0x23]
mov dword [esp + 0x34], eax
mov eax, dword [esi + 0x27]
mov dword [esp + 0x38], eax
mov eax, dword [esi + 0x2b]
mov dword [esp + 0x3c], eax
call sub.KERNEL32.DLL_GetTickCount
xor edx, edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
jmp 0x516468
call sub.KERNEL32.DLL_GetTickCount
xor edx, edx
sub eax, dword [esp + 8]
sbb edx, dword [esp + 0xc]
cmp edx, 0
jne 0x516460
cmp eax, 0x7d0
jbe 0x516468
jmp 0x516462
jle 0x516468
mov byte [esp], 0
jmp 0x516477
push 0xc8
call sub.KERNEL32.DLL_Sleep
jmp 0x5161f3
mov al, byte [esp]
add esp, 0x40
pop edi
pop esi
pop ebx
ret