Function at 0x140058ea8
Capabilities:
Check for time delay via gettickcount
Connect pipe
Create pipe

Disassembly:
mov r11, rsp
mov qword [r11 + 0x10], rbx
mov qword [r11 + 0x18], rbp
mov qword [r11 + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
mov rax, qword [rcx + 0x270]
xor ebx, ebx
mov r12, r9
mov qword [r11 - 0x38], rax
mov r15, r8
mov rax, qword [rcx + 0x278]
mov rdi, rdx
mov qword [r11 - 0x30], rax
mov rsi, rcx
mov dword [r11 + 8], ebx
cmp byte [rcx + 1], bl
jne 0x1400591a0
mov ebp, 0x217
lea r13d, [rbx + 1]
xor r8d, r8d
lea rdx, [rsp + 0x40]
or r9d, 0xffffffff
lea ecx, [r8 + 2]
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov dword [rdi + 0x20], eax
test eax, eax
je 0x1400591a0
cmp byte [rsi + 4], bl
je 0x140058f2e
mov rcx, qword [rdi + 0x48]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov qword [rsi + 0x228], rdi
mov rax, qword [rdi + 8]
add rax, r13
test rax, 0xfffffffffffffffe
jne 0x140058fea
mov al, byte [rsi + 6]
mov r9d, 0xff
neg al
mov r8d, 6
mov al, byte [rsi + 4]
sbb edx, edx
mov dword [rdi + 0x74], 2
and edx, 0xfffffffe
add edx, 3
neg al
mov rax, qword [rsi + 0x230]
sbb ecx, ecx
mov qword [rsp + 0x38], rax
and ecx, 0x40000000
mov dword [rsp + 0x30], ebx
or edx, ecx
mov dword [rsp + 0x28], 0x1000
lea rcx, [rsi + 0xc]
mov dword [rsp + 0x20], 0x1000
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov qword [rdi + 8], rax
mov dword [rdi + 0x74], 3
cmp byte [rsi + 1], bl
jne 0x14005918a
dec rax
cmp rax, 0xfffffffffffffffd
jbe 0x140058fea
call qword [sym.imp.KERNEL32.dll_GetLastError]
xor r9d, r9d
lea r8, str.PipeServerThread:ConnectNamedPipe_failed_with_0x_08X
mov rdx, rdi
mov dword [rdi + 0x1c], eax
mov rcx, rsi
call fcn.140057250
mov ecx, 0xa
mov qword [rdi + 8], rbx
jmp 0x140059085
cmp dword [rsi + 0x260], ebx
jne 0x140059011
mov rax, qword [rsi + 0x250]
test rax, rax
je 0x140059011
mov rdx, qword [rsi + 0x268]
mov rcx, rdi
mov dword [rsi + 0x260], r13d
call rax
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [rdi + 0x74], 4
lea rcx, [rdi + 0x50]
mov al, byte [rsi + 4]
neg al
sbb rdx, rdx
and rdx, rcx
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
mov dword [r15], eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rdi + 0x1c], eax
mov cl, byte [rsi + 4]
test cl, cl
jne 0x140059060
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov cl, byte [rsi + 4]
mov eax, dword [r15]
test cl, cl
je 0x1400590ab
test eax, eax
je 0x1400590a1
xor r9d, r9d
lea r8, str.PipeServerThread:ConnectNamedPipe_failed_with_0x_08X
mov rdx, rdi
mov rcx, rsi
call fcn.140057250
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
jmp 0x140059159
cmp dword [rdi + 0x1c], ebp
mov eax, ebx
sete al
jmp 0x1400590bc
test eax, eax
jne 0x1400590bc
mov eax, ebx
cmp dword [rdi + 0x1c], ebp
jne 0x1400590bc
mov dword [r15], r13d
mov eax, r13d
mov dword [r12], eax
cmp byte [rsi + 1], bl
jne 0x14005918a
cmp byte [rsi + 4], bl
je 0x14005911d
cmp dword [rdi + 0x1c], ebp
jne 0x1400590d8
mov ebp, r13d
jmp 0x1400590ed
lea r8, [rsp + 0x80]
mov rdx, rdi
mov rcx, rsi
call fcn.1400591c0
mov ebp, eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
mov edx, r13d
mov r14d, eax
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
test ebp, ebp
je 0x140059173
cmp ebp, r13d
je 0x140059163
mov ebp, 0x217
jmp 0x140059159
cmp dword [r15], ebx
jne 0x14005917e
mov rcx, qword [rdi + 8]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140059159
mov dword [rdi + 0x74], 0x64
call qword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov rcx, qword [rdi + 8]
mov dword [rdi + 0x74], 0xc8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rdi + 8], rbx
mov dword [rdi + 0x74], 0xc9
cmp byte [rsi + 1], bl
jne 0x1400591a0
jmp 0x140058efe
mov dword [rdi + 0x74], 5
mov bl, r13b
mov dword [r12], r13d
jmp 0x1400591a0
sub eax, r14d
add dword [rdi + 0x30], eax
mov dword [rdi + 0x38], eax
jmp 0x1400591a0
mov bl, r13b
mov dword [rdi + 0x74], 5
jmp 0x1400591a0
cmp byte [rsi + 4], bl
je 0x1400591a0
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
lea r11, [rsp + 0x50]
mov al, bl
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret