// File: /workspace/github_c_makefile_star2_O1/Oric4ever[P]lcc65/6502/build/../src/sym.c
// Function: constant
Symbol constant(ty, v) Type ty; Value v; {
	struct entry *p;
	unsigned h = v.u&(HASHSIZE-1);

	ty = unqual(ty);
	for (p = constants->buckets[h]; p; p = p->link)
		if (eqtype(ty, p->sym.type, 1))
			switch (ty->op) {
			case CHAR:     if (v.uc == p->sym.u.c.v.uc) return &p->sym; break;
			case SHORT:    if (v.ss == p->sym.u.c.v.ss) return &p->sym; break;
			case INT:      if (v.i  == p->sym.u.c.v.i)  return &p->sym; break;
			case UNSIGNED: if (v.u  == p->sym.u.c.v.u)  return &p->sym; break;
			case FLOAT:    if (v.f  == p->sym.u.c.v.f)  return &p->sym; break;
			case DOUBLE:   if (v.d  == p->sym.u.c.v.d)  return &p->sym; break;
			case ARRAY: case FUNCTION:
			case POINTER:  if (v.p  == p->sym.u.c.v.p)  return &p->sym; break;
			default: assert(0);
			}
	p = (struct entry *) alloc(sizeof *p);
	BZERO(&p->sym, struct symbol);
	p->sym.name = vtoa(ty, v);
	p->sym.scope = CONSTANTS;
	p->sym.type = ty;
	p->sym.sclass = STATIC;
	p->sym.u.c.v = v;
	p->link = constants->buckets[h];
	p->sym.up = constants->list;
	constants->list = &p->sym;
	constants->buckets[h] = p;
	p->refs = 0;	/* (omit) */
	defsymbol(&p->sym);
	return &p->sym;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, 0x8(%rsp)
movl %r15d, %r12d
andl $0x7f, %r12d
cmpl $0xf, (%rdi)
jb 0x16ed5
movq 0x10(%r14), %r14
movq 0x11bcc(%rip), %rax     # 0x28aa8
movq 0x18(%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0x16f94
movq 0x8(%rsp), %r13
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movzwl 0x8(%rsp), %eax
movw %ax, 0x6(%rsp)
movb 0x8(%rsp), %al
movb %al, 0x5(%rsp)
leaq 0x9b8c(%rip), %rbp      # 0x20aa0
movq 0x20(%rbx), %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x192a9
testl %eax, %eax
je 0x16f88
movl (%r14), %eax
decl %eax
cmpl $0xb, %eax
ja 0x1707f
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
cmpq 0x48(%rbx), %r13
jne 0x16f88
jmp 0x1706d
cmpl 0x48(%rbx), %r15d
jne 0x16f88
jmp 0x1706d
movsd 0x10(%rsp), %xmm0
ucomisd 0x48(%rbx), %xmm0
jne 0x16f88
jp 0x16f88
jmp 0x1706d
movb 0x5(%rsp), %al
cmpb 0x48(%rbx), %al
jne 0x16f88
jmp 0x1706d
movzwl 0x6(%rsp), %eax
cmpw 0x48(%rbx), %ax
je 0x1706d
movq 0x90(%rbx), %rbx
testq %rbx, %rbx
jne 0x16f14
leaq 0x127d5(%rip), %rax     # 0x29770
movq (%rax), %rax
movl $0x98, (%rax)
movq 0x8(%rax), %rbx
leaq 0x98(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jae 0x16fbb
movq %rcx, 0x8(%rax)
jmp 0x16fcf
leaq 0x127ae(%rip), %rsi     # 0x29770
movl $0x98, %edi
callq 0x17978
movq %rax, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x70(%rbx)
movupd %xmm0, 0x60(%rbx)
movupd %xmm0, 0x50(%rbx)
movupd %xmm0, 0x40(%rbx)
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
xorl %r15d, %r15d
movq %r15, 0x80(%rbx)
movq 0x8(%rsp), %xmm0
movq %xmm0, 0x10(%rsp)
movq %xmm0, %rsi
movq %r14, %rdi
callq 0x14e3f
movq %rax, 0x10(%rbx)
movw $0x1, 0x18(%rbx)
movq %r14, 0x20(%rbx)
movb $0x51, 0x1a(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x48(%rbx)
movq 0x11a67(%rip), %rax     # 0x28aa8
movq 0x18(%rax,%r12,8), %rcx
movq %rcx, 0x90(%rbx)
movq 0x10(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq %rbx, 0x10(%rax)
movq %rbx, 0x18(%rax,%r12,8)
movq %r15, 0x88(%rbx)
movq %rbx, %rdi
callq 0x1a687
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7115(%rip), %rdi      # 0x1e19b
leaq 0x9a43(%rip), %rsi      # 0x20ad0
leaq 0x9a49(%rip), %rcx      # 0x20add
movl $0x37, %edx
callq 0x30d0