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

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x20
cmp dword [ebp + 0xc], 3
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0xfeedbab1
mov dword [ebp - 0x14], 0
mov dword [ebp - 0xc], 1
je 0x40e828
lea esp, [ebp - 8]
mov eax, 1
pop ebx
pop esi
pop ebp
ret 0xc
mov eax, dword [0x41f40c]
test eax, eax
je 0x40e9b5
cmp dword [eax], 0xffffffff
je 0x40e81a
mov eax, dword [0x41f40c]
test eax, eax
je 0x40ea06
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
test eax, eax
mov ebx, eax
je 0x40e81a
test byte [eax + 0x20], 0x30
je 0x40e907
mov eax, dword [eax + 0xbc]
test eax, eax
jne 0x40e9a7
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40e8a5
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp], eax
call esi
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x40e897
mov dword [esp], eax
call esi
sub esp, 4
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x14], 0
lea eax, [ebx + 0x1c]
mov dword [esp], eax
call sym._pthread_mutex_destroy
mov eax, dword [ebp - 0x18]
mov esi, dword [ebx + 0xb8]
mov dword [ebx + 0x34], eax
mov eax, dword [ebp - 0x14]
test esi, esi
mov dword [ebx + 0x38], eax
mov eax, dword [ebp - 0x10]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0x40], eax
je 0x40ea2c
mov eax, dword [0x41f40c]
test eax, eax
je 0x40e9e0
mov dword [esp + 4], 0
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, 1
sub esp, 8
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret 0xc
mov ecx, dword [eax + 0x70]
mov eax, dword [eax + 0x18]
test ecx, ecx
jne 0x40e961
test eax, eax
je 0x40e921
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [ebx + 0xbc]
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x70], 1
test eax, eax
jne 0x40e9a0
test byte [ebx + 0x24], 4
je 0x40e978
mov eax, dword [ebx + 0x14]
mov dword [ebx], 0xdeadbeef
test eax, eax
je 0x40e89e
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x40e89e
test eax, eax
je 0x40e971
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov dword [ebx + 0x18], 0
lea eax, [ebx + 0x1c]
mov dword [esp], eax
call sym._pthread_mutex_destroy
mov eax, dword [ebp - 0x18]
mov dword [ebx + 0x34], eax
mov eax, dword [ebp - 0x14]
mov dword [ebx + 0x38], eax
mov eax, dword [ebp - 0x10]
mov dword [ebx + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0x40], eax
jmp 0x40e81a
call sym.__pthread_cleanup_dest.part.2
jmp 0x40e939
call sym.__pthread_cleanup_dest.part.2
lea esi, [esi]
jmp 0x40e873
mov dword [esp + 8], sym.___shmem_winpthreads_init__pthread_tls_shmem
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f40c], eax
jmp 0x40e835
mov dword [esp + 8], sym.___shmem_winpthreads_init__pthread_tls_shmem
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f40c], eax
jmp 0x40e8e3
mov dword [esp + 8], sym.___shmem_winpthreads_init__pthread_tls_shmem
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f40c], eax
jmp 0x40e847
mov eax, ebx
call sym._push_pthread_mem.part.0
jmp 0x40e8d6