// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/evaluate.c
// Function: check_duplicates
void check_duplicates(struct symbol *sym)
{
	int declared = 0;
	struct symbol *next = sym;
	int initialized = sym->initializer != NULL;

	while ((next = next->same_symbol) != NULL) {
		const char *typediff;
		evaluate_symbol(next);
		if (initialized && next->initializer) {
			sparse_error(sym->pos, "symbol '%s' has multiple initializers (originally initialized at %s:%d)",
				show_ident(sym->ident),
				stream_name(next->pos.stream), next->pos.line);
			/* Only warn once */
			initialized = 0;
		}
		declared++;
		typediff = type_difference(&sym->ctype, &next->ctype, 0, 0);
		if (typediff) {
			sparse_error(sym->pos, "symbol '%s' redeclared with different type (%s):",
				show_ident(sym->ident), typediff);
			info(sym->pos, "   %s", show_typename(sym));
			info(next->pos, "note: previously declared as:");
			info(next->pos, "   %s", show_typename(next));
			return;
		}
	}
	if (!declared) {
		unsigned long mod = sym->ctype.modifiers;
		if (mod & (MOD_STATIC | MOD_REGISTER | MOD_EXT_VISIBLE))
			return;
		if (!(mod & MOD_TOPLEVEL))
			return;
		if (!Wdecl)
			return;
		if (sym->ident == &main_ident)
			return;
		warning(sym->pos, "symbol '%s' was not declared. Should it be static?", show_ident(sym->ident));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
cmpq $0x0, 0xb0(%rdi)
setne %r12b
leaq 0x60(%rdi), %r15
xorl %ebp, %ebp
movq %rdi, %r14
movq 0x38(%r14), %r14
testq %r14, %r14
je 0x36ee1
movq %r14, %rdi
callq 0x366a3
testl %r12d, %r12d
je 0x36e3e
cmpq $0x0, 0xb0(%r14)
je 0x36e43
movq 0x18(%rbx), %rdi
callq 0x2e465
movq %rax, %r13
movl 0x4(%r14), %edi
shrl $0x6, %edi
andl $0x3fff, %edi           # imm = 0x3FFF
callq 0x2e3c4
movl 0x8(%r14), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x4(%rbx), %rdi
xorl %r12d, %r12d
leaq 0x13fe8(%rip), %rsi     # 0x4ae17
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x11a38
jmp 0x36e49
xorl %r12d, %r12d
jmp 0x36e49
movl $0x1, %r12d
leaq 0x60(%r14), %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x32020
decl %ebp
testq %rax, %rax
je 0x36dd3
movq %rax, %r13
movq 0x18(%rbx), %rdi
callq 0x2e465
movq 0x4(%rbx), %rdi
leaq 0x13fe4(%rip), %rsi     # 0x4ae5f
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x11a38
movq %rbx, %rdi
callq 0x2386c
movq 0x4(%rbx), %rdi
leaq 0x12a7c(%rip), %rbx     # 0x49917
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11744
movq 0x4(%r14), %rdi
leaq 0x13fdd(%rip), %rsi     # 0x4ae90
xorl %eax, %eax
callq 0x11744
movq %r14, %rdi
callq 0x2386c
movq 0x4(%r14), %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11744
testl %ebp, %ebp
je 0x36ef4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20000016, %eax       # imm = 0x20000016
andl 0x68(%rbx), %eax
cmpl $0x10, %eax
jne 0x36ee5
leaq 0x2a690(%rip), %rax     # 0x61598
cmpl $0x0, (%rax)
je 0x36ee5
movq 0x18(%rbx), %rdi
cmpq 0x2a090(%rip), %rdi     # 0x60fa8
je 0x36ee5
callq 0x2e465
movq 0x4(%rbx), %rdi
leaq 0x13f84(%rip), %rsi     # 0x4aeae
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x118b4