// File: /workspace/github_c_makefile_star2_O0/ebiggers[P]mysh/mysh_main.c
// Function: execute_tok_list
static int execute_tok_list(struct list_head *tok_list)
{
	struct token *tok, *tmp;
	unsigned ncommands;
	unsigned i;
	int ret;
	struct list_head *cur_list;

	mysh_assert(!list_empty(tok_list) &&
		    (list_entry(tok_list->prev, struct token, list)->type ==
		    TOK_END_OF_SHELL_STATEMENT));
	BUILD_BUG_ON((TOK_CLASS_CMD_BOUNDARY & TOK_END_OF_SHELL_STATEMENT) == 0);

	/* Count the number of commands in the pipeline */
	ncommands = 0;
	list_for_each_entry(tok, tok_list, list)
		if (tok->type & TOK_CLASS_CMD_BOUNDARY)
			ncommands++;

	struct list_head command_tokens[ncommands];

	for (i = 0; i < ncommands; i++)
		INIT_LIST_HEAD(&command_tokens[i]);

	/* Return 0 if the pipeline is empty (e.g. a line of only whitespace, or
	 * only a comment) */
	if (list_is_singular(tok_list)) {
		ret = 0;
		goto out;
	}

	/* Split the tokens into individual lists (pipeline components), around
	 * the '|' signs. */
	cur_list = &command_tokens[0];
	list_for_each_entry_safe(tok, tmp, tok_list, list) {
		if (tok->type & TOK_CLASS_CMD_BOUNDARY) {
			if (list_empty(cur_list)) {
				mysh_error("empty command in pipeline");
				ret = -1;
				goto out;
			}
			cur_list++;
		} else {
			list_move_tail(&tok->list, cur_list);
		}
	}
	/* Execute the pipeline */
	ret = execute_pipeline(command_tokens, ncommands);
out:
	free_tok_list(tok_list);
	for (i = 0; i < ncommands; i++)
		free_tok_list(&command_tokens[i]);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x47c0
cmpl $0x0, %eax
jne 0x4524
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpl $0x400, 0x4(%rax)       # imm = 0x400
jne 0x4524
jmp 0x4543
leaq 0x60b6(%rip), %rdi      # 0xa5e1
leaq 0x611d(%rip), %rsi      # 0xa64f
movl $0x1ee, %edx            # imm = 0x1EE
leaq 0x611d(%rip), %rcx      # 0xa65b
callq 0x2160
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rax
cmpq -0x8(%rbp), %rax
je 0x45b5
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x500, %eax            # imm = 0x500
cmpl $0x0, %eax
je 0x4591
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4593
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x4569
movl -0x1c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x68(%rbp)
movq %rax, %rdx
shlq $0x4, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0xa8(%rbp)
movq %rcx, %rsp
movq %rax, -0x70(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x460a
movq -0xa8(%rbp), %rdi
movl -0x20(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x40e0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x45e1
movq -0x8(%rbp), %rdi
callq 0x47e0
cmpl $0x0, %eax
je 0x4624
movl $0x0, -0x24(%rbp)
jmp 0x472e
movq -0xa8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rax
cmpq -0x8(%rbp), %rax
je 0x471c
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x500, %eax            # imm = 0x500
cmpl $0x0, %eax
je 0x46d0
movq -0x30(%rbp), %rdi
callq 0x47c0
cmpl $0x0, %eax
je 0x46c2
leaq 0x5fd2(%rip), %rdi      # 0xa684
movb $0x0, %al
callq 0x8c20
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x472e
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rbp)
jmp 0x46e1
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movq -0x30(%rbp), %rsi
callq 0x4830
jmp 0x46e3
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x467a
movq -0xa8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x4860
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x33b0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x4767
movq -0xa8(%rbp), %rdi
movl -0x20(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x33b0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x473e
movl -0x24(%rbp), %eax
movq -0x68(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)