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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x240
mov eax, dword [0x906980]
mov edx, dword [ebx + 0xcc]
mov dword [esp + 0x23c], eax
cmp edx, dword [ebx + 0xd0]
push esi
mov esi, 0x800
push edi
mov dword [esp + 0xc], esi
je 0x84ff80
mov ecx, dword [ebx + 0xd4]
mov edi, dword [ebx + 0xc4]
lea ecx, [ecx]
sub esi, dword [ecx + edx]
mov eax, dword [ebx + 0xc0]
add eax, edx
cdq
idiv edi
cmp edx, dword [ebx + 0xd0]
jne 0x84ff30
cmp esi, 0x100
mov dword [esp + 0xc], esi
jge 0x84ff72
call fcn.0084bcb0
sub eax, dword [ebx + 0xe4]
cmp eax, 0xfa
jbe 0x84ff72
mov dword [esp + 0xc], 0x100
mov esi, dword [esp + 0xc]
jmp 0x84ff80
test esi, esi
jle 0x850255
lea ebx, [ebx]
mov edi, 0x218
cmp esi, edi
jge 0x84ff8b
mov edi, esi
xor esi, esi
mov dword [esp + 8], esi
test edi, edi
jle 0x84ffdd
mov edx, dword [ebx + 0xd0]
cmp edx, dword [ebx + 0xc8]
je 0x84ffdd
mov ecx, dword [ebx + 0xd4]
add ecx, edx
or eax, 0xffffffff
sub eax, dword [ecx]
add edi, eax
test esi, esi
jle 0x84ffba
test edi, edi
jle 0x84ffdd
mov eax, dword [ebx + 0xc0]
add eax, edx
cdq
idiv dword [ebx + 0xc4]
inc esi
mov dword [ebx + 0xd0], edx
cmp dword [ecx], 0xfa
jg 0x84ffdd
cmp esi, 8
jl 0x84ff91
test esi, esi
mov dword [esp + 8], esi
je 0x850255
mov esi, dword [ebx + 0xc0]
mov ecx, dword [ebx + 0xc4]
mov eax, dword [ebx + 0xd0]
sub eax, esi
add eax, ecx
cdq
idiv ecx
mov esi, dword [ebx + 0xd4]
mov ecx, dword [esi + edx]
add ecx, 0x10
mov eax, ecx
shr ecx, 2
lea edi, [esp + 0x18]
add esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 8]
and ecx, 3
dec eax
test eax, eax
rep movsb byte es:[edi], byte [esi]
jle 0x8500ce
mov dword [esp + 0x14], eax
jmp 0x850040
mov ecx, dword [ebx + 0xc4]
mov edi, dword [ebx + 0xc0]
mov eax, ecx
sub eax, edi
add eax, edx
cdq
idiv ecx
mov esi, dword [ebx + 0xd4]
mov eax, dword [ebx + 0x38]
add esi, edx
test eax, eax
mov dword [esp + 8], edx
mov dword [esp + 0x10], esi
je 0x85007b
mov ecx, dword [esi]
push 0
push ecx
lea edx, [esi + 0x10]
push edx
push ebx
call eax
add esp, 0x10
add dword [esp + 0x20], 0x10000000
mov ecx, dword [esi]
mov edi, dword [esp + 0x18]
mov eax, ecx
shr ecx, 2
add esi, 0x10
lea edi, [esp + edi + 0x28]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
add eax, dword [esi]
mov edx, dword [esp + 8]
mov dword [esp + 0x18], eax
mov cl, byte [esi]
mov byte [esp + eax + 0x28], cl
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
inc ecx
dec eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], eax
jne 0x850040
cmp edx, dword [ebx + 0xcc]
je 0x85019c
jmp 0x8500e0
mov edx, dword [esp + 8]
mov eax, dword [esp + 0x20]
cmp eax, dword [0x90d3e4]
ja 0x850194
mov ecx, dword [ebx + 0xc4]
mov edi, dword [ebx + 0xc0]
mov eax, ecx
sub eax, edi
add eax, edx
cdq
idiv ecx
mov esi, dword [ebx + 0xd4]
mov eax, dword [esi + edx]
mov ecx, dword [esp + 0x18]
add esi, edx
mov dword [esp + 8], edx
lea edx, [eax + ecx]
cmp edx, 0x40
mov dword [esp + 0x10], esi
jg 0x850190
mov ecx, dword [ebx + 0x38]
test ecx, ecx
je 0x850138
push 0
push eax
lea eax, [esi + 0x10]
push eax
push ebx
call ecx
add esp, 0x10
mov ecx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
add ecx, 0x10000000
mov dword [esp + 0x20], ecx
mov ecx, dword [esi]
mov edx, ecx
shr ecx, 2
add esi, 0x10
lea edi, [esp + edi + 0x28]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
add eax, dword [esi]
mov edx, dword [esp + 8]
mov dword [esp + 0x18], eax
mov cl, byte [esi]
mov byte [esp + eax + 0x28], cl
mov ecx, dword [esp + 0x18]
mov eax, dword [ebx + 0xcc]
inc ecx
cmp edx, eax
mov dword [esp + 0x18], ecx
jne 0x8500dc
mov edx, dword [esp + 8]
cmp edx, dword [ebx + 0xcc]
jne 0x8501a8
mov dword [0x90d3e4], 0x20000000
jmp 0x8501c7
mov eax, dword [0x90d3e4]
cmp eax, 0x80000000
jae 0x8501bd
add eax, eax
mov dword [0x90d3e4], eax
jmp 0x8501c7
mov dword [0x90d3e4], 0xf0000000
mov eax, dword [ebx + 0xb0]
mov esi, dword [esp + 0x18]
push 0x10
lea ecx, [ebx + 0x84]
push ecx
mov dword [ebx + 0xb8], eax
push 0
dec eax
add esi, 8
push esi
lea edx, [esp + 0x30]
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 0x80]
push edx
push eax
call fcn.0084b110
mov edi, eax
add esp, 0x18
cmp edi, esi
jne 0x85024f
call fcn.0084bcb0
mov edx, dword [ebx + 0x5c]
mov ecx, dword [ebx + 0x64]
add edx, esi
mov dword [ebx + 0xe4], eax
mov eax, dword [esp + 0x20]
inc ecx
cmp eax, 0x100
mov dword [ebx + 0x5c], edx
mov dword [ebx + 0x64], ecx
jb 0x850234
mov dword [ebx + 0xbc], 0
test edi, edi
jl 0x850255
mov eax, dword [esp + 0xc]
sub eax, dword [esp + 0x18]
test eax, eax
mov dword [esp + 0xc], eax
jle 0x850255
mov esi, eax
jmp 0x84ff80
mov dword [ebx + 0xe0], edi
mov ecx, dword [esp + 0x244]
call fcn.007d6cb0
pop edi
pop esi
mov esp, ebp
pop ebp
ret