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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
push 0xffffffffffffffff
push 0x100aff6b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xe8
push ebx
push esi
mov ebx, ecx
lea ecx, [esp + 0x5c]
push edi
mov dword [esp + 0x58], ebx
call fcn.1008de30
mov dword [esp + 0xfc], 0
lea esi, [esp + 0x9c]
mov edi, 2
lea ebx, [ebx]
mov ecx, esi
call fcn.100954e0
add esi, 4
dec edi
jns 0x10013c30
mov eax, dword [ebx - 0x50]
push dword [0x100db8a4]
mov eax, dword [eax + 4]
mov esi, dword [eax + ebx - 0x48]
mov dword [esi], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push esi
push dword [0x100db8a4]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx + 0x10]
dec eax
mov dword [esp + 0x44], eax
mov eax, dword [ebx - 0x50]
mov ecx, dword [eax + 4]
mov eax, dword [ecx + ebx - 0x14]
mov edi, dword [ecx + ebx + 0x18]
mov esi, dword [ecx + ebx]
mov dword [esp + 0x50], edi
cmp byte [eax + 0x390], 0
mov eax, dword [ecx + ebx - 8]
mov dword [esp + 0x5c], eax
sete byte [esp + 0x3f]
mov dword [esp + 0xb4], eax
mov eax, dword [ecx + ebx - 4]
mov dword [esp + 0x6c], eax
lea eax, [esp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
lea eax, [esp + 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
fld dword [0x100b8f40]
mov eax, edi
fst dword [esp + 0xa8]
fld dword [0x100b8f54]
neg eax
cdq
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], edx
fstp dword [esp + 0xac]
fstp dword [esp + 0xb0]
cmp esi, 0x10
jne 0x10013fb8
lea eax, [edi*4]
mov dword [esp + 0x74], eax
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
cmp byte [eax + ebx + 0x14], 0
je 0x10014252
jmp 0x10013d30
lea eax, [esp + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ecx, dword [esp + 0x80]
sub ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
sbb eax, dword [esp + 0x8c]
push 0
push dword [esp + 0x60]
push eax
push ecx
call fcn.100a2ea0
push dword [esp + 0x94]
push dword [esp + 0x94]
push edx
push eax
call fcn.100a2df0
mov esi, eax
sub esi, dword [esp + 0x48]
mov dword [esp + 0x64], esi
sbb edx, dword [esp + 0x4c]
mov dword [esp + 0x68], edx
js 0x10013f88
jg 0x10013da0
cmp esi, edi
jb 0x10013f88
mov edi, edi
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
push dword [eax + ebx + 0x1c]
lea ecx, [eax - 0x44]
add ecx, ebx
call fcn.100033a0
mov dword [esp + 0x78], eax
test eax, eax
je 0x10013f88
mov esi, dword [eax + 0xc]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x60]
push 0xa
mov dword [esp + 0x74], esi
lea edx, [eax + eax]
mov edi, dword [ecx]
push edx
push esi
call dword [edi + 4]
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx + 0x10]
cmp dword [esp + 0x44], eax
jne 0x10013e05
mov eax, dword [ebx - 0x50]
mov cl, byte [esp + 0x3f]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx - 0x14]
cmp cl, byte [eax + 0x390]
je 0x10013eb4
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ebx + 0x10]
mov dword [esp + 0x44], ecx
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov edx, dword [eax + ebx - 0x14]
mov al, byte [edx + 0x390]
mov byte [esp + 0x3f], al
test al, al
je 0x10013e47
mov eax, dword [edx + 0x36c]
mov ecx, eax
mov ebx, dword [edx + eax*8 + 0x2e3]
add ebx, dword [edx + ecx*8 + 0x2df]
mov ecx, dword [esp + 0x44]
jmp 0x10013e49
xor ebx, ebx
mov eax, dword [esp + 0x6c]
xor edi, edi
shr eax, 1
mov esi, eax
test ebx, ebx
jne 0x10013e60
mov eax, dword [edi*4 + 0x100b6ec0]
jmp 0x10013e69
mov eax, ebx
sub eax, dword [edi*4 + 0x100b6ec0]
sub eax, ecx
mov dword [esp + 0x54], eax
cdq
xor eax, edx
sub eax, edx
cmp eax, esi
jge 0x10013ea1
fild dword [esp + 0x54]
mov ecx, dword [esp + edi*4 + 0x9c]
push 1
sub esp, 8
mov byte [esp + edi + 0x4c], 1
fidiv dword [esp + 0xc0]
mov eax, dword [ecx]
fstp qword [esp]
call dword [eax]
mov ecx, dword [esp + 0x44]
jmp 0x10013ea6
mov byte [esp + edi + 0x40], 0
inc edi
cmp edi, 3
jl 0x10013e53
mov esi, dword [esp + 0x70]
mov ebx, dword [esp + 0x58]
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx - 0x14]
cmp dword [eax + 0x36c], 0
jne 0x10013efa
mov ebx, dword [esp + 0x50]
xor edi, edi
lea ecx, [ecx]
cmp byte [esp + edi + 0x40], 0
je 0x10013ef0
mov ecx, dword [esp + edi*4 + 0x9c]
fld dword [esp + edi*4 + 0xa8]
push ecx
fstp dword [esp]
mov eax, dword [ecx]
push ebx
push esi
call dword [eax + 0x14]
inc edi
cmp edi, 3
jl 0x10013ed0
mov ebx, dword [esp + 0x58]
mov eax, dword [ebx - 0x50]
push 0
push dword [esp + 0x78]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ebx - 0x14]
add ecx, 0x378
call fcn.10013b50
mov eax, dword [ebx - 0x50]
add esp, 8
mov ecx, dword [eax + 4]
add ecx, 0xffffffb0
add ecx, ebx
push 0x10
push dword [esp + 0x7c]
mov eax, dword [ecx]
call dword [eax + 0x2c]
mov esi, dword [esp + 0x64]
mov edi, dword [esp + 0x50]
sub esi, edi
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x48]
sbb eax, 0
mov edx, dword [esp + 0x4c]
add ecx, edi
mov dword [esp + 0x64], esi
adc edx, 0
mov dword [esp + 0x68], eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
test eax, eax
jg 0x10013f7c
jl 0x10013f88
cmp esi, dword [esp + 0x5c]
jae 0x10013f7c
test eax, eax
jg 0x10013da0
jl 0x10013f88
cmp esi, edi
jae 0x10013da0
jmp 0x10013f88
add ecx, esi
mov dword [esp + 0x48], ecx
adc edx, eax
mov dword [esp + 0x4c], edx
mov eax, dword [ebx - 0x50]
push 0xa
mov eax, dword [eax + 4]
push dword [eax + ebx + 0x1c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x10014252
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
cmp byte [eax + ebx + 0x14], 0
jne 0x10013d30
jmp 0x10014252
lea eax, [edi + edi*2]
add eax, eax
mov dword [esp + 0x70], eax
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
cmp byte [eax + ebx + 0x14], 0
je 0x10014252
lea eax, [esp + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ecx, dword [esp + 0x80]
sub ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
sbb eax, dword [esp + 0x8c]
push 0
push dword [esp + 0x60]
push eax
push ecx
call fcn.100a2ea0
push dword [esp + 0x94]
push dword [esp + 0x94]
push edx
push eax
call fcn.100a2df0
mov esi, eax
sub esi, dword [esp + 0x48]
mov dword [esp + 0x68], esi
sbb edx, dword [esp + 0x4c]
mov dword [esp + 0x64], edx
js 0x1001422b
jg 0x10014040
cmp esi, edi
jb 0x1001422b
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
push dword [eax + ebx + 0x1c]
lea ecx, [eax - 0x44]
add ecx, ebx
call fcn.100033a0
mov dword [esp + 0x7c], eax
test eax, eax
je 0x1001422b
mov esi, dword [eax + 0xc]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x60]
push 0xf
mov dword [esp + 0x78], esi
lea edx, [eax + eax]
mov edi, dword [ecx]
push edx
push esi
call dword [edi]
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx + 0x10]
cmp dword [esp + 0x44], eax
jne 0x100140a4
mov eax, dword [ebx - 0x50]
mov cl, byte [esp + 0x3f]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx - 0x14]
cmp cl, byte [eax + 0x390]
je 0x10014153
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ebx + 0x10]
mov dword [esp + 0x44], ecx
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov edx, dword [eax + ebx - 0x14]
mov al, byte [edx + 0x390]
mov byte [esp + 0x3f], al
test al, al
je 0x100140e6
mov eax, dword [edx + 0x36c]
mov ecx, eax
mov ebx, dword [edx + eax*8 + 0x2e3]
add ebx, dword [edx + ecx*8 + 0x2df]
mov ecx, dword [esp + 0x44]
jmp 0x100140e8
xor ebx, ebx
mov eax, dword [esp + 0x6c]
xor edi, edi
shr eax, 1
mov esi, eax
test ebx, ebx
jne 0x100140ff
mov eax, dword [edi*4 + 0x100b6ec0]
jmp 0x10014108
mov eax, ebx
sub eax, dword [edi*4 + 0x100b6ec0]
sub eax, ecx
mov dword [esp + 0x54], eax
cdq
xor eax, edx
sub eax, edx
cmp eax, esi
jge 0x10014140
fild dword [esp + 0x54]
mov ecx, dword [esp + edi*4 + 0x9c]
push 1
sub esp, 8
mov byte [esp + edi + 0x4c], 1
fidiv dword [esp + 0xc0]
mov eax, dword [ecx]
fstp qword [esp]
call dword [eax]
mov ecx, dword [esp + 0x44]
jmp 0x10014145
mov byte [esp + edi + 0x40], 0
inc edi
cmp edi, 3
jl 0x100140f2
mov esi, dword [esp + 0x74]
mov ebx, dword [esp + 0x58]
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
mov eax, dword [eax + ebx - 0x14]
cmp dword [eax + 0x36c], 0
jne 0x1001419a
mov ebx, dword [esp + 0x50]
xor edi, edi
lea esp, [esp]
cmp byte [esp + edi + 0x40], 0
je 0x10014190
mov ecx, dword [esp + edi*4 + 0x9c]
fld dword [esp + edi*4 + 0xa8]
push ecx
fstp dword [esp]
mov eax, dword [ecx]
push ebx
push esi
call dword [eax + 0x18]
inc edi
cmp edi, 3
jl 0x10014170
mov ebx, dword [esp + 0x58]
mov eax, dword [ebx - 0x50]
push 0
push dword [esp + 0x74]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ebx - 0x14]
add ecx, 0x378
call fcn.10013b50
mov eax, dword [ebx - 0x50]
add esp, 8
mov ecx, dword [eax + 4]
add ecx, 0xffffffb0
add ecx, ebx
push 0x20
push dword [esp + 0x80]
mov eax, dword [ecx]
call dword [eax + 0x2c]
mov esi, dword [esp + 0x68]
mov edi, dword [esp + 0x50]
sub esi, edi
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x48]
sbb eax, 0
mov edx, dword [esp + 0x4c]
add ecx, edi
mov dword [esp + 0x68], esi
adc edx, 0
mov dword [esp + 0x64], eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
test eax, eax
jg 0x1001421f
jl 0x1001422b
cmp esi, dword [esp + 0x5c]
jae 0x1001421f
test eax, eax
jg 0x10014040
jl 0x1001422b
cmp esi, edi
jae 0x10014040
jmp 0x1001422b
add ecx, esi
mov dword [esp + 0x48], ecx
adc edx, eax
mov dword [esp + 0x4c], edx
mov eax, dword [ebx - 0x50]
push 0xa
mov eax, dword [eax + 4]
push dword [eax + ebx + 0x1c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x10014252
mov eax, dword [ebx - 0x50]
mov eax, dword [eax + 4]
cmp byte [eax + ebx + 0x14], 0
jne 0x10013fd2
mov eax, dword [esp + 0x60]
test eax, eax
je 0x10014263
push eax
call fcn.1009c777
add esp, 4
mov ecx, dword [esp + 0xf4]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret