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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101627ad
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x101cd100]
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 - 0x50], 0xffffffff
mov dword [ebp - 0x48], 0xffffffff
movups xmmword [ebp - 0x20], xmm0
cmp ecx, 0xffffffff
je 0x1008535a
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 [0x101cc3a4]
setne al
mov dword [ebp - 0x40], eax
cmp ecx, 0xffffffff
jne 0x10085381
mov dword [ebp - 0x3c], eax
jmp 0x100853d7
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x3c], esi
test eax, eax
je 0x100853d7
mov eax, dword [0x101cc3a4]
cmp eax, 0xffffffff
jne 0x100853a0
xor ecx, ecx
jmp 0x100853ae
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, eax
mov eax, dword [0x101cc3a4]
cmp byte [ecx + 0x38], 0
mov dword [ebp - 0x3c], esi
je 0x100853d7
mov dword [ebp - 0x50], esi
cmp eax, 0xffffffff
jne 0x100853c3
xor eax, eax
jmp 0x100853ca
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [eax + 0x34]
lea edx, [esi + 1]
mov dword [ebp + esi*4 - 0x20], eax
mov dword [ebp - 0x3c], edx
xor esi, esi
mov dword [ebp - 0x54], esi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 4], esi
cmp dword [edi], 0xffffffff
jne 0x100853f4
cmp dword [edi + 4], 0x7fffffff
je 0x10085517
lea eax, [ebp - 0x30]
push eax
call fcn.10084340
mov ecx, dword [edi]
add esp, 4
mov edx, dword [edi + 4]
sub ecx, dword [eax]
sbb edx, dword [eax + 4]
js 0x1008541d
jg 0x10085412
test ecx, ecx
jb 0x1008541d
add ecx, 0xf423f
adc edx, 0
jmp 0x10085426
sub ecx, 0xf423f
sbb edx, 0
push 0
push 0xf4240
push edx
push ecx
call fcn.10132aa0
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 0x10085517
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x40], 0x20
test eax, eax
jl 0x1008548e
jg 0x1008546a
cmp edi, 0x294
jb 0x1008548e
push 0
push 0x14
push eax
push edi
call fcn.10132aa0
mov ecx, eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x40], ecx
cmp ecx, 0x3e8
jbe 0x1008548e
mov dword [ebp - 0x40], 0x3e8
jmp 0x100854a6
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
test eax, eax
jl 0x100854ba
jg 0x100854a6
test edi, edi
je 0x100854ba
push 0xffffffffffffffff
push 0xffffd8f0
push eax
push edi
call fcn.10132b50
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], edx
mov edi, dword [0x101d7e88]
test edi, edi
jne 0x100854eb
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 edi, 0x100849a0
cmovne edi, eax
mov dword [0x101d7e88], edi
push dword [ebp - 0x40]
lea eax, [ebp - 0x28]
mov ecx, edi
push 0
push 0
push 0
push 0
push eax
push esi
call dword [0x101653ec]
call edi
test eax, eax
je 0x10085517
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x48], eax
mov dword [ebp + eax*4 - 0x20], esi
inc eax
mov dword [ebp - 0x3c], eax
or edi, 0xffffffff
xor edx, edx
mov dword [ebp - 0x24], edx
cmp dword [ebp - 0x48], edi
jne 0x10085580
mov edx, dword [ebp + 0xc]
cmp dword [edx], edi
jne 0x10085534
cmp dword [edx + 4], 0x7fffffff
je 0x10085580
lea eax, [ebp - 0x38]
push eax
call fcn.10084340
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 - 0x2c], ecx
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x30], edx
call fcn.10085110
mov edi, eax
mov eax, edx
mov dword [ebp - 0x24], eax
test eax, eax
jg 0x10085580
jl 0x1008556c
test edi, edi
jae 0x10085580
xorps xmm0, xmm0
movlpd qword [ebp - 0x30], xmm0
mov edx, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x30]
mov dword [ebp - 0x24], edx
nop dword [eax]
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x100855bf
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 - 0x3c]
jae 0x100855cd
cmp eax, dword [ebp - 0x58]
je 0x1008570f
cmp eax, dword [ebp - 0x50]
je 0x1008572a
cmp eax, dword [ebp - 0x48]
jne 0x100855cd
mov dword [ebp - 4], 2
jmp 0x100856e2
test edi, edi
jne 0x100855c6
push edi
jmp 0x100855c7
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x48], 0xffffffff
jne 0x100856b9
mov edx, dword [ebp + 0xc]
cmp dword [edx], 0xffffffff
jne 0x100855ec
cmp dword [edx + 4], 0x7fffffff
je 0x100856b9
lea eax, [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
test eax, eax
jne 0x10085604
xorps xmm0, xmm0
movlpd qword [ebp - 0x44], xmm0
jmp 0x1008567e
cmp dword [ebp - 0x34], 0
jg 0x1008561c
jl 0x100855fa
cmp dword [ebp - 0x38], 0
ja 0x1008561c
xorps xmm0, xmm0
movlpd qword [ebp - 0x44], xmm0
jmp 0x1008567e
lea eax, [ebp - 0x30]
xor edi, edi
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
test eax, eax
jne 0x10085644
nop dword [eax]
inc edi
cmp edi, 3
ja 0x100855fa
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
test eax, eax
je 0x10085630
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x30]
call fcn.10133020
mulsd xmm0, qword [0x10170a28]
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
movsd qword [ebp - 0x28], xmm0
call fcn.10133020
movsd xmm1, qword [ebp - 0x28]
divsd xmm1, xmm0
movaps xmm0, xmm1
call fcn.10132f20
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], edx
mov edi, dword [ebp + 0xc]
mov eax, dword [edi]
sub eax, dword [ebp - 0x44]
mov ecx, dword [edi + 4]
sbb ecx, dword [ebp - 0x40]
js 0x1008569e
jg 0x10085694
test eax, eax
jb 0x1008569e
add eax, 0xf423f
adc ecx, 0
jmp 0x100856a6
sub eax, 0xf423f
sbb ecx, 0
push 0
push 0xf4240
push ecx
push eax
call fcn.10132aa0
mov dword [ebp - 0x24], edx
mov edi, eax
mov eax, dword [ebp - 0x24]
cmp edi, 0xffffffff
jne 0x100856c9
test eax, eax
je 0x10085580
test eax, eax
jl 0x100856db
jg 0x10085580
test edi, edi
jne 0x10085580
mov dword [ebp - 4], 3
test esi, esi
je 0x100856f2
cmp esi, 0xffffffff
je 0x100856f2
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.10132a90
mov esp, ebp
pop ebp
ret
mov dword [ebp - 4], 1
test esi, esi
je 0x10085726
cmp esi, 0xffffffff
je 0x10085726
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x100856f4
call fcn.10085160
lea ecx, [eax + 0x34]
call fcn.100731b0
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0x101a4dd8
lea eax, [ebp - 0x49]
push eax
call fcn.10134106
int3