// File: /workspace/github_c_makefile_star2_O0/ebiggers[P]mysh/mysh_parse.c
// Function: expand_params_and_word_split
static int expand_params_and_word_split(struct token *tok,
					struct token *next,
					struct list_head *out_list)
{
	struct string *s;
	unsigned char *param_char_map = NULL;

	mysh_assert(tok->type & TOK_CLASS_STRING);
	mysh_assert(list_empty(out_list));

	/* Transfer the token ('struct token') to a string ('struct string') */
 	s = xmalloc(sizeof(struct string));
	s->chars = tok->tok_data;
	s->len = strlen(tok->tok_data);
	tok->tok_data = NULL;
	BUILD_BUG_ON(TOK_CLASS_STRING != (TOK_UNQUOTED_STRING |
					  TOK_DOUBLE_QUOTED_STRING |
					  TOK_SINGLE_QUOTED_STRING));
	BUILD_BUG_ON((int)TOK_UNQUOTED_STRING != (int)STRING_FLAG_UNQUOTED);
	BUILD_BUG_ON((int)TOK_DOUBLE_QUOTED_STRING != (int)STRING_FLAG_DOUBLE_QUOTED);
	BUILD_BUG_ON((int)TOK_SINGLE_QUOTED_STRING != (int)STRING_FLAG_SINGLE_QUOTED);
	BUILD_BUG_ON((int)TOK_FLAG_EXPANDED_ALIAS != (int)STRING_FLAG_EXPANDED_ALIAS);
	s->flags = (int)tok->type;
	if (tok->preceded_by_whitespace)
		s->flags |= STRING_FLAG_PRECEDING_WHITESPACE;

	/* Do parameter expansion on unquoted strings and on double-quoted
	 * strings */
	if (s->flags & (STRING_FLAG_UNQUOTED | STRING_FLAG_DOUBLE_QUOTED))
		s = do_param_expansion(s, &param_char_map);

	/* Do word splitting on unquoted strings that had parameter expansion
	 * performed */
	if ((s->flags & STRING_FLAG_UNQUOTED
	     && s->flags & (STRING_FLAG_PARAM_EXPANDED | STRING_FLAG_EXPANDED_ALIAS)))
	{
		bool trailing_whitespace;

		trailing_whitespace = split_string_around_whitespace(s,
								     out_list,
								     param_char_map);
		/* If there was trailing whitespace as a result of word
		 * splitting, force @preceded_by_whitespace to true on the next
		 * token (if there is one) */
		if (next && trailing_whitespace)
			next->preceded_by_whitespace = true;
		free(param_char_map);
	} else {
		list_add_tail(&s->list, out_list);
		mysh_assert(param_char_map == NULL);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0x73cd
jmp 0x73ec
leaq 0x3b16(%rip), %rdi      # 0xaeea
leaq 0x3a4d(%rip), %rsi      # 0xae28
movl $0xe2, %edx
leaq 0x3b20(%rip), %rcx      # 0xaf07
callq 0x2160
movq -0x18(%rbp), %rdi
callq 0x7310
cmpl $0x0, %eax
je 0x73fc
jmp 0x741b
leaq 0x3b59(%rip), %rdi      # 0xaf5c
leaq 0x3a1e(%rip), %rsi      # 0xae28
movl $0xe3, %edx
leaq 0x3af1(%rip), %rcx      # 0xaf07
callq 0x2160
movl $0x28, %edi
callq 0x8e00
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2100
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
testb $0x1, (%rax)
je 0x7480
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x74a0
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x6520
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x74f3
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x28, %eax
cmpl $0x0, %eax
je 0x74f3
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7b30
andb $0x1, %al
movb %al, -0x29(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x74e8
testb $0x1, -0x29(%rbp)
je 0x74e8
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rdi
callq 0x2050
jmp 0x752e
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
callq 0x7d30
cmpq $0x0, -0x28(%rbp)
jne 0x750d
jmp 0x752c
leaq 0x3a5d(%rip), %rdi      # 0xaf71
leaq 0x390d(%rip), %rsi      # 0xae28
movl $0x10c, %edx            # imm = 0x10C
leaq 0x39e0(%rip), %rcx      # 0xaf07
callq 0x2160
jmp 0x752e
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)