Function at 0x140046c70
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 rsi, rcx
mov r15, qword [0x14010d158]
lea rdi, [0x14010d120]
xor ebp, ebp
lea r14, [0x14192911c]
jmp 0x140046ca7
mov r15, qword [0x14010d158]
mov r13, r15
and r13, 3
je 0x140046cc0
cmp r13d, 1
je 0x140046ce0
jmp 0x1400471a6
test rsi, rsi
je 0x140046ce0
lea rcx, [r15 + 1]
mov rax, r15
lock cmpxchg qword [0x14010d158], rcx
mov r15, rax
jne 0x140046ca7
jmp 0x1400471c2
lea rbx, [rsp + r13]
add rbx, 0x28
nop dword [rax + rax]
mov ecx, dword [0x14010d138]
test ecx, ecx
je 0x140046d1a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140046d30
mov r12, rax
cmp qword [rax + 8], 0
je 0x140046d30
add r12, 0x10
jmp 0x140046de4
mov rcx, rdi
call fcn.1400e94f0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140046d07
nop
mov ecx, dword [0x14010d138]
test ecx, ecx
je 0x140046d51
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140046d70
cmp rax, 1
jne 0x140046db5
jmp 0x1400472e2
mov rcx, rdi
call fcn.1400e94f0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140046d46
nop word cs:[rax + rax]
movzx eax, byte [0x141934140]
mov edx, 0x18
xor ecx, ecx
call fcn.1400e65f0
test rax, rax
je 0x1400472e2
mov qword [rax], rdi
mov qword [rax + 8], 0
mov ecx, dword [0x14010d138]
test ecx, ecx
je 0x140046ec6
dec ecx
mov rdx, rax
mov r12, rax
call sub.KERNEL32.dll_TlsSetValue
mov rax, r12
lea r12, [rax + 0x10]
mov rcx, qword [rax + 0x10]
cmp qword [rax + 8], 0
mov qword [rax + 8], 1
mov qword [rax + 0x10], 0
je 0x140046ded
test rcx, rcx
je 0x140046ded
lock dec qword [rcx]
jne 0x140046de4
call fcn.1400f7e50
mov rcx, qword [r12]
test rcx, rcx
jne 0x140046e5e
movzx eax, byte [0x141934140]
mov edx, 0x30
xor ecx, ecx
call fcn.1400e65f0
test rax, rax
je 0x1400472e2
mov rcx, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x141934118]
nop word [rax + rax]
mov rdx, rax
inc rdx
je 0x1400472e2
lock cmpxchg qword [0x141934118], rdx
jne 0x140046e30
mov qword [rcx + 0x10], rdx
mov byte [rcx + 0x28], 0
cmp qword [r12], 0
jne 0x1400472e2
mov qword [r12], rcx
lock inc qword [rcx]
jle 0x1400472e2
mov rax, r15
and rax, 0xfffffffffffffffc
mov qword [rsp + 0x28], rcx
mov byte [rsp + 0x38], 0
mov qword [rsp + 0x30], rax
mov rax, r15
lock cmpxchg qword [0x14010d158], rbx
je 0x140047140
mov r15, rax
and eax, 3
cmp rax, r13
jne 0x140047180
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140046cf0
lock dec qword [rax]
jne 0x140046cf0
mov rcx, qword [rsp + 0x28]
call fcn.1400f7e50
jmp 0x140046cf0
mov rcx, rdi
mov r12, rax
call fcn.1400e94f0
mov ecx, eax
mov rax, r12
jmp 0x140046da7
mov ecx, dword [0x14010d138]
test ecx, ecx
je 0x140046f0a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140046f20
mov r12, rax
cmp qword [rax + 8], 0
je 0x140046f20
add r12, 0x10
jmp 0x140046fd4
mov rcx, rdi
call fcn.1400e94f0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140046ef7
nop
mov ecx, dword [0x14010d138]
test ecx, ecx
je 0x140046f41
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140046f60
cmp rax, 1
jne 0x140046fa5
jmp 0x1400472e2
mov rcx, rdi
call fcn.1400e94f0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140046f36
nop word cs:[rax + rax]
movzx eax, byte [0x141934140]
mov edx, 0x18
xor ecx, ecx
call fcn.1400e65f0
test rax, rax
je 0x1400472e2
mov qword [rax], rdi
mov qword [rax + 8], 0
mov ecx, dword [0x14010d138]
test ecx, ecx
je 0x140047121
dec ecx
mov rdx, rax
mov rbx, rax
call sub.KERNEL32.dll_TlsSetValue
mov rax, rbx
lea r12, [rax + 0x10]
mov rcx, qword [rax + 0x10]
cmp qword [rax + 8], 0
mov qword [rax + 8], 1
mov qword [rax + 0x10], 0
je 0x140046fdd
test rcx, rcx
je 0x140046fdd
lock dec qword [rcx]
jne 0x140046fd4
call fcn.1400f7e50
mov r15, qword [r12]
test r15, r15
jne 0x14004704f
movzx eax, byte [0x141934140]
mov edx, 0x30
xor ecx, ecx
call fcn.1400e65f0
test rax, rax
je 0x1400472e2
mov r15, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x141934118]
nop word [rax + rax]
mov rcx, rax
inc rcx
je 0x1400472e2
lock cmpxchg qword [0x141934118], rcx
jne 0x140047020
mov qword [r15 + 0x10], rcx
mov byte [r15 + 0x28], 0
cmp qword [r12], 0
jne 0x1400472e2
mov qword [r12], r15
lock inc qword [r15]
jle 0x1400472e2
lock dec byte [r15 + 0x28]
je 0x14004708e
lea r12, [r15 + 0x28]
mov rbx, qword [0x141934128]
test rbx, rbx
je 0x1400470a5
mov r8d, 1
mov rcx, r12
mov rdx, r14
mov r9d, 0xffffffff
call rbx
mov al, 1
lock cmpxchg byte [r12], bpl
jne 0x140047070
lock dec qword [r15]
jne 0x140047140
mov rcx, r15
call fcn.1400f7e50
jmp 0x140047140
mov rcx, qword [0x14010d0e8]
cmp rcx, 0xffffffffffffffff
jne 0x1400470fe
mov qword [rsp + 0x40], 0xffffffffffffffff
mov rax, qword [0x14010d140]
lea rcx, [rsp + 0x40]
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x1400472e2
mov rcx, qword [rsp + 0x40]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x14010d0e8], rcx
je 0x1400470fe
mov r13, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, r13
mov rax, qword [0x14010d118]
mov rdx, r12
xor r8d, r8d
xor r9d, r9d
call rax
xor eax, eax
xchg byte [r12], al
lock dec qword [r15]
jne 0x140047140
jmp 0x140047098
mov rcx, rdi
mov rbx, rax
call fcn.1400e94f0
mov ecx, eax
mov rax, rbx
jmp 0x140046f97
movzx eax, byte [rsp + 0x38]
test al, al
je 0x140046ee0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140046ca0
lock dec qword [rax]
jne 0x140046ca0
mov rcx, qword [rsp + 0x28]
call fcn.1400f7e50
jmp 0x140046ca0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x14004719a
lock dec qword [rax]
jne 0x14004719a
mov rcx, qword [rsp + 0x28]
call fcn.1400f7e50
mov r15, qword [0x14010d158]
jmp 0x140046ca7
cmp r13d, 2
jne 0x1400471c0
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x1400471c0
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 0x1400472e2
call rax
mov rcx, qword [rsi + 8]
mov rcx, qword [rcx]
mov byte [rcx], al
mov eax, 2
xchg qword [0x14010d158], rax
mov ecx, eax
and ecx, 3
cmp ecx, 1
jne 0x1400472e2
dec rax
je 0x1400471ac
lea rsi, [rsp + 0x28]
jmp 0x140047228
mov rax, r15
test r15, r15
je 0x1400471ac
mov rdi, qword [rax]
mov r15, qword [rax + 8]
mov qword [rax], 0
test rdi, rdi
je 0x1400472e2
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rdi + 0x28], al
cmp al, 0xff
jne 0x140047261
lea rbx, [rdi + 0x28]
mov rax, qword [0x141934120]
test rax, rax
je 0x140047271
mov rcx, rbx
call rax
lock dec qword [rdi]
jne 0x140047220
mov rcx, rdi
call fcn.1400f7e50
jmp 0x140047220
mov rcx, qword [0x14010d0e8]
cmp rcx, 0xffffffffffffffff
jne 0x1400472c4
mov qword [rsp + 0x28], 0xffffffffffffffff
mov rax, qword [0x14010d140]
mov rcx, rsi
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x1400472e2
mov rcx, qword [rsp + 0x28]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x14010d0e8], rcx
je 0x1400472c4
mov r14, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, r14
mov rax, qword [0x14010d148]
mov rdx, rbx
xor r8d, r8d
xor r9d, r9d
call rax
lock dec qword [rdi]
jne 0x140047220
jmp 0x140047267
ud2