Function at 0x1002f780
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1006945d
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push esi
push edi
mov eax, dword [0x1008600c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [ebp + 0x10]
mov dword [esi + 0x10], eax
sub eax, 1
je 0x1002f957
mov edx, dword [esi + 0xc]
mov ebx, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
add edx, ecx
mov dword [esi + 0xc], edx
mov eax, dword [ebx]
test eax, eax
jne 0x1002f7d1
test ecx, ecx
je 0x1002f7e8
cmp edx, dword [esi + 8]
jae 0x1002f7e8
xor ecx, ecx
mov edi, 0x10000
test eax, eax
cmovne edi, ecx
je 0x1002f966
mov ecx, dword [esi + 0x20]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
test ecx, ecx
je 0x1002f804
lock inc dword [ecx + 4]
mov ecx, dword [esi + 0x20]
mov eax, dword [esi + 0x1c]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebx]
mov dword [ebp - 0x28], ecx
mov ecx, dword [ebx + 4]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 4], 0
lea edi, [esi + 0x18]
mov ebx, dword [esi + 0x14]
push dword [0x10089594]
mov esi, dword [edi]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x1002f84f
nop word [eax + eax]
cmp dword [eax], esi
je 0x1002f93a
mov eax, dword [eax + 8]
test eax, eax
jne 0x1002f840
lea eax, [ebp - 0x2c]
push eax
push 0x38
mov dword [ebp - 0x18], eax
call fcn.10004cb0
add esp, 8
mov esi, eax
mov byte [ebp - 4], 2
mov ecx, ebx
mov dword [esi + 0x20], 0
mov dword [esi + 0x24], 0
mov dword [esi + 0x14], 0
mov dword [esi + 0x18], 0x10031110
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 eax, dword [ebp - 0x2c]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 0x28]
mov dword [esi + 0x24], eax
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
push esi
mov dword [esi + 0x28], eax
mov dword [esi + 0x2c], edx
mov eax, dword [ebp - 0x1c]
push edi
mov dword [esi + 0x30], eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
call fcn.100081a0
lea ecx, [ebp - 0x18]
call fcn.100310b0
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x1002f99e
or edi, 0xffffffff
mov eax, edi
lock xadd dword [esi + 4], eax
jne 0x1002f99e
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], edi
dec edi
jne 0x1002f99e
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [eax + 4], 0
je 0x1002f84f
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 1
push eax
push eax
call fcn.10031a20
add esp, 8
jmp 0x1002f8f6
mov eax, dword [ebp + 8]
xor ecx, ecx
mov edi, 0x10000
cmp dword [eax], ecx
cmovne edi, ecx
mov edx, dword [esi + 8]
mov ecx, dword [esi + 0xc]
cmp ecx, edx
mov eax, dword [esi + 4]
cmovae ecx, edx
add eax, ecx
sub edx, ecx
mov dword [ebp - 0x14], eax
cmp edx, edi
mov eax, dword [esi]
cmovae edx, edi
mov dword [ebp - 0x10], edx
lea ecx, [eax + 0x44]
push ecx
push esi
push 0
lea ecx, [ebp - 0x14]
push ecx
lea ecx, [eax + 4]
push ecx
mov ecx, dword [eax]
add ecx, 0x14
call fcn.10030740
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc