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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x58
mov qword [rsp + 0x50], r8
mov qword [rsp + 0x40], rdx
mov rsi, rcx
mov r13, qword [rcx]
xor r15d, r15d
lea r12, [0x1401d57d0]
jmp 0x1400237c3
mov r13, qword [rsi]
mov rbx, r13
and rbx, 3
je 0x1400237e0
cmp ebx, 1
je 0x140023800
jmp 0x140023d02
cmp qword [rsp + 0x40], 0
je 0x140023800
lea rcx, [r13 + 1]
mov rax, r13
lock cmpxchg qword [rsi], rcx
mov r13, rax
jne 0x1400237c3
jmp 0x140023d22
lea r14, [rsp + rbx]
add r14, 0x28
nop dword [rax + rax]
mov ecx, dword [0x1401b00d8]
test ecx, ecx
je 0x14002383a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140023860
mov rbp, rax
cmp qword [rax + 8], 0
je 0x140023860
add rbp, 0x10
jmp 0x140023918
lea rcx, case.0x140086fb6.471
call fcn.140091a10
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140023827
nop word cs:[rax + rax]
mov ecx, dword [0x1401b00d8]
test ecx, ecx
je 0x140023884
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x1400238a0
mov rdi, rax
cmp rax, 1
jne 0x1400238e9
jmp 0x140023e22
lea rcx, case.0x140086fb6.471
call fcn.140091a10
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140023876
nop dword [rax]
movzx eax, byte [0x140254141]
mov edx, 0x18
xor ecx, ecx
call fcn.14008bd10
test rax, rax
je 0x140023e22
mov rdi, rax
lea rax, case.0x140086fb6.471
mov qword [rdi], rax
mov qword [rdi + 8], 0
mov ecx, dword [0x1401b00d8]
test ecx, ecx
je 0x1400239f2
dec ecx
mov rdx, rdi
call sub.KERNEL32.dll_TlsSetValue
lea rbp, [rdi + 0x10]
mov rcx, qword [rdi + 0x10]
cmp qword [rdi + 8], 0
mov qword [rdi + 8], 1
mov qword [rdi + 0x10], 0
je 0x140023921
test rcx, rcx
je 0x140023921
lock dec qword [rcx]
jne 0x140023918
call fcn.1400c1ef0
mov rcx, qword [rbp]
test rcx, rcx
jne 0x14002398e
movzx eax, byte [0x140254141]
mov edx, 0x30
xor ecx, ecx
call fcn.14008bd10
test rax, rax
je 0x140023e22
mov rcx, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x1402540d8]
nop
mov rdx, rax
inc rdx
je 0x140023e22
lock cmpxchg qword [0x1402540d8], rdx
jne 0x140023960
mov qword [rcx + 0x10], rdx
mov byte [rcx + 0x28], 0
cmp qword [rbp], 0
jne 0x140023e22
mov qword [rbp], rcx
lock inc qword [rcx]
jle 0x140023e22
mov rax, r13
and rax, 0xfffffffffffffffc
mov qword [rsp + 0x28], rcx
mov byte [rsp + 0x38], 0
mov qword [rsp + 0x30], rax
mov rax, r13
lock cmpxchg qword [rsi], r14
je 0x140023ca0
mov r13, rax
and eax, 3
cmp rax, rbx
jne 0x140023ce0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140023810
lock dec qword [rax]
jne 0x140023810
mov rcx, qword [rsp + 0x28]
call fcn.1400c1ef0
jmp 0x140023810
lea rcx, case.0x140086fb6.471
call fcn.140091a10
mov ecx, eax
jmp 0x1400238e1
mov ecx, dword [0x1401b00d8]
test ecx, ecx
je 0x140023a3a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140023a60
mov rbp, rax
cmp qword [rax + 8], 0
je 0x140023a60
add rbp, 0x10
jmp 0x140023b1b
lea rcx, case.0x140086fb6.471
call fcn.140091a10
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140023a27
nop word cs:[rax + rax]
mov ecx, dword [0x1401b00d8]
test ecx, ecx
je 0x140023a81
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140023aa0
cmp rax, 1
jne 0x140023aec
jmp 0x140023e22
lea rcx, case.0x140086fb6.471
call fcn.140091a10
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140023a76
nop dword [rax]
movzx eax, byte [0x140254141]
mov edx, 0x18
xor ecx, ecx
call fcn.14008bd10
test rax, rax
je 0x140023e22
lea rcx, case.0x140086fb6.471
mov qword [rax], rcx
mov qword [rax + 8], 0
mov ecx, dword [0x1401b00d8]
test ecx, ecx
je 0x140023c82
dec ecx
mov rdx, rax
mov rdi, rax
call sub.KERNEL32.dll_TlsSetValue
mov rax, rdi
lea rbp, [rax + 0x10]
mov rcx, qword [rax + 0x10]
cmp qword [rax + 8], 0
mov qword [rax + 8], 1
mov qword [rax + 0x10], 0
je 0x140023b24
test rcx, rcx
je 0x140023b24
lock dec qword [rcx]
jne 0x140023b1b
call fcn.1400c1ef0
mov r13, qword [rbp]
test r13, r13
jne 0x140023b9f
movzx eax, byte [0x140254141]
mov edx, 0x30
xor ecx, ecx
call fcn.14008bd10
test rax, rax
je 0x140023e22
mov r13, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x1402540d8]
nop word cs:[rax + rax]
mov rcx, rax
inc rcx
je 0x140023e22
lock cmpxchg qword [0x1402540d8], rcx
jne 0x140023b70
mov qword [r13 + 0x10], rcx
mov byte [r13 + 0x28], 0
cmp qword [rbp], 0
jne 0x140023e22
mov qword [rbp], r13
lock inc qword [r13]
jle 0x140023e22
lock dec byte [r13 + 0x28]
je 0x140023bee
lea rbp, [r13 + 0x28]
mov rdi, qword [0x140254130]
test rdi, rdi
je 0x140023c06
nop word cs:[rax + rax]
mov r8d, 1
mov rcx, rbp
mov rdx, r12
mov r9d, 0xffffffff
call rdi
mov al, 1
lock cmpxchg byte [rbp], r15b
jne 0x140023bd0
lock dec qword [r13]
jne 0x140023ca0
mov rcx, r13
call fcn.1400c1ef0
jmp 0x140023ca0
mov rcx, qword [0x1401b0068]
cmp rcx, 0xffffffffffffffff
jne 0x140023c5f
mov qword [rsp + 0x48], 0xffffffffffffffff
mov rax, qword [str._9_t_]
lea rcx, [rsp + 0x48]
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x140023e22
mov rcx, qword [rsp + 0x48]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x1401b0068], rcx
je 0x140023c5f
mov rdi, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, rdi
mov rax, qword [0x1401b0098]
mov rdx, rbp
xor r8d, r8d
xor r9d, r9d
call rax
xor eax, eax
xchg byte [rbp], al
lock dec qword [r13]
jne 0x140023ca0
jmp 0x140023bf9
lea rcx, case.0x140086fb6.471
mov rdi, rax
call fcn.140091a10
mov ecx, eax
mov rax, rdi
jmp 0x140023ade
movzx eax, byte [rsp + 0x38]
test al, al
je 0x140023a10
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x1400237c0
lock dec qword [rax]
jne 0x1400237c0
mov rcx, qword [rsp + 0x28]
call fcn.1400c1ef0
jmp 0x1400237c0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140023cfa
lock dec qword [rax]
jne 0x140023cfa
mov rcx, qword [rsp + 0x28]
call fcn.1400c1ef0
mov r13, qword [rsi]
jmp 0x1400237c3
cmp ebx, 2
jne 0x140023d20
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x140023d20
mov rcx, qword [rsp + 0x40]
mov rax, qword [rsp + 0x50]
call qword [rax + 0x20]
movzx eax, al
add eax, eax
xchg qword [rsi], rax
mov ecx, eax
and ecx, 3
cmp ecx, 1
jne 0x140023e22
dec rax
je 0x140023d07
lea rsi, [rsp + 0x28]
jmp 0x140023d68
mov rax, r15
test r15, r15
je 0x140023d07
mov rdi, qword [rax]
mov r15, qword [rax + 8]
mov qword [rax], 0
test rdi, rdi
je 0x140023e22
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rdi + 0x28], al
cmp al, 0xff
jne 0x140023da1
lea rbx, [rdi + 0x28]
mov rax, qword [0x140254128]
test rax, rax
je 0x140023db1
mov rcx, rbx
call rax
lock dec qword [rdi]
jne 0x140023d60
mov rcx, rdi
call fcn.1400c1ef0
jmp 0x140023d60
mov rcx, qword [0x1401b0068]
cmp rcx, 0xffffffffffffffff
jne 0x140023e04
mov qword [rsp + 0x28], 0xffffffffffffffff
mov rax, qword [str._9_t_]
mov rcx, rsi
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x140023e22
mov rcx, qword [rsp + 0x28]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x1401b0068], rcx
je 0x140023e04
mov r14, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, r14
mov rax, qword [str.___t_]
mov rdx, rbx
xor r8d, r8d
xor r9d, r9d
call rax
lock dec qword [rdi]
jne 0x140023d60
jmp 0x140023da7
ud2