Function at 0x100646e0
Capabilities:
Check for time delay via queryperformancecounter
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1008d02d
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x100a9040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 8]
xorps xmm0, xmm0
mov dword [ebp - 0x48], 0xffffffff
mov dword [ebp - 0x40], 0xffffffff
movups xmmword [ebp - 0x20], xmm0
cmp ecx, 0xffffffff
je 0x1006472a
mov dword [ebp - 0x20], ecx
xor eax, eax
cmp ecx, 0xffffffff
setne al
dec eax
mov dword [ebp - 0x58], eax
xor eax, eax
cmp ecx, 0xffffffff
mov ecx, dword [0x100a900c]
setne al
mov dword [ebp - 0x30], eax
cmp ecx, 0xffffffff
jne 0x10064751
mov dword [ebp - 0x2c], eax
jmp 0x100647a1
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
push ecx
call edi
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0x2c], esi
test eax, eax
je 0x100647a1
mov eax, dword [0x100a900c]
cmp eax, 0xffffffff
jne 0x10064772
xor ecx, ecx
jmp 0x1006477c
push eax
call edi
mov ecx, eax
mov eax, dword [0x100a900c]
cmp byte [ecx + 0x38], 0
mov dword [ebp - 0x2c], esi
je 0x100647a1
mov dword [ebp - 0x48], esi
cmp eax, 0xffffffff
jne 0x10064791
xor eax, eax
jmp 0x10064794
push eax
call edi
mov eax, dword [eax + 0x34]
lea edx, [esi + 1]
mov dword [ebp + esi*4 - 0x20], eax
mov dword [ebp - 0x2c], edx
xor esi, esi
mov dword [ebp - 0x54], esi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 4], esi
cmp dword [edi], 0xffffffff
jne 0x100647be
cmp dword [edi + 4], 0x7fffffff
je 0x100648d9
lea eax, [ebp - 0x3c]
push eax
call fcn.10013250
mov ecx, dword [edi]
add esp, 4
mov edx, dword [edi + 4]
sub ecx, dword [eax]
sbb edx, dword [eax + 4]
js 0x100647e7
jg 0x100647dc
test ecx, ecx
jb 0x100647e7
add ecx, 0xf423f
adc edx, 0
jmp 0x100647f0
sub ecx, 0xf423f
sbb edx, 0
push 0
push 0xf4240
push edx
push ecx
call fcn.10068d40
push 0
push 0
push 0
mov dword [ebp - 0x24], edx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CreateWaitableTimerA]
mov esi, eax
mov dword [ebp - 0x54], esi
test esi, esi
je 0x100648d9
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x30], 0x20
test eax, eax
jl 0x10064858
jg 0x10064834
cmp edi, 0x294
jb 0x10064858
push 0
push 0x14
push eax
push edi
call fcn.10068d40
mov ecx, eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x30], ecx
cmp ecx, 0x3e8
jbe 0x10064858
mov dword [ebp - 0x30], 0x3e8
jmp 0x10064870
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
test eax, eax
jl 0x10064884
jg 0x10064870
test edi, edi
je 0x10064884
push 0xffffffffffffffff
push 0xffffd8f0
push eax
push edi
call fcn.10068c90
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], edx
mov ecx, dword [0x100acfd0]
test ecx, ecx
jne 0x100648b5
push str.SetWaitableTimerEx
push str.KERNEL32.DLL
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov ecx, 0x10064040
cmovne ecx, eax
mov dword [0x100acfd0], ecx
push dword [ebp - 0x30]
lea eax, [ebp - 0x28]
push 0
push 0
push 0
push 0
push eax
push esi
call ecx
test eax, eax
je 0x100648d9
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x40], eax
mov dword [ebp + eax*4 - 0x20], esi
inc eax
mov dword [ebp - 0x2c], eax
or edi, 0xffffffff
xor edx, edx
mov dword [ebp - 0x24], edx
cmp dword [ebp - 0x40], edi
jne 0x1006493f
mov edx, dword [ebp + 0xc]
cmp dword [edx], edi
jne 0x100648f6
cmp dword [edx + 4], 0x7fffffff
je 0x1006493f
lea eax, [ebp - 0x3c]
push eax
call fcn.10013250
mov edi, dword [ebp + 0xc]
add esp, 4
mov edx, dword [edi]
sub edx, dword [eax]
mov ecx, dword [edi + 4]
sbb ecx, dword [eax + 4]
mov dword [ebp - 0x38], ecx
lea ecx, [ebp - 0x3c]
mov dword [ebp - 0x3c], edx
call fcn.10064680
mov edi, eax
mov eax, edx
mov dword [ebp - 0x24], eax
test eax, eax
jg 0x1006493f
jl 0x1006492e
test edi, edi
jae 0x1006493f
xorps xmm0, xmm0
movlpd qword [ebp - 0x3c], xmm0
mov edx, dword [ebp - 0x38]
mov edi, dword [ebp - 0x3c]
mov dword [ebp - 0x24], edx
mov ecx, dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x10064984
push 0
push edi
push 0
lea ecx, [ebp - 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
cmp eax, dword [ebp - 0x2c]
jae 0x1006498e
cmp eax, dword [ebp - 0x58]
je 0x10064ad5
cmp eax, dword [ebp - 0x48]
je 0x10064af0
cmp eax, dword [ebp - 0x40]
jne 0x1006498e
mov dword [ebp - 4], 2
jmp 0x10064aa8
test edi, edi
jne 0x1006498b
push edi
jmp 0x1006498c
push edi
call ecx
cmp dword [ebp - 0x40], 0xffffffff
jne 0x10064a79
mov edx, dword [ebp + 0xc]
cmp dword [edx], 0xffffffff
jne 0x100649ad
cmp dword [edx + 4], 0x7fffffff
je 0x10064a79
lea eax, [ebp - 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
test eax, eax
jne 0x100649c5
xorps xmm0, xmm0
movlpd qword [ebp - 0x34], xmm0
jmp 0x10064a3e
cmp dword [ebp - 0x4c], 0
jg 0x100649dd
jl 0x100649bb
cmp dword [ebp - 0x50], 0
ja 0x100649dd
xorps xmm0, xmm0
movlpd qword [ebp - 0x34], xmm0
jmp 0x10064a3e
lea eax, [ebp - 0x3c]
xor edi, edi
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
test eax, eax
jne 0x10064a04
nop dword [eax]
inc edi
cmp edi, 3
ja 0x100649bb
lea eax, [ebp - 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
test eax, eax
je 0x100649f0
mov edx, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x3c]
call fcn.10068ef0
mulsd xmm0, qword [0x100a0740]
mov edx, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x50]
movsd qword [ebp - 0x28], xmm0
call fcn.10068ef0
movsd xmm1, qword [ebp - 0x28]
divsd xmm1, xmm0
movaps xmm0, xmm1
call fcn.10068df0
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edx
mov edi, dword [ebp + 0xc]
mov eax, dword [edi]
sub eax, dword [ebp - 0x34]
mov ecx, dword [edi + 4]
sbb ecx, dword [ebp - 0x30]
js 0x10064a5e
jg 0x10064a54
test eax, eax
jb 0x10064a5e
add eax, 0xf423f
adc ecx, 0
jmp 0x10064a66
sub eax, 0xf423f
sbb ecx, 0
push 0
push 0xf4240
push ecx
push eax
call fcn.10068d40
mov dword [ebp - 0x24], edx
mov edi, eax
mov eax, dword [ebp - 0x24]
cmp edi, 0xffffffff
jne 0x10064a8f
mov ecx, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, eax
je 0x10064945
test eax, eax
jl 0x10064aa1
jg 0x1006493f
test edi, edi
jne 0x1006493f
mov dword [ebp - 4], 3
test esi, esi
je 0x10064ab8
cmp esi, 0xffffffff
je 0x10064ab8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10067e95
mov esp, ebp
pop ebp
ret
mov dword [ebp - 4], 1
test esi, esi
je 0x10064aec
cmp esi, 0xffffffff
je 0x10064aec
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x10064aba
call fcn.100646c0
lea ecx, [eax + 0x34]
call fcn.10064030
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0x100a696c
lea eax, [ebp - 0x41]
push eax
call fcn.1006a16a
int3