Function at 0x40eaf0
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa8
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x10], edi
call fcn.0040aa60
fldz
mov esi, eax
fcomp dword [esi]
fnstsw ax
test ah, 0x44
jnp 0x40eb2f
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
fild qword [ebp - 0xc]
fdiv dword [esi]
call fcn.00497036
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], edx
jmp 0x40eb37
lea esi, [ebp - 0x2c]
call fcn.0040a8e0
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], edi
mov edi, dword [ebp + 8]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp + 0x10]
cmp byte [ecx], 0
jne 0x40eb62
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c
mov edx, dword [edi + 0x3c]
sub edx, dword [edi + 0x38]
lea ebx, [edi + 0x2c]
sar edx, 6
mov dword [ebp - 0x10], ebx
cmp edx, 0x7a120
jae 0x40eb4f
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x18], eax
mov eax, dword [0x4fa8f0]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [ebp - 0x14], esi
call fcn.0040f590
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp esi, eax
je 0x40ecf1
test esi, esi
je 0x40ecf1
cmp byte [esi], 0
je 0x40ecf1
call fcn.0040f590
mov edx, dword [eax]
push esi
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x40ebd2
call fcn.004194c0
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x34]
lea ebx, [edi + 0x74]
push ecx
call fcn.00420230
mov edx, dword [edi + 0x90]
mov eax, dword [edi + 0x7c]
lea esi, [ebp - 0xc]
lea edi, [ebp - 0x34]
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], eax
call fcn.0040f1c0
test al, al
je 0x40ec1f
mov ecx, dword [ebp - 0x14]
push ecx
push ecx
lea edx, [ebp - 0x18]
push edx
mov eax, ebx
call fcn.0040eff0
add esp, 4
mov ecx, eax
call fcn.0040ee50
jmp 0x40eceb
lea esi, [ebp - 0x4c]
call fcn.0040f1e0
push 0x4ee4c0
lea ecx, [ebp - 0xc]
call fcn.0040b790
lea esi, [ebp - 0x34]
call fcn.0040f190
add eax, 4
push eax
lea ecx, [ebp - 0x54]
call fcn.004059b0
lea eax, [ebp - 0xc]
push eax
lea ecx, [ebp - 0x54]
push ecx
lea eax, [ebp - 0x4c]
call fcn.00411fa0
add esp, 8
lea esi, [ebp - 0x54]
lea edi, [ebp - 0x4c]
call fcn.0040f230
mov edx, dword [eax]
mov ebx, dword [eax + 4]
lea esi, [ebp - 0x5c]
mov dword [ebp - 0xc], edx
call fcn.0040f210
mov esi, dword [eax]
mov ecx, dword [eax + 4]
lea eax, [ebp - 0x14]
call fcn.00410810
mov dword [ebp - 0xc], esi
lea esi, [ebp - 0x64]
mov dword [ebp - 8], eax
call fcn.0040f230
mov esi, eax
lea edi, [ebp - 0xc]
call fcn.0040f250
test al, al
jne 0x40ecc4
push 0x2c
lea esi, [ebp - 0x34]
call fcn.0040f190
add eax, 4
call fcn.0040ee80
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040f190
mov ecx, eax
add ecx, 4
call fcn.0040b180
mov eax, dword [ebp - 0x40]
xor esi, esi
cmp eax, esi
je 0x40ecd6
push eax
call fcn.00443256
add esp, 4
mov ecx, dword [ebp - 0x4c]
push ecx
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x38], esi
call fcn.00443256
add esp, 4
mov edi, dword [ebp + 8]
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebp + 0x1c]
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebx + 0x10]
sub esi, dword [ebx + 0xc]
push edx
mov edx, dword [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push 0
push 0
push ecx
mov ecx, dword [ebp - 0x28]
push edx
mov edx, dword [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x18]
push ecx
push edx
push eax
mov eax, dword [ebp + 0x20]
lea ecx, [ebp - 0xa4]
push ecx
sar esi, 6
call fcn.0040e2c0
call fcn.0040eee0
mov eax, dword [ebp - 0x74]
test eax, eax
je 0x40ed61
lea edi, [eax + 4]
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
sub eax, 1
jne 0x40ed5e
test edi, edi
je 0x40ed5e
lea ecx, [edi - 4]
test ecx, ecx
je 0x40ed5e
mov edx, dword [ecx]
mov eax, dword [edx + 8]
push 1
call eax
mov edi, dword [ebp + 8]
mov ecx, dword [ebx + 0x10]
sub ecx, dword [ebx + 0xc]
and ecx, 0xffffffc0
cmp ecx, 0x1e84800
jne 0x40ed8e
mov ebx, dword [edi + 0x24]
test ebx, ebx
je 0x40ed85
push 1
lea edx, [ebx + 4]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov eax, dword [edi + 0x28]
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], eax
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [ebp - 0x20]
test ebx, ebx
je 0x40edc7
push ebx
call dword [ebp - 0x1c]
add esp, 4
push 0xffffffffffffffff
add ebx, 4
push ebx
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
sub eax, 1
jne 0x40edc7
test ebx, ebx
je 0x40edc7
add ebx, 0xfffffffc
je 0x40edc7
mov edx, dword [ebx]
mov eax, dword [edx]
push 1
mov ecx, ebx
call eax
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c