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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x63115c]
cmp eax, dword [ebp + 8]
jne 0x5aeb13
cmp dword [0x1276e1c], 0
jne 0x5aeb13
mov eax, 1
jmp 0x5aeee5
mov dword [0x1276e1c], 0
cmp dword [0x1276de8], 0
je 0x5aeb2e
or eax, 0xffffffff
jmp 0x5aeee5
cmp dword [0x63115c], 0xffffffff
je 0x5aeb3c
call fcn.005ae390
cmp dword [ebp + 8], 0xfffffffe
jne 0x5aeb53
mov ecx, dword [ebp + 8]
mov dword [0x63115c], ecx
or eax, 0xffffffff
jmp 0x5aeee5
cmp dword [ebp + 8], 0x2c
jb 0x5aeb61
or eax, 0xffffffff
jmp 0x5aeee5
cmp dword [ebp + 8], 0
jge 0x5aeb6f
or eax, 0xffffffff
jmp 0x5aeee5
cmp dword [0x631144], 0
jne 0x5aeb80
or eax, 0xffffffff
jmp 0x5aeee5
push 0x10000
push 0
mov edx, dword [ebp + 8]
imul edx, edx, 0x4c
add edx, 0x1267d48
push edx
call dword [sym.imp.WINMM.dll_mmioOpenA]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x5aebaa
xor eax, eax
jmp 0x5aeee5
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
call fcn.005ae170
add esp, 0xc
test eax, eax
jne 0x5aebc9
xor eax, eax
jmp 0x5aeee5
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp + 8]
imul ecx, ecx, 0x4c
movsx edx, byte [ecx + 0x1267d8c]
cmp edx, 2
jne 0x5aed95
mov dword [0x1276e30], 1
push 0x5f90c8
mov eax, dword [ebp + 8]
imul eax, eax, 0x4c
add eax, 0x1267d48
push eax
call fcn.005cd6b5
add esp, 8
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x5aec18
xor eax, eax
jmp 0x5aeee5
mov dword [ebp - 0x28], 8
mov ecx, dword [ebp - 0x28]
add ecx, 4
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x28]
add edx, 4
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
add eax, 0x10
mov dword [ebp - 0x28], eax
push 1
mov ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x24]
push edx
call fcn.005cdc9c
add esp, 0xc
mov eax, dword [ebp - 0x24]
push eax
call fcn.005ce115
add esp, 4
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.005ce115
add esp, 4
shl eax, 8
or eax, dword [ebp - 0x2c]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], 2
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x28]
lea ecx, [eax + edx + 0xc]
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x1c]
and edx, 1
je 0x5aec95
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
add ecx, 0x30
mov dword [ebp - 0x28], ecx
push 1
mov edx, dword [ebp - 0x28]
push edx
mov eax, dword [ebp - 0x24]
push eax
call fcn.005cdc9c
add esp, 0xc
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.005ce115
add esp, 4
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x24]
push edx
call fcn.005ce115
add esp, 4
shl eax, 8
or eax, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x24]
push eax
call fcn.005ce115
add esp, 4
shl eax, 0x10
or eax, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.005ce115
add esp, 4
shl eax, 0x18
or eax, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x30]
imul edx, dword [ebp - 0x2c]
mov dword [0x1276de4], edx
mov eax, dword [ebp - 0x24]
push eax
call fcn.005ce115
add esp, 4
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.005ce115
add esp, 4
shl eax, 8
or eax, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x24]
push edx
call fcn.005ce115
add esp, 4
shl eax, 0x10
or eax, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x24]
push eax
call fcn.005ce115
add esp, 4
shl eax, 0x18
or eax, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.005cd459
add esp, 4
mov edx, dword [ebp - 0x18]
push edx
push 0
mov eax, dword [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x14]
push ecx
call fcn.005aeef0
add esp, 0x10
test eax, eax
jne 0x5aed86
xor eax, eax
jmp 0x5aeee5
mov edx, dword [ebp - 0x30]
imul edx, dword [ebp - 0x2c]
mov dword [0x127626c], edx
jmp 0x5aede1
mov dword [0x1276e30], 0
push 0x1276b50
mov eax, dword [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x14]
push ecx
call fcn.005ae310
add esp, 0xc
test eax, eax
jne 0x5aedbf
xor eax, eax
jmp 0x5aeee5
mov edx, dword [0x1276b50]
push edx
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.005ae280
add esp, 0xc
test eax, eax
jne 0x5aede1
xor eax, eax
jmp 0x5aeee5
push 0
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.WINMM.dll_mmioClose]
mov eax, dword [ebp + 8]
movsx ecx, byte [eax + 0x1276e4c]
mov edx, dword [ecx*4 + 0x6311f4]
push edx
mov eax, dword [0x1276b50]
mov ecx, dword [eax]
mov edx, dword [0x1276b50]
push edx
mov eax, dword [ecx + 0x44]
call eax
mov ecx, dword [ebp + 8]
imul ecx, ecx, 0x4c
mov eax, dword [ecx + 0x1267d88]
imul eax, dword [0x631154]
cdq
mov ecx, 0xf
idiv ecx
mov edx, dword [eax*4 + 0x1276b58]
push edx
mov eax, dword [0x1276b50]
mov ecx, dword [eax]
mov edx, dword [0x1276b50]
push edx
mov eax, dword [ecx + 0x3c]
call eax
mov ecx, dword [ebp + 8]
imul ecx, ecx, 0x4c
movsx edx, byte [ecx + 0x1267d8c]
test edx, edx
je 0x5aee74
push 1
push 0
push 0
mov eax, dword [0x1276b50]
mov ecx, dword [eax]
mov edx, dword [0x1276b50]
push edx
mov eax, dword [ecx + 0x30]
call eax
jmp 0x5aee8d
push 0
push 0
push 0
mov ecx, dword [0x1276b50]
mov edx, dword [ecx]
mov eax, dword [0x1276b50]
push eax
mov ecx, dword [edx + 0x30]
call ecx
mov edx, dword [ebp + 8]
mov dword [0x63115c], edx
call dword [sym.imp.kernel32.dll_GetTickCount]
cmp eax, 0x35a4e900
jbe 0x5aeeb7
call dword [sym.imp.kernel32.dll_GetTickCount]
xor edx, edx
mov ecx, 0x35a4e900
div ecx
mov dword [ebp - 0x34], edx
jmp 0x5aeec0
call dword [sym.imp.kernel32.dll_GetTickCount]
mov dword [ebp - 0x34], eax
mov edx, dword [ebp - 0x34]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x38], 0
fild qword [ebp - 0x3c]
fstp qword [0x7d12b8]
mov dword [0x1276e18], 1
mov eax, 1
mov esp, ebp
pop ebp
ret