Function at 0x47b8e0
Capabilities:
Allocate thread local storage
Set environment variable
Set thread local storage value

Disassembly:
push 0xffffffffffffffff
push 0x58fdcf
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x10], esi
lea ebx, [esi + 8]
mov ecx, ebx
call sub.MFC42.DLL_CDWordArray::CDWordArray
lea edi, [esi + 0x28]
xor ebp, ebp
mov ecx, edi
mov dword [esp + 0x20], ebp
mov dword [esp + 0x14], edi
call fcn.004709a0
push closesocket
mov ecx, edi
mov byte [esp + 0x24], 1
call fcn.00472230
push 0x6227c8
mov ecx, edi
call fcn.00470d20
mov dword [esi + 0x30b0], 0x5a0788
mov dword [esi + 0x30b4], ebp
mov dword [esi + 0x30c0], ebp
mov dword [esi + 0x30bc], ebp
mov dword [esi + 0x30b8], ebp
push 0xa
lea ecx, [esi + 0x30c4]
mov byte [esp + 0x24], 3
call sub.MFC42.DLL_CMapStringToPtr::CMapStringToPtr
mov dword [esi + 0x30e0], 0x5b5098
mov dword [esi + 0x30ec], ebp
mov dword [esi + 0x30f0], ebp
mov dword [esi + 0x30e8], ebp
mov dword [esi + 0x30e4], ebp
mov dword [esi + 0x30f4], ebp
mov dword [esi + 0x30f8], 0xa
lea edi, [esi + 0x3100]
mov byte [esp + 0x20], 5
mov dword [esp + 0x14], edi
lea ecx, [edi + 0x20]
call sub.MFC42.DLL_CString::CString_3
mov eax, ebp
mov dword [edi + 4], ebp
mov dword [edi], ebp
mov dword [edi + 0x1c], ebp
mov dword [edi + 0x2c], ebp
mov dword [edi + 0x18], ebp
or al, 0xf0
mov dword [edi + 0x28], ebp
push 0x633dc4
lea ecx, [edi + 0x20]
mov byte [esp + 0x24], 6
mov dword [edi + 0x28], eax
call sub.MFC42.DLL_CString::operator
mov dword [edi + 0x24], ebp
mov dword [esi + 0x3140], 0x5b5084
mov dword [esi + 0x3144], ebp
mov dword [esi + 0x3148], 0x11
mov dword [esi + 0x314c], ebp
mov dword [esi + 0x3150], ebp
mov dword [esi + 0x3154], ebp
mov dword [esi + 0x3158], 0xa
lea edi, [esi + 0x315c]
mov byte [esp + 0x20], 8
mov ecx, edi
mov dword [esp + 0x14], edi
call fcn.004631b0
mov byte [esp + 0x20], 9
lea ecx, [edi + 0xc4]
call sub.MFC42.DLL_CString::CString_3
lea ecx, [edi + 0xc8]
mov byte [esp + 0x20], 0xa
call sub.MFC42.DLL_CString::CString_3
lea ecx, [edi + 0xcc]
mov byte [esp + 0x20], 0xb
call fcn.0040141a
lea ecx, [edi + 0xe4]
mov byte [esp + 0x20], 0xc
call sub.MFC42.DLL_CStringArray::CStringArray
lea ecx, [edi + 0xf8]
mov byte [esp + 0x20], 0xd
call fcn.00401f5f
lea ecx, [edi + 0x14c]
mov byte [esp + 0x20], 0xe
call sub.MFC42.DLL_CStringArray::CStringArray
lea ecx, [edi + 0x160]
mov byte [esp + 0x20], 0xf
call sub.MFC42.DLL_CStringArray::CStringArray
lea ecx, [edi + 0x174]
mov byte [esp + 0x20], 0x10
call fcn.00401d48
mov dword [edi], 0x59efdc
mov dword [edi + 0xc0], ebp
mov dword [edi + 0x14], 1
mov ecx, 0x10
xor eax, eax
add edi, 0x10c
rep stosd dword es:[edi], eax
lea eax, [esi + 0x32ec]
mov byte [esp + 0x20], 0x11
push eax
mov dword [esi], 0x5b5080
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0xffffffffffffffff
push 0x2000
mov ecx, ebx
call sub.MFC42.DLL_CDWordArray::SetSize
mov dword [esi + 0x1c], ebp
mov dword [esi + 0x24], ebp
mov eax, dword [esi + 0x3144]
cmp eax, ebp
je 0x47bb1a
push eax
call sub.MFC42.DLL_operatordelete
add esp, 4
mov dword [esi + 0x3144], ebp
push 0x1000
call sub.MFC42.DLL_operatornew
mov edi, eax
mov ecx, 0x400
xor eax, eax
mov dword [esi + 0x3144], edi
rep stosd dword es:[edi], eax
add esp, 4
mov dword [esi + 0x3148], 0x400
mov dword [esi + 0x3304], ebp
mov dword [esi + 0x313c], ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [esp + 0x28]
lea ecx, [esi + 4]
mov dword [esi + 0x30fc], eax
push edx
mov dword [ecx], ebp
lea ecx, [esi + 0x3100]
call fcn.0047bc20
mov edx, dword [esi + 0x3130]
mov eax, dword [esi + 0x315c]
lea ecx, [esi + 0x315c]
push edx
call dword [eax + 0x28]
cmp dword [0x652168], ebp
jne 0x47bbdc
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
lea ecx, [esp + 0x28]
mov dword [0x652168], eax
call sub.MFC42.DLL_CString::CString_3
mov eax, dword [0x652168]
lea ecx, [esp + 0x28]
push eax
push 0x621cf4
push ecx
mov byte [esp + 0x2c], 0x12
call sub.MFC42.DLL_CString::Format
mov edx, dword [esp + 0x34]
add esp, 0xc
push edx
push str.QVMInstanceTlsIndex
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea ecx, [esp + 0x28]
mov byte [esp + 0x20], 0x11
call sub.MFC42.DLL_CString::CString
mov eax, dword [0x652168]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [esp + 0x18]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x14
ret 4