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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
call fcn.0040bfc0
mov edx, dword [eax]
mov esi, eax
mov dword [ebp - 0x1c], eax
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
test eax, eax
mov ebx, eax
je 0x40c476
xor edi, edi
lea esi, [esi + 4]
mov eax, dword [ebx + edi*4]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40c242
mov dword [ebx + edi*4], 0
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx + edi*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [ebp - 0x24]
sub esp, 4
test edx, edx
je 0x40c242
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call edx
add edi, 1
mov ecx, dword [ebx + edi*4]
test ecx, ecx
je 0x40c287
mov dword [ebp - 0x24], ecx
mov dword [ebx + edi*4], 0
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + edi*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x20]
sub esp, 4
test ecx, ecx
je 0x40c287
mov edx, dword [ebp - 0x24]
mov dword [esp], edx
call ecx
lea eax, [edi + 1]
mov ecx, dword [ebx + eax*4]
test ecx, ecx
mov dword [ebp - 0x20], ecx
je 0x40c2d2
mov dword [ebx + eax*4], 0
mov dword [ebp - 0x24], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx + eax*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x24]
sub esp, 4
test eax, eax
je 0x40c2d2
mov edx, dword [ebp - 0x20]
mov dword [esp], edx
call eax
lea ecx, [edi + 2]
mov eax, dword [ebx + ecx*4]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40c31d
mov dword [ebx + ecx*4], 0
mov dword [ebp - 0x24], ecx
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + ecx*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x24]
sub esp, 4
test ecx, ecx
je 0x40c31d
mov edx, dword [ebp - 0x20]
mov dword [esp], edx
call ecx
lea eax, [edi + 3]
mov ecx, dword [ebx + eax*4]
test ecx, ecx
mov dword [ebp - 0x20], ecx
je 0x40c368
mov dword [ebx + eax*4], 0
mov dword [ebp - 0x24], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx + eax*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x24]
sub esp, 4
test eax, eax
je 0x40c368
mov edx, dword [ebp - 0x20]
mov dword [esp], edx
call eax
lea ecx, [edi + 4]
mov eax, dword [ebx + ecx*4]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40c3b3
mov dword [ebx + ecx*4], 0
mov dword [ebp - 0x24], ecx
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + ecx*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x24]
sub esp, 4
test ecx, ecx
je 0x40c3b3
mov edx, dword [ebp - 0x20]
mov dword [esp], edx
call ecx
lea eax, [edi + 5]
mov ecx, dword [ebx + eax*4]
test ecx, ecx
mov dword [ebp - 0x20], ecx
je 0x40c3fe
mov dword [ebx + eax*4], 0
mov dword [ebp - 0x24], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx + eax*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x24]
sub esp, 4
test eax, eax
je 0x40c3fe
mov edx, dword [ebp - 0x20]
mov dword [esp], edx
call eax
lea ecx, [edi + 6]
mov eax, dword [ebx + ecx*4]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40c449
mov dword [ebx + ecx*4], 0
mov dword [ebp - 0x24], ecx
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + ecx*4 + 0x20]
sub esp, 4
mov dword [esp], esi
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x24]
sub esp, 4
test ecx, ecx
je 0x40c449
mov edx, dword [ebp - 0x20]
mov dword [esp], edx
call ecx
add edi, 7
cmp edi, 0x40
jne 0x40c200
mov edi, dword [ebp - 0x1c]
mov dword [esp + 4], 0
mov esi, dword [edi]
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
mov dword [esp], ebx
call fcn.004289d0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret