Function at 0x1400439b0
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 + 0x40], rdx
mov rsi, rcx
mov r13, qword [rcx]
xor r15d, r15d
lea r12, [0x14017cb8d]
jmp 0x1400439e3
mov r13, qword [rsi]
mov rbx, r13
and rbx, 3
je 0x140043a00
cmp ebx, 1
je 0x140043a20
jmp 0x140043f32
cmp qword [rsp + 0x40], 0
je 0x140043a20
lea rcx, [r13 + 1]
mov rax, r13
lock cmpxchg qword [rsi], rcx
mov r13, rax
jne 0x1400439e3
jmp 0x140043f52
lea r14, [rsp + rbx]
add r14, 0x28
nop dword [rax + rax]
mov ecx, dword [0x1401170e0]
test ecx, ecx
je 0x140043a5a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140043a80
mov rbp, rax
cmp qword [rax + 8], 0
je 0x140043a80
add rbp, 0x10
jmp 0x140043b40
lea rcx, [0x1401170c8]
call fcn.1400f37b0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140043a47
nop word cs:[rax + rax]
mov ecx, dword [0x1401170e0]
test ecx, ecx
je 0x140043ae1
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140043b00
movzx eax, byte [0x140188180]
mov edx, 0x18
xor ecx, ecx
call fcn.1400f2120
test rax, rax
je 0x140044052
mov rdi, rax
lea rax, [0x1401170c8]
mov qword [rdi], rax
mov qword [rdi + 8], 0
mov ecx, dword [0x1401170e0]
test ecx, ecx
je 0x140043c22
dec ecx
mov rdx, rdi
call sub.KERNEL32.dll_TlsSetValue
jmp 0x140043b0d
lea rcx, [0x1401170c8]
call fcn.1400f37b0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140043a96
nop dword [rax]
mov rdi, rax
cmp rax, 1
je 0x140044052
lea rbp, [rdi + 0x10]
mov rcx, qword [rdi + 0x10]
cmp qword [rdi + 8], 0
mov qword [rdi + 8], 1
mov qword [rdi + 0x10], 0
je 0x140043b40
test rcx, rcx
je 0x140043b40
lock dec qword [rcx]
jne 0x140043b40
call fcn.1400484a0
nop dword [rax]
mov rcx, qword [rbp]
test rcx, rcx
jne 0x140043bbe
movzx eax, byte [0x140188180]
mov edx, 0x30
xor ecx, ecx
call fcn.1400f2120
test rax, rax
je 0x140044052
mov rcx, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x140188148]
nop word cs:[rax + rax]
mov rdx, rax
inc rdx
je 0x140044052
lock cmpxchg qword [0x140188148], rdx
jne 0x140043b90
mov qword [rcx + 0x10], rdx
mov byte [rcx + 0x28], 0
cmp qword [rbp], 0
jne 0x140044052
mov qword [rbp], rcx
lock inc qword [rcx]
jle 0x140044052
mov rax, r13
and rax, 0xfffffffffffffffc
mov qword [rsp + 0x28], rcx
mov byte [rsp + 0x38], 0
mov qword [rsp + 0x30], rax
mov rax, r13
lock cmpxchg qword [rsi], r14
je 0x140043ed0
mov r13, rax
and eax, 3
cmp rax, rbx
jne 0x140043f10
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140043a30
lock dec qword [rax]
jne 0x140043a30
mov rcx, qword [rsp + 0x28]
call fcn.1400484a0
jmp 0x140043a30
lea rcx, [0x1401170c8]
call fcn.1400f37b0
mov ecx, eax
jmp 0x140043ad7
mov ecx, dword [0x1401170e0]
test ecx, ecx
je 0x140043c6a
dec ecx
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jb 0x140043c90
mov rbp, rax
cmp qword [rax + 8], 0
je 0x140043c90
add rbp, 0x10
jmp 0x140043d50
lea rcx, [0x1401170c8]
call fcn.1400f37b0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 2
jae 0x140043c57
nop word cs:[rax + rax]
mov ecx, dword [0x1401170e0]
test ecx, ecx
je 0x140043cf1
dec ecx
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
jne 0x140043d10
movzx eax, byte [0x140188180]
mov edx, 0x18
xor ecx, ecx
call fcn.1400f2120
test rax, rax
je 0x140044052
mov rdi, rax
lea rax, [0x1401170c8]
mov qword [rdi], rax
mov qword [rdi + 8], 0
mov ecx, dword [0x1401170e0]
test ecx, ecx
je 0x140043eb2
dec ecx
mov rdx, rdi
call sub.KERNEL32.dll_TlsSetValue
jmp 0x140043d1d
lea rcx, [0x1401170c8]
call fcn.1400f37b0
mov ecx, eax
call sub.KERNEL32.dll_TlsGetValue
test rax, rax
je 0x140043ca6
nop dword [rax]
mov rdi, rax
cmp rax, 1
je 0x140044052
lea rbp, [rdi + 0x10]
mov rcx, qword [rdi + 0x10]
cmp qword [rdi + 8], 0
mov qword [rdi + 8], 1
mov qword [rdi + 0x10], 0
je 0x140043d50
test rcx, rcx
je 0x140043d50
lock dec qword [rcx]
jne 0x140043d50
call fcn.1400484a0
nop dword [rax]
mov r13, qword [rbp]
test r13, r13
jne 0x140043dcf
movzx eax, byte [0x140188180]
mov edx, 0x30
xor ecx, ecx
call fcn.1400f2120
test rax, rax
je 0x140044052
mov r13, rax
mov qword [rax], 1
mov qword [rax + 8], 1
mov qword [rax + 0x18], 0
mov rax, qword [0x140188148]
nop word cs:[rax + rax]
mov rcx, rax
inc rcx
je 0x140044052
lock cmpxchg qword [0x140188148], rcx
jne 0x140043da0
mov qword [r13 + 0x10], rcx
mov byte [r13 + 0x28], 0
cmp qword [rbp], 0
jne 0x140044052
mov qword [rbp], r13
lock inc qword [r13]
jle 0x140044052
lock dec byte [r13 + 0x28]
je 0x140043e1e
lea rbp, [r13 + 0x28]
mov rdi, qword [0x140188160]
test rdi, rdi
je 0x140043e36
nop word cs:[rax + rax]
mov r8d, 1
mov rcx, rbp
mov rdx, r12
mov r9d, 0xffffffff
call rdi
mov al, 1
lock cmpxchg byte [rbp], r15b
jne 0x140043e00
lock dec qword [r13]
jne 0x140043ed0
mov rcx, r13
call fcn.1400484a0
jmp 0x140043ed0
mov rcx, qword [0x1401170f0]
cmp rcx, 0xffffffffffffffff
jne 0x140043e8f
mov qword [rsp + 0x48], 0xffffffffffffffff
mov rax, qword [0x140117128]
lea rcx, [rsp + 0x48]
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x140044052
mov rcx, qword [rsp + 0x48]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x1401170f0], rcx
je 0x140043e8f
mov rdi, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, rdi
mov rax, qword [0x1401170e8]
mov rdx, rbp
xor r8d, r8d
xor r9d, r9d
call rax
xor eax, eax
xchg byte [rbp], al
lock dec qword [r13]
jne 0x140043ed0
jmp 0x140043e29
lea rcx, [0x1401170c8]
call fcn.1400f37b0
mov ecx, eax
jmp 0x140043ce7
movzx eax, byte [rsp + 0x38]
test al, al
je 0x140043c40
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x1400439e0
lock dec qword [rax]
jne 0x1400439e0
mov rcx, qword [rsp + 0x28]
call fcn.1400484a0
jmp 0x1400439e0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140043f2a
lock dec qword [rax]
jne 0x140043f2a
mov rcx, qword [rsp + 0x28]
call fcn.1400484a0
mov r13, qword [rsi]
jmp 0x1400439e3
cmp ebx, 2
jne 0x140043f50
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
jmp 0x140043f50
mov rcx, qword [rsp + 0x40]
mov rax, qword [rsp + 0x50]
call qword [rax + 0x20]
movzx eax, al
add rax, rax
xchg qword [rsi], rax
mov ecx, eax
and ecx, 3
cmp ecx, 1
jne 0x140044052
dec rax
je 0x140043f37
lea rsi, [rsp + 0x28]
jmp 0x140043f98
mov rax, r15
test r15, r15
je 0x140043f37
mov rdi, qword [rax]
mov r15, qword [rax + 8]
mov qword [rax], 0
test rdi, rdi
je 0x140044052
mov byte [rax + 0x10], 1
mov al, 1
xchg byte [rdi + 0x28], al
cmp al, 0xff
jne 0x140043fd1
lea rbx, [rdi + 0x28]
mov rax, qword [0x140188168]
test rax, rax
je 0x140043fe1
mov rcx, rbx
call rax
lock dec qword [rdi]
jne 0x140043f90
mov rcx, rdi
call fcn.1400484a0
jmp 0x140043f90
mov rcx, qword [0x1401170f0]
cmp rcx, 0xffffffffffffffff
jne 0x140044034
mov qword [rsp + 0x28], 0xffffffffffffffff
mov rax, qword [0x140117128]
mov rcx, rsi
mov edx, 0xc0000000
xor r8d, r8d
xor r9d, r9d
call rax
test eax, eax
jne 0x140044052
mov rcx, qword [rsp + 0x28]
mov rax, 0xffffffffffffffff
lock cmpxchg qword [0x1401170f0], rcx
je 0x140044034
mov r14, rax
call sub.KERNEL32.dll_CloseHandle
mov rcx, r14
mov rax, qword [0x140117118]
mov rdx, rbx
xor r8d, r8d
xor r9d, r9d
call rax
lock dec qword [rdi]
jne 0x140043f90
jmp 0x140043fd7
ud2