// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/walk.c
// Function: dopipe
static void dopipe(Node *n) {
	int i, j, sp, pid, fd_prev, fd_out, pids[MAX_PIPELINE], p[2];
	bool intr;
	Node *r;
	struct termios t;

	if (interactive)
		tcgetattr(0, &t);
	fd_prev = fd_out = 1;
	for (r = n, i = 0; r != NULL && r->type == nPipe; r = r->u[2].p, i++) {
		if (i + 1 >= MAX_PIPELINE)
			rc_error("pipe too long");
		if (pipe(p) < 0) {
			uerror("pipe");
			rc_error(NULL);
		}
		if ((pid = rc_fork()) == 0) {
			setsigdefaults(FALSE);
			redirq = NULL; /* clear preredir queue */
			mvfd(p[0], r->u[1].i);
			if (fd_prev != 1)
				mvfd(fd_prev, fd_out);
			close(p[1]);
			walk(r->u[3].p, FALSE);
			exit(getstatus());
		}
		if (fd_prev != 1)
			close(fd_prev); /* parent must close all pipe fd's */
		pids[i] = pid;
		fd_prev = p[1];
		fd_out = r->u[0].i;
		close(p[0]);
	}
	if ((pid = rc_fork()) == 0) {
		setsigdefaults(FALSE);
		mvfd(fd_prev, fd_out);
		walk(r, FALSE);
		exit(getstatus());
		/* NOTREACHED */
	}
	redirq = NULL; /* clear preredir queue */
	close(fd_prev);
	pids[i++] = pid;

	/* collect statuses */

	intr = FALSE;
	setpipestatuslength(i);
	for (j = 0; j < i; j++) {
		rc_wait4(pids[j], &sp, TRUE);
		setpipestatus(j, -1, sp);
		intr |= WIFSIGNALED(sp);
	}
	if (interactive && intr)
		tcsetattr(0, TCSANOW, &t);
	sigchk();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x880, %rsp            # imm = 0x880
movq %rdi, -0x8(%rbp)
leaq 0xc24e(%rip), %rax      # 0x1fc64
cmpl $0x0, (%rax)
je 0x13a29
xorl %edi, %edi
leaq -0x874(%rbp), %rsi
callq 0x32b0
movl $0x1, -0x20(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x838(%rbp)
movl $0x0, -0xc(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x838(%rbp)
movb %al, -0x875(%rbp)
je 0x13a6e
movq -0x838(%rbp), %rax
cmpl $0x12, (%rax)
sete %al
movb %al, -0x875(%rbp)
movb -0x875(%rbp), %al
testb $0x1, %al
jne 0x13a7d
jmp 0x13b8a
movl -0xc(%rbp), %eax
addl $0x1, %eax
cmpl $0x200, %eax            # imm = 0x200
jl 0x13a96
leaq 0x6f71(%rip), %rdi      # 0x1aa02
callq 0x50d0
leaq -0x828(%rbp), %rdi
callq 0x3180
cmpl $0x0, %eax
jge 0x13abc
leaq 0x658c(%rip), %rdi      # 0x1a03a
callq 0x11c10
xorl %eax, %eax
movl %eax, %edi
callq 0x50d0
callq 0x127b0
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jne 0x13b2d
xorl %edi, %edi
callq 0x5ab0
leaq 0xc081(%rip), %rax      # 0x1fb58
movq $0x0, (%rax)
movl -0x828(%rbp), %edi
movq -0x838(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x11e10
cmpl $0x1, -0x1c(%rbp)
je 0x13b04
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x11e10
movl -0x824(%rbp), %edi
callq 0x3170
movq -0x838(%rbp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x12d80
callq 0x10730
movl %eax, %edi
callq 0x3320
cmpl $0x1, -0x1c(%rbp)
je 0x13b3b
movl -0x1c(%rbp), %edi
callq 0x3170
movl -0x18(%rbp), %ecx
movslq -0xc(%rbp), %rax
movl %ecx, -0x820(%rbp,%rax,4)
movl -0x824(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x838(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x828(%rbp), %edi
callq 0x3170
movq -0x838(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x838(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x13a49
callq 0x127b0
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jne 0x13bc3
xorl %edi, %edi
callq 0x5ab0
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x11e10
movq -0x838(%rbp), %rdi
xorl %esi, %esi
callq 0x12d80
callq 0x10730
movl %eax, %edi
callq 0x3320
leaq 0xbf8e(%rip), %rax      # 0x1fb58
movq $0x0, (%rax)
movl -0x1c(%rbp), %edi
callq 0x3170
movl -0x18(%rbp), %ecx
movl -0xc(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0xc(%rbp)
cltq
movl %ecx, -0x820(%rbp,%rax,4)
movl $0x0, -0x82c(%rbp)
movl -0xc(%rbp), %edi
callq 0x109b0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x13c6a
movslq -0x10(%rbp), %rax
movl -0x820(%rbp,%rax,4), %edi
leaq -0x14(%rbp), %rsi
movl $0x1, %edx
callq 0x128c0
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x109d0
movl -0x14(%rbp), %eax
andl $0x7f, %eax
addl $0x1, %eax
movsbl %al, %eax
sarl %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
orl -0x82c(%rbp), %eax
movl %eax, -0x82c(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x13c09
leaq 0xbff3(%rip), %rax      # 0x1fc64
cmpl $0x0, (%rax)
je 0x13c8f
cmpl $0x0, -0x82c(%rbp)
je 0x13c8f
xorl %esi, %esi
leaq -0x874(%rbp), %rdx
movl %esi, %edi
callq 0x32e0
callq 0x104a0
addq $0x880, %rsp            # imm = 0x880
popq %rbp
retq
nopl (%rax)