// File: /workspace/github_c_makefile_star2_O0/ebiggers[P]mysh/mysh_parse.c
// Function: parse_tok_list
int parse_tok_list(struct list_head *toks,
		   bool *async_ret,
		   struct list_head *cmd_args,
		   struct list_head *var_assignments,
		   struct list_head *redirs,
		   unsigned *cmd_nargs_ret,
		   unsigned *num_redirs_ret)
{
	struct token *tok, *tmp, *next;
	int ret;

	mysh_assert(list_empty(var_assignments));
	mysh_assert(list_empty(cmd_args));
	mysh_assert(list_empty(redirs));
	LIST_HEAD(string_list);

	if (!mysh_alias_expansion_disabled && !list_empty(toks)) {
		tok = list_entry(toks->next, struct token, list);
		expand_alias(tok);
	}
	list_for_each_entry_safe(tok, tmp, toks, list) {
		if (!(tok->type & TOK_CLASS_STRING))
			break;
		if (tok->list.next == toks)
			next = NULL;
		else
			next = list_entry(tok->list.next, struct token, list);
		LIST_HEAD(tmp_list);
		ret = expand_params_and_word_split(tok, next, &tmp_list);
		if (ret)
			goto out_free_string_list;
		list_splice_tail(&tmp_list, &string_list);
		list_del(&tok->list);
		mysh_assert(tok->tok_data == NULL);
		free(tok);
	}

	ret = glue_strings(&string_list);
	if (ret)
		goto out_free_string_list;
	if (!mysh_filename_expansion_disabled) {
		ret = do_filename_expansion(&string_list);
		if (ret)
			goto out_free_string_list;
	}
	transfer_var_assignments(&string_list, var_assignments);
	ret = parse_redirections(toks, &string_list, redirs, async_ret);
	if (ret)
		goto out_free_string_list;
	list_splice_tail(&string_list, cmd_args);
	*cmd_nargs_ret = list_size(cmd_args);
	*num_redirs_ret = list_size(redirs);
	ret = 0;
	goto out;
out_free_string_list:
	free_string_list(&string_list);
out:
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7310
cmpl $0x0, %eax
je 0x7007
jmp 0x7026
leaq 0x3dfe(%rip), %rdi      # 0xae0c
leaq 0x3e13(%rip), %rsi      # 0xae28
movl $0x353, %edx            # imm = 0x353
leaq 0x3e14(%rip), %rcx      # 0xae35
callq 0x2160
movq -0x18(%rbp), %rdi
callq 0x7310
cmpl $0x0, %eax
je 0x7036
jmp 0x7055
leaq 0x2fc8(%rip), %rdi      # 0xa005
leaq 0x3de4(%rip), %rsi      # 0xae28
movl $0x354, %edx            # imm = 0x354
leaq 0x3de5(%rip), %rcx      # 0xae35
callq 0x2160
movq -0x28(%rbp), %rdi
callq 0x7310
cmpl $0x0, %eax
je 0x7065
jmp 0x7084
leaq 0x3e55(%rip), %rdi      # 0xaec1
leaq 0x3db5(%rip), %rsi      # 0xae28
movl $0x355, %edx            # imm = 0x355
leaq 0x3db6(%rip), %rcx      # 0xae35
callq 0x2160
leaq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x7589(%rip), %rax      # 0xe624
cmpl $0x0, (%rax)
jne 0x70d6
movq -0x8(%rbp), %rdi
callq 0x7310
cmpl $0x0, %eax
jne 0x70d6
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x7330
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, -0x38(%rbp)
movq -0x38(%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, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq $0x10, %rax
cmpq -0x8(%rbp), %rax
je 0x7254
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
jne 0x7147
jmp 0x7254
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x715f
movq $0x0, -0x48(%rbp)
jmp 0x718b
movq -0x38(%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, -0x48(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x73a0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x71c9
jmp 0x72f2
leaq -0xb0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x7540
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
callq 0x7580
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x71f3
jmp 0x7212
leaq 0x3cda(%rip), %rdi      # 0xaed4
leaq 0x3c27(%rip), %rsi      # 0xae28
movl $0x369, %edx            # imm = 0x369
leaq 0x3c28(%rip), %rcx      # 0xae35
callq 0x2160
movq -0x38(%rbp), %rdi
callq 0x2050
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x7121
leaq -0x60(%rbp), %rdi
callq 0x75b0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x726b
jmp 0x72f2
leaq 0x73be(%rip), %rax      # 0xe630
cmpl $0x0, (%rax)
jne 0x728d
leaq -0x60(%rbp), %rdi
callq 0x7750
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x728b
jmp 0x72f2
jmp 0x728d
movq -0x20(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7830
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq -0x60(%rbp), %rsi
callq 0x78f0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x72ba
jmp 0x72f2
movq -0x18(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7540
movq -0x18(%rbp), %rdi
callq 0x7ae0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x7ae0
movl %eax, %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4c(%rbp)
jmp 0x72fb
leaq -0x60(%rbp), %rdi
callq 0x9050
movl -0x4c(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)