// File: /workspace/github_c_makefile_star2_O0/alexgirao[P]aimant/subprocess.c
// Function: selfpipe_setup
static int selfpipe_setup()
{
	int r;
	static struct sigaction act;
	static struct sigaction pip;

	if (selfpipe[0] != -1) {
		/* already initialized
		 */
		DEBUG_INFO("selfpipe already setup");
		return 0;
	}

	/* check if there is a signal already installed
	 */

	{
		struct sigaction old;
		memset(&old, 0, sizeof(old));
		sigaction(SIGCHLD, NULL, &old);
		assert(old.sa_sigaction == NULL);
	}

	/* setup
	 */

	if ((r = xpipe(selfpipe))) {
		int save_errno = errno;
		assert(r == -1);
		DEBUG("pipe(selfpipe), errno=%i", save_errno);
		errno = save_errno;
		perror("pipe(selfpipe)");
		abort();
	}

	assert(make_fd_non_blocking(selfpipe[0]) == 0);
	assert(make_fd_non_blocking(selfpipe[1]) == 0);

	/* SIGCHLD signal handling
	 */

	memset(&act, 0, sizeof(act));
	sigemptyset(&act.sa_mask);
	act.sa_sigaction = sigaction_SIGCHLD;
	act.sa_flags = SA_SIGINFO;
	assert(sigaction(SIGCHLD, &act, NULL) == 0);

	/* SIGPIPE signal handling
	 */

	memset(&pip, 0, sizeof(pip));
	sigemptyset(&pip.sa_mask);
	pip.sa_handler = SIG_IGN;
	assert(sigaction(SIGPIPE, &pip, NULL) == 0);

	/* sigset_SIGCHLD
	 */

	assert(sigemptyset(sigset_SIGCHLD) == 0);
	assert(sigaddset(sigset_SIGCHLD, SIGCHLD) == 0);

	/*
	 */

	subprocesses = children_new0();
	assert(subprocesses);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
cmpl $-0x1, 0xb4d6(%rip)     # 0x16718
je 0xb250
movl $0x0, -0x4(%rbp)
jmp 0xb524
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x21c0
movl $0x11, %edi
xorl %eax, %eax
movl %eax, %esi
leaq -0xa0(%rbp), %rdx
callq 0x20c0
cmpq $0x0, -0xa0(%rbp)
jne 0xb284
jmp 0xb2a3
leaq 0x6664(%rip), %rdi      # 0x118ef
leaq 0x5d06(%rip), %rsi      # 0x10f98
movl $0x13b, %edx            # imm = 0x13B
leaq 0x666a(%rip), %rcx      # 0x11908
callq 0x21a0
leaq 0xb46e(%rip), %rdi      # 0x16718
callq 0x9ca0
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
je 0xb33b
callq 0x2070
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
cmpl $-0x1, -0x8(%rbp)
jne 0xb2d0
jmp 0xb2ef
leaq 0x689e(%rip), %rdi      # 0x11b75
leaq 0x5cba(%rip), %rsi      # 0x10f98
movl $0x143, %edx            # imm = 0x143
leaq 0x661e(%rip), %rcx      # 0x11908
callq 0x21a0
jmp 0xb2f1
movl -0xa4(%rbp), %ecx
leaq 0x5c9a(%rip), %rdi      # 0x10f98
movl $0x144, %esi            # imm = 0x144
leaq 0x6613(%rip), %rdx      # 0x1191d
movb $0x0, %al
callq 0xdfe0
movl -0xa4(%rbp), %eax
movl %eax, -0xa8(%rbp)
callq 0x2070
movl -0xa8(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x6605(%rip), %rdi      # 0x11936
callq 0x2310
callq 0x2060
movl 0xb3d7(%rip), %edi      # 0x16718
callq 0x6d50
cmpl $0x0, %eax
jne 0xb34d
jmp 0xb36c
leaq 0x65f1(%rip), %rdi      # 0x11945
leaq 0x5c3d(%rip), %rsi      # 0x10f98
movl $0x14a, %edx            # imm = 0x14A
leaq 0x65a1(%rip), %rcx      # 0x11908
callq 0x21a0
movl 0xb3aa(%rip), %edi      # 0x1671c
callq 0x6d50
cmpl $0x0, %eax
jne 0xb37e
jmp 0xb39d
leaq 0x65e7(%rip), %rdi      # 0x1196c
leaq 0x5c0c(%rip), %rsi      # 0x10f98
movl $0x14b, %edx            # imm = 0x14B
leaq 0x6570(%rip), %rcx      # 0x11908
callq 0x21a0
leaq 0xb474(%rip), %rdi      # 0x16818
xorl %esi, %esi
movl $0x98, %edx
callq 0x21c0
leaq 0xb461(%rip), %rdi      # 0x16818
addq $0x8, %rdi
callq 0x2240
leaq 0x169(%rip), %rax       # 0xb530
movq %rax, 0xb44a(%rip)      # 0x16818
movl $0x4, 0xb4c8(%rip)      # 0x168a0
movl $0x11, %edi
leaq 0xb434(%rip), %rsi      # 0x16818
xorl %eax, %eax
movl %eax, %edx
callq 0x20c0
cmpl $0x0, %eax
jne 0xb3f4
jmp 0xb413
leaq 0x6598(%rip), %rdi      # 0x11993
leaq 0x5b96(%rip), %rsi      # 0x10f98
movl $0x154, %edx            # imm = 0x154
leaq 0x64fa(%rip), %rcx      # 0x11908
callq 0x21a0
leaq 0xb496(%rip), %rdi      # 0x168b0
xorl %esi, %esi
movl $0x98, %edx
callq 0x21c0
leaq 0xb483(%rip), %rdi      # 0x168b0
addq $0x8, %rdi
callq 0x2240
movl $0x1, %eax
movq %rax, 0xb46e(%rip)      # 0x168b0
movl $0xd, %edi
leaq 0xb462(%rip), %rsi      # 0x168b0
xorl %eax, %eax
movl %eax, %edx
callq 0x20c0
cmpl $0x0, %eax
jne 0xb45e
jmp 0xb47d
leaq 0x6552(%rip), %rdi      # 0x119b7
leaq 0x5b2c(%rip), %rsi      # 0x10f98
movl $0x15c, %edx            # imm = 0x15C
leaq 0x6490(%rip), %rcx      # 0x11908
callq 0x21a0
leaq 0xb30c(%rip), %rdi      # 0x16790
callq 0x2240
cmpl $0x0, %eax
jne 0xb490
jmp 0xb4af
leaq 0x6544(%rip), %rdi      # 0x119db
leaq 0x5afa(%rip), %rsi      # 0x10f98
movl $0x161, %edx            # imm = 0x161
leaq 0x645e(%rip), %rcx      # 0x11908
callq 0x21a0
leaq 0xb2da(%rip), %rdi      # 0x16790
movl $0x11, %esi
callq 0x2370
cmpl $0x0, %eax
jne 0xb4c7
jmp 0xb4e6
leaq 0x652e(%rip), %rdi      # 0x119fc
leaq 0x5ac3(%rip), %rsi      # 0x10f98
movl $0x162, %edx            # imm = 0x162
leaq 0x6427(%rip), %rcx      # 0x11908
callq 0x21a0
callq 0x8da0
movq %rax, 0xb31e(%rip)      # 0x16810
cmpq $0x0, 0xb316(%rip)      # 0x16810
je 0xb4fe
jmp 0xb51d
leaq 0x651f(%rip), %rdi      # 0x11a24
leaq 0x5a8c(%rip), %rsi      # 0x10f98
movl $0x168, %edx            # imm = 0x168
leaq 0x63f0(%rip), %rcx      # 0x11908
callq 0x21a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq