Function at 0x140019890
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, 0x48
mov qword [rsp + 0x38], rcx
mov r15, qword [0x140057110]
xor esi, esi
lea r14, [0x1427fc4c8]
jmp 0x1400198c7
mov r15, qword [0x140057110]
mov rbx, r15
and rbx, 3
je 0x1400198e0
cmp ebx, 1
je 0x140019910
jmp 0x140019d66
cmp qword [rsp + 0x38], 0
je 0x140019910
lea rcx, [r15 + 1]
mov rax, r15
lock cmpxchg qword [0x140057110], rcx
mov r15, rax
jne 0x1400198c7
jmp 0x140019d82
lea rdi, [rsp + rbx]
add rdi, 0x20
nop dword [rax + rax]
mov ecx, dword [0x1400570e0]
test ecx, ecx
je 0x140019943
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
jbe 0x140019960
mov r12, rax
add r12, 8
jmp 0x140019a01
lea rcx, [0x1400570c8]
call fcn.140027d80
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
ja 0x140019937
nop dword [rax]
je 0x140019e19
movzx eax, byte [0x142802108]
mov edx, 0x10
xor ecx, ecx
call fcn.1400259b0
test rax, rax
je 0x140019e19
mov r12, rax
mov rbp, rax
lea rax, [0x1400570c8]
mov qword [r12], rax
mov qword [r12 + 8], 0
mov ecx, dword [0x1400570e0]
test ecx, ecx
je 0x140019ae2
dec ecx
call sub.KERNEL32.dll_TlsGetValue
mov r13, rax
mov ecx, dword [0x1400570e0]
test ecx, ecx
je 0x140019af5
dec ecx
add r12, 8
mov rdx, rbp
call sub.KERNEL32.dll_TlsSetValue
test r13, r13
je 0x140019a01
mov rax, qword [r13 + 8]
test rax, rax
je 0x1400199f0
lock dec qword [rax]
jne 0x1400199f0
mov rcx, r13
add rcx, 8
call fcn.140034ff0
mov rcx, qword [0x142802058]
xor edx, edx
mov r8, r13
call sub.KERNEL32.dll_HeapFree
mov rcx, qword [r12]
test rcx, rcx
jne 0x140019a7e
movzx eax, byte [0x142802108]
mov edx, 0x38
xor ecx, ecx
call fcn.1400259b0
test rax, rax
je 0x140019e19
mov rcx, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x10], 2
mov rax, qword [0x142802078]
nop word [rax + rax]
mov rdx, rax
inc rdx
je 0x140019e19
lock cmpxchg qword [0x142802078], rdx
jne 0x140019a50
mov qword [rcx + 0x28], rdx
mov byte [rcx + 0x30], 0
cmp qword [r12], 0
jne 0x140019e19
mov qword [r12], rcx
lock inc qword [rcx]
jle 0x140019e19
mov rax, r15
and rax, 0xfffffffffffffffc
mov qword [rsp + 0x20], rcx
mov byte [rsp + 0x30], 0
mov qword [rsp + 0x28], rax
mov rax, r15
lock cmpxchg qword [0x140057110], rdi
je 0x140019b10
mov r15, rax
and eax, 3
cmp rax, rbx
jne 0x140019d40
mov rax, qword [rsp + 0x20]
test rax, rax
je 0x140019920
lock dec qword [rax]
jne 0x140019920
mov rcx, qword [rsp + 0x20]
call fcn.140019830
jmp 0x140019920
lea rcx, [0x1400570c8]
call fcn.140027d80
mov ecx, eax
jmp 0x1400199ac
lea rcx, [0x1400570c8]
call fcn.140027d80
mov ecx, eax
jmp 0x1400199c4
movzx eax, byte [rsp + 0x30]
test al, al
lea rdi, [rsp + 0x40]
je 0x140019b59
mov rax, qword [rsp + 0x20]
test rax, rax
je 0x1400198c0
lock dec qword [rax]
jne 0x1400198c0
mov rcx, qword [rsp + 0x20]
call fcn.140019830
jmp 0x1400198c0
movzx eax, byte [rsp + 0x30]
test al, al
jne 0x140019b1e
mov ecx, dword [0x1400570e0]
test ecx, ecx
je 0x140019b7c
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
jbe 0x140019ba0
mov r15, rax
add r15, 8
jmp 0x140019c40
lea rcx, [0x1400570c8]
call fcn.140027d80
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
ja 0x140019b70
nop word cs:[rax + rax]
je 0x140019e19
movzx eax, byte [0x142802108]
mov edx, 0x10
xor ecx, ecx
call fcn.1400259b0
test rax, rax
je 0x140019e19
mov r15, rax
mov r13, rax
lea rax, [0x1400570c8]
mov qword [r15], rax
mov qword [r15 + 8], 0
mov ecx, dword [0x1400570e0]
test ecx, ecx
je 0x140019d18
dec ecx
call sub.KERNEL32.dll_TlsGetValue
mov r12, rax
mov ecx, dword [0x1400570e0]
test ecx, ecx
je 0x140019d2b
dec ecx
add r15, 8
mov rdx, r13
call sub.KERNEL32.dll_TlsSetValue
test r12, r12
je 0x140019c40
mov rax, qword [r12 + 8]
test rax, rax
je 0x140019c2f
lock dec qword [rax]
jne 0x140019c2f
mov rcx, r12
add rcx, 8
call fcn.140034ff0
mov rcx, qword [0x142802058]
xor edx, edx
mov r8, r12
call sub.KERNEL32.dll_HeapFree
mov r12, qword [r15]
test r12, r12
jne 0x140019cbf
movzx eax, byte [0x142802108]
mov edx, 0x38
xor ecx, ecx
call fcn.1400259b0
test rax, rax
je 0x140019e19
mov r12, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x10], 2
mov rax, qword [0x142802078]
nop word cs:[rax + rax]
mov rcx, rax
inc rcx
je 0x140019e19
lock cmpxchg qword [0x142802078], rcx
jne 0x140019c90
mov qword [r12 + 0x28], rcx
mov byte [r12 + 0x30], 0
cmp qword [r15], 0
jne 0x140019e19
mov qword [r15], r12
lock inc qword [r12]
jle 0x140019e19
mov qword [rsp + 0x40], r12
lock dec byte [r12 + 0x30]
je 0x140019d00
lea r15, [r12 + 0x30]
nop dword [rax]
mov r8d, 1
mov rcx, r15
mov rdx, r14
mov r9d, 0xffffffff
call sub.api_ms_win_core_synch_l1_2_0.dll_WaitOnAddress
mov al, 1
lock cmpxchg byte [r15], sil
jne 0x140019ce0
lock dec qword [r12]
jne 0x140019b50
mov rcx, rdi
call fcn.140034ff0
jmp 0x140019b50
lea rcx, [0x1400570c8]
call fcn.140027d80
mov ecx, eax
jmp 0x140019bea
lea rcx, [0x1400570c8]
call fcn.140027d80
mov ecx, eax
jmp 0x140019c02
mov rax, qword [rsp + 0x20]
test rax, rax
je 0x140019d5a
lock dec qword [rax]
jne 0x140019d5a
mov rcx, qword [rsp + 0x20]
call fcn.140019830
mov r15, qword [0x140057110]
jmp 0x1400198c7
cmp ebx, 2
jne 0x140019d80
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x140019d80
mov rsi, qword [rsp + 0x38]
mov rax, qword [rsi]
mov rcx, qword [rax]
mov qword [rax], 0
mov rax, qword [rcx + 0x10]
mov qword [rcx + 0x10], 0
test rax, rax
je 0x140019e19
call rax
mov rcx, qword [rsi + 8]
mov rcx, qword [rcx]
mov byte [rcx], al
mov eax, 2
xchg qword [0x140057110], rax
mov ecx, eax
and ecx, 3
cmp ecx, 1
jne 0x140019e19
dec rax
jne 0x140019dd8
jmp 0x140019d6b
mov rax, rdi
test rdi, rdi
je 0x140019d6b
mov rsi, qword [rax]
mov rdi, qword [rax + 8]
mov qword [rax], 0
test rsi, rsi
je 0x140019e19
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rsi + 0x30], al
cmp al, 0xff
je 0x140019e00
lock dec qword [rsi]
jne 0x140019dd0
jmp 0x140019e0f
lea rcx, [rsi + 0x30]
call sub.api_ms_win_core_synch_l1_2_0.dll_WakeByAddressSingle
lock dec qword [rsi]
jne 0x140019dd0
mov rcx, rsi
call fcn.140019830
jmp 0x140019dd0
ud2