// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0xe8, %rsp
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x40d0
movl %eax, 0xc(%rsp)
testl %eax, %eax
jns 0xbb5a
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3e29(%rip), %rsi      # 0xf951
leaq 0x3e28(%rip), %rdx      # 0xf957
leaq 0x50(%rsp), %rdi
callq 0x9376
leaq 0x50(%rsp), %rdi
callq 0xa5a4
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xbb5a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x43e0
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movups %xmm0, 0xce(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movw $0x1, 0x70(%rsp)
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8a1f(%rip), %r12      # 0x145c8
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x8ff2
leaq 0x3d8f(%rip), %rsi      # 0xf958
movq %rbx, %rdi
callq 0x47c0
movq 0x8898(%rip), %rsi      # 0x14470
leaq 0x10(%rsp), %rdi
callq 0x47c0
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xbc09
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xbc10
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x72(%rsp), %rdi
movq 0x30(%rsp), %rbx
movl $0x6b, %edx
movq %rbx, %rsi
callq 0x4200
cmpq %r15, %rbx
je 0xbc54
movq 0x40(%rsp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x43e0
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xbc6b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x43e0
movl 0xc(%rsp), %edi
leaq 0x70(%rsp), %rsi
movl $0x6e, %edx
callq 0x4340
testl %eax, %eax
je 0xbd4b
leaq 0x10(%rsp), %rbx
movq %r14, (%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x8ff2
leaq 0x3caf(%rip), %rsi      # 0xf958
movq %rbx, %rdi
callq 0x47c0
movq 0x87b8(%rip), %rsi      # 0x14470
leaq 0x10(%rsp), %rdi
callq 0x47c0
movq %r15, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xbce5
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xbcec
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
callq 0x41d0
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xbd25
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x43e0
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xbd3c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x43e0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x825e(%rip), %rax      # 0x13fb0
movq (%rax), %rdi
callq 0x4420
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
leaq 0xb(%rsp), %r8
movb $0x0, (%r8)
leaq 0x8877(%rip), %rax      # 0x145e8
movb (%rax), %al
xorb $0x1, %al
leaq 0xa(%rsp), %r9
movb %al, (%r9)
leaq -0xa40(%rip), %rsi      # 0xb344
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rcx
callq 0x57c8
movl (%rbx), %ebx
movq 0x81e9(%rip), %rax      # 0x13f88
movq (%rax), %rdi
callq 0x4420
movl %ebx, %edi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xb344
xorl %edi, %edi
callq 0x44a0
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xbe03
movq 0x60(%rsp), %rsi
jmp 0xbdfb
jmp 0xbdd9
cmpq $0x0, 0x30(%rsp)
jne 0xbdde
movq %rax, %rbx
jmp 0xbe03
callq 0x4100
jmp 0xbde9
jmp 0xbde9
jmp 0xbde9
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xbe03
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x4770