Function at 0x140061bc0
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 + 0x48], rdx
mov rsi, rcx
mov rdi, qword [rcx]
lea r12, [0x140216128]
xor ebx, ebx
lea rbp, [0x141a5cd68]
jmp 0x140061c03
mov rdi, qword [rsi]
mov r14, rdi
and r14, 3
je 0x140061c20
cmp r14d, 1
je 0x140061c40
jmp 0x140061fb2
cmp qword [rsp + 0x48], 0
je 0x140061c40
lea rcx, [rdi + 1]
mov rax, rdi
lock cmpxchg qword [rsi], rcx
mov rdi, rax
jne 0x140061c03
jmp 0x140061fd2
lea r13, [rsp + r14]
add r13, 0x20
nop dword [rax + rax]
mov ecx, dword [0x140216140]
test ecx, ecx
je 0x140061c99
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140061c75
mov r15, rax
cmp qword [rax + 8], 0
jne 0x140061d50
mov ecx, dword [0x140216140]
test ecx, ecx
je 0x140061cb0
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140061cd0
mov r15, rax
cmp rax, 1
jne 0x140061d12
jmp 0x140062049
mov rcx, r12
call fcn.14015aec0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140061c67
jmp 0x140061c75
mov rcx, r12
call fcn.14015aec0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140061c8b
nop word cs:[rax + rax]
movzx eax, byte [0x141ada129]
mov edx, 0x18
xor ecx, ecx
call fcn.14014fee0
test rax, rax
je 0x140062049
mov r15, rax
mov qword [rax], r12
mov qword [rax + 8], 0
mov ecx, dword [0x140216140]
test ecx, ecx
je 0x140061dbf
dec ecx
mov rdx, r15
call sub.KERNEL32.dll_TlsSetValue
mov rcx, qword [r15 + 8]
mov rax, qword [r15 + 0x10]
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x40], rax
mov qword [r15 + 8], 1
mov qword [r15 + 0x10], 0
test rcx, rcx
je 0x140061d50
test rax, rax
je 0x140061d50
lock dec qword [rax]
jne 0x140061d50
lea rcx, [rsp + 0x40]
call fcn.14015b900
nop
add r15, 0x10
mov rcx, r15
call fcn.14015d880
mov rax, qword [r15]
lock inc qword [rax]
jle 0x140062049
mov rcx, rdi
and rcx, 0xfffffffffffffffc
mov qword [rsp + 0x20], rax
mov byte [rsp + 0x30], 0
mov qword [rsp + 0x28], rcx
mov rax, rdi
lock cmpxchg qword [rsi], r13
je 0x140061dd0
mov rdi, rax
and eax, 3
cmp rax, r14
jne 0x140061f90
mov rax, qword [rsp + 0x20]
test rax, rax
je 0x140061c50
lock dec qword [rax]
jne 0x140061c50
mov rcx, qword [rsp + 0x20]
call fcn.1401a5be0
jmp 0x140061c50
mov rcx, r12
call fcn.14015aec0
mov ecx, eax
jmp 0x140061d0a
movzx eax, byte [rsp + 0x30]
test al, al
lea r15, [rsp + 0x38]
je 0x140061e19
mov rax, qword [rsp + 0x20]
test rax, rax
je 0x140061c00
lock dec qword [rax]
jne 0x140061c00
mov rcx, qword [rsp + 0x20]
call fcn.1401a5be0
jmp 0x140061c00
movzx eax, byte [rsp + 0x30]
test al, al
jne 0x140061dde
mov ecx, dword [0x140216140]
test ecx, ecx
je 0x140061e62
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140061e3e
mov rdi, rax
cmp qword [rax + 8], 0
jne 0x140061f10
mov ecx, dword [0x140216140]
test ecx, ecx
je 0x140061e79
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140061e90
mov rdi, rax
cmp rax, 1
jne 0x140061ed2
jmp 0x140062049
mov rcx, r12
call fcn.14015aec0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140061e30
jmp 0x140061e3e
mov rcx, r12
call fcn.14015aec0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140061e54
nop dword [rax]
movzx eax, byte [0x141ada129]
mov edx, 0x18
xor ecx, ecx
call fcn.14014fee0
test rax, rax
je 0x140062049
mov rdi, rax
mov qword [rax], r12
mov qword [rax + 8], 0
mov ecx, dword [0x140216140]
test ecx, ecx
je 0x140061f76
dec ecx
mov rdx, rdi
call sub.KERNEL32.dll_TlsSetValue
mov rcx, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x40], rax
mov qword [rdi + 8], 1
mov qword [rdi + 0x10], 0
test rcx, rcx
je 0x140061f10
test rax, rax
je 0x140061f10
lock dec qword [rax]
jne 0x140061f10
lea rcx, [rsp + 0x40]
call fcn.14015b900
nop
add rdi, 0x10
mov rcx, rdi
call fcn.14015d880
mov r14, qword [rdi]
lock inc qword [r14]
jle 0x140062049
mov qword [rsp + 0x38], r14
lock dec byte [r14 + 0x28]
je 0x140061f5f
lea rdi, [r14 + 0x28]
nop dword [rax]
mov r8d, 1
mov rcx, rdi
mov rdx, rbp
mov r9d, 0xffffffff
call sub.api_ms_win_core_synch_l1_2_0.dll_WaitOnAddress
mov al, 1
lock cmpxchg byte [rdi], bl
jne 0x140061f40
lock dec qword [r14]
jne 0x140061e10
mov rcx, r15
call fcn.14015b900
jmp 0x140061e10
mov rcx, r12
call fcn.14015aec0
mov ecx, eax
jmp 0x140061eca
mov rax, qword [rsp + 0x20]
test rax, rax
je 0x140061faa
lock dec qword [rax]
jne 0x140061faa
mov rcx, qword [rsp + 0x20]
call fcn.1401a5be0
mov rdi, qword [rsi]
jmp 0x140061c03
cmp r14d, 2
jne 0x140061fd0
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x140061fd0
mov rcx, qword [rsp + 0x48]
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 0x140062049
dec rax
jne 0x140062008
jmp 0x140061fb8
mov rax, rdi
test rdi, rdi
je 0x140061fb8
mov rsi, qword [rax]
mov rdi, qword [rax + 8]
mov qword [rax], 0
test rsi, rsi
je 0x140062049
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rsi + 0x28], al
cmp al, 0xff
je 0x140062030
lock dec qword [rsi]
jne 0x140062000
jmp 0x14006203f
lea rcx, [rsi + 0x28]
call fcn.1401f3560
lock dec qword [rsi]
jne 0x140062000
mov rcx, rsi
call fcn.1401a5be0
jmp 0x140062000
ud2