Function at 0x40d4f0
Capabilities:
Set thread local storage value

Disassembly:
push rbp
push r12
push rdi
push rsi
push rbx
mov rbp, rsp
sub rsp, 0x30
mov qword [rbp - 8], rcx
mov rcx, qword [0x004309b8]
test rcx, rcx
je 0x40d6ff
call sym.pthread_mutex_lock
mov rax, qword [rbp - 8]
add rax, 0x38
mov rcx, rax
mov qword [rbp - 0x10], rax
call sym.pthread_mutex_lock
mov rcx, qword [0x004309f0]
test rcx, rcx
je 0x40d726
cmp dword [rcx], 1
je 0x40d544
call sym._pthread_once_raw.part.1.constprop.4
mov rax, qword [0x004309e8]
test rax, rax
je 0x40d749
mov rdi, qword [rbp - 8]
mov ecx, dword [rax]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rcx, qword [rbp - 0x10]
mov dword [rdi + 0x70], eax
call sym.pthread_mutex_unlock
lea rcx, [rdi + 0xd0]
mov rdx, rbp
call sym._setjmp
test eax, eax
jne 0x40d68d
mov rcx, qword [0x004309b8]
test rcx, rcx
je 0x40d7bb
call sym.pthread_mutex_unlock
mov rax, qword [rbp - 8]
mov rcx, qword [rax + 8]
call qword [rax + 0x10]
mov rbx, rax
nop
nop
mov rcx, qword [0x004309b8]
test rcx, rcx
je 0x40d794
call sym.pthread_mutex_lock
mov rax, qword [rbp - 8]
mov rcx, qword [rax + 0x1d8]
mov qword [rax + 8], rbx
test rcx, rcx
jne 0x40d6a7
mov rcx, qword [rbp - 0x10]
call sym.pthread_mutex_lock
mov rax, qword [rbp - 8]
mov rcx, qword [rax + 0x30]
mov rsi, qword [rax + 8]
test rcx, rcx
je 0x40d5fe
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbp - 8]
cmp qword [rax + 0x28], 0
mov qword [rax + 0x30], 0
je 0x40d6b5
mov rdi, qword [rbp - 0x10]
mov rax, qword [rbp - 8]
mov rcx, rdi
mov dword [rax + 0xbc], 1
call sym.pthread_mutex_unlock
mov rcx, rdi
call sym.pthread_mutex_destroy
lea r12, [sym.__shmem_winpthreads_init_mtx_pthr_locked_shmem]
lea rdi, str.mtx_pthr_locked_shmem
mov rbx, qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40d654
xor ecx, ecx
call rbx
mov rcx, qword [0x004309b8]
test rcx, rcx
je 0x40d671
call sym.pthread_mutex_unlock
test eax, eax
je 0x40d650
mov ecx, esi
call qword [sym.imp.msvcrt.dll__endthreadex]
mov rcx, rdi
mov r8, r12
mov edx, 8
call sym.__shmem_winpthreads_grab
mov qword [0x004309b8], rax
mov rcx, rax
jmp 0x40d660
mov rcx, qword [0x004309b8]
test rcx, rcx
je 0x40d76d
call sym.pthread_mutex_lock
jmp 0x40d5de
call sym._pthread_cleanup_dest.part.2
nop dword [rax]
jmp 0x40d5de
mov rdi, qword [rbp - 0x10]
mov dword [rax], 0xdeadbeef
mov rbx, rax
mov rcx, rdi
call sym.pthread_mutex_unlock
mov rcx, rdi
call sym.pthread_mutex_destroy
cmp qword [rbx + 0x1d0], 0
je 0x40d806
mov rax, qword [0x004309e8]
test rax, rax
je 0x40d7e2
xor edx, edx
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x40d637
lea rcx, str.mtx_pthr_locked_shmem
lea r8, [sym.__shmem_winpthreads_init_mtx_pthr_locked_shmem]
mov edx, 8
call sym.__shmem_winpthreads_grab
mov qword [0x004309b8], rax
mov rcx, rax
jmp 0x40d511
lea rcx, str._pthread_tls_once_shmem
xor r8d, r8d
mov edx, 4
call sym.__shmem_winpthreads_grab
mov qword [0x004309f0], rax
mov rcx, rax
jmp 0x40d53a
lea r8, [sym.__shmem_winpthreads_init__pthread_tls_shmem]
lea rcx, str._pthread_tls_shmem
mov edx, 4
call sym.__shmem_winpthreads_grab
mov qword [0x004309e8], rax
jmp 0x40d554
lea rcx, str.mtx_pthr_locked_shmem
lea r8, [sym.__shmem_winpthreads_init_mtx_pthr_locked_shmem]
mov edx, 8
call sym.__shmem_winpthreads_grab
mov qword [0x004309b8], rax
mov rcx, rax
jmp 0x40d69d
lea rcx, str.mtx_pthr_locked_shmem
lea r8, [sym.__shmem_winpthreads_init_mtx_pthr_locked_shmem]
mov edx, 8
call sym.__shmem_winpthreads_grab
mov qword [0x004309b8], rax
mov rcx, rax
jmp 0x40d5c1
lea rcx, str.mtx_pthr_locked_shmem
lea r8, [sym.__shmem_winpthreads_init_mtx_pthr_locked_shmem]
mov edx, 8
call sym.__shmem_winpthreads_grab
mov qword [0x004309b8], rax
mov rcx, rax
jmp 0x40d59c
lea r8, [sym.__shmem_winpthreads_init__pthread_tls_shmem]
lea rcx, str._pthread_tls_shmem
mov edx, 4
call sym.__shmem_winpthreads_grab
mov qword [0x004309e8], rax
jmp 0x40d6f0
mov rcx, qword [rbp - 8]
call sym.push_pthread_mem.part.0
jmp 0x40d6e0