Function at 0x180035e6c
Capabilities:
Allocate thread local storage

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x20
cmp qword [rcx + 0x20], 0xffffffffffffffff
mov rdi, rdx
mov rbx, rcx
jne 0x180035e94
xor al, al
jmp 0x1800360e4
xor esi, esi
xor eax, eax
lock cmpxchg dword [rcx + 0x80], esi
je 0x180035e8d
mov ecx, dword [rcx + 0x7c]
or ebp, 0xffffffff
cmp ecx, ebp
je 0x180035eb2
call qword [sym.imp.KERNEL32.dll_TlsFree]
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [rbx + 0x7c], eax
cmp eax, ebp
je 0x180035e8d
mov rcx, rbx
call fcn.1800363cc
mov rcx, qword [rdi + 0x10]
mov ebp, 8
test rcx, rcx
je 0x180036060
cmp qword [rcx], rsi
je 0x180035f23
mov rcx, qword [rcx]
call qword [sym.imp.msvcrt.dll_wcslen]
mov rcx, qword [rbx + 0x20]
mov edx, ebp
lea r8, [rax + rax + 2]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbx + 0x38], rax
test rax, rax
je 0x180035e8d
mov rcx, qword [rdi + 0x10]
mov rcx, qword [rcx]
call qword [sym.imp.msvcrt.dll_wcslen]
mov rdx, qword [rdi + 0x10]
mov rcx, qword [rbx + 0x38]
mov rdx, qword [rdx]
lea r8, [rax + 1]
call qword [sym.imp.msvcrt.dll_wcsncpy]
mov rax, qword [rdi + 0x10]
mov rcx, qword [rax + 8]
test rcx, rcx
je 0x180035f78
call qword [sym.imp.msvcrt.dll_wcslen]
mov rcx, qword [rbx + 0x20]
mov edx, ebp
lea r8, [rax + rax + 2]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbx + 0x40], rax
test rax, rax
je 0x180035e8d
mov rcx, qword [rdi + 0x10]
mov rcx, qword [rcx + 8]
call qword [sym.imp.msvcrt.dll_wcslen]
mov rdx, qword [rdi + 0x10]
mov rcx, qword [rbx + 0x40]
mov rdx, qword [rdx + 8]
lea r8, [rax + 1]
call qword [sym.imp.msvcrt.dll_wcsncpy]
mov rax, qword [rdi + 0x10]
mov rcx, qword [rax + 0x10]
test rcx, rcx
je 0x180035fcd
call qword [sym.imp.msvcrt.dll_wcslen]
mov rcx, qword [rbx + 0x20]
mov edx, ebp
lea r8, [rax + rax + 2]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbx + 0x48], rax
test rax, rax
je 0x180035e8d
mov rcx, qword [rdi + 0x10]
mov rcx, qword [rcx + 0x10]
call qword [sym.imp.msvcrt.dll_wcslen]
mov rdx, qword [rdi + 0x10]
mov rcx, qword [rbx + 0x48]
mov rdx, qword [rdx + 0x10]
lea r8, [rax + 1]
call qword [sym.imp.msvcrt.dll_wcsncpy]
mov rax, qword [rdi + 0x10]
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x180036022
call qword [sym.imp.msvcrt.dll_wcslen]
mov rcx, qword [rbx + 0x20]
mov edx, ebp
lea r8, [rax + rax + 2]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbx + 0x50], rax
test rax, rax
je 0x180035e8d
mov rcx, qword [rdi + 0x10]
mov rcx, qword [rcx + 0x18]
call qword [sym.imp.msvcrt.dll_wcslen]
mov rdx, qword [rdi + 0x10]
mov rcx, qword [rbx + 0x50]
mov rdx, qword [rdx + 0x18]
lea r8, [rax + 1]
call qword [sym.imp.msvcrt.dll_wcsncpy]
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + 0x20]
mov dword [rbx + 0x58], ecx
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + 0x30]
mov dword [rbx + 0x68], ecx
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + 0x2c]
mov dword [rbx + 0x64], ecx
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + 0x24]
mov dword [rbx + 0x5c], ecx
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + 0x34]
mov dword [rbx + 0x6c], ecx
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + 0x28]
mov dword [rbx + 0x60], ecx
jmp 0x180036070
mov rcx, rbx
call fcn.1800360fc
test al, al
je 0x180035e8d
mov r8, qword [rbx + 0x70]
test r8, r8
je 0x18003608d
mov rcx, qword [rbx + 0x20]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
je 0x18003608d
mov qword [rbx + 0x70], rsi
cmp qword [rbx + 0x40], rsi
je 0x1800360cd
mov rcx, qword [rbx + 0x20]
mov r8d, 0x800
mov edx, ebp
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbx + 0x70], rax
test rax, rax
je 0x180035e8d
mov r9, qword [rbx + 0x40]
lea r8, [0x18003f258]
lea rdx, str._spipe_s
mov rcx, rax
call qword [sym.imp.msvcrt.dll_swprintf]
mov r8, qword [rbx + 0x70]
lea rdx, str.PipeName___s_n
mov ecx, 0xb4
call fcn.180030818
mov al, 1
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
add rsp, 0x20
pop rdi
ret