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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1003c6bb
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
mov eax, dword [0x1003e4a4]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
mov dword [ebp - 0x1c], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov edx, dword [ebx + 0x94]
mov ecx, dword [edx]
mov dword [ebp - 0x28], ecx
cmp eax, dword [esi + 4]
je 0x100394d3
cmp eax, dword [edi + 0xc]
je 0x100394d3
cmp byte [esi], 0
je 0x1003963e
push 0xb0
push 0xf00000
push dword [0x1003e800]
call dword [sym.imp.MSDART.DLL_MpHeapAlloc]
add esp, 0xc
mov dword [ebp - 0x28], eax
mov dword [ebp - 4], 2
test eax, eax
je 0x100394cc
push ebx
mov ecx, eax
call fcn.100396d0
test eax, eax
je 0x100394cc
mov ecx, dword [ebx + 0x80]
cmp byte [ecx + 0x1000bd80], 0
je 0x100394bb
mov dword [eax + 0xa8], 3
push eax
push 0
push 0x2001
push dword [edi + 0x10]
call dword [sym.imp.USER32.dll_PostMessageW]
xor eax, eax
jmp 0x1003967c
mov eax, dword [0x1003e830]
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
je 0x10039602
push 0x20
mov dword [ebp - 4], 0
push 0xf00000
push dword [0x1003e800]
mov byte [ebp - 0x15], 0
call dword [sym.imp.MSDART.DLL_MpHeapAlloc]
add esp, 0xc
mov dword [ebp - 0x24], eax
test eax, eax
je 0x10039548
mov esi, edi
mov byte [ebp - 0x15], 1
mov edi, eax
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp - 0x20]
xor eax, eax
mov esi, dword [ebp + 8]
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], eax
mov dword [edi + 0x14], eax
mov dword [edi + 0x18], eax
mov dword [edi + 0x1c], eax
mov byte [edi + 0x12], 1
cmp byte [esi], 0
je 0x10039586
mov ecx, dword [esi + 8]
lea eax, [ebx + 0x84]
push 0
push 0
push 0
mov esi, dword [ecx]
push eax
push 1
push 0x800
mov esi, dword [esi + 0x18]
push 0x10004f30
push dword [ebx + 0x80]
push ecx
mov ecx, esi
call dword [0x1003f1c0]
call esi
mov esi, eax
mov dword [ebp - 0x1c], esi
jmp 0x100395a2
mov eax, dword [ebp - 0x1c]
push ebx
push esi
mov eax, dword [eax]
mov esi, dword [eax + 0x2c]
mov ecx, esi
call dword [0x1003f1c0]
mov ecx, dword [ebp - 0x1c]
call esi
mov esi, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 4], 0xffffffff
test eax, eax
je 0x10039653
push dword [ebp - 0x20]
mov esi, eax
mov ecx, 8
mov eax, dword [0x1003e830]
rep movsd dword es:[edi], dword [esi]
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [ebp - 0x24]
push dword [0x1003e800]
call dword [sym.imp.MSDART.DLL_MpHeapFree]
mov esi, dword [ebp - 0x1c]
add esp, 8
jmp 0x10039653
cmp byte [esi], 0
je 0x1003963b
mov ecx, dword [esi + 8]
lea eax, [ebx + 0x84]
push 0
push 0
push 0
mov esi, dword [ecx]
push eax
push 1
push 0x800
mov esi, dword [esi + 0x18]
push 0x10004f30
push dword [ebx + 0x80]
push ecx
mov ecx, esi
call dword [0x1003f1c0]
call esi
jmp 0x10039651
mov edi, dword [ebp - 0x1c]
mov eax, dword [edi]
push ebx
push esi
mov esi, dword [eax + 0x2c]
mov ecx, esi
call dword [0x1003f1c0]
mov ecx, edi
call esi
mov esi, eax
mov eax, dword [ebx + 0x80]
cmp byte [eax + 0x1000bd80], 0
je 0x1003967a
cmp dword [ebp - 0x28], 3
je 0x1003967a
mov eax, dword [ebx + 0x94]
cmp dword [eax], 4
jne 0x1003967a
mov ecx, ebx
call fcn.100373e0
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.1003ad10
mov esp, ebp
pop ebp
ret 8