// File: /workspace/github_c_makefile_star2_O2/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 %r8, %rbx
movq %rcx, %r15
movq %rdi, %rcx
movq %r8, 0x8(%rsp)
movq (%r8), %rdi
movl %edi, %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1c71d
cmpl $0x111, 0x10(%rbx)      # imm = 0x111
jne 0x1c71d
leaq 0x2274b(%rip), %rsi     # 0x3ee63
jmp 0x1c8e4
movq %rcx, 0x10(%rsp)
movq %rdx, (%rsp)
movq %rsi, 0x18(%rsp)
movq %r9, 0x20(%rsp)
leaq 0x8(%rsp), %r13
leaq 0x63ea4(%rip), %r12     # 0x805e0
cmpq %r12, %rbx
je 0x1c8ff
movl (%rbx), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1c76c
cmpl $0x23, 0x10(%rbx)
jne 0x1c76c
movq %r13, %rdi
movq %r15, %rsi
callq 0x1d213
movq %rax, %rbx
testq %rax, %rax
je 0x1c8eb
movq 0x8(%rbx), %rax
movl (%rax), %ecx
andl $0x3f, %ecx
cmpl $0x12, %ecx
jne 0x1c897
cmpl $0x111, 0x10(%rax)      # imm = 0x111
jne 0x1c897
movl (%rbx), %eax
andl $0x3f, %eax
xorl %r14d, %r14d
cmpl $0x12, %eax
jne 0x1c7a3
xorl %r14d, %r14d
cmpl $0x2c, 0x10(%rbx)
sete %r14b
movq %rbx, %rdi
pushq $0x17
popq %rsi
movq %r15, %rdx
callq 0x1d282
movq 0x8(%rbx), %rdi
movq %rbx, %rbp
movq 0x8(%rdi), %r13
movl (%r13), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1c7e0
cmpl $0x111, 0x10(%r13)      # imm = 0x111
jne 0x1c7e0
movq %r13, 0x8(%rbx)
callq 0x2a956
movq %r13, %rdi
jmp 0x1c7b8
movq (%rdi), %rax
andq $-0x40, %rax
orq $0x18, %rax
movq %rax, (%rdi)
cmpq %r12, %r13
je 0x1c8da
movl (%r13), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1c822
cmpl $0x23, 0x10(%r13)
jne 0x1c822
addq $0x8, %rdi
movq %r15, %rsi
callq 0x1d213
movq %rax, %r13
testq %rax, %rax
je 0x1c8eb
movq %r13, %rdi
pushq $0x17
popq %rsi
movq %r15, %rdx
callq 0x1d282
cmpl $0x1, %r14d
jne 0x1c83d
movl %eax, %r14d
testl %eax, %eax
jne 0x1c85e
movl (%r13), %eax
andl $0x3f, %eax
xorl %r14d, %r14d
movq %r13, %rbp
cmpl $0x12, %eax
jne 0x1c85e
xorl %r14d, %r14d
cmpl $0x2c, 0x10(%r13)
sete %r14b
movq %r13, %rbp
movq 0x8(%r13), %rdi
movl (%rdi), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1c87c
cmpl $0x111, 0x10(%rdi)      # imm = 0x111
movq %r13, %rbx
je 0x1c7b8
cmpl $0x2, %r14d
jne 0x1c892
movq (%rbp), %rax
andq $-0x40, %rax
orq $0x19, %rax
movq %rax, (%rbp)
movq %r13, %rbx
jmp 0x1c8a5
movq %rbx, %rdi
pushq $0x15
popq %rsi
movq %r15, %rdx
callq 0x1d282
movq (%rbx), %rdi
movl %edi, %eax
andl $0x3f, %eax
leal -0x10(%rax), %ecx
cmpl $0x2, %ecx
jae 0x1c8c1
movq 0x10(%rbx), %rax
orl $0x80000000, (%rax)     # imm = 0x80000000
jmp 0x1c8ca
cmpl $0x2, %eax
je 0x1ca65
movq %rbx, %r13
movq 0x8(%rbx), %rbx
addq $0x8, %r13
jmp 0x1c73c
leaq 0x22582(%rip), %rsi     # 0x3ee63
movq %rax, %rdi
xorl %eax, %eax
callq 0x1120e
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x1d35e
movq (%rax), %rcx
andq $-0x40, %rcx
orq $0x1a, %rcx
movq %rcx, (%rax)
movq (%rsp), %rdi
movq %rdi, 0x10(%rax)
movq (%r13), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%r13)
movq 0x8(%rsp), %r13
pushq $0x1
popq %rbx
testq %r13, %r13
je 0x1c8ee
movl $0x81, %esi
callq 0x266e9
testq %rax, %rax
movq 0x20(%rsp), %r12
je 0x1c9f6
movq %rax, %r14
movl (%rax), %eax
movl %eax, %ecx
shrl $0x12, %ecx
andl $0x3, %ecx
cmpl %r12d, %ecx
jg 0x1c8ee
xorl %r12d, %ecx
andl $0x1ff00, %eax          # imm = 0x1FF00
xorl $0x100, %eax            # imm = 0x100
orl %ecx, %eax
sete %bpl
movq 0x48(%r14), %rdi
movq %r13, %rsi
callq 0x1d12e
testl %eax, %eax
jne 0x1c999
movq 0x50(%r14), %rdi
movq %r15, %rsi
callq 0x1d12e
testl %eax, %eax
je 0x1ca71
cmpl $0x1, %r12d
sete %al
testb %bpl, %al
jne 0x1c9b5
movq 0x58(%r14), %rax
leaq 0x413e8(%rip), %rcx     # 0x5dd98
cmpq (%rcx), %rax
jne 0x1c9e6
movq (%rsp), %rax
movzbl 0x10(%rax), %edx
leaq 0x12(%rax), %rcx
leaq 0x22458(%rip), %rsi     # 0x3ee20
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x1108a
movq 0x4(%r14), %rdi
leaq 0x22463(%rip), %rsi     # 0x3ee42
xorl %eax, %eax
callq 0x10ddc
movq 0x30(%r14), %rax
leaq 0x413a7(%rip), %rcx     # 0x5dd98
cmpq (%rcx), %rax
je 0x1ca27
pushq $0x3
popq %rsi
movq 0x10(%rsp), %rdi
callq 0x2671f
movq %rax, %r14
pushq $0x1
popq %rdx
movq %rax, %rdi
movq (%rsp), %rbx
movq %rbx, %rsi
callq 0x274ad
leaq 0x44621(%rip), %rdi     # 0x61040
movq %rbx, %rsi
callq 0x1fae9
movq %r13, 0x48(%r14)
movq %r15, 0x50(%r14)
xorl %ebx, %ebx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1ca40
callq 0x2a956
andq $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 0x1c8ee
leaq 0x22429(%rip), %rsi     # 0x3ee95
jmp 0x1c8e4
testb %bpl, %bpl
jne 0x1c8ee
movq 0x30(%r14), %rax
leaq 0x41313(%rip), %rcx     # 0x5dd98
cmpq (%rcx), %rax
jne 0x1c9f6
pushq $0x1
popq %rbx
jmp 0x1ca40