Function at 0x10031360
Capabilities:
Allocate thread local storage

Disassembly:
push 4
mov eax, 0x1000ffda
call fcn.1000f120
or ebx, 0xffffffff
xor edi, edi
push 2
pop esi
cmp dword [0x10041124], ebx
jne 0x1003138f
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x10041124], eax
cmp eax, ebx
je 0x100314b1
push 0x10
pop ecx
call fcn.10014d5b
mov dword [ebp - 0x10], eax
test eax, eax
je 0x100313ab
mov dword [eax], edi
mov dword [eax + 4], edi
mov dword [eax + 8], edi
mov dword [eax + 0xc], edi
jmp 0x100313ad
mov eax, edi
mov dword [0x10041d34], eax
test eax, eax
je 0x100314a1
push 0x10
pop ecx
call fcn.10014d5b
mov dword [ebp - 0x10], eax
test eax, eax
je 0x100313d6
mov dword [eax], edi
mov dword [eax + 4], edi
mov dword [eax + 8], edi
mov dword [eax + 0xc], edi
jmp 0x100313d8
mov eax, edi
mov dword [0x10041d30], eax
test eax, eax
je 0x100314a1
push 0x14
pop ecx
call fcn.10014d5b
mov dword [ebp - 0x10], eax
test eax, eax
je 0x1003140a
mov dword [eax], esi
lea ecx, [eax + 0xc]
mov edx, esi
mov dword [ecx - 8], edi
mov dword [ecx], edi
lea ecx, [ecx + 4]
sub edx, 1
jne 0x100313fb
jmp 0x1003140c
mov eax, edi
mov dword [0x10041d2c], eax
test eax, eax
je 0x100314a1
mov ecx, 0x84
call fcn.10014d5b
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], edi
test eax, eax
je 0x10031436
mov ecx, eax
call fcn.1003121f
jmp 0x10031438
mov eax, edi
mov dword [ebp - 4], ebx
mov dword [0x10041d28], eax
test eax, eax
je 0x100314a1
mov ecx, 0xa4
call fcn.10014d5b
mov esi, eax
mov dword [ebp - 0x10], esi
mov dword [ebp - 4], 1
test esi, esi
je 0x10031476
push 0xa4
push edi
push esi
call sub.msvcrt.dll_memset
add esp, 0xc
mov ecx, esi
call fcn.10031276
jmp 0x10031478
mov esi, edi
mov dword [ebp - 4], ebx
mov dword [0x10041d24], esi
test esi, esi
je 0x100314a1
push 0x80000000
push 0x10041614
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
je 0x100314a1
xor eax, eax
inc eax
jmp 0x10031590
mov eax, dword [0x10041124]
cmp eax, ebx
je 0x100314b1
push eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov esi, dword [0x10041d34]
test esi, esi
je 0x100314d1
mov ecx, esi
call fcn.10035cf0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [0x10041d30]
mov dword [0x10041d34], edi
test esi, esi
je 0x100314f7
mov ecx, esi
call fcn.10035cf0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [0x10041d2c]
mov dword [0x10041d30], edi
test eax, eax
je 0x10031515
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [0x10041d28]
mov dword [0x10041d2c], edi
test esi, esi
je 0x10031550
push 0x10031330
push 8
push 0xc
lea eax, [esi + 4]
mov dword [ebp - 4], 2
push eax
call fcn.1000e352
push esi
push edi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [0x10041d24]
mov dword [0x10041d28], edi
test esi, esi
je 0x10031588
push 0x10031330
push 8
push 0xc
lea eax, [esi + 4]
mov dword [ebp - 4], 3
push eax
call fcn.1000e352
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [0x10041d24], edi
xor eax, eax
call fcn.1000f0ee
ret