// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/pre-process.c
// Function: do_define
static int do_define(struct position pos, struct token *token, struct ident *name,
		     struct token *arglist, struct token *expansion, int attr)
{
	struct symbol *sym;
	int ret = 1;

	expansion = parse_expansion(expansion, arglist, name);
	if (!expansion)
		return 1;

	sym = lookup_symbol(name, NS_MACRO | NS_UNDEF);
	if (sym) {
		int clean;

		if (attr < sym->attr)
			goto out;

		clean = (attr == sym->attr && sym->namespace == NS_MACRO);

		if (token_list_different(sym->expansion, expansion) ||
		    token_list_different(sym->arglist, arglist)) {
			ret = 0;
			if ((clean && attr == SYM_ATTR_NORMAL)
					|| sym->used_in == file_scope) {
				warning(pos, "preprocessor token %.*s redefined",
						name->len, name->name);
				info(sym->pos, "this was the original definition");
			}
		} else if (clean)
			goto out;
	}

	if (!sym || sym->scope != file_scope) {
		sym = alloc_symbol(pos, SYM_NODE);
		bind_symbol(sym, name, NS_MACRO);
		add_ident(&macros, name);
		ret = 0;
	}

	if (!ret) {
		sym->expansion = expansion;
		sym->arglist = arglist;
		if (token) /* Free the "define" token, but not the rest of the line */
			__free_token(token);
	}

	sym->namespace = NS_MACRO;
	sym->used_in = NULL;
	sym->attr = attr;
out:
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0x1, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c100
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2b59f
movl $0x1, -0x4(%rbp)
jmp 0x2b77a
movq -0x20(%rbp), %rdi
movl $0x81, %esi
callq 0x3f450
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x2b6b0
movl -0x34(%rbp), %eax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
shrl $0x12, %ecx
andl $0x3, %ecx
movzbl %cl, %ecx
cmpl %ecx, %eax
jge 0x2b5d7
jmp 0x2b774
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movl (%rax), %eax
shrl $0x12, %eax
andl $0x3, %eax
movzbl %al, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x49(%rbp)
jne 0x2b609
movq -0x40(%rbp), %rax
movl (%rax), %eax
shrl $0x8, %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0x1, %eax
sete %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x2c2d0
cmpl $0x0, %eax
jne 0x2b640
movq -0x40(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x2c2d0
cmpl $0x0, %eax
je 0x2b6a1
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0x2b653
cmpl $0x1, -0x34(%rbp)
je 0x2b667
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
leaq 0x5da56(%rip), %rcx     # 0x890b8
cmpq (%rcx), %rax
jne 0x2b69f
movq -0x20(%rbp), %rax
movzbl 0x10(%rax), %edx
movq -0x20(%rbp), %rcx
addq $0x12, %rcx
movq -0xc(%rbp), %rdi
leaq 0x3c14a(%rip), %rsi     # 0x677cc
movb $0x0, %al
callq 0x16d80
movq -0x40(%rbp), %rax
movq 0x4(%rax), %rdi
leaq 0x3c156(%rip), %rsi     # 0x677ee
movb $0x0, %al
callq 0x16c10
jmp 0x2b6ae
cmpl $0x0, -0x48(%rbp)
je 0x2b6ac
jmp 0x2b774
jmp 0x2b6ae
jmp 0x2b6b0
cmpq $0x0, -0x40(%rbp)
je 0x2b6cb
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
leaq 0x5d9f2(%rip), %rcx     # 0x890b8
cmpq (%rcx), %rax
je 0x2b706
movq -0xc(%rbp), %rdi
movl $0x3, %esi
callq 0x3f4d0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x40a40
movq -0x20(%rbp), %rsi
leaq 0x61d26(%rip), %rdi     # 0x8d420
callq 0x2c350
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x2b736
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x50(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x2b734
movq -0x18(%rbp), %rdi
callq 0x469b0
jmp 0x2b736
movq -0x40(%rbp), %rax
movl (%rax), %ecx
andl $0xfffe00ff, %ecx       # imm = 0xFFFE00FF
orl $0x100, %ecx            # imm = 0x100
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x58(%rax)
movl -0x34(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movzbl %cl, %edx
movl (%rax), %ecx
andl $0x3, %edx
shll $0x12, %edx
andl $0xfff3ffff, %ecx       # imm = 0xFFF3FFFF
orl %edx, %ecx
movl %ecx, (%rax)
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)