// File: /workspace/github_c_makefile_star2_O3/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 0x363ca
movq %r14, %rdi
callq 0x35be9
testl %r12d, %r12d
je 0x36327
cmpq $0x0, 0xb0(%r14)
je 0x3632c
movq 0x18(%rbx), %rdi
callq 0x2de35
movq %rax, %r13
movl 0x4(%r14), %edi
shrl $0x6, %edi
andl $0x3fff, %edi           # imm = 0x3FFF
callq 0x2dd94
movl 0x8(%r14), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x4(%rbx), %rdi
xorl %r12d, %r12d
leaq 0x13a6f(%rip), %rsi     # 0x49d87
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x11a80
jmp 0x36332
xorl %r12d, %r12d
jmp 0x36332
movl $0x1, %r12d
leaq 0x60(%r14), %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x31898
decl %ebp
testq %rax, %rax
je 0x362bc
movq %rax, %r13
movq 0x18(%rbx), %rdi
callq 0x2de35
movq 0x4(%rbx), %rdi
leaq 0x13a6b(%rip), %rsi     # 0x49dcf
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x11a80
movq %rbx, %rdi
callq 0x237c5
movq 0x4(%rbx), %rdi
leaq 0x12503(%rip), %rbx     # 0x48887
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1178c
movq 0x4(%r14), %rdi
leaq 0x13a64(%rip), %rsi     # 0x49e00
xorl %eax, %eax
callq 0x1178c
movq %r14, %rdi
callq 0x237c5
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 0x1178c
testl %ebp, %ebp
je 0x363dd
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 0x363ce
leaq 0x2a1a7(%rip), %rax     # 0x60598
cmpl $0x0, (%rax)
je 0x363ce
movq 0x18(%rbx), %rdi
cmpq 0x29baf(%rip), %rdi     # 0x5ffb0
je 0x363ce
callq 0x2de35
movq 0x4(%rbx), %rdi
leaq 0x13a0b(%rip), %rsi     # 0x49e1e
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x118fc