// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
testb $0x7, 0x4(%rdi)
je 0x5854
movq %rdx, %r14
cmpq %rdx, (%rdx)
jne 0x5873
movq %rsi, %rbx
movq %rdi, %r12
pushq $0x28
popq %rdi
callq 0x6099
movq %rax, %r15
movq 0x8(%r12), %rdi
movq %rdi, (%rax)
callq 0x2100
movq %rax, 0x8(%r15)
andq $0x0, 0x8(%r12)
movl 0x4(%r12), %eax
movl %eax, 0x10(%r15)
cmpb $0x1, (%r12)
jne 0x56a1
orl $0x10, %eax
movl %eax, 0x10(%r15)
testb $0x3, %al
je 0x56b8
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x4a08
movq %rax, %r15
movl 0x10(%rax), %eax
testb $0x1, %al
sete %cl
testb $0x28, %al
sete %al
orb %cl, %al
je 0x5708
leaq 0x18(%r15), %rax
movq 0x8(%r14), %rcx
movq %rax, 0x8(%r14)
movq %r14, 0x18(%r15)
movq %rcx, 0x20(%r15)
movq %rax, (%rcx)
cmpq $0x0, 0x8(%rsp)
je 0x5845
leaq 0x26c1(%rip), %rdi      # 0x7db1
leaq 0x2571(%rip), %rsi      # 0x7c68
leaq 0x2649(%rip), %rcx      # 0x7d47
movl $0x10c, %edx            # imm = 0x10C
callq 0x2160
movq %rbx, 0x10(%rsp)
movq 0x8(%rsp), %r13
movq (%r15), %rbp
callq 0x23c0
movq %rax, 0x20(%rsp)
leaq 0x1(%rbp), %rax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x20(%rsp), %rax
movq (%rax), %rcx
leaq (%rbx,%r13), %rdx
leaq (%rbx,%rbp), %rdi
xorl %eax, %eax
xorl %r8d, %r8d
movsbq (%rdi,%rax), %r9
testb $0x20, 0x1(%rcx,%r9,2)
je 0x576c
testq %r13, %r13
je 0x575a
cmpb $0x0, (%rdx,%rax)
je 0x576c
cmpq %r8, %rbx
sete %sil
orb %sil, %r12b
decq %r8
incq %rax
jmp 0x5742
testb %r9b, %r9b
je 0x5802
subq %r8, %rdi
movq 0x18(%rsp), %rsi
leaq (%rsi,%rbx), %r10
addq %rax, %r10
addq %rax, %rdx
xorl %esi, %esi
testb %r9b, %r9b
je 0x57ae
movsbq %r9b, %r9
testb $0x20, 0x1(%rcx,%r9,2)
je 0x57a5
testq %r13, %r13
je 0x57ae
cmpb $0x0, (%rdx,%rsi)
jne 0x57ae
movb (%r10,%rsi), %r9b
incq %rsi
jmp 0x5789
cmpq %r8, %rbx
jne 0x57c2
movq %rbx, %rcx
subq 0x8(%r15), %rcx
addq %rax, %rcx
addq %rsi, %rcx
je 0x5824
addq %rax, %rbx
addq %rsi, %rbx
callq 0x6152
movl 0x10(%r15), %ecx
movl %ecx, %edx
orl $0x10, %edx
testb $0x1, %r12b
cmovnel %edx, %ecx
testq %rbx, %rbx
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 0x572d
testq %r8, %r8
sete %bl
movq %r15, %rdi
callq 0x6193
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
sete %al
orb %bl, %al
jne 0x583b
movb $0x1, (%rcx)
jmp 0x583b
leaq 0x18(%r15), %rax
movq 0x8(%r14), %rcx
movq %rax, 0x8(%r14)
movq %r14, 0x18(%r15)
movq %rcx, 0x20(%r15)
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 0x24cf(%rip), %rdi      # 0x7d2a
leaq 0x2406(%rip), %rsi      # 0x7c68
leaq 0x24de(%rip), %rcx      # 0x7d47
movl $0xe2, %edx
callq 0x2160
leaq 0x2522(%rip), %rdi      # 0x7d9c
leaq 0x23e7(%rip), %rsi      # 0x7c68
leaq 0x24bf(%rip), %rcx      # 0x7d47
movl $0xe3, %edx
callq 0x2160