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

Disassembly:
sub esp, 0x2c
push ebx
mov ebx, dword [esp + 0x34]
test ebx, ebx
je 0x1053c177
push ebp
push esi
lea ebp, [ebx + 0x1c]
xor ecx, ecx
push edi
mov dword [esp + 0x14], ebp
nop dword [eax]
xor edi, edi
mov dword [esp + 0x1c], ebp
inc ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], ecx
lea esi, [esp + 0x1c]
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], edi
xchg dword [ebp], esi
test esi, esi
je 0x1053bf95
lea ecx, [esp + 0x1c]
lea eax, [esi + 4]
xchg dword [eax], ecx
or edx, 0xffffffff
lea ecx, [esi + 0xc]
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x1053bf5b
cmp eax, 0xffffffff
je 0x1053bf5b
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
lea ecx, [esp + 0x24]
lock xadd dword [ecx], eax
test eax, eax
jne 0x1053bf95
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x24]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x1053bf8e
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx + 0x30]
mov dword [ebx + 0x34], eax
lea eax, [esp + 0x1c]
push eax
call fcn.1053c220
add esp, 4
nop dword [eax + eax]
mov dword [esp + 0x1c], ebp
lea esi, [esp + 0x1c]
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
xchg dword [ebp], esi
test esi, esi
je 0x1053c036
lea ecx, [esp + 0x1c]
lea eax, [esi + 4]
xchg dword [eax], ecx
or edx, 0xffffffff
lea ecx, [esi + 0xc]
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x1053bffc
cmp eax, 0xffffffff
je 0x1053bffc
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
lea ecx, [esp + 0x24]
lock xadd dword [ecx], eax
test eax, eax
jne 0x1053c036
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x24]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x1053c02f
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebx + 0x34]
test esi, esi
je 0x1053c15b
mov edx, dword [esi + 4]
lea ecx, [esp + 0x2c]
add edx, 8
mov dword [esp + 0x38], 0
mov dword [esp + 0x2c], edx
xor eax, eax
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x1053c08b
lea eax, [esp + 0x1c]
push eax
call fcn.1053c220
add esp, 4
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1053bfb0
mov eax, dword [esi + 8]
mov dword [ebx + 0x34], eax
mov edi, dword [esi + 4]
push dword [edi]
mov ebp, dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0
push dword [edi]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test ebx, ebx
je 0x1053c0e6
cmp dword [esp + 0x18], 4
jg 0x1053c0e6
lea eax, [esp + 0x1c]
push eax
call fcn.1053c220
lea eax, [esp + 0x30]
push eax
call fcn.1053c220
mov edi, dword [esp + 0x18]
inc edi
push ebx
mov dword [esp + 0x1c], edi
call ebp
mov ebx, dword [esp + 0x4c]
add esp, 0xc
mov ebp, dword [esp + 0x14]
jmp 0x1053bfb0
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 8]
test ecx, ecx
je 0x1053c0f3
mov dword [ecx + 8], eax
test eax, eax
je 0x1053c0fa
mov dword [eax + 0x10], ecx
mov ecx, dword [esi]
cmp dword [ecx + 0x30], esi
jne 0x1053c104
mov dword [ecx + 0x30], eax
mov ecx, dword [esi]
cmp dword [ecx + 0x34], esi
jne 0x1053c10e
mov dword [ecx + 0x34], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 0xc]
test ecx, ecx
je 0x1053c11b
mov dword [ecx + 0xc], eax
test eax, eax
je 0x1053c122
mov dword [eax + 0x14], ecx
mov ecx, dword [esi + 4]
cmp dword [ecx + 0xc], esi
jne 0x1053c12d
mov dword [ecx + 0xc], eax
push esi
call fcn.1051f7a2
lea eax, [esp + 0x20]
push eax
call fcn.1053c220
lea eax, [esp + 0x34]
push eax
call fcn.1053c220
mov ebx, dword [esp + 0x4c]
add esp, 0xc
mov edi, dword [esp + 0x10]
mov ebp, dword [esp + 0x14]
jmp 0x1053bfb0
lea eax, [esp + 0x1c]
push eax
call fcn.1053c220
mov ecx, dword [esp + 0x1c]
add esp, 4
test edi, edi
jne 0x1053bf10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret