// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, %r12
movq %rcx, %r15
movq %rdx, 0x8(%rsp)
movq %rdi, %rcx
movq %r8, (%rsp)
movq (%r8), %rdi
movl %edi, %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f054
cmpl $0x111, 0x10(%r12)      # imm = 0x111
jne 0x1f054
leaq 0x26db4(%rip), %rsi     # 0x45e03
jmp 0x1f3a1
movq %rcx, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
leaq 0x6757b(%rip), %rdi     # 0x865e0
movq %rsp, %r14
cmpq %rdi, %r12
je 0x1f228
movl (%r12), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f09c
cmpl $0x23, 0x10(%r12)
jne 0x1f09c
movq %r14, %rdi
movq %r15, %rsi
callq 0x1fb9d
movq %rax, %r12
testq %rax, %rax
je 0x1f3a8
movq 0x8(%r12), %rax
movl (%rax), %ecx
andl $0x3f, %ecx
cmpl $0x12, %ecx
jne 0x1f1d7
cmpl $0x111, 0x10(%rax)      # imm = 0x111
jne 0x1f1d7
movl (%r12), %eax
andl $0x3f, %eax
xorl %ebx, %ebx
cmpl $0x12, %eax
jne 0x1f0d5
xorl %ebx, %ebx
cmpl $0x2c, 0x10(%r12)
sete %bl
movq %r12, %rdi
movl $0x17, %esi
movq %r15, %rdx
callq 0x1fc0e
movq 0x8(%r12), %rdi
movq %r12, %r13
movq 0x8(%rdi), %r14
movl (%r14), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f125
movq %r14, %rbp
cmpl $0x111, 0x10(%r14)      # imm = 0x111
jne 0x1f122
movq %rbp, 0x8(%r12)
callq 0x2f875
movq 0x8(%rbp), %r14
movl (%r14), %eax
andl $0x3f, %eax
movq %rbp, %rdi
jmp 0x1f0f7
movq %rbp, %r14
movq (%rdi), %rax
andq $-0x40, %rax
orq $0x18, %rax
movq %rax, (%rdi)
cmpq 0x40dae(%rip), %r14     # 0x5fee8
je 0x1f397
movl (%r14), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f16a
cmpl $0x23, 0x10(%r14)
jne 0x1f16a
addq $0x8, %rdi
movq %r15, %rsi
callq 0x1fb9d
movq %rax, %r14
testq %rax, %rax
je 0x1f3a8
movq %r14, %rdi
movl $0x17, %esi
movq %r15, %rdx
callq 0x1fc0e
cmpl $0x1, %ebx
jne 0x1f185
movl %eax, %ebx
testl %eax, %eax
jne 0x1f1a2
movl (%r14), %eax
andl $0x3f, %eax
xorl %ebx, %ebx
movq %r14, %r13
cmpl $0x12, %eax
jne 0x1f1a2
xorl %ebx, %ebx
cmpl $0x2c, 0x10(%r14)
sete %bl
movq %r14, %r13
movq 0x8(%r14), %rdi
movl (%rdi), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f1c0
cmpl $0x111, 0x10(%rdi)      # imm = 0x111
movq %r14, %r12
je 0x1f0ed
cmpl $0x2, %ebx
jne 0x1f1ea
movq (%r13), %rax
andq $-0x40, %rax
orq $0x19, %rax
movq %rax, (%r13)
jmp 0x1f1ea
movq %r12, %rdi
movl $0x15, %esi
movq %r15, %rdx
callq 0x1fc0e
movq %r12, %r14
movq (%r14), %rdi
movl %edi, %eax
andl $0x3f, %eax
leal -0x10(%rax), %ecx
cmpl $0x2, %ecx
jae 0x1f206
movq 0x10(%r14), %rax
orl $0x80000000, (%rax)     # imm = 0x80000000
jmp 0x1f20f
cmpl $0x2, %eax
je 0x1f3c0
movq 0x8(%r14), %r12
addq $0x8, %r14
cmpq 0x40cca(%rip), %r12     # 0x5fee8
jne 0x1f071
movq (%rsp), %rdi
callq 0x1fcf8
movq (%rax), %rcx
andq $-0x40, %rcx
orq $0x1a, %rcx
movq %rcx, (%rax)
movq 0x8(%rsp), %rdi
movq %rdi, 0x10(%rax)
movq (%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%r14)
movq (%rsp), %rbp
movl $0x1, %r13d
testq %rbp, %rbp
movq 0x20(%rsp), %r12
je 0x1f3ae
movl $0x81, %esi
callq 0x2afd5
testq %rax, %rax
je 0x1f322
movq %rax, %r14
movl (%rax), %eax
movl %eax, %ecx
shrl $0x12, %ecx
andl $0x3, %ecx
cmpl %r12d, %ecx
jg 0x1f3ae
xorl %r12d, %ecx
andl $0x1ff00, %eax          # imm = 0x1FF00
xorl $0x100, %eax            # imm = 0x100
orl %ecx, %eax
sete %bl
movq 0x48(%r14), %rdi
movq %rbp, %rsi
callq 0x1fab1
testl %eax, %eax
jne 0x1f2c5
movq 0x50(%r14), %rdi
movq %r15, %rsi
callq 0x1fab1
testl %eax, %eax
je 0x1f3c9
cmpl $0x1, %r12d
sete %al
testb %bl, %al
jne 0x1f2e0
movq 0x58(%r14), %rax
leaq 0x44abd(%rip), %rcx     # 0x63d98
cmpq (%rcx), %rax
jne 0x1f312
movq 0x8(%rsp), %rax
movzbl 0x10(%rax), %edx
leaq 0x12(%rax), %rcx
leaq 0x26acc(%rip), %rsi     # 0x45dc0
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x118fc
movq 0x4(%r14), %rdi
leaq 0x26ad7(%rip), %rsi     # 0x45de2
xorl %eax, %eax
callq 0x1178c
movq 0x30(%r14), %rax
leaq 0x44a7b(%rip), %rcx     # 0x63d98
cmpq (%rcx), %rax
je 0x1f358
movq 0x10(%rsp), %rdi
movl $0x3, %esi
callq 0x2b00b
movq %rax, %r14
movq %rax, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movl $0x1, %edx
callq 0x2beca
leaq 0x47cf0(%rip), %rdi     # 0x67040
movq %rbx, %rsi
callq 0x227b4
movq %rbp, 0x48(%r14)
movq %r15, 0x50(%r14)
xorl %r13d, %r13d
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1f372
callq 0x2f875
movq $0x0, 0x58(%r14)
andl $0x3, %r12d
shll $0x12, %r12d
movl $0xfff200ff, %eax       # imm = 0xFFF200FF
andl (%r14), %eax
addl %r12d, %eax
addl $0x100, %eax            # imm = 0x100
movl %eax, (%r14)
jmp 0x1f3ae
leaq 0x26a65(%rip), %rsi     # 0x45e03
movq %rax, %rdi
xorl %eax, %eax
callq 0x11a80
movl $0x1, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26a6e(%rip), %rsi     # 0x45e35
jmp 0x1f3a1
testb %bl, %bl
jne 0x1f3ae
movq 0x30(%r14), %rax
leaq 0x449c0(%rip), %rcx     # 0x63d98
cmpq (%rcx), %rax
jne 0x1f322
movl $0x1, %r13d
jmp 0x1f372