// File: /workspace/github_c_makefile_star2_O2/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 0x3056c
movq %r14, %rdi
callq 0x3031d
testl %r12d, %r12d
je 0x304d1
cmpq $0x0, 0xb0(%r14)
pushq $0x1
popq %r12
je 0x304d4
movq 0x18(%rbx), %rdi
callq 0x2936d
movq %rax, %r13
movl 0x4(%r14), %edi
shrl $0x6, %edi
andl $0x3fff, %edi           # imm = 0x3FFF
callq 0x292d8
movl 0x8(%r14), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x4(%rbx), %rdi
xorl %r12d, %r12d
leaq 0x12b15(%rip), %rsi     # 0x42fd7
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1120e
jmp 0x304d4
xorl %r12d, %r12d
leaq 0x60(%r14), %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2c88c
decl %ebp
testq %rax, %rax
je 0x30462
movq %rax, %r13
movq 0x18(%rbx), %rdi
callq 0x2936d
movq 0x4(%rbx), %rdi
leaq 0x12b19(%rip), %rsi     # 0x4301f
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x1120e
movq %rbx, %rdi
callq 0x20b5a
movq 0x4(%rbx), %rdi
leaq 0x11511(%rip), %rbx     # 0x41a37
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10ddc
movq 0x4(%r14), %rdi
leaq 0x12b12(%rip), %rsi     # 0x43050
xorl %eax, %eax
callq 0x10ddc
movq %r14, %rdi
callq 0x20b5a
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 0x10ddc
testl %ebp, %ebp
je 0x3057f
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 0x30570
leaq 0x2a005(%rip), %rax     # 0x5a598
cmpl $0x0, (%rax)
je 0x30570
movq 0x18(%rbx), %rdi
cmpq 0x29a05(%rip), %rdi     # 0x59fa8
je 0x30570
callq 0x2936d
movq 0x4(%rbx), %rdi
leaq 0x12ab9(%rip), %rsi     # 0x4306e
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1108a