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

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov ebp, ecx
mov eax, dword [ebp + 0x44]
lea esi, [ebp + 0x40]
push edi
xor edi, edi
cmp eax, edi
je 0x10051493
mov ecx, dword [esi + 8]
mov ebx, dword [esp + 0x30]
sub ecx, eax
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x10051493
mov eax, dword [esi + 4]
cmp eax, edi
je 0x100512d0
mov ecx, dword [esi + 8]
sub ecx, eax
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x100512d5
call fcn.1015828d
mov ecx, dword [esi + 4]
lea eax, [ebx*8]
sub eax, ebx
mov edx, dword [ecx + eax*4]
cmp edx, dword [esp + 0x28]
jne 0x10051493
push ebx
mov ecx, esi
call fcn.1004ff20
mov eax, dword [eax + 4]
cmp eax, dword [esp + 0x2c]
jne 0x10051493
cmp dword [ebp + 0x14], edi
jbe 0x10051403
add dword [ebp + 0x54], 1
mov dword [esp + 0x28], edi
mov eax, dword [esi + 4]
test eax, eax
je 0x10051403
mov ecx, dword [esi + 8]
sub ecx, eax
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp edi, eax
jae 0x10051403
push edi
mov ecx, esi
call fcn.1004ff20
cmp dword [eax], 0xffffffff
je 0x100513f7
cmp dword [eax + 4], 0xffffffff
je 0x100513f7
push edi
mov ecx, esi
call fcn.1004ff20
mov ecx, dword [esp + 0x30]
push ecx
mov ecx, esi
lea ebx, [eax + 0x18]
call fcn.1004ff20
mov edx, dword [ebx]
cmp edx, dword [eax + 0x18]
jae 0x100513f3
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push edi
mov ecx, esi
mov ebx, eax
call fcn.1004ff20
sub ebx, dword [eax + 0x10]
mov eax, dword [ebp + 0x64]
imul eax, dword [ebp + 0x24]
cmp ebx, eax
jbe 0x100513f3
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push edi
mov ecx, esi
mov ebx, eax
call fcn.1004ff20
push edi
mov ecx, esi
mov dword [eax + 0x10], ebx
call fcn.1004ff20
add dword [eax + 0x14], 1
add eax, 0x14
push edi
mov ecx, esi
call fcn.1004ff20
mov ecx, dword [ebp + 0x54]
push edi
mov dword [eax + 0x18], ecx
push edi
mov ecx, esi
call fcn.1004ff20
push eax
lea ecx, [esp + 0x18]
call fcn.1004fee0
mov ecx, dword [esp + 0x34]
push eax
call fcn.100510b0
mov eax, dword [esp + 0x28]
add eax, 1
cmp eax, dword [ebp + 0x14]
mov dword [esp + 0x28], eax
ja 0x100513ff
mov ebx, dword [esp + 0x30]
add edi, 1
jmp 0x10051314
mov ebx, dword [esp + 0x30]
push ebx
mov ecx, esi
call fcn.1004ff20
cmp dword [eax + 0x14], 1
jne 0x10051418
mov ecx, ebp
call fcn.1004ffe0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push ebx
mov ecx, esi
mov edi, eax
call fcn.1004ff20
mov eax, dword [eax + 0x10]
cmp edi, eax
jb 0x10051433
sub edi, eax
jmp 0x10051438
sub edi, eax
sub edi, 1
mov edx, dword [ebp + 0x24]
lea ecx, [edi + edx*2]
mov eax, 0xaaaaaaab
mul ecx
shr edx, 1
cmp edx, 0x1f4
mov dword [ebp + 0x24], edx
jae 0x10051459
mov dword [ebp + 0x24], 0x1f4
mov eax, 0x7d0
cmp dword [ebp + 0x24], eax
jbe 0x10051466
mov dword [ebp + 0x24], eax
push ebx
mov ecx, esi
call fcn.1004ff20
xor ecx, ecx
or edx, 0xffffffff
pop edi
mov dword [eax], edx
mov dword [eax + 4], edx
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], ecx
add dword [ebp + 0x34], edx
pop esi
mov dword [ebp + 0x38], ebx
pop ebp
mov al, 1
pop ebx
add esp, 0x14
ret 0x10
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x14
ret 0x10