Function at 0x40ea40
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x10
mov eax, dword [0x41f3f4]
test eax, eax
je 0x40ec55
mov dword [esp], eax
call sym._pthread_mutex_lock
mov eax, dword [ebp + 8]
add eax, 0x1c
mov dword [esp], eax
mov dword [ebp - 0xc], eax
call sym._pthread_mutex_lock
mov eax, dword [0x41f410]
test eax, eax
je 0x40ec7b
cmp dword [eax], 1
je 0x40ea85
call sym.__pthread_once_raw.part.1.constprop.4
mov eax, dword [0x41f40c]
test eax, eax
je 0x40eca1
mov ecx, dword [ebp + 8]
mov dword [esp + 4], ecx
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebp + 8]
mov dword [edx + 0x44], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._pthread_mutex_unlock
mov eax, dword [ebp + 8]
mov dword [esp + 4], 0
add eax, 0x78
mov dword [esp], eax
call sym.__setjmp3
test eax, eax
mov eax, dword [0x41f3f4]
jne 0x40ebe3
test eax, eax
je 0x40ed15
mov dword [esp], eax
call sym._pthread_mutex_unlock
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
mov dword [esp], eax
mov eax, dword [ebp + 8]
call dword [eax + 8]
mov edx, dword [0x41f3f4]
test edx, edx
mov ebx, eax
je 0x40eced
mov dword [esp], edx
call sym._pthread_mutex_lock
mov eax, dword [ebp + 8]
mov dword [eax + 4], ebx
mov eax, dword [eax + 0xbc]
test eax, eax
jne 0x40ebf8
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._pthread_mutex_lock
mov eax, dword [ebp + 8]
mov esi, dword [eax + 4]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x40eb50
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x14]
mov dword [eax + 0x18], 0
test edx, edx
je 0x40ec05
mov ebx, dword [ebp - 0xc]
mov eax, dword [ebp + 8]
mov dword [eax + 0x70], 1
mov dword [esp], ebx
call sym._pthread_mutex_unlock
mov dword [esp], ebx
call sym._pthread_mutex_destroy
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40eb9c
mov dword [esp], 0
call ebx
sub esp, 4
mov eax, dword [0x41f3f4]
test eax, eax
je 0x40ebc0
mov dword [esp], eax
call sym._pthread_mutex_unlock
test eax, eax
je 0x40eb90
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__endthreadex]
lea esi, [esi]
mov dword [esp + 8], sym.___shmem_winpthreads_init_mtx_pthr_locked_shmem
mov dword [esp + 4], 4
mov dword [esp], str.mtx_pthr_locked_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f3f4], eax
jmp 0x40eba5
test eax, eax
je 0x40ecc7
mov dword [esp], eax
call sym._pthread_mutex_lock
jmp 0x40eb2c
call sym.__pthread_cleanup_dest.part.2
lea esi, [esi]
jmp 0x40eb2c
mov ebx, dword [ebp - 0xc]
mov dword [eax], 0xdeadbeef
mov dword [esp], ebx
call sym._pthread_mutex_unlock
mov dword [esp], ebx
call sym._pthread_mutex_destroy
mov eax, dword [ebp + 8]
cmp dword [eax + 0xb8], 0
je 0x40ed61
mov eax, dword [0x41f40c]
test eax, eax
je 0x40ed3b
mov dword [esp + 4], 0
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push eax
push eax
jmp 0x40eb82
mov dword [esp + 8], sym.___shmem_winpthreads_init_mtx_pthr_locked_shmem
mov dword [esp + 4], 4
mov dword [esp], str.mtx_pthr_locked_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f3f4], eax
jmp 0x40ea55
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_tls_once_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f410], eax
jmp 0x40ea7b
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 0x40ea92
mov dword [esp + 8], sym.___shmem_winpthreads_init_mtx_pthr_locked_shmem
mov dword [esp + 4], 4
mov dword [esp], str.mtx_pthr_locked_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f3f4], eax
jmp 0x40ebeb
mov dword [esp + 8], sym.___shmem_winpthreads_init_mtx_pthr_locked_shmem
mov dword [esp + 4], 4
mov dword [esp], str.mtx_pthr_locked_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f3f4], eax
mov edx, eax
jmp 0x40eb10
mov dword [esp + 8], sym.___shmem_winpthreads_init_mtx_pthr_locked_shmem
mov dword [esp + 4], 4
mov dword [esp], str.mtx_pthr_locked_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f3f4], eax
jmp 0x40eae9
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 0x40ec3b
call sym._push_pthread_mem.part.0
jmp 0x40ec2e