Function at 0x140045db0
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, [0x14010a0a8]
xor ebx, ebx
lea rbp, [0x14016e798]
jmp 0x140045df3
mov rdi, qword [rsi]
mov r14, rdi
and r14, 3
je 0x140045e10
cmp r14d, 1
je 0x140045e30
jmp 0x140046202
cmp qword [rsp + 0x48], 0
je 0x140045e30
lea rcx, [rdi + 1]
mov rax, rdi
lock cmpxchg qword [rsi], rcx
mov rdi, rax
jne 0x140045df3
jmp 0x140046222
lea r13, [rsp + r14]
add r13, 0x30
nop dword [rax + rax]
mov ecx, dword [0x14010a0c0]
test ecx, ecx
je 0x140045e89
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140045e65
mov r15, rax
cmp qword [rax + 8], 0
jne 0x140045f40
mov ecx, dword [0x14010a0c0]
test ecx, ecx
je 0x140045ea0
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140045ec0
mov r15, rax
cmp rax, 1
jne 0x140045f02
jmp 0x140046299
mov rcx, r12
call fcn.1400dcb90
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140045e57
jmp 0x140045e65
mov rcx, r12
call fcn.1400dcb90
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140045e7b
nop word cs:[rax + rax]
movzx eax, byte [0x14017a148]
mov edx, 0x18
xor ecx, ecx
call fcn.1400dbb10
test rax, rax
je 0x140046299
mov r15, rax
mov qword [rax], r12
mov qword [rax + 8], 0
mov ecx, dword [0x14010a0c0]
test ecx, ecx
je 0x140045fc9
dec ecx
mov rdx, r15
call fcn.140107c40
mov rcx, qword [r15 + 8]
mov rax, qword [r15 + 0x10]
mov qword [rsp + 0x20], rcx
mov qword [rsp + 0x28], rax
mov qword [r15 + 8], 1
mov qword [r15 + 0x10], 0
test rcx, rcx
je 0x140045f40
test rax, rax
je 0x140045f40
lock dec qword [rax]
jne 0x140045f40
lea rcx, [rsp + 0x28]
call fcn.1400e6c90
nop
add r15, 0x10
mov rax, qword [r15]
test rax, rax
je 0x140045fac
lock inc qword [rax]
jle 0x140046299
mov rcx, rdi
and rcx, 0xfffffffffffffffc
mov qword [rsp + 0x30], rax
mov byte [rsp + 0x40], 0
mov qword [rsp + 0x38], rcx
mov rax, rdi
lock cmpxchg qword [rsi], r13
je 0x140045fe0
mov rdi, rax
and eax, 3
cmp rax, r14
jne 0x1400461e0
mov rax, qword [rsp + 0x30]
test rax, rax
je 0x140045e40
lock dec qword [rax]
jne 0x140045e40
mov rcx, qword [rsp + 0x30]
call fcn.14004b270
jmp 0x140045e40
call fcn.1400e21f0
cmp qword [r15], 0
jne 0x140046299
mov qword [r15], rax
lock inc qword [rax]
jg 0x140045f56
jmp 0x140046299
mov rcx, r12
call fcn.1400dcb90
mov ecx, eax
jmp 0x140045efa
movzx eax, byte [rsp + 0x40]
test al, al
lea r14, [rsp + 0x20]
je 0x140046029
mov rax, qword [rsp + 0x30]
test rax, rax
je 0x140045df0
lock dec qword [rax]
jne 0x140045df0
mov rcx, qword [rsp + 0x30]
call fcn.14004b270
jmp 0x140045df0
movzx eax, byte [rsp + 0x40]
test al, al
jne 0x140045fee
mov ecx, dword [0x14010a0c0]
test ecx, ecx
je 0x14004606c
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x14004604b
cmp qword [rax + 8], 0
jne 0x140046130
mov ecx, dword [0x14010a0c0]
test ecx, ecx
je 0x140046083
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x1400460a0
cmp rax, 1
jne 0x1400460e5
jmp 0x140046299
mov rcx, r12
call fcn.1400dcb90
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140046040
jmp 0x14004604b
mov rcx, r12
call fcn.1400dcb90
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140046061
nop word [rax + rax]
movzx eax, byte [0x14017a148]
mov edx, 0x18
xor ecx, ecx
call fcn.1400dbb10
test rax, rax
je 0x140046299
mov qword [rax], r12
mov qword [rax + 8], 0
mov ecx, dword [0x14010a0c0]
test ecx, ecx
je 0x1400461c2
dec ecx
mov rdx, rax
mov rdi, rax
call fcn.140107c40
mov rax, rdi
mov rdx, qword [rax + 8]
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0x20], rdx
mov qword [rsp + 0x28], rcx
mov qword [rax + 8], 1
mov qword [rax + 0x10], 0
test rdx, rdx
je 0x140046130
test rcx, rcx
je 0x140046130
lock dec qword [rcx]
jne 0x140046130
lea rcx, [rsp + 0x28]
mov rdi, rax
call fcn.1400e6c90
mov rax, rdi
nop word [rax + rax]
add rax, 0x10
mov rdi, qword [rax]
test rdi, rdi
je 0x140046197
lock inc qword [rdi]
jle 0x140046299
mov qword [rsp + 0x20], rdi
lock dec byte [rdi + 0x28]
je 0x140046180
lea r15, [rdi + 0x28]
nop word cs:[rax + rax]
mov r8d, 1
mov rcx, r15
mov rdx, rbp
mov r9d, 0xffffffff
call sub.api_ms_win_core_synch_l1_2_0.dll_WaitOnAddress
mov al, 1
lock cmpxchg byte [r15], bl
jne 0x140046160
lock dec qword [rdi]
jne 0x140046020
mov rcx, r14
call fcn.1400e6c90
jmp 0x140046020
mov r14, rax
call fcn.1400e21f0
cmp qword [r14], 0
jne 0x140046299
mov rdi, rax
mov rax, r14
mov qword [r14], rdi
lea r14, [rsp + 0x20]
lock inc qword [rdi]
jg 0x140046146
jmp 0x140046299
mov rcx, r12
mov rdi, rax
call fcn.1400dcb90
mov ecx, eax
mov rax, rdi
jmp 0x1400460d7
mov rax, qword [rsp + 0x30]
test rax, rax
je 0x1400461fa
lock dec qword [rax]
jne 0x1400461fa
mov rcx, qword [rsp + 0x30]
call fcn.14004b270
mov rdi, qword [rsi]
jmp 0x140045df3
cmp r14d, 2
jne 0x140046220
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x140046220
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 0x140046299
dec rax
jne 0x140046258
jmp 0x140046208
mov rax, rdi
test rdi, rdi
je 0x140046208
mov rsi, qword [rax]
mov rdi, qword [rax + 8]
mov qword [rax], 0
test rsi, rsi
je 0x140046299
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rsi + 0x28], al
cmp al, 0xff
je 0x140046280
lock dec qword [rsi]
jne 0x140046250
jmp 0x14004628f
lea rcx, [rsi + 0x28]
call fcn.140107f78
lock dec qword [rsi]
jne 0x140046250
mov rcx, rsi
call fcn.14004b270
jmp 0x140046250
ud2