Function at 0x14005eeb0
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 + 0x48], r8
mov qword [rsp + 0x40], rdx
mov qword [rsp + 0x20], rcx
mov r13, qword [rcx]
xor r15d, r15d
lea r12, [0x141a7aaf0]
jmp 0x14005eee8
mov rax, qword [rsp + 0x20]
mov r13, qword [rax]
mov r14, r13
and r14, 3
je 0x14005ef00
cmp r14d, 1
je 0x14005ef30
jmp 0x14005f35e
cmp qword [rsp + 0x40], 0
je 0x14005ef30
lea rcx, [r13 + 1]
mov rax, r13
mov rdx, qword [rsp + 0x20]
lock cmpxchg qword [rdx], rcx
mov r13, rax
jne 0x14005eee8
jmp 0x14005f382
lea rsi, [rsp + r14]
add rsi, 0x28
nop dword [rax + rax]
mov ecx, dword [0x140212150]
test ecx, ecx
je 0x14005ef63
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
jbe 0x14005ef80
mov rbp, rax
add rbp, 8
jmp 0x14005f020
lea rcx, [0x140212138]
call fcn.140149310
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
ja 0x14005ef57
nop dword [rax]
je 0x14005f3f9
movzx eax, byte [0x141af8129]
mov edx, 0x10
xor ecx, ecx
call fcn.140146820
test rax, rax
je 0x14005f3f9
mov rbp, rax
mov rbx, rax
lea rax, [0x140212138]
mov qword [rbp], rax
mov qword [rbp + 8], 0
mov ecx, dword [0x140212150]
test ecx, ecx
je 0x14005f0ff
dec ecx
call sub.KERNEL32.dll_TlsGetValue
mov rdi, rax
mov ecx, dword [0x140212150]
test ecx, ecx
je 0x14005f112
dec ecx
add rbp, 8
mov rdx, rbx
call sub.KERNEL32.dll_TlsSetValue
test rdi, rdi
je 0x14005f020
mov rax, qword [rdi + 8]
test rax, rax
je 0x14005f00f
lock dec qword [rax]
jne 0x14005f00f
mov rcx, rdi
add rcx, 8
call fcn.140156d30
mov rcx, qword [0x141af8068]
xor edx, edx
mov r8, rdi
call sub.KERNEL32.dll_HeapFree
mov rcx, qword [rbp]
test rcx, rcx
jne 0x14005f09e
movzx eax, byte [0x141af8129]
mov edx, 0x38
xor ecx, ecx
call fcn.140146820
test rax, rax
je 0x14005f3f9
mov rcx, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x10], 2
mov rax, qword [0x141af8080]
nop word cs:[rax + rax]
mov rdx, rax
inc rdx
je 0x14005f3f9
lock cmpxchg qword [0x141af8080], rdx
jne 0x14005f070
mov qword [rcx + 0x28], rdx
mov byte [rcx + 0x30], 0
cmp qword [rbp], 0
jne 0x14005f3f9
mov qword [rbp], rcx
lock inc qword [rcx]
jle 0x14005f3f9
mov rax, r13
and rax, 0xfffffffffffffffc
mov qword [rsp + 0x28], rcx
mov byte [rsp + 0x38], 0
mov qword [rsp + 0x30], rax
mov rax, r13
mov rcx, qword [rsp + 0x20]
lock cmpxchg qword [rcx], rsi
je 0x14005f130
mov r13, rax
and eax, 3
cmp rax, r14
jne 0x14005f13e
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x14005ef40
lock dec qword [rax]
jne 0x14005ef40
mov rcx, qword [rsp + 0x28]
call fcn.1401667a0
jmp 0x14005ef40
lea rcx, [0x140212138]
call fcn.140149310
mov ecx, eax
jmp 0x14005efcb
lea rcx, [0x140212138]
call fcn.140149310
mov ecx, eax
jmp 0x14005efe3
movzx eax, byte [rsp + 0x38]
test al, al
lea rsi, [rsp + 0x50]
je 0x14005f179
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x14005eee0
lock dec qword [rax]
jne 0x14005eee0
mov rcx, qword [rsp + 0x28]
call fcn.1401667a0
jmp 0x14005eee0
movzx eax, byte [rsp + 0x38]
test al, al
jne 0x14005f13e
mov ecx, dword [0x140212150]
test ecx, ecx
je 0x14005f19c
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
jbe 0x14005f1c0
mov r13, rax
add r13, 8
jmp 0x14005f260
lea rcx, [0x140212138]
call fcn.140149310
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
ja 0x14005f190
nop word cs:[rax + rax]
je 0x14005f3f9
movzx eax, byte [0x141af8129]
mov edx, 0x10
xor ecx, ecx
call fcn.140146820
test rax, rax
je 0x14005f3f9
mov r13, rax
mov rbx, rax
lea rax, [0x140212138]
mov qword [r13], rax
mov qword [r13 + 8], 0
mov ecx, dword [0x140212150]
test ecx, ecx
je 0x14005f338
dec ecx
call sub.KERNEL32.dll_TlsGetValue
mov rdi, rax
mov ecx, dword [0x140212150]
test ecx, ecx
je 0x14005f34b
dec ecx
add r13, 8
mov rdx, rbx
call sub.KERNEL32.dll_TlsSetValue
test rdi, rdi
je 0x14005f260
mov rax, qword [rdi + 8]
test rax, rax
je 0x14005f24f
lock dec qword [rax]
jne 0x14005f24f
mov rcx, rdi
add rcx, 8
call fcn.140156d30
mov rcx, qword [0x141af8068]
xor edx, edx
mov r8, rdi
call sub.KERNEL32.dll_HeapFree
mov rbp, qword [r13]
test rbp, rbp
jne 0x14005f2de
movzx eax, byte [0x141af8129]
mov edx, 0x38
xor ecx, ecx
call fcn.140146820
test rax, rax
je 0x14005f3f9
mov rbp, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x10], 2
mov rax, qword [0x141af8080]
nop word cs:[rax + rax]
mov rcx, rax
inc rcx
je 0x14005f3f9
lock cmpxchg qword [0x141af8080], rcx
jne 0x14005f2b0
mov qword [rbp + 0x28], rcx
mov byte [rbp + 0x30], 0
cmp qword [r13], 0
jne 0x14005f3f9
mov qword [r13], rbp
lock inc qword [rbp]
jle 0x14005f3f9
mov qword [rsp + 0x50], rbp
lock dec byte [rbp + 0x30]
je 0x14005f320
lea rdi, [rbp + 0x30]
nop dword [rax + rax]
mov r8d, 1
mov rcx, rdi
mov rdx, r12
mov r9d, 0xffffffff
call sub.api_ms_win_core_synch_l1_2_0.dll_WaitOnAddress
mov al, 1
lock cmpxchg byte [rdi], r15b
jne 0x14005f300
lock dec qword [rbp]
jne 0x14005f170
mov rcx, rsi
call fcn.140156d30
jmp 0x14005f170
lea rcx, [0x140212138]
call fcn.140149310
mov ecx, eax
jmp 0x14005f20b
lea rcx, [0x140212138]
call fcn.140149310
mov ecx, eax
jmp 0x14005f223
cmp r14d, 2
jne 0x14005f380
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x14005f380
mov rcx, qword [rsp + 0x40]
mov rax, qword [rsp + 0x48]
call qword [rax + 0x20]
movzx eax, al
add eax, eax
mov rcx, qword [rsp + 0x20]
xchg qword [rcx], rax
mov ecx, eax
and ecx, 3
cmp ecx, 1
jne 0x14005f3f9
dec rax
jne 0x14005f3b8
jmp 0x14005f364
mov rax, rdi
test rdi, rdi
je 0x14005f364
mov rsi, qword [rax]
mov rdi, qword [rax + 8]
mov qword [rax], 0
test rsi, rsi
je 0x14005f3f9
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rsi + 0x30], al
cmp al, 0xff
je 0x14005f3e0
lock dec qword [rsi]
jne 0x14005f3b0
jmp 0x14005f3ef
lea rcx, [rsi + 0x30]
call fcn.1401e62f0
lock dec qword [rsi]
jne 0x14005f3b0
mov rcx, rsi
call fcn.1401667a0
jmp 0x14005f3b0
ud2