// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
cmpq %rdi, %rax
je 0x3e4f
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
cmpl $0x400, -0xc(%rcx)      # imm = 0x400
jne 0x3e4f
movq (%rbx), %rdx
xorl %r14d, %r14d
cmpq %rbx, %rdx
je 0x3d79
movb -0xb(%rdx), %sil
andb $0x5, %sil
cmpb $0x1, %sil
sbbl $-0x1, %r14d
movq (%rdx), %rdx
jmp 0x3d5f
movl %r14d, %r13d
movq %rsp, %r15
movq %r13, %rdx
shlq $0x4, %rdx
subq %rdx, %r15
movq %r15, %rsp
testl %r14d, %r14d
je 0x3da7
movq %r13, %rdx
movq %r15, %rsi
movq %rsi, (%rsi)
movq %rsi, 0x8(%rsi)
addq $0x10, %rsi
decq %rdx
jne 0x3d97
cmpq %rbx, %rax
setne %dl
cmpq %rcx, %rax
sete %cl
xorl %r12d, %r12d
testb %cl, %dl
jne 0x3e1f
cmpq %rbx, %rax
je 0x3dfb
movq %r15, %rcx
movq (%rax), %rdx
testb $0x5, -0xb(%rax)
je 0x3dd6
cmpq %rcx, (%rcx)
je 0x3e0b
addq $0x10, %rcx
jmp 0x3df3
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rdx)
movq %rdx, (%rsi)
movq 0x8(%rcx), %rsi
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
movq %rsi, 0x8(%rax)
movq %rax, (%rsi)
movq %rdx, %rax
cmpq %rbx, %rdx
jne 0x3dc2
movq %r15, %rdi
movl %r14d, %esi
callq 0x3e6e
movl %eax, %r12d
jmp 0x3e1f
leaq 0x3752(%rip), %rdi      # 0x7564
xorl %eax, %eax
callq 0x23e0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2fc0
testl %r14d, %r14d
je 0x3e3d
movq %r15, %rdi
callq 0x2fc0
addq $0x10, %r15
decq %r13
jne 0x3e2c
movl %r12d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x366b(%rip), %rdi      # 0x74c1
leaq 0x36d2(%rip), %rsi      # 0x752f
leaq 0x36d7(%rip), %rcx      # 0x753b
movl $0x1ee, %edx            # imm = 0x1EE
callq 0x2160