Function at 0x40d710
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a2629
mov eax, dword fs:[0]
push eax
sub esp, 0xe8
mov eax, dword [0x4c8104]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x4c], esi
mov eax, dword [ebp + 8]
mov edi, esi
push dword [0x50b8e0]
mov dword [ebp - 0x48], eax
neg edi
lea eax, [esi - 8]
sbb edi, edi
and edi, eax
mov dword [ebp - 0x64], edi
mov eax, dword [edi + 0x190]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x54], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x40d784
mov ecx, dword [ebp - 0x54]
cmp dword [eax], ecx
je 0x40d971
mov eax, dword [eax + 8]
test eax, eax
jne 0x40d775
lea eax, [ebp - 0x50]
mov ecx, edi
push eax
call fcn.0040d230
mov dword [ebp - 4], 1
mov ecx, dword [eax]
mov dword [ebp - 0x88], ecx
mov ecx, dword [eax + 4]
mov dword [ebp - 0x84], ecx
mov ecx, dword [ebp - 0x48]
mov dword [eax], 0
mov dword [eax + 4], 0
mov dword [ebp - 0x90], esi
movups xmm0, xmmword [ecx + 4]
mov eax, dword [ecx]
mov dword [ebp - 0x8c], edi
movups xmmword [ebp - 0x7c], xmm0
mov dword [ebp - 0x80], eax
movq xmm0, qword [ecx + 0x14]
mov dword [ecx + 0x14], 0
mov dword [ecx + 0x18], 0xf
movq qword [ebp - 0x6c], xmm0
mov byte [ecx + 4], 0
lea esi, [edi + 0x158]
neg esi
lea ecx, [ebp - 0xf0]
sbb esi, esi
and esi, edi
lea eax, [esi + 0x608]
mov dword [ebp - 0xf4], eax
lea eax, [ebp - 0x90]
push eax
call fcn.004175f0
mov eax, dword [esi + 0x190]
lea ecx, [ebp - 0xbc]
mov byte [ebp - 0xc3], 1
mov edi, dword [eax + 0xc]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0xf4]
mov dword [ebp - 0xc0], eax
lea eax, [ebp - 0xf0]
push eax
mov dword [ebp - 0x58], edi
call fcn.004175f0
push 0x34
lea eax, [ebp - 0x44]
push 0
push eax
call sub.msvcrt.dll_memset
mov al, byte [ebp - 0xc3]
lea ecx, [ebp - 0x3c]
mov byte [ebp - 0x43], al
add esp, 0xc
mov eax, dword [ebp - 0xc0]
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0xbc]
mov byte [ebp - 0xc3], 0
push eax
call fcn.004175f0
lea eax, [ebp - 0x44]
mov byte [ebp - 4], 5
push eax
push 0x54
call fcn.0042ae70
mov esi, eax
add esp, 8
mov dword [esi + 0x14], 0
mov dword [esi + 0x18], 0x41fab0
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0
mov dword [esi + 0x10], 0
mov dword [esi + 0x1c], 0
mov cl, byte [ebp - 0x43]
mov byte [esi + 0x21], cl
lea ecx, [esi + 0x28]
mov eax, dword [ebp - 0x40]
mov byte [ebp - 0x43], 0
mov dword [esi + 0x24], eax
lea eax, [ebp - 0x3c]
push eax
call fcn.004175f0
push ecx
push esi
lea eax, [ebp - 0x54]
mov ecx, edi
push eax
call fcn.0042acf0
lea ecx, [ebp - 0x3c]
call fcn.0040fb10
lea ecx, [ebp - 0xbc]
call fcn.0040fb10
lea ecx, [ebp - 0xf0]
call fcn.0040fb10
lea ecx, [ebp - 0x90]
call fcn.0040fb10
mov dword [ebp - 4], 6
mov esi, dword [ebp - 0x4c]
test esi, esi
je 0x40d951
or edi, 0xffffffff
mov eax, edi
lock xadd dword [esi + 4], eax
jne 0x40d951
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], edi
dec edi
jne 0x40d951
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov eax, dword [ebp - 0x64]
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.0049f3c4
mov esp, ebp
pop ebp
ret 4
cmp dword [eax + 4], 0
je 0x40d784
push dword [ebp - 0x48]
mov ecx, dword [ebp - 0x4c]
mov esi, dword [esi + 0x10]
call fcn.0040d9f0
test esi, esi
jne 0x40d9d8
mov eax, dword [ebp - 0x4c]
mov edx, dword [eax + 0xc]
mov eax, dword [eax]
test eax, eax
je 0x40d99b
mov eax, dword [eax]
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, edx
mov esi, dword [eax + ecx*4]
lea eax, [ebp - 0x5c]
push eax
mov ecx, edi
mov dword [ebp - 0x60], edi
call fcn.0040d230
mov byte [ebp - 0x54], 1
mov dword [ebp - 4], 0
mov ecx, dword [esi + 0x24]
test ecx, ecx
je 0x40d9df
mov edx, dword [ecx]
lea eax, [ebp - 0x60]
push eax
call dword [edx + 8]
lea ecx, [ebp - 0x60]
call fcn.0040d1b0
mov eax, edi
jmp 0x40d954
call fcn.004757c0
int3