// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/pre-process.c
// Function: expand
static int expand(struct token **list, struct symbol *sym)
{
	struct token *last;
	struct token *token = *list;
	struct ident *expanding = token->ident;
	struct token **tail;
	struct token *expansion = sym->expansion;
	int nargs = sym->arglist ? sym->arglist->count.normal : 0;
	struct arg args[nargs];

	if (expanding->tainted) {
		token->pos.noexpand = 1;
		return 1;
	}

	if (sym->arglist) {
		if (!match_op(scan_next(&token->next), '('))
			return 1;
		if (!collect_arguments(token->next, sym->arglist, args, token))
			return 1;
		expand_arguments(nargs, args);
	}

	if (sym->expand)
		return sym->expand(token, args) ? 0 : 1;

	expanding->tainted = 1;

	last = token->next;
	tail = substitute(list, expansion, args);
	/*
	 * Note that it won't be eof - at least TOKEN_UNTAINT will be there.
	 * We still can lose the newline flag if the sucker expands to nothing,
	 * but the price of dealing with that is probably too high (we'd need
	 * to collect the flags during scan_next())
	 */
	(*list)->pos.newline = token->pos.newline;
	(*list)->pos.whitespace = token->pos.whitespace;
	*tail = last;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x2ec83
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl 0x10(%rax), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0x60(%rbp)
jmp 0x2ec8a
xorl %eax, %eax
movl %eax, -0x60(%rbp)
jmp 0x2ec8a
movl -0x60(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x50(%rbp)
leaq (%rax,%rax,4), %rcx
leaq 0xf(,%rcx,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movb 0x11(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
je 0x2ecfc
movq -0x28(%rbp), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq (%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
jmp 0x2ee67
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x2ed7a
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x2eaf0
movq %rax, %rdi
movl $0x28, %esi
callq 0x2c380
cmpl $0x0, %eax
jne 0x2ed39
movl $0x1, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
jmp 0x2ee67
movq -0x68(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
movq -0x28(%rbp), %rcx
callq 0x2ee80
cmpl $0x0, %eax
jne 0x2ed6e
movl $0x1, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
jmp 0x2ee67
movq -0x68(%rbp), %rsi
movl -0x44(%rbp), %edi
callq 0x2f260
movq -0x18(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x2edb5
movq -0x68(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movb %al, %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
jmp 0x2ee67
movq -0x68(%rbp), %rdx
movq -0x30(%rbp), %rax
movb 0x11(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x11(%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x2f3b0
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
shrq $0x14, %rax
andq $0x1, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq (%rax), %rcx
andq $0x1, %rdx
shlq $0x14, %rdx
andq $-0x100001, %rcx        # imm = 0xFFEFFFFF
orq %rdx, %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
shrq $0x15, %rax
andq $0x1, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq (%rax), %rcx
andq $0x1, %rdx
shlq $0x15, %rdx
andq $-0x200001, %rcx        # imm = 0xFFDFFFFF
orq %rdx, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
movq -0x50(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)