Function at 0x40db50
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 0x40dd65
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 0x40dd8b
cmp dword [eax], 1
je 0x40db95
call sym.__pthread_once_raw.part.1.constprop.4
mov eax, dword [0x41f40c]
test eax, eax
je 0x40ddb1
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 0x40dcf3
test eax, eax
je 0x40de25
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 0x40ddfd
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 0x40dd08
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 0x40dc60
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 0x40dd15
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 0x40dcac
mov dword [esp], 0
call ebx
sub esp, 4
mov eax, dword [0x41f3f4]
test eax, eax
je 0x40dcd0
mov dword [esp], eax
call sym._pthread_mutex_unlock
test eax, eax
je 0x40dca0
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 0x40dcb5
test eax, eax
je 0x40ddd7
mov dword [esp], eax
call sym._pthread_mutex_lock
jmp 0x40dc3c
call sym.__pthread_cleanup_dest.part.2
lea esi, [esi]
jmp 0x40dc3c
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 0x40de71
mov eax, dword [0x41f40c]
test eax, eax
je 0x40de4b
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 0x40dc92
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 0x40db65
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 0x40db8b
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 0x40dba2
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 0x40dcfb
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 0x40dc20
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 0x40dbf9
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 0x40dd4b
call sym._push_pthread_mem.part.0
jmp 0x40dd3e