Function at 0x1400239e0
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, [0x1401db004]
jmp 0x140023a13
mov r13, qword [rsi]
mov rbx, r13
and rbx, 3
je 0x140023a30
cmp ebx, 1
je 0x140023a50
jmp 0x140023f52
cmp qword [rsp + 0x40], 0
je 0x140023a50
lea rcx, [r13 + 1]
mov rax, r13
lock cmpxchg qword [rsi], rcx
mov r13, rax
jne 0x140023a13
jmp 0x140023f72
lea r14, [rsp + rbx]
add r14, 0x28
nop dword [rax + rax]
mov ecx, dword [0x1401b50d8]
test ecx, ecx
je 0x140023a8a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140023ab0
mov rbp, rax
cmp qword [rax + 8], 0
je 0x140023ab0
add rbp, 0x10
jmp 0x140023b68
lea rcx, str._y_b_
call fcn.14008e730
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140023a77
nop word cs:[rax + rax]
mov ecx, dword [0x1401b50d8]
test ecx, ecx
je 0x140023ad4
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140023af0
mov rdi, rax
cmp rax, 1
jne 0x140023b39
jmp 0x140024072
lea rcx, str._y_b_
call fcn.14008e730
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140023ac6
nop dword [rax]
movzx eax, byte [0x140259141]
mov edx, 0x18
xor ecx, ecx
call fcn.14008b700
test rax, rax
je 0x140024072
mov rdi, rax
lea rax, str._y_b_
mov qword [rdi], rax
mov qword [rdi + 8], 0
mov ecx, dword [0x1401b50d8]
test ecx, ecx
je 0x140023c42
dec ecx
mov rdx, rdi
call fcn.140114e38
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 0x140023b71
test rcx, rcx
je 0x140023b71
lock dec qword [rcx]
jne 0x140023b68
call fcn.1400293e0
mov rcx, qword [rbp]
test rcx, rcx
jne 0x140023bde
movzx eax, byte [0x140259141]
mov edx, 0x30
xor ecx, ecx
call fcn.14008b700
test rax, rax
je 0x140024072
mov rcx, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x140259108]
nop
mov rdx, rax
inc rdx
je 0x140024072
lock cmpxchg qword [0x140259108], rdx
jne 0x140023bb0
mov qword [rcx + 0x10], rdx
mov byte [rcx + 0x28], 0
cmp qword [rbp], 0
jne 0x140024072
mov qword [rbp], rcx
lock inc qword [rcx]
jle 0x140024072
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 0x140023ef0
mov r13, rax
and eax, 3
cmp rax, rbx
jne 0x140023f30
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140023a60
lock dec qword [rax]
jne 0x140023a60
mov rcx, qword [rsp + 0x28]
call fcn.1400293e0
jmp 0x140023a60
lea rcx, str._y_b_
call fcn.14008e730
mov ecx, eax
jmp 0x140023b31
mov ecx, dword [0x1401b50d8]
test ecx, ecx
je 0x140023c8a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140023cb0
mov rbp, rax
cmp qword [rax + 8], 0
je 0x140023cb0
add rbp, 0x10
jmp 0x140023d6b
lea rcx, str._y_b_
call fcn.14008e730
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140023c77
nop word cs:[rax + rax]
mov ecx, dword [0x1401b50d8]
test ecx, ecx
je 0x140023cd1
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140023cf0
cmp rax, 1
jne 0x140023d3c
jmp 0x140024072
lea rcx, str._y_b_
call fcn.14008e730
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140023cc6
nop dword [rax]
movzx eax, byte [0x140259141]
mov edx, 0x18
xor ecx, ecx
call fcn.14008b700
test rax, rax
je 0x140024072
lea rcx, str._y_b_
mov qword [rax], rcx
mov qword [rax + 8], 0
mov ecx, dword [0x1401b50d8]
test ecx, ecx
je 0x140023ed2
dec ecx
mov rdx, rax
mov rdi, rax
call fcn.140114e38
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 0x140023d74
test rcx, rcx
je 0x140023d74
lock dec qword [rcx]
jne 0x140023d6b
call fcn.1400293e0
mov r13, qword [rbp]
test r13, r13
jne 0x140023def
movzx eax, byte [0x140259141]
mov edx, 0x30
xor ecx, ecx
call fcn.14008b700
test rax, rax
je 0x140024072
mov r13, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x140259108]
nop word cs:[rax + rax]
mov rcx, rax
inc rcx
je 0x140024072
lock cmpxchg qword [0x140259108], rcx
jne 0x140023dc0
mov qword [r13 + 0x10], rcx
mov byte [r13 + 0x28], 0
cmp qword [rbp], 0
jne 0x140024072
mov qword [rbp], r13
lock inc qword [r13]
jle 0x140024072
lock dec byte [r13 + 0x28]
je 0x140023e3e
lea rbp, [r13 + 0x28]
mov rdi, qword [0x140259128]
test rdi, rdi
je 0x140023e56
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 0x140023e20
lock dec qword [r13]
jne 0x140023ef0
mov rcx, r13
call fcn.1400293e0
jmp 0x140023ef0
mov rcx, qword [0x1401b5088]
cmp rcx, 0xffffffffffffffff
jne 0x140023eaf
mov qword [rsp + 0x48], 0xffffffffffffffff
mov rax, qword [0x1401b50e0]
lea rcx, [rsp + 0x48]
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x140024072
mov rcx, qword [rsp + 0x48]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x1401b5088], rcx
je 0x140023eaf
mov rdi, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, rdi
mov rax, qword [0x1401b50b8]
mov rdx, rbp
xor r8d, r8d
xor r9d, r9d
call rax
xor eax, eax
xchg byte [rbp], al
lock dec qword [r13]
jne 0x140023ef0
jmp 0x140023e49
lea rcx, str._y_b_
mov rdi, rax
call fcn.14008e730
mov ecx, eax
mov rax, rdi
jmp 0x140023d2e
movzx eax, byte [rsp + 0x38]
test al, al
je 0x140023c60
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140023a10
lock dec qword [rax]
jne 0x140023a10
mov rcx, qword [rsp + 0x28]
call fcn.1400293e0
jmp 0x140023a10
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140023f4a
lock dec qword [rax]
jne 0x140023f4a
mov rcx, qword [rsp + 0x28]
call fcn.1400293e0
mov r13, qword [rsi]
jmp 0x140023a13
cmp ebx, 2
jne 0x140023f70
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x140023f70
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 0x140024072
dec rax
je 0x140023f57
lea rsi, [rsp + 0x28]
jmp 0x140023fb8
mov rax, r15
test r15, r15
je 0x140023f57
mov rdi, qword [rax]
mov r15, qword [rax + 8]
mov qword [rax], 0
test rdi, rdi
je 0x140024072
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rdi + 0x28], al
cmp al, 0xff
jne 0x140023ff1
lea rbx, [rdi + 0x28]
mov rax, qword [0x140259120]
test rax, rax
je 0x140024001
mov rcx, rbx
call rax
lock dec qword [rdi]
jne 0x140023fb0
mov rcx, rdi
call fcn.1400293e0
jmp 0x140023fb0
mov rcx, qword [0x1401b5088]
cmp rcx, 0xffffffffffffffff
jne 0x140024054
mov qword [rsp + 0x28], 0xffffffffffffffff
mov rax, qword [0x1401b50e0]
mov rcx, rsi
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x140024072
mov rcx, qword [rsp + 0x28]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x1401b5088], rcx
je 0x140024054
mov r14, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, r14
mov rax, qword [0x1401b50e8]
mov rdx, rbx
xor r8d, r8d
xor r9d, r9d
call rax
lock dec qword [rdi]
jne 0x140023fb0
jmp 0x140023ff7
ud2