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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [0x10103ce4]
test ebx, ebx
je 0x100befcb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
test ebx, ebx
je 0x100befcb
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 0x10]
lea esi, [esp + 0x20]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.100be530
lea edx, [ebx + 0x20]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
mov eax, esi
mov dword [esp + 0x20], edx
xchg dword [edx], eax
test eax, eax
je 0x100beef2
mov dword [eax + 4], esi
lea edx, [eax + 0xc]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100beedf
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
lea ebp, [esp + 0x28]
xor edi, edi
lock xadd dword [ebp], edi
test edi, edi
je 0x100befd3
mov dword [ebx + 0x18], 6
mov ecx, dword [esp + 0x20]
lea edi, [esp + 0x24]
xor edx, edx
lock xadd dword [edi], edx
test edx, edx
mov eax, edx
je 0x100bf040
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100bef2f
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov eax, dword [ebx + 0x7c]
mov esi, 0xffffffff
test eax, eax
jne 0x100bef5d
jmp 0x100bef91
add edx, 4
mov ecx, esi
xchg dword [edx], ecx
mov eax, dword [eax + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [ebx + 0x7c]
sub esp, 4
test eax, eax
je 0x100bef91
mov eax, dword [eax]
mov ecx, dword [eax + 0x18]
mov edi, dword [eax + 0xc]
mov dword [eax + 0xc], ebx
mov edx, dword [ecx + 0xc]
test edx, edx
je 0x100bef75
mov ebp, dword [ecx + 8]
mov dword [edx + 8], ebp
mov ebp, dword [ecx + 8]
test ebp, ebp
je 0x100bef7f
mov dword [ebp + 0xc], edx
cmp ecx, dword [edi + 0x7c]
mov edx, ecx
jne 0x100bef40
mov edx, dword [ecx + 0xc]
mov dword [edi + 0x7c], edx
mov edx, dword [eax + 0x18]
jmp 0x100bef40
cmp dword [ebx + 0x84], 1
jne 0x100befcb
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 0x10]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.100be1e0
mov eax, dword [0x10103ce4]
test eax, eax
je 0x100befcb
mov dword [esp + 4], 0
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov edx, eax
sub esp, 0x10
mov eax, edi
lock cmpxchg dword [ebp], edx
test eax, eax
je 0x100bf019
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100beef2
mov dword [esp], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov edx, dword [esp + 0x1c]
jmp 0x100bf008
mov eax, esi
lock cmpxchg dword [ecx], edx
cmp esi, eax
je 0x100bef2f
lea esi, [esp + 0x2c]
lock xadd dword [esi], edx
test edx, edx
je 0x100bf065
xor eax, eax
lock xadd dword [edi], eax
jmp 0x100bef11
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov ebp, eax
mov edx, dword [esp + 0x1c]
mov eax, edx
lock cmpxchg dword [esi], ebp
test eax, eax
je 0x100bf0af
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100bf05a
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100bf0a1