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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x3320
call fcn.1009b8d0
mov eax, dword [0x10112018]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [sym.ACE.dll_class_ACE_OS_Object_Manager__ACE_OS_Object_Manager::instance_]
push ebx
push esi
push edi
mov edi, dword [0x10115c84]
mov ebx, ecx
xor esi, esi
mov dword [ebp - 0x110c], ebx
mov dword [ebp - 0x1114], edi
mov dword [ebp - 0x1110], 0xffffffff
test eax, eax
je 0x10058bbf
xor ecx, ecx
cmp dword [eax + 4], 2
setl cl
mov eax, ecx
test eax, eax
jne 0x10058bbf
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 0x1110], esi
mov eax, dword [ebx + 0x3300]
lea edi, [ebx + 0x3300]
cmp eax, dword [sym.ACE.dll_unsigned_long_int_ACE_OS::NULL_key]
je 0x10058c0b
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
mov dword [ebp - 0x111c], ebx
test ebx, ebx
jne 0x10058c04
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x10058c02
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call dword [sym.imp.MSVCR100.dll__errno]
mov dword [eax], esi
jmp 0x10058c0b
test ebx, ebx
setne al
test al, al
jne 0x10058c36
cmp dword [ebp - 0x1110], 0xffffffff
je 0x10058d95
mov edx, dword [ebp - 0x1114]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1009acfd
mov esp, ebp
pop ebp
ret
mov eax, 0x440
jmp 0x10058c40
dec eax
sub edi, 0xc
cmp dword [edi + 8], 0xffffffff
mov dword [ebp - 0x1118], eax
je 0x10058cd6
mov ebx, dword [edi]
mov edx, ebx
shr edx, 5
cmp edx, 0x22
jae 0x10058cd6
mov ecx, ebx
and ecx, 0x1f
mov eax, 1
shl eax, cl
mov ecx, dword [ebp - 0x111c]
and eax, dword [ecx + edx*4]
neg eax
sbb eax, eax
neg eax
je 0x10058cd6
mov eax, dword [ebp - 0x110c]
cmp ebx, dword [eax + 0x3300]
je 0x10058cd6
lea eax, [ebp + esi*4 - 0x2220]
push eax
lea ebx, [ebp + esi*4 - 0x3320]
mov dword [eax], 0
mov eax, dword [ebp - 0x110c]
push ebx
mov dword [ebx], 0
mov dword [ebp + esi*4 - 0x1108], 0
call fcn.10058fe0
cmp dword [ebx], 0
je 0x10058cd6
cmp dword [ebp + esi*4 - 0x2220], 0
je 0x10058cd6
mov edx, dword [edi]
mov dword [ebp + esi*4 - 0x1108], edx
inc esi
mov eax, dword [ebp - 0x1118]
test eax, eax
jne 0x10058c40
mov edi, dword [ebp - 0x110c]
mov eax, dword [edi + 0x3300]
lea eax, [eax + eax*2]
lea edi, [edi + eax*4]
lea eax, [ebp + esi*4 - 0x2220]
push eax
lea ebx, [ebp + esi*4 - 0x3320]
mov dword [eax], 0
mov eax, dword [ebp - 0x110c]
push ebx
mov dword [ebx], 0
mov dword [ebp + esi*4 - 0x1108], 0
call fcn.10058fe0
cmp dword [ebx], 0
je 0x10058d41
cmp dword [ebp + esi*4 - 0x2220], 0
je 0x10058d41
mov ecx, dword [edi]
mov dword [ebp + esi*4 - 0x1108], ecx
inc esi
cmp dword [ebp - 0x1110], 0xffffffff
je 0x10058d57
mov edx, dword [ebp - 0x1114]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor edi, edi
test esi, esi
je 0x10058d95
mov ebx, dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x10058d70
mov eax, dword [ebp + edi*4 - 0x2220]
mov ecx, dword [ebp + edi*4 - 0x3320]
push eax
call ecx
mov edx, dword [ebp + edi*4 - 0x1108]
add esp, 4
push 0
push edx
call ebx
inc edi
cmp edi, esi
jb 0x10058d70
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1009acfd
mov esp, ebp
pop ebp
ret