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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff8ac
push ebx
push esi
push edi
mov esi, eax
xor ebx, ebx
xor edx, edx
push ebp
push 0x51e628
push dword fs:[edx]
mov dword fs:[edx], esp
call fcn.004e9340
mov dword [ebp - 0xc], eax
xor edi, edi
movzx eax, word [esi + 0x8cc]
imul edx, eax, 0x3e8
mov eax, esi
call fcn.0051dfcc
test al, al
je 0x51e4f5
xor eax, eax
mov dword [ebp - 0x10], eax
xor ecx, ecx
xor edx, edx
mov eax, esi
call fcn.0051dea0
lea edx, [ebp - 0x63f]
mov ecx, 0x10
mov eax, esi
call fcn.0051dfd8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0x10
jne 0x51e3ce
call fcn.0050becc
lea edx, [eax + 0xbd0]
lea eax, [ebp - 0x63f]
call fcn.0049d55c
test al, al
jne 0x51e3d5
lea edx, [ebp - 0x650]
mov eax, 0x51e648
call fcn.0049d50c
lea edx, [ebp - 0x650]
lea eax, [ebp - 0x63f]
call fcn.0049d55c
test al, al
jne 0x51e3d5
mov bl, 2
jmp 0x51e4f5
add edi, dword [ebp - 4]
xor ecx, ecx
mov edx, edi
mov eax, esi
call fcn.0051b508
mov edx, dword [esi + 0x8c4]
lea eax, [ebp - 0x63f]
mov ecx, dword [ebp - 4]
call fcn.00402b40
movzx eax, word [esi + 0x8cc]
imul edx, eax, 0x3e8
mov eax, esi
call fcn.0051dfcc
test al, al
je 0x51e4f5
xor eax, eax
mov dword [ebp - 8], eax
lea edx, [ebp - 8]
mov ecx, 4
mov eax, esi
call fcn.0051dfd8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 4
je 0x51e437
mov bl, 2
jmp 0x51e4f5
xor ecx, ecx
mov edx, dword [ebp - 8]
mov eax, esi
call fcn.0051b508
mov edx, dword [esi + 0x8c4]
add edx, edi
lea eax, [ebp - 8]
mov ecx, dword [ebp - 4]
call fcn.00402b40
add edi, dword [ebp - 4]
jmp 0x51e4d6
movzx eax, word [esi + 0x8cc]
imul edx, eax, 0x3e8
mov eax, esi
call fcn.0051dfcc
test al, al
je 0x51e4d6
mov eax, dword [ebp - 8]
sub eax, edi
mov edx, 0x10000
call fcn.004e81c4
mov edx, dword [esi + 0x8c4]
add edx, edi
mov ecx, eax
mov eax, esi
call fcn.0051dfd8
mov dword [ebp - 4], eax
add edi, dword [ebp - 4]
mov dword [ebp - 0x654], edi
fild dword [ebp - 0x654]
fild dword [ebp - 8]
fdivp st(1)
fmul dword [0x51e654]
call fcn.00402de4
mov ebx, eax
mov eax, esi
call fcn.0051bdc4
movzx eax, ax
add eax, dword [ebp - 0x10]
cmp ebx, eax
jl 0x51e4d6
mov ecx, ebx
mov edx, edi
mov eax, esi
call fcn.0051dea0
mov dword [ebp - 0x10], ebx
mov eax, esi
call fcn.0051dfbc
test al, al
je 0x51e4ea
cmp edi, dword [ebp - 8]
jl 0x51e45b
cmp edi, dword [ebp - 8]
jne 0x51e4f3
mov bl, 1
jmp 0x51e4f5
mov bl, 2
cmp bl, 1
jne 0x51e61e
mov cx, 0x64
mov edx, edi
mov eax, esi
call fcn.0051dea0
call fcn.004e9340
mov edi, eax
mov eax, esi
call fcn.0051b7d4
cmp byte [esi + 0x86c], 0
je 0x51e61e
call fcn.0040b8d0
fstp qword [ebp - 0x62f]
wait
mov byte [ebp - 0x627], 4
mov edx, edi
mov eax, dword [ebp - 0xc]
call fcn.004e9348
mov dword [ebp - 0x626], eax
mov al, byte [esi + 0x248]
mov byte [ebp - 0x622], al
mov al, byte [esi + 0x364]
mov byte [ebp - 0x621], al
lea eax, [ebp - 0x620]
lea edx, [esi + 0x367]
call fcn.00402f00
lea eax, [ebp - 0x520]
lea edx, [esi + 0x467]
call fcn.00402f00
mov eax, dword [esi + 0x568]
mov dword [ebp - 0x420], eax
lea eax, [ebp - 0x41c]
lea edx, [esi + 0x56c]
call fcn.00402f00
lea eax, [ebp - 0x31c]
lea edx, [esi + 0x66c]
call fcn.00402f00
mov word [ebp - 0x21c], 0
mov byte [ebp - 0x21a], 0
xor eax, eax
mov dword [ebp - 0x11a], eax
mov eax, dword [esi + 0x8c4]
mov ax, word [eax + 0x15]
mov word [ebp - 0x116], ax
call fcn.0050becc
lea ecx, [ebp - 0x754]
mov edx, dword [esi + 0x8c4]
mov dx, word [edx + 0x15]
call fcn.00514800
lea edx, [ebp - 0x754]
lea eax, [ebp - 0x114]
call fcn.00402f00
mov eax, dword [esi + 0x8c4]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x14], eax
lea edx, [ebp - 0x62f]
mov eax, esi
call fcn.0051debc
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x51e634
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret