Function at 0x140104590
Capabilities:
Allocate thread local storage
Create thread
Get thread local storage value
Set thread local storage value

Disassembly:
mov qword [rsp + 8], rbx
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x70
movzx ebx, cl
mov r14d, 1
cmp dword [0x14037a2e0], 0xffffffff
jne 0x14010460c
mov rax, qword [0x140385770]
test rax, rax
jne 0x1401045ca
lock cmpxchg qword [0x140385770], r14
je 0x1401045d6
lea rcx, [0x140385770]
call fcn.140107130
cmp dword [0x14037a2e0], 0xffffffff
je 0x1401045fe
xor r15d, r15d
mov rax, r14
lock cmpxchg qword [0x140385770], r15
je 0x14010460f
lea rcx, [0x140385770]
call fcn.1401076f0
jmp 0x14010460f
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x14037a2e0], eax
jmp 0x1401045df
xor r15d, r15d
mov ecx, dword [0x14037a2e0]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
test rax, rax
jne 0x1401046cc
test bl, bl
je 0x1401046cc
mov ecx, 0x98
call fcn.140214368
mov qword [rsp + 0xb0], rax
mov edx, r14d
mov rcx, rax
call fcn.1400ed570
mov rsi, rax
mov qword [rsp + 0x50], rax
mov rdx, rax
mov ecx, dword [0x14037a2e0]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
nop
mov ecx, reloc.SHLWAPI.dll_SHCreateThread
call fcn.140214368
mov qword [rsp + 0xb0], rax
mov rdx, rsi
mov rcx, rax
call fcn.1400ed3a0
nop
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0xb0]
nop
nop
mov qword [rsi + 0x60], rax
mov rcx, rsi
call fcn.1400ee070
mov byte [rsi + 0x92], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov eax, eax
mov qword [rsi + 0x68], rax
mov rax, qword [0x1403855d8]
nop
test rax, rax
jne 0x1401046e4
mov rax, qword [rsi + 0x60]
nop
mov qword [0x1403855d8], rax
mov rax, rsi
mov rbx, qword [rsp + 0xa0]
add rsp, 0x70
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret
mov qword [rsp + 0xa8], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], r15d
lea r9, [rsp + 0xa8]
mov r8, rdi
mov rdx, rbx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov rdi, qword [rsi + 0x60]
nop
mov rbx, qword [rsp + 0xa8]
lea r12, [0x140385760]
mov qword [rsp + 0x58], r12
mov rax, qword [0x140385760]
test rax, rax
jne 0x140104761
lock cmpxchg qword [0x140385760], r14
je 0x140104769
mov rcx, r12
call fcn.140107130
mov byte [rsp + 0x60], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x140385768]
jne 0x1401047a5
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov rax, r14
lock cmpxchg qword [0x140385760], r15
je 0x1401046cc
mov rcx, r12
call fcn.1401076f0
jmp 0x1401046cc
mov qword [rsp + 0xb8], rbx
lea r8, [rsp + 0xb8]
mov rdx, qword [0x140385790]
lea rcx, [0x140385780]
call fcn.140097fe0
mov rax, qword [0x140385780]
test rax, rax
je 0x1401047db
mov eax, dword [rax]
cmp eax, 1
jle 0x1401047ef
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [0x140385780]
call fcn.1400a12d0
mov qword [rsp + 0x40], rdi
lea r8, [rsp + 0x40]
mov rdx, qword [0x1403857a8]
lea rcx, [0x140385798]
call fcn.140097fe0
mov rax, qword [0x140385798]
test rax, rax
je 0x14010481f
mov eax, dword [rax]
cmp eax, 1
jle 0x140104833
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [0x140385798]
call fcn.1400a12d0
cmp dword [0x140385768], 0
jne 0x1401048a2
cmp qword [0x1403857b0], 0
jne 0x140104875
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [0x1403857b0], rax
mov qword [rsp + 0x48], rax
lea r8, [rsp + 0x48]
xor edx, edx
lea rcx, [0x140385780]
call fcn.140097fe0
lea rax, [0x140385768]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], r15d
xor r9d, r9d
lea r8, [0x140104ae0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, rax
jmp 0x14010477f
mov rcx, qword [0x1403857b0]
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x140104786