// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movq $0x0, 0x8(%rsp)
testb $0x7, 0x4(%rdi)
je 0x60d7
movq %rdx, %r14
cmpq %rdx, (%rdx)
jne 0x60f6
movq %rsi, %rbx
movq %rdi, %r12
movl $0x28, %edi
callq 0x6754
movq %rax, %r15
movq 0x8(%r12), %rdi
movq %rdi, (%rax)
callq 0x2100
movq %rax, 0x8(%r15)
movq $0x0, 0x8(%r12)
movl 0x4(%r12), %eax
movl %eax, 0x10(%r15)
cmpb $0x1, (%r12)
jne 0x5ede
orl $0x10, %eax
movl %eax, 0x10(%r15)
testb $0x3, 0x10(%r15)
je 0x5ef5
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x511d
movq %rax, %r15
movl 0x10(%r15), %eax
testb $0x1, %al
sete %cl
testb $0x28, %al
sete %al
orb %cl, %al
je 0x5f49
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 0x60c8
leaq 0x1e80(%rip), %rdi      # 0x7db1
leaq 0x1d30(%rip), %rsi      # 0x7c68
leaq 0x1e08(%rip), %rcx      # 0x7d47
movl $0x10c, %edx            # imm = 0x10C
callq 0x2160
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq 0x8(%rsp), %r13
movq (%r15), %rbp
movq %r15, 0x10(%rsp)
callq 0x23c0
movq 0x10(%rsp), %r8
movq %rax, 0x30(%rsp)
leaq 0x18(%r8), %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
movl $0x1, %ebx
xorl %r12d, %r12d
movl $0x0, 0x4(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movsbq (%rbp,%r15), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x5fa5
movq %r15, %r14
jmp 0x5fd0
movq %r15, %r14
testq %r13, %r13
je 0x5fb5
cmpb $0x0, (%r13,%r14)
je 0x5fd0
testq %r14, %r14
movzbl %r12b, %r12d
cmovel %ebx, %r12d
movsbq 0x1(%rbp,%r14), %rcx
incq %r14
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x5fa8
testb %cl, %cl
je 0x6086
leaq (%r14,%rbp), %rdi
movb (%rdi), %cl
movq %r14, %r15
testb %cl, %cl
je 0x6007
movsbq %cl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x5ffd
testq %r13, %r13
je 0x6007
cmpb $0x0, (%r13,%r15)
jne 0x6007
movb 0x1(%rbp,%r15), %cl
incq %r15
jmp 0x5fe1
testq %r14, %r14
jne 0x603b
cmpq 0x8(%r8), %r15
jne 0x603b
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rsp), %rdx
movq %rdx, 0x8(%rcx)
movq %rcx, 0x18(%r8)
movq %rax, 0x20(%r8)
movq %rdx, (%rax)
movl $0x0, 0x4(%rsp)
xorl %eax, %eax
jmp 0x60a2
movq %r15, %rsi
subq %r14, %rsi
callq 0x67fa
movq 0x10(%rsp), %r8
movl 0x10(%r8), %ecx
movl %ecx, 0x10(%rax)
testq %r15, %r15
jne 0x605d
testb $0x1, %r12b
je 0x6063
orl $0x10, %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rcx
addq $0x18, %rcx
movq 0x18(%rsp), %rsi
movq 0x8(%rsi), %rdx
movq %rcx, 0x8(%rsi)
movq %rsi, 0x18(%rax)
movq %rdx, 0x20(%rax)
movq %rcx, (%rdx)
movb $0x1, %al
jmp 0x60a2
cmpq %r15, %r14
setne %al
movl %eax, 0x4(%rsp)
movq %r8, %rdi
callq 0x6870
movq 0x10(%rsp), %r8
xorl %eax, %eax
movq %r14, %r15
testb %al, %al
jne 0x5f8b
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x60be
testb $0x1, 0x4(%rsp)
je 0x60be
movb $0x1, (%rax)
movq 0x8(%rsp), %rdi
callq 0x2050
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c4c(%rip), %rdi      # 0x7d2a
leaq 0x1b83(%rip), %rsi      # 0x7c68
leaq 0x1c5b(%rip), %rcx      # 0x7d47
movl $0xe2, %edx
callq 0x2160
leaq 0x1c9f(%rip), %rdi      # 0x7d9c
leaq 0x1b64(%rip), %rsi      # 0x7c68
leaq 0x1c3c(%rip), %rcx      # 0x7d47
movl $0xe3, %edx
callq 0x2160