// File: /workspace/github_cpp_makefile_star2_O3/mniip[P]sandbox/wakeup.cpp
// Function: try_connect()
void try_connect()
{
	int server = socket(AF_UNIX, SOCK_STREAM, 0);
	if(server < 0)
		panic_errno("socket");
	
	struct sockaddr_un addr;
	memset(&addr, 0, sizeof addr);
	addr.sun_family = AF_UNIX;
	strncpy(addr.sun_path, (conf_sockdir + "/socket_" + ident).c_str(), sizeof addr.sun_path - 1);
	if(connect(server, (struct sockaddr *)&addr, sizeof addr))
	{
		unlink((conf_sockdir + "/socket_" + ident).c_str());
		return;
	}

	std::thread feed_in(feed_data, fileno(stdin), server, false, !conf_wakeup);
	feed_data(server, fileno(stdout), false, false);
	exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x40d0
movl %eax, %ebx
movl %eax, 0x2c(%rsp)
testl %eax, %eax
jns 0xb98e
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2ff5(%rip), %rsi      # 0xe951
leaq 0x2ff4(%rip), %rdx      # 0xe957
leaq 0x50(%rsp), %rdi
callq 0x9234
leaq 0x50(%rsp), %rdi
callq 0xa3cc
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xb98e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x43e0
movw $0x0, 0xde(%rsp)
movw $0x1, 0x72(%rsp)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7c19(%rip), %r12      # 0x135c8
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x8eda
leaq 0x2f89(%rip), %rsi      # 0xe958
movq %r14, %rdi
callq 0x47c0
movq 0x7a92(%rip), %rsi      # 0x13470
leaq 0x8(%rsp), %rdi
callq 0x47c0
leaq 0x40(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %r14
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %r14
je 0xba0f
movq %r14, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xba1a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %r13, %r14
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x74(%rsp), %rdi
movl $0x6b, %edx
movq %r14, %rsi
callq 0x4200
cmpq %r13, %r14
je 0xba59
movq 0x40(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x43e0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xba70
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
leaq 0x72(%rsp), %rsi
movl %ebx, %edi
movl $0x6e, %edx
callq 0x4340
testl %eax, %eax
je 0xbb51
leaq 0x8(%rsp), %rbx
movq %r15, (%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x8eda
leaq 0x2eac(%rip), %rsi      # 0xe958
movq %rbx, %rdi
callq 0x47c0
movq 0x79b5(%rip), %rsi      # 0x13470
leaq 0x8(%rsp), %rdi
callq 0x47c0
leaq 0x40(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdi
je 0xbaec
movq %rdi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xbaf5
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rdi
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x41d0
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xbb29
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x43e0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xbb40
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x7458(%rip), %rax      # 0x12fb0
movq (%rax), %rdi
callq 0x4420
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x7(%rsp), %r8
movb $0x0, (%r8)
leaq 0x7a71(%rip), %rax      # 0x135e8
movb (%rax), %al
xorb $0x1, %al
leaq 0x6(%rsp), %r9
movb %al, (%r9)
leaq -0xa12(%rip), %rsi      # 0xb178
leaq 0x30(%rsp), %rdi
leaq 0x2c(%rsp), %rbx
movq %rbx, %rcx
callq 0x57ca
movl (%rbx), %ebx
movq 0x73e3(%rip), %rax      # 0x12f88
movq (%rax), %rdi
callq 0x4420
movl %ebx, %edi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xb178
xorl %edi, %edi
callq 0x44a0
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xbc09
movq 0x60(%rsp), %rsi
jmp 0xbc01
jmp 0xbbdf
cmpq $0x0, 0x30(%rsp)
jne 0xbbe4
movq %rax, %rbx
jmp 0xbc09
callq 0x4100
jmp 0xbbef
jmp 0xbbef
jmp 0xbbef
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xbc09
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x4770