// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/types.c
// Function: qual
Type qual(int op, Type ty) {
	if (isarray(ty))
		ty = tynode(ARRAY, qual(op, ty->type), ty->size,
			ty->align, 0);
	else if (isfunc(ty))
		warning("qualified function type ignored\n");
	else if ((isconst(ty) && op == CONST) || (isvolatile(ty) && op == VOLATILE))
		error("illegal type `%k %t'\n", op, ty);
	else {
		int i;
		struct type *tn;
		if (isqual(ty)) {
			op += ty->op;
			ty = ty->type;
		}
		for (i = 0; i < sizeof typetable/sizeof typetable[0]; i++)
			for (tn = typetable[i]; tn; tn = tn->link)
				if (tn->type.op == op && tn->type.type == ty) {
					tn->type.size = ty->size;
					tn->type.align = ty->align;
					return &tn->type;
				}
		return tynode(op, ty, ty->size, ty->align, 0);
	}
	return ty;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x27a96
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x27a9e
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x27ae1
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x27a70
movq %rax, %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %ecx
movl $0xc, %edi
xorl %eax, %eax
movl %eax, %r8d
callq 0x26eb0
movq %rax, -0x18(%rbp)
jmp 0x27c3f
movq -0x18(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x27af8
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x27b00
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0xb, (%rax)
jne 0x27b1c
leaq 0xb1bd(%rip), %rdi      # 0x32ccd
movb $0x0, %al
callq 0xdba0
jmp 0x27c3d
movq -0x18(%rbp), %rax
cmpl $0xf, (%rax)
je 0x27b2e
movq -0x18(%rbp), %rax
cmpl $0x1f, (%rax)
jne 0x27b34
cmpl $0xf, -0xc(%rbp)
je 0x27b4c
movq -0x18(%rbp), %rax
cmpl $0x10, (%rax)
je 0x27b46
movq -0x18(%rbp), %rax
cmpl $0x1f, (%rax)
jne 0x27b66
cmpl $0x10, -0xc(%rbp)
jne 0x27b66
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
leaq 0xb194(%rip), %rdi      # 0x32cee
movb $0x0, %al
callq 0xd530
jmp 0x27c3b
movq -0x18(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x27b87
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
cmpq $0x80, %rax
jae 0x27c15
movslq -0x1c(%rbp), %rcx
leaq 0x1c6fb(%rip), %rax     # 0x442a0
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x27c05
movq -0x28(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x27bf5
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x27bf5
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x27c47
jmp 0x27bf7
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x27bad
jmp 0x27c07
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x27b8e
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x26eb0
movq %rax, -0x8(%rbp)
jmp 0x27c47
jmp 0x27c3d
jmp 0x27c3f
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)