Function at 0x140005840
Capabilities:
Set thread local storage value

Disassembly:
push rbp
mov rbp, rsp
push r12
push rsi
push rbx
sub rsp, 0x28
mov qword [rbp + 0x10], rcx
call dbg._fpreset
mov rbx, qword [0x14000e680]
mov rax, qword [rbx]
test rax, rax
je 0x140005a87
cmp qword [rax + 0x60], 0
jne 0x140005aa7
mov rax, qword [0x14000e680]
lea rcx, [0x14000d068]
mov rax, qword [rax]
mov qword [rax + 0x60], rcx
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x10]
lea r12, [rax + 0x38]
mov rcx, r12
call sym.pthread_mutex_lock
mov rbx, qword [0x14000e680]
mov rax, qword [rbx]
test rax, rax
je 0x140005adb
cmp qword [rax + 0x28], 0
jne 0x140005ab0
mov rax, qword [0x14000e680]
lea rcx, [0x1400111d8]
mov rax, qword [rax]
mov qword [rax + 0x28], rcx
cmp dword [rcx], 1
je 0x140005acc
call sym._pthread_once_raw.part.0.constprop.0.isra.0
mov rbx, qword [0x14000e680]
mov rax, qword [rbx]
test rax, rax
je 0x140005b0d
cmp qword [rax + 0x30], 0
jne 0x140005ab9
mov rax, qword [0x14000e680]
mov rdx, qword [rax]
lea rax, [0x14000d078]
mov qword [rdx + 0x30], rax
mov rdx, qword [rbp + 0x10]
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rsi, qword [rbp + 0x10]
mov rcx, r12
mov dword [rsi + 0x70], eax
call sym.pthread_mutex_unlock
mov rax, qword [rbp + 0x10]
mov rdx, rbp
lea rcx, [rax + 0xd0]
call sym._setjmp
test eax, eax
jne 0x140005b2f
mov rbx, qword [0x14000e680]
mov rax, qword [rbx]
test rax, rax
je 0x140005b64
cmp qword [rax + 0x60], 0
jne 0x140005b84
lea rcx, [0x14000d068]
mov qword [rax + 0x60], rcx
call sym.pthread_mutex_unlock
mov rax, qword [rbp + 0x10]
mov rax, qword [rax + 0x10]
test rax, rax
je 0x140005bd9
mov rsi, qword [rbp + 0x10]
mov rcx, qword [rsi + 8]
call rax
mov rbx, rax
nop
nop
mov r12, qword [0x14000e680]
mov rax, qword [r12]
test rax, rax
je 0x140005baf
cmp qword [rax + 0x60], 0
jne 0x140005bd0
lea rcx, [0x14000d068]
mov qword [rax + 0x60], rcx
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x10]
mov rcx, qword [rax + 0x1d8]
mov qword [rax + 8], rbx
test rcx, rcx
je 0x1400059e3
call sym._pthread_cleanup_dest.part.0
mov rax, qword [rbp + 0x10]
lea r12, [rax + 0x38]
mov rcx, r12
call sym.pthread_mutex_lock
mov rax, qword [rbp + 0x10]
mov rcx, qword [rax + 0x30]
mov rbx, qword [rax + 8]
test rcx, rcx
je 0x140005a0a
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbp + 0x10]
cmp qword [rax + 0x28], 0
mov qword [rax + 0x30], 0
je 0x140005c1c
mov rcx, r12
call sym.pthread_mutex_unlock
mov rcx, r12
call sym.pthread_mutex_destroy
mov rax, qword [rbp + 0x10]
mov qword [rax + 0x38], 0xffffffffffffffff
mov dword [rax + 0xbc], 1
mov rsi, qword [0x14000e680]
lea r12, [0x14000d068]
mov rax, qword [rsi]
test rax, rax
je 0x140005bf7
cmp qword [rax + 0x60], 0
je 0x140005beb
mov rcx, qword [rax + 0x60]
call sym.pthread_mutex_unlock
test eax, eax
jne 0x140005be3
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140005a55
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [rbx]
cmp qword [r8 + 0x60], 0
je 0x140005873
test rax, rax
jne 0x140005aa7
call sym.__shmem3_winpthreads_tdm_init_local_region
mov rcx, qword [rax + 0x60]
jmp 0x140005888
mov rcx, qword [rax + 0x28]
jmp 0x1400058d0
mov rax, qword [0x14000e680]
mov rax, qword [rax]
mov rax, qword [rax + 0x30]
jmp 0x140005911
mov rax, qword [0x14000e680]
mov rax, qword [rax]
jmp 0x1400058f1
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [rbx]
cmp qword [r8 + 0x28], 0
je 0x1400058bb
test rax, rax
jne 0x140005ab0
call sym.__shmem3_winpthreads_tdm_init_local_region
mov rcx, qword [rax + 0x28]
cmp dword [rcx], 1
jne 0x1400058d9
jmp 0x1400058de
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [rbx]
cmp qword [r8 + 0x30], 0
je 0x1400058fc
test rax, rax
jne 0x140005ac3
call sym.__shmem3_winpthreads_tdm_init_local_region
jmp 0x140005ac3
mov rbx, qword [0x14000e680]
mov rax, qword [rbx]
test rax, rax
je 0x140005b8d
cmp qword [rax + 0x60], 0
jne 0x140005ba9
mov rax, qword [0x14000e680]
lea rcx, [0x14000d068]
mov rax, qword [rax]
mov qword [rax + 0x60], rcx
call sym.pthread_mutex_lock
jmp 0x1400059e3
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [rbx]
cmp qword [r8 + 0x60], 0
je 0x14000596b
test rax, rax
jne 0x140005b84
call sym.__shmem3_winpthreads_tdm_init_local_region
mov rcx, qword [rax + 0x60]
jmp 0x140005976
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [rbx]
cmp qword [r8 + 0x60], 0
je 0x140005b45
test rax, rax
jne 0x140005ba9
call sym.__shmem3_winpthreads_tdm_init_local_region
mov rcx, qword [rax + 0x60]
jmp 0x140005b5a
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [r12]
cmp qword [r8 + 0x60], 0
je 0x1400059ba
test rax, rax
jne 0x140005bd0
call sym.__shmem3_winpthreads_tdm_init_local_region
mov rcx, qword [rax + 0x60]
jmp 0x1400059c5
mov ebx, pe_nt_image_headers64
jmp 0x140005999
mov ecx, ebx
call qword [sym.imp.msvcrt.dll__endthreadex]
mov qword [rax + 0x60], r12
mov rcx, r12
jmp 0x140005a70
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [rsi]
cmp qword [r8 + 0x60], 0
je 0x140005beb
test rax, rax
jne 0x140005a6c
call sym.__shmem3_winpthreads_tdm_init_local_region
jmp 0x140005a6c
mov rax, qword [rbp + 0x10]
mov rcx, r12
mov dword [rax], 0xdeadbeef
call sym.pthread_mutex_unlock
mov rcx, r12
call sym.pthread_mutex_destroy
mov rcx, qword [rbp + 0x10]
call sym.push_pthread_mem
mov r12, qword [0x14000e680]
mov rax, qword [r12]
test rax, rax
je 0x140005c73
cmp qword [rax + 0x30], 0
jne 0x140005c90
lea rdx, [0x14000d078]
mov qword [rax + 0x30], rdx
mov rax, rdx
mov ecx, dword [rax]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x140005a47
call sym.__shmem3_winpthreads_tdm_init_local_region
mov r8, rax
mov rax, qword [r12]
cmp qword [r8 + 0x30], 0
je 0x140005c56
test rax, rax
jne 0x140005c90
call sym.__shmem3_winpthreads_tdm_init_local_region
mov rax, qword [rax + 0x30]
jmp 0x140005c64