// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movl %r9d, 0x24(%rsp)
movq %r8, %r12
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, 0x30(%rsp)
movq %r8, 0x18(%rsp)
movq (%r8), %rdi
movl %edi, %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1ef4a
cmpl $0x111, 0x10(%r12)      # imm = 0x111
jne 0x1ef4a
leaq 0x27f3e(%rip), %rsi     # 0x46e83
jmp 0x1f19f
leaq 0x18(%rsp), %r14
cmpq 0x41f82(%rip), %r12     # 0x60ed8
je 0x1f15c
movl (%r12), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1ef89
cmpl $0x23, 0x10(%r12)
jne 0x1ef89
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x1fb1e
movq %rax, %r12
testq %rax, %rax
je 0x1f18e
movq 0x8(%r12), %rax
movl (%rax), %ecx
andl $0x3f, %ecx
cmpl $0x12, %ecx
jne 0x1f0d0
cmpl $0x111, 0x10(%rax)      # imm = 0x111
jne 0x1f0d0
movl (%r12), %eax
andl $0x3f, %eax
xorl %ebx, %ebx
cmpl $0x12, %eax
jne 0x1efc2
xorl %ebx, %ebx
cmpl $0x2c, 0x10(%r12)
sete %bl
movq %r12, %rdi
movl $0x17, %esi
movq 0x8(%rsp), %rdx
callq 0x1fba2
movq %r12, %r15
movq 0x8(%r12), %r13
movq 0x8(%r13), %rbp
movl (%rbp), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f016
movq %rbp, %r14
cmpl $0x111, 0x10(%rbp)      # imm = 0x111
jne 0x1f013
movq %r14, 0x8(%r12)
movq %r13, %rdi
callq 0x2fea9
movq 0x8(%r14), %rbp
movl (%rbp), %eax
andl $0x3f, %eax
movq %r14, %r13
jmp 0x1efe6
movq %r14, %rbp
movq (%r13), %rax
andq $-0x40, %rax
orq $0x18, %rax
movq %rax, (%r13)
cmpq 0x41eab(%rip), %rbp     # 0x60ed8
je 0x1f0ba
movl (%rbp), %eax
andl $0x3f, %eax
cmpl $0x12, %eax
jne 0x1f05a
cmpl $0x23, 0x10(%rbp)
jne 0x1f05a
leaq 0x8(%r13), %rdi
movq 0x8(%rsp), %rsi
callq 0x1fb1e
movq %rax, %rbp
testq %rax, %rax
je 0x1f0c9
movq %rbp, %rdi
movl $0x17, %esi
movq 0x8(%rsp), %rdx
callq 0x1fba2
cmpl $0x1, %ebx
jne 0x1f077
movl %eax, %ebx
testl %eax, %eax
jne 0x1f093
movl (%rbp), %eax
andl $0x3f, %eax
xorl %ebx, %ebx
movq %rbp, %r15
cmpl $0x12, %eax
jne 0x1f093
xorl %ebx, %ebx
cmpl $0x2c, 0x10(%rbp)
sete %bl
movq %rbp, %r15
movq 0x8(%rbp), %rcx
movl (%rcx), %edx
andl $0x3f, %edx
movl $0x3, %eax
cmpl $0x12, %edx
jne 0x1f0b5
xorl %eax, %eax
cmpl $0x111, 0x10(%rcx)      # imm = 0x111
setne %al
leal (%rax,%rax,2), %eax
movq %rbp, %r12
jmp 0x1f0bf
movl $0x6, %eax
testl %eax, %eax
je 0x1efd7
jmp 0x1f0e4
movl $0x1, %eax
jmp 0x1f0bf
movq %r12, %rdi
movl $0x15, %esi
movq 0x8(%rsp), %rdx
callq 0x1fba2
jmp 0x1f11d
cmpl $0x6, %eax
je 0x1f103
cmpl $0x3, %eax
jne 0x1f115
cmpl $0x2, %ebx
jne 0x1f118
movq (%r15), %rax
andq $-0x40, %rax
orq $0x19, %rax
movq %rax, (%r15)
jmp 0x1f118
movq (%r13), %rdi
leaq 0x27d75(%rip), %rsi     # 0x46e83
xorl %eax, %eax
callq 0x11a38
xorl %r12d, %r12d
testq %r12, %r12
je 0x1f18e
movq (%r12), %rdi
movl %edi, %eax
andl $0x3f, %eax
leal -0x10(%rax), %ecx
cmpl $0x2, %ecx
jae 0x1f13b
movq 0x10(%r12), %rax
orl $0x80000000, (%rax)     # imm = 0x80000000
jmp 0x1f140
cmpl $0x2, %eax
je 0x1f198
movq %r12, %r14
movq 0x8(%r12), %rax
addq $0x8, %r14
movq %rax, %r12
cmpq 0x41d82(%rip), %rax     # 0x60ed8
jne 0x1ef5c
movq 0x18(%rsp), %rdi
callq 0x1fc92
movq (%rax), %rcx
andq $-0x40, %rcx
orq $0x1a, %rcx
movq %rcx, (%rax)
movq 0x10(%rsp), %r15
movq %r15, 0x10(%rax)
movq (%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%r14)
movq 0x18(%rsp), %r12
jmp 0x1f1ae
movq 0x10(%rsp), %r15
xorl %r12d, %r12d
jmp 0x1f1ae
leaq 0x27d16(%rip), %rsi     # 0x46eb5
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x11a38
movq 0x10(%rsp), %r15
testq %r12, %r12
movl 0x24(%rsp), %ebp
je 0x1f1e8
movq %r15, %rdi
movl $0x81, %esi
callq 0x2b511
movq %rax, %r14
testq %rax, %rax
je 0x1f1f3
movl (%r14), %eax
movl %eax, %ecx
shrl $0x12, %ecx
andl $0x3, %ecx
movl $0x1, %r13d
cmpl %ebp, %ecx
jle 0x1f1fe
xorl %ebx, %ebx
jmp 0x1f289
movl $0x1, %r13d
jmp 0x1f31e
movl $0x1, %r13d
jmp 0x1f291
xorl %ebp, %ecx
andl $0x1ff00, %eax          # imm = 0x1FF00
xorl $0x100, %eax            # imm = 0x100
orl %ecx, %eax
sete %bl
movq 0x48(%r14), %rdi
movq %r12, %rsi
callq 0x1fa24
testl %eax, %eax
jne 0x1f235
movq 0x50(%r14), %rdi
movq 0x8(%rsp), %rsi
callq 0x1fa24
testl %eax, %eax
je 0x1f330
cmpl $0x1, %ebp
sete %al
testb %bl, %al
jne 0x1f256
movq 0x58(%r14), %rax
leaq 0x45b4e(%rip), %rcx     # 0x64d98
cmpq (%rcx), %rax
je 0x1f256
movb $0x1, %bl
xorl %r13d, %r13d
jmp 0x1f289
movzbl 0x10(%r15), %edx
leaq 0x12(%r15), %rcx
leaq 0x27bda(%rip), %rsi     # 0x46e40
xorl %r13d, %r13d
movq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x118b4
movq 0x4(%r14), %rdi
leaq 0x27be2(%rip), %rsi     # 0x46e62
xorl %eax, %eax
callq 0x11744
movb $0x1, %bl
testb %bl, %bl
je 0x1f31e
testq %r14, %r14
je 0x1f2a6
movq 0x30(%r14), %rax
leaq 0x45af7(%rip), %rcx     # 0x64d98
cmpq (%rcx), %rax
je 0x1f2da
movq 0x30(%rsp), %rdi
movl $0x3, %esi
callq 0x2b547
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2c3dd
leaq 0x48d71(%rip), %rdi     # 0x68040
movq %r15, %rsi
callq 0x2285b
xorl %r13d, %r13d
testl %r13d, %r13d
jne 0x1f2fe
movq %r12, 0x48(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0x50(%r14)
cmpq $0x0, 0x28(%rsp)
je 0x1f2fe
movq 0x28(%rsp), %rdi
callq 0x2fea9
movl $0x100, %eax            # imm = 0x100
orl (%r14), %eax
movq $0x0, 0x58(%r14)
andl $0x3, %ebp
shll $0x12, %ebp
andl $0xfff201ff, %eax       # imm = 0xFFF201FF
orl %ebp, %eax
movl %eax, (%r14)
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorb $0x1, %bl
jmp 0x1f289