// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x4fea3
movq -0x18(%rbp), %rdi
callq 0x4f490
cmpl $0x0, -0x1c(%rbp)
je 0x4fdc1
movq -0x18(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x4fdc1
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x44150
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x4(%rax), %rax
shrq $0x6, %rax
andq $0x3fff, %rax           # imm = 0x3FFF
movl %eax, %edi
callq 0x44030
movq -0x40(%rbp), %rdx
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rsi
movq 0x4(%rsi), %rsi
shrq $0x20, %rsi
andq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
movl %esi, %r8d
movq 0x4(%rax), %rdi
leaq 0x1bcf4(%rip), %rsi     # 0x6baa7
movb $0x0, %al
callq 0x16f90
movl $0x0, -0x1c(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
addq $0x48, %rsi
addq $0x18, %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x4ad70
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4fe9e
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x44150
movq %rax, %rdx
movq -0x58(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x4(%rax), %rdi
leaq 0x1bcc7(%rip), %rsi     # 0x6baef
movb $0x0, %al
callq 0x16f90
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x50(%rbp), %rax
movq 0x4(%rax), %rdi
leaq 0x1a611(%rip), %rsi     # 0x6a463
movb $0x0, %al
callq 0x16c10
movq -0x18(%rbp), %rax
movq 0x4(%rax), %rdi
leaq 0x1bcb8(%rip), %rsi     # 0x6bb20
movb $0x0, %al
callq 0x16c10
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x48(%rbp), %rax
movq 0x4(%rax), %rdi
leaq 0x1a5d1(%rip), %rsi     # 0x6a463
movb $0x0, %al
callq 0x16c10
jmp 0x4ff26
jmp 0x4fd22
cmpl $0x0, -0xc(%rbp)
jne 0x4ff26
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
andq $0x20000006, %rax       # imm = 0x20000006
cmpq $0x0, %rax
je 0x4fec7
jmp 0x4ff26
movq -0x30(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
jne 0x4fed7
jmp 0x4ff26
leaq 0x3493a(%rip), %rax     # 0x84818
cmpl $0x0, (%rax)
jne 0x4fee5
jmp 0x4ff26
movq -0x8(%rbp), %rax
leaq 0x3a658(%rip), %rcx     # 0x8a548
cmpq %rcx, 0x18(%rax)
jne 0x4fef8
jmp 0x4ff26
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x44150
movq %rax, %rdx
movq -0x60(%rbp), %rax
movq 0x4(%rax), %rdi
leaq 0x1bc1f(%rip), %rsi     # 0x6bb3e
movb $0x0, %al
callq 0x16d80
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)