// File: /workspace/github_c_makefile_star2_O2/Oric4ever[P]lcc65/6502/build/../src/types.c
// Function: eqtype
int eqtype(ty1, ty2, ret) Type ty1, ty2; int ret; {
	if (ty1 == ty2)
		return 1;
	if (ty1->op != ty2->op)
		return 0;
	switch (ty1->op) {
	case CONST: case VOLATILE: case CONST+VOLATILE: case POINTER:
		return eqtype(ty1->type, ty2->type, ret);
	case ARRAY:
		if (eqtype(ty1->type, ty2->type, ret)) {
			if (ty1->size == ty2->size)
				return 1;
			if ((ty1->size == 0 && ty2->size >  0)
			||  (ty1->size >  0 && ty2->size == 0))
				return ret;
		}
		break;
	case FUNCTION:
		if (eqtype(ty1->type, ty2->type, ret)) {
			Type *p1 = ty1->u.proto, *p2 = ty2->u.proto;
			if (p1 == p2)
				return 1;
			if (p1 == 0 || p2 == 0) {
				if (p1 == 0) {
					ty1 = ty2;
					p1 = p2;
				}
				for ( ; *p1; p1++) {
					Type ty = unqual(*p1);
					if (promote(ty) != ty || ty == floattype
					|| (ty == voidtype && p1 != ty1->u.proto))
						return 0;
				}
				return 1;
			}
			for ( ; *p1 && *p2; p1++, p2++)
				if (eqtype(unqual(*p1), unqual(*p2), ret) == 0)
/*				if (eqtype(*p1, *p2, ret) == 0) */
					return 0;
			if (*p1 == 0 && *p2 == 0)
				return 1;
		}
		break;
	case CHAR:   case SHORT: case INT:     case DOUBLE:
	case VOID:   case FLOAT: case UNSIGNED:
	case STRUCT: case UNION: case ENUM:
		break;
	default:
		assert(0);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x7499(%rip), %rax      # 0x1effc
cmpq %r15, %r14
je 0x17c9b
movl (%r14), %ecx
cmpl (%r15), %ecx
jne 0x17c99
decl %ecx
cmpl $0x1e, %ecx
ja 0x17cac
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%r14), %r14
movq 0x10(%r15), %r15
jmp 0x17b63
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
movl %ebp, %edx
callq 0x17b46
testl %eax, %eax
je 0x17c99
movl 0x8(%r14), %ecx
movl 0x8(%r15), %eax
cmpl %eax, %ecx
je 0x17c9b
testl %ecx, %ecx
jne 0x17c88
testl %eax, %eax
jle 0x17c88
movl %ebp, %ebx
jmp 0x17c9b
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
movl %ebp, %edx
callq 0x17b46
testl %eax, %eax
je 0x17c99
movq 0x18(%r14), %r13
movq 0x18(%r15), %r12
cmpq %r12, %r13
je 0x17c9b
testq %r13, %r13
je 0x17c3f
testq %r12, %r12
je 0x17c3f
xorl %r14d, %r14d
movq (%r13,%r14), %rdi
movq (%r12,%r14), %rsi
testq %rdi, %rdi
je 0x17c94
testq %rsi, %rsi
je 0x17c99
cmpl $0xf, (%rdi)
jb 0x17c25
movq 0x10(%rdi), %rdi
cmpl $0xf, (%rsi)
jb 0x17c2e
movq 0x10(%rsi), %rsi
movl %ebp, %edx
callq 0x17b46
testl %eax, %eax
je 0x17c99
addq $0x8, %r14
jmp 0x17c09
testq %r13, %r13
cmoveq %r15, %r14
cmovneq %r13, %r12
movq (%r12), %r15
testq %r15, %r15
je 0x17c9b
cmpl $0xf, (%r15)
jb 0x17c5d
movq 0x10(%r15), %r15
movq %r15, %rdi
callq 0xa287
cmpq %r15, %rax
jne 0x17c99
cmpq 0x1a31f(%rip), %r15     # 0x31f90
je 0x17c99
cmpq 0x1a366(%rip), %r15     # 0x31fe0
jne 0x17c82
cmpq 0x18(%r14), %r12
jne 0x17c99
addq $0x8, %r12
jmp 0x17c4a
testl %ecx, %ecx
jle 0x17c99
movl %ebp, %ebx
testl %eax, %eax
je 0x17c9b
jmp 0x17c99
testq %rsi, %rsi
je 0x17c9b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44e8(%rip), %rdi      # 0x1c19b
leaq 0x756e(%rip), %rsi      # 0x1f228
leaq 0x7a2c(%rip), %rcx      # 0x1f6ed
movl $0xfd, %edx
callq 0x30d0