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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5f4a75ca
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push esi
push edi
mov dword [ebp - 0x1c], ecx
cmp dword [ebp + 8], 0
je 0x5f490f8b
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 0xc]
jl 0x5f490f9f
push 0x10b
push str.afxtls.cpp
call sym.MFC42D.DLL_Ordinal_1041
test eax, eax
je 0x5f490f9f
int3
xor edx, edx
test edx, edx
jne 0x5f490f7a
mov eax, dword [ebp - 0x1c]
cmp dword [eax + 0x10], 0
jne 0x5f490fc2
push 0x10c
push str.afxtls.cpp
call sym.MFC42D.DLL_Ordinal_1041
test eax, eax
je 0x5f490fc2
int3
xor ecx, ecx
test ecx, ecx
jne 0x5f490fa5
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x10]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + ecx*8]
and edx, 1
test edx, edx
jne 0x5f490fef
push 0x10d
push str.afxtls.cpp
call sym.MFC42D.DLL_Ordinal_1041
test eax, eax
je 0x5f490fef
int3
xor eax, eax
test eax, eax
jne 0x5f490fc8
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x5f491023
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 8]
jl 0x5f491148
cmp dword [ebp + 0xc], 0
je 0x5f491148
cmp dword [ebp - 0x10], 0
jne 0x5f4910b2
push 0x10
call sym.MFC42D.DLL_Ordinal_715
mov dword [ebp - 0x18], eax
mov dword [ebp - 4], 0
cmp dword [ebp - 0x18], 0
je 0x5f491051
mov ecx, dword [ebp - 0x18]
call sym.MFC42D.DLL_Ordinal_503
mov dword [ebp - 0x20], eax
jmp 0x5f491058
mov dword [ebp - 0x20], 0
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x14], edx
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 8], 0
mov edx, dword [ebp - 0x10]
mov dword [edx + 0xc], 0
mov eax, dword [ebp - 0x10]
mov dword [eax + 4], 0
mov ecx, dword [ebp - 0x1c]
add ecx, 0x1c
push ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebp - 0x10]
push edx
mov ecx, dword [ebp - 0x1c]
add ecx, 0x14
call sym.MFC42D.DLL_Ordinal_1002
mov eax, dword [ebp - 0x1c]
add eax, 0x1c
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x10]
cmp dword [ecx + 0xc], 0
jne 0x5f4910d5
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0xc]
shl eax, 2
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0xc], eax
jmp 0x5f4910f4
push 2
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0xc]
shl eax, 2
push eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_LocalReAlloc]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0xc], eax
mov edx, dword [ebp - 0x10]
cmp dword [edx + 0xc], 0
jne 0x5f491102
call sym.MFC42D.DLL_Ordinal_1172
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov edx, dword [eax + 0xc]
sub edx, dword [ecx + 8]
shl edx, 2
push edx
push 0
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 8]
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0xc]
lea ecx, [eax + ecx*4]
push ecx
call sub.MSVCRTD.dll_memset
add esp, 0xc
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0xc]
mov dword [edx + 8], ecx
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, dword [ebp - 0x10]
cmp dword [edx + 0xc], 0
je 0x5f49115c
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 8]
jl 0x5f491170
push 0x12f
push str.afxtls.cpp
call sym.MFC42D.DLL_Ordinal_1041
test eax, eax
je 0x5f491170
int3
xor edx, edx
test edx, edx
jne 0x5f491148
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov dword [ecx + edx*4], eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8