// File: /workspace/github_c_makefile_star2_O0/ebiggers[P]mysh/mysh_main.c
// Function: start_child
static void __attribute__((noreturn))
start_child(const struct list_head *cmd_args,
	    const struct list_head *redirs,
	    const struct list_head *var_assignments,
	    unsigned cmd_nargs,
	    unsigned pipeline_cmd_idx,
	    unsigned pipeline_ncommands,
	    const int pipe_fds[2],
	    int prev_read_end)
{
	char *argv[cmd_nargs + 1];
	struct string *s;
	unsigned i;

	/* Set up stdin and stdout for this component of the pipeline */

	if (pipeline_cmd_idx != pipeline_ncommands - 1) {
		/* Not the last command in the pipeline; close the read end of
		 * pipe we are writing to, then assign the write end of the pipe
		 * to stdout */
		close(pipe_fds[0]);
		if (dup2(pipe_fds[1], STDOUT_FILENO) < 0) {
			mysh_error_with_errno("Failed to set up stdout "
					      "for pipeline");
			goto fail;
		}
	}

	if (pipeline_cmd_idx != 0) {
		/* Not the first command in the pipeline; assign the read end of
		 * the previous pipe to stdin. */
		if (dup2(prev_read_end, STDIN_FILENO) < 0) {
			mysh_error_with_errno("Failed to set up stdin "
					      "for pipeline");
			goto fail;
		}
	}

	/* Apply other redirections */
	if (do_redirections(redirs, NULL) != 0)
		goto fail;

	/* Set up argv */
	i = 0;
	list_for_each_entry(s, cmd_args, list)
		argv[i++] = s->chars;
	argv[i] = NULL;
	mysh_assert(i == cmd_nargs);

	/* Set any environmental variables for this command */
	list_for_each_entry(s, var_assignments, list) {
		if (putenv(s->chars)) {
			mysh_error_with_errno("Failed to set environmental "
					      "variable %s", s->chars);
			goto fail;
		}
	}

	/* Use the default SIGINT handler (the shell may be using a different
	 * one) */
	install_handler(SIGINT, SIG_DFL);

	/* Execute the new program.  execvp() automatically searches $PATH.
	 * Note: this shell does not attempt to save time by remembering the
	 * locations of executable programs on the $PATH. */
	execvp(argv[0], argv);

	/* Only reached if execvp() failed */
	if (errno == ENOENT)
		mysh_error("%s: command not found", argv[0]);
	else
		mysh_error_with_errno("Failed to execute %s", argv[0]);
fail:
	exit(-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl -0x1c(%rbp), %eax
incl %eax
movq %rsp, %rcx
movq %rcx, -0x30(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x90(%rbp)
movq %rcx, %rsp
movq %rax, -0x38(%rbp)
movl -0x20(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x4ed8
movq 0x10(%rbp), %rax
movl (%rax), %edi
callq 0x21c0
movq 0x10(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x1, %esi
callq 0x2120
cmpl $0x0, %eax
jge 0x4ed6
leaq 0x588c(%rip), %rdi      # 0xa756
movb $0x0, %al
callq 0x8cf0
jmp 0x50a6
jmp 0x4ed8
cmpl $0x0, -0x20(%rbp)
je 0x4f02
movl 0x18(%rbp), %edi
xorl %esi, %esi
callq 0x2120
cmpl $0x0, %eax
jge 0x4f00
leaq 0x5887(%rip), %rdi      # 0xa77b
movb $0x0, %al
callq 0x8cf0
jmp 0x50a6
jmp 0x4f02
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8a40
cmpl $0x0, %eax
je 0x4f19
jmp 0x50a6
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
addq $-0x18, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x18, %rax
cmpq -0x8(%rbp), %rax
je 0x4f8e
movq -0x90(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rcx), %rdx
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x44(%rbp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
addq $-0x18, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x4f3f
movq -0x90(%rbp), %rax
movl -0x44(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x4faa
jmp 0x4fc9
leaq 0x57ee(%rip), %rdi      # 0xa79f
leaq 0x5697(%rip), %rsi      # 0xa64f
movl $0xff, %edx
leaq 0x57ea(%rip), %rcx      # 0xa7ae
callq 0x2160
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
addq $-0x18, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x18, %rax
cmpq -0x18(%rbp), %rax
je 0x504b
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x2220
cmpl $0x0, %eax
je 0x5021
movq -0x40(%rbp), %rax
movq (%rax), %rsi
leaq 0x5834(%rip), %rdi      # 0xa849
movb $0x0, %al
callq 0x8cf0
jmp 0x50a6
jmp 0x5023
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
addq $-0x18, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x4fe8
movl $0x2, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5320
movq -0x90(%rbp), %rsi
movq (%rsi), %rdi
callq 0x2300
callq 0x2060
cmpl $0x2, (%rax)
jne 0x508c
movq -0x90(%rbp), %rax
movq (%rax), %rsi
leaq 0x57ee(%rip), %rdi      # 0xa871
movb $0x0, %al
callq 0x8c20
jmp 0x50a4
movq -0x90(%rbp), %rax
movq (%rax), %rsi
leaq 0x57ea(%rip), %rdi      # 0xa887
movb $0x0, %al
callq 0x8cf0
jmp 0x50a6
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2360