Function at 0x10004840
Capabilities:
Allocate thread local storage
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1005d34d
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push esi
push edi
mov eax, dword [0x1007b00c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x10], esi
lea edi, [esi + 4]
mov dword [esi], vtable.qmbase::MessageLoop.0
mov dword [ebp - 0x14], edi
push 8
mov dword [edi], 0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x10], 0
call fcn.1005b6ec
xor ecx, ecx
mov dword [edi], eax
xor edx, edx
mov dword [ebp - 0x1c], ecx
add esp, 4
mov dword [ebp - 0x18], edx
test eax, eax
je 0x100048b9
mov dword [eax], ecx
mov dword [eax + 4], edx
mov eax, dword [edi]
mov dword [eax], edi
mov dword [ebp - 4], 0
lea edi, [esi + 0x18]
mov dword [ebp - 0x14], edi
push 8
mov dword [edi], 0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x10], 0
call fcn.1005b6ec
xor ecx, ecx
mov dword [edi], eax
xor edx, edx
mov dword [ebp - 0x24], ecx
add esp, 4
mov dword [ebp - 0x20], edx
test eax, eax
je 0x1000490b
mov dword [eax], ecx
mov dword [eax + 4], edx
mov eax, dword [edi]
mov dword [eax], edi
lea eax, [esi + 0x2c]
push 0x7d0
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
mov dword [esi + 0x44], 0
mov dword [esi + 0x48], 0
mov dword [esi + 0x4c], 0
mov dword [esi + 0x54], 0
mov dword [esi + 0x58], 0
mov dword [esi + 0x60], 0
mov dword [esi + 0x64], 0
mov dword [esi + 0x68], 0
mov dword [esi + 0x6c], 0
mov byte [ebp - 4], 4
lea edi, [esi + 0x70]
mov dword [ebp - 0x14], edi
push 8
mov dword [edi], 0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x10], 0
call fcn.1005b6ec
xor ecx, ecx
mov dword [edi], eax
xor edx, edx
mov dword [ebp - 0x2c], ecx
add esp, 4
mov dword [ebp - 0x28], edx
test eax, eax
je 0x100049a8
mov dword [eax], ecx
mov dword [eax + 4], edx
mov eax, dword [edi]
mov dword [eax], edi
mov byte [ebp - 4], 5
mov edi, dword [0x1007de18]
mov dword [esi + 0x84], 0
test edi, edi
jne 0x100049ef
push 8
call fcn.1005b6ec
mov edi, eax
add esp, 4
mov dword [ebp - 0x14], edi
mov dword [edi], 0
mov dword [edi + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [edi + 4], eax
mov dword [0x1007de18], edi
lock inc dword [edi]
mov edi, dword [0x1007de18]
test edi, edi
jne 0x10004a27
push 8
call fcn.1005b6ec
mov edi, eax
add esp, 4
mov dword [ebp - 0x14], edi
mov dword [edi], 0
mov dword [edi + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [edi + 4], eax
mov dword [0x1007de18], edi
mov eax, dword [edi + 4]
cmp eax, 0xffffffff
je 0x10004a37
push esi
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push 0x24
call fcn.1005b6ec
add esp, 4
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 6
xorps xmm0, xmm0
movups xmmword [eax], xmm0
mov ecx, eax
movups xmmword [eax + 0x10], xmm0
mov dword [eax + 0x20], 0
call fcn.10006dd0
mov edi, eax
mov byte [ebp - 4], 5
test edi, edi
je 0x10004a6e
lock inc dword [edi + 4]
mov edx, dword [esi + 0x6c]
test edx, edx
je 0x10004a90
lea ecx, [edx + 4]
or eax, 0xffffffff
lock xadd dword [ecx], eax
jne 0x10004a90
lea eax, [edx + 4]
xor ecx, ecx
test eax, eax
cmovne ecx, edx
mov eax, dword [ecx]
call dword [eax + 0x18]
mov dword [esi + 0x6c], edi
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret