// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r8d, %r15d
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, -0x30(%rbp)
movq %rdi, %r12
leal 0x1(%r13), %eax
movq %rsp, %rbx
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
decl %r9d
cmpl %r8d, %r9d
je 0x420a
movq 0x10(%rbp), %rax
movl (%rax), %edi
callq 0x21c0
movq 0x10(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x1, %esi
callq 0x2120
testl %eax, %eax
jns 0x420a
leaq 0x342e(%rip), %rdi      # 0x7636
jmp 0x4224
testl %r15d, %r15d
je 0x4230
movl 0x18(%rbp), %edi
xorl %esi, %esi
callq 0x2120
testl %eax, %eax
jns 0x4230
leaq 0x3437(%rip), %rdi      # 0x765b
xorl %eax, %eax
callq 0x249f
jmp 0x432e
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x6419
testl %eax, %eax
jne 0x432e
movq (%r12), %rax
cmpq %r12, %rax
je 0x4268
xorl %r15d, %r15d
movq -0x18(%rax), %rcx
movl %r15d, %edx
incl %r15d
movq %rcx, (%rbx,%rdx,8)
movq (%rax), %rax
cmpq %r12, %rax
jne 0x4252
movl %r15d, %eax
movq $0x0, (%rbx,%rax,8)
cmpl %r13d, %r15d
jne 0x42a0
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x42bf
movq -0x18(%r15), %rdi
callq 0x2220
testl %eax, %eax
je 0x427b
movq -0x18(%r15), %rsi
leaq 0x348e(%rip), %rdi      # 0x7729
jmp 0x4327
leaq 0x33d8(%rip), %rdi      # 0x767f
leaq 0x3281(%rip), %rsi      # 0x752f
leaq 0x33d9(%rip), %rcx      # 0x768e
movl $0xff, %edx
callq 0x2160
leaq -0xc0(%rbp), %r14
leaq -0xc8(%rbp), %r15
movl $0x98, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2180
movq %r14, %rdi
movl $0x2, %esi
callq 0x23a0
movl $0x2, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x20a0
movq (%rbx), %rdi
movq %rbx, %rsi
callq 0x2300
callq 0x2060
cmpl $0x2, (%rax)
movq (%rbx), %rsi
jne 0x4320
leaq 0x343a(%rip), %rdi      # 0x7751
xorl %eax, %eax
callq 0x23e0
jmp 0x432e
leaq 0x3440(%rip), %rdi      # 0x7767
xorl %eax, %eax
callq 0x249f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2350