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

Disassembly:
sub esp, 0xc
push esi
call fcn.0041a785
mov esi, dword [esp + 0x14]
test byte [esi + 0x8c], 0x80
mov dword [esp + 4], eax
je 0x41fb57
push dword [esp + 0x18]
add esi, 0xac
push esi
call fcn.0041a48c
pop ecx
pop ecx
jmp 0x41fdf6
test byte [eax + 0x8c], 0x80
push ebx
mov ebx, dword [0x4a9bfc]
jne 0x41fbbd
cmp dword [0x4a7e00], 0
je 0x41fb81
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov eax, dword [eax + 0xc]
jmp 0x41fb8d
push dword [0x4aa03c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [0x4a7e00], 0
mov dword [esp + 0x18], eax
je 0x41fbaf
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov dword [eax + 0xc], 1
jmp 0x41fbbd
push 1
push dword [0x4aa03c]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ebp
lea eax, [esi + 0x3c]
push edi
push eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebp, dword [esp + 0x24]
cmp ebp, dword [esi + 4]
je 0x41fd52
mov eax, dword [esi]
cmp eax, 1
mov edi, dword [esi + 0x98]
je 0x41fc6f
cmp eax, 2
je 0x41fc0f
jbe 0x41fd52
cmp eax, 4
jbe 0x41fc07
add eax, 0xfffffffa
cmp eax, 1
ja 0x41fd52
mov dword [esi + 4], ebp
jmp 0x41fd52
push dword [edi + 0x24]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esi + 4], ebp
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 0x68]
lea ecx, [ebp + 1]
shr eax, cl
test eax, eax
je 0x41fc61
mov eax, dword [esp + 0x10]
test byte [eax + 0x8c], 0x80
jne 0x41fc61
cmp dword [0x4a7e00], 0
je 0x41fc51
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov eax, dword [eax + 0x10]
jmp 0x41fc5d
push dword [0x4aa04c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov byte [eax + 0xf], 1
push dword [edi + 0x24]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x41fd52
push dword [edi + 0x24]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 4]
mov edx, dword [esi + 0x68]
mov ecx, dword [esi + 0x98]
mov dword [esp + 0x14], eax
lea eax, [esi + 0x64]
mov ebx, dword [eax]
mov dword [edx], ebx
mov edx, dword [eax]
mov ebx, dword [esi + 0x68]
mov dword [edx + 4], ebx
mov edx, dword [ecx + 0x24]
mov ebx, dword [esp + 0x14]
lea edx, [edx + ebx*8 + 0x48]
cmp dword [edx], edx
jne 0x41fcbd
mov edx, dword [ecx + 0x24]
xor ecx, ecx
inc ecx
mov dword [esp + 0x14], ecx
mov ecx, ebx
mov ebx, dword [esp + 0x14]
shl ebx, cl
not ebx
and dword [edx + 0x68], ebx
and dword [esi + 0x54], 0
mov dword [esi + 4], ebp
mov ecx, dword [edi + 0x24]
lea ecx, [ecx + ebp*8 + 0x48]
mov dword [eax], ecx
mov ecx, dword [edi + 0x24]
mov ecx, dword [ecx + ebp*8 + 0x4c]
mov dword [esi + 0x68], ecx
mov ecx, dword [edi + 0x24]
mov ecx, dword [ecx + ebp*8 + 0x4c]
mov dword [ecx], eax
mov ecx, dword [edi + 0x24]
mov dword [ecx + ebp*8 + 0x4c], eax
mov eax, dword [edi + 0x24]
xor edx, edx
inc edx
mov ebx, edx
mov ecx, ebp
shl ebx, cl
or dword [eax + 0x68], ebx
mov dword [esi + 0x54], edx
push dword [edi + 0x24]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x10]
cmp ebp, dword [eax + 4]
jle 0x41fd4c
test byte [eax + 0x8c], 0x80
jne 0x41fd4c
cmp dword [0x4a7e00], 0
je 0x41fd34
mov ebx, dword [0x4a9bfc]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov eax, dword [eax + 0x10]
jmp 0x41fd46
push dword [0x4aa04c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, dword [0x4a9bfc]
mov byte [eax + 0xf], 1
jmp 0x41fd52
mov ebx, dword [0x4a9bfc]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x10]
test byte [eax + 0x8c], 0x80
jne 0x41fdf3
mov esi, dword [esp + 0x20]
xor edi, edi
cmp esi, edi
jne 0x41fdcd
cmp dword [0x4a7e00], edi
je 0x41fd90
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov eax, dword [eax + 0x10]
jmp 0x41fd9c
push dword [0x4aa04c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0xc], edi
je 0x41fdcd
cmp dword [0x4a7e00], edi
je 0x41fdba
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov eax, dword [eax + 0x10]
jmp 0x41fdc6
push dword [0x4aa04c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push eax
call fcn.00418fe9
pop ecx
cmp dword [0x4a7e00], edi
je 0x41fde6
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ebx*4]
mov dword [eax + 0xc], esi
jmp 0x41fdf3
push esi
push dword [0x4aa03c]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
pop edi
pop ebp
pop ebx
pop esi
add esp, 0xc
ret