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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0xa8
mov esi, esp
mov dword [esi + 0x90], ebp
mov dword [esi + 0x94], esp
mov dword [esi + 0xa0], 0xffffffff
mov dword [esi + 0x9c], 0x411630
mov ebx, dword [ebp + 8]
lea eax, [esi + 0x98]
mov ecx, dword fs:[0]
mov dword [esi + 0x98], ecx
mov dword fs:[0], eax
mov eax, dword [ebx]
test eax, eax
je 0x40fb10
dec eax
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 2
jb 0x40f991
mov edi, eax
mov eax, dword [eax]
or eax, dword [edi + 4]
jne 0x40fb3f
mov eax, dword [ebx]
test eax, eax
je 0x40fb44
dec eax
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 1
je 0x40fb5d
mov edi, eax
test eax, eax
jne 0x40fa05
mov dword [esi + 0x44], 0
mov dword [esi + 0x40], 0
mov dword [esi + 0x88], ebx
movzx eax, byte [0x599449]
push 8
push 0x50
call fcn.00421c10
add esp, 8
test eax, eax
je 0x40fb83
mov edi, eax
lea eax, [esi + 0x40]
push 0x50
push eax
push edi
call fcn.00517140
add esp, 0xc
mov eax, dword [ebx]
test eax, eax
je 0x40fb75
dec eax
push edi
push eax
call dword [sym.imp.kernel32.dll_TlsSetValue]
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40fa2b
mov ecx, dword [eax]
mov dword [eax], 0
lea edx, [eax + 8]
or ecx, dword [eax + 4]
mov dword [eax + 4], 0
mov eax, 0x55c238
cmovne eax, edx
jmp 0x40fa30
mov eax, 0x55c238
movsd xmm1, qword [eax + 0x30]
movsd xmm2, qword [eax + 0x28]
movsd xmm0, qword [eax + 0x38]
movsd qword [esi + 0x30], xmm1
movsd xmm1, qword [eax + 0x20]
movsd qword [esi + 0x28], xmm2
movsd xmm2, qword [eax + 0x18]
movsd qword [esi + 0x38], xmm0
movsd qword [esi + 0x20], xmm1
movsd xmm1, qword [eax + 0x10]
movsd qword [esi + 0x18], xmm2
movsd xmm2, qword [eax]
movsd qword [esi + 0x10], xmm1
movsd xmm1, qword [eax + 8]
movsd qword [esi], xmm2
lea eax, [esi + 0x40]
movsd qword [esi + 8], xmm1
push 0x48
push edi
push eax
call fcn.00517140
add esp, 0xc
mov dword [edi + 4], 0
mov dword [edi], 1
movsd xmm0, qword [esi + 0x38]
movsd qword [edi + 0x40], xmm0
movsd xmm0, qword [esi + 0x30]
movsd qword [edi + 0x38], xmm0
movsd xmm0, qword [esi + 0x28]
movsd qword [edi + 0x30], xmm0
movsd xmm0, qword [esi + 0x20]
movsd qword [edi + 0x28], xmm0
movsd xmm0, qword [esi + 0x18]
movsd qword [edi + 0x20], xmm0
movsd xmm0, qword [esi + 0x10]
movsd qword [edi + 0x18], xmm0
movsd xmm0, qword [esi]
movsd xmm1, qword [esi + 8]
movsd qword [edi + 0x10], xmm1
movsd qword [edi + 8], xmm0
mov eax, dword [esi + 0x40]
or eax, dword [esi + 0x44]
je 0x40fb3f
mov eax, dword [esi + 0x4c]
cmp eax, 2
je 0x40fb3f
test eax, eax
lea eax, [esi + 0x50]
je 0x40fb2e
mov ecx, dword [esi + 0x50]
lock dec dword [ecx]
jne 0x40fb3f
push eax
call fcn.0040bbd0
jmp 0x40fb3c
push ebx
call fcn.0051e5f0
add esp, 4
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 2
jae 0x40f984
jmp 0x40f991
mov ecx, dword [esi + 0x50]
lock dec dword [ecx]
jne 0x40fb3f
push eax
call fcn.0040b890
add esp, 4
add edi, 8
jmp 0x40fb5f
push ebx
call fcn.0051e5f0
add esp, 4
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 1
jne 0x40f9ac
xor edi, edi
mov eax, dword [esi + 0x98]
mov dword fs:[0], eax
mov eax, edi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push ebx
call fcn.0051e5f0
add esp, 4
jmp 0x40f9fd
mov dword [esi + 0xa0], 0
push 0x50
push 8
call fcn.0051ec40
add esp, 8
ud2