// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq $0x0, 0x8(%rsp)
testb $0x7, 0x4(%rdi)
je 0x5ebb
movq %rdx, %r14
cmpq %rdx, (%rdx)
jne 0x5eda
movq %rsi, %rbx
movq %rdi, %r12
movl $0x28, %edi
callq 0x6540
movq %rax, %r15
movq 0x8(%r12), %rdi
movq %rdi, (%rax)
callq 0x2100
movq %r15, %rdi
movq %rax, 0x8(%r15)
movq $0x0, 0x8(%r12)
movl 0x4(%r12), %eax
movl %eax, 0x10(%r15)
cmpb $0x1, (%r12)
jne 0x5d17
orl $0x10, %eax
movl %eax, 0x10(%rdi)
testb $0x3, %al
je 0x5d2b
leaq 0x8(%rsp), %rsi
callq 0x501a
movq %rax, %rdi
movl 0x10(%rax), %eax
testb $0x1, %al
sete %cl
testb $0x28, %al
sete %al
orb %cl, %al
je 0x5d7b
leaq 0x18(%rdi), %rax
movq 0x8(%r14), %rcx
movq %rax, 0x8(%r14)
movq %r14, 0x18(%rdi)
movq %rcx, 0x20(%rdi)
movq %rax, (%rcx)
cmpq $0x0, 0x8(%rsp)
je 0x5eac
leaq 0x204e(%rip), %rdi      # 0x7db1
leaq 0x1efe(%rip), %rsi      # 0x7c68
leaq 0x1fd6(%rip), %rcx      # 0x7d47
movl $0x10c, %edx            # imm = 0x10C
callq 0x2160
movq %rbx, 0x18(%rsp)
movq 0x8(%rsp), %r13
movq (%rdi), %rbx
xorl %r15d, %r15d
movq %rdi, 0x10(%rsp)
callq 0x23c0
movq 0x10(%rsp), %rsi
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
movq 0x20(%rsp), %rax
movq (%rax), %rax
movsbq (%rbx,%r15), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x5dbb
movq %r15, %rbp
jmp 0x5de4
movq %r15, %rbp
testq %r13, %r13
je 0x5dcb
cmpb $0x0, (%r13,%rbp)
je 0x5de4
testq %rbp, %rbp
sete %cl
orb %cl, %r12b
movsbq 0x1(%rbx,%rbp), %rcx
incq %rbp
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x5dbe
testb %cl, %cl
je 0x5e6f
leaq (%rbx,%rbp), %rdi
movb (%rdi), %cl
movq %rbp, %r15
testb %cl, %cl
je 0x5e20
movq %rbp, %r15
movsbq %cl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x5e14
testq %r13, %r13
je 0x5e20
cmpb $0x0, (%r13,%r15)
jne 0x5e20
movb 0x1(%rbx,%r15), %cl
incq %r15
testb %cl, %cl
jne 0x5dfc
testq %rbp, %rbp
jne 0x5e2b
cmpq 0x8(%rsi), %r15
je 0x5e8b
movq %r15, %rsi
subq %rbp, %rsi
callq 0x65e6
movq 0x10(%rsp), %rsi
movl 0x10(%rsi), %ecx
movl %ecx, %edx
orl $0x10, %edx
testb $0x1, %r12b
cmovnel %edx, %ecx
testq %r15, %r15
cmovnel %edx, %ecx
movl %ecx, 0x10(%rax)
leaq 0x18(%rax), %rcx
movq 0x8(%r14), %rdx
movq %rcx, 0x8(%r14)
movq %r14, 0x18(%rax)
movq %rdx, 0x20(%rax)
movq %rcx, (%rdx)
jmp 0x5da2
movq %rsi, %rdi
callq 0x665c
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x5ea2
cmpq %r15, %rbp
je 0x5ea2
movb $0x1, (%rax)
jmp 0x5ea2
leaq 0x18(%rsi), %rax
movq 0x8(%r14), %rcx
movq %rax, 0x8(%r14)
movq %r14, 0x18(%rsi)
movq %rcx, 0x20(%rsi)
movq %rax, (%rcx)
movq 0x8(%rsp), %rdi
callq 0x2050
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e68(%rip), %rdi      # 0x7d2a
leaq 0x1d9f(%rip), %rsi      # 0x7c68
leaq 0x1e77(%rip), %rcx      # 0x7d47
movl $0xe2, %edx
callq 0x2160
leaq 0x1ebb(%rip), %rdi      # 0x7d9c
leaq 0x1d80(%rip), %rsi      # 0x7c68
leaq 0x1e58(%rip), %rcx      # 0x7d47
movl $0xe3, %edx
callq 0x2160