// File: /workspace/github_c_makefile_star2_O3/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 $0x1, %ebx
cmpq %rsi, %rdi
je 0x1924e
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x7efb(%rip), %rax      # 0x20ffc
movl (%r14), %ecx
cmpl (%r15), %ecx
jne 0x1924c
decl %ecx
cmpl $0x1e, %ecx
ja 0x1925f
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%r14), %r14
movq 0x10(%r15), %r15
cmpq %r15, %r14
jne 0x19101
jmp 0x1924e
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
movl %ebp, %edx
callq 0x190d9
testl %eax, %eax
je 0x1924c
movl 0x8(%r14), %ecx
movl 0x8(%r15), %eax
cmpl %eax, %ecx
je 0x1924e
testl %ecx, %ecx
jne 0x19242
testl %eax, %eax
jle 0x19242
movl %ebp, %ebx
jmp 0x1924e
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
movl %ebp, %edx
callq 0x190d9
testl %eax, %eax
je 0x1924c
movq 0x18(%r14), %r13
movq 0x18(%r15), %r12
cmpq %r12, %r13
je 0x1924e
testq %r13, %r13
je 0x191f4
testq %r12, %r12
je 0x191f4
movq (%r13), %rdi
testq %rdi, %rdi
je 0x191eb
addq $0x8, %r13
movq (%r12), %rsi
testq %rsi, %rsi
je 0x1924c
cmpl $0xf, (%rdi)
jb 0x191c6
movq 0x10(%rdi), %rdi
cmpl $0xf, (%rsi)
jb 0x191cf
movq 0x10(%rsi), %rsi
movl %ebp, %edx
callq 0x190d9
testl %eax, %eax
je 0x1924c
addq $0x8, %r12
movq (%r13), %rdi
addq $0x8, %r13
testq %rdi, %rdi
jne 0x191b0
cmpq $0x0, (%r12)
jne 0x1924c
jmp 0x1924e
testq %r13, %r13
cmoveq %r15, %r14
cmovneq %r13, %r12
movq (%r12), %r15
testq %r15, %r15
je 0x1924e
cmpl $0xf, (%r15)
jb 0x19212
movq 0x10(%r15), %r15
movq %r15, %rdi
callq 0xac7b
cmpq %r15, %rax
jne 0x1924c
cmpq 0x19d6a(%rip), %r15     # 0x32f90
je 0x1924c
cmpq 0x19db1(%rip), %r15     # 0x32fe0
jne 0x19237
cmpq 0x18(%r14), %r12
jne 0x1924c
movq 0x8(%r12), %r15
addq $0x8, %r12
jmp 0x19203
testl %ecx, %ecx
jle 0x1924c
movl %ebp, %ebx
testl %eax, %eax
je 0x1924e
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f35(%rip), %rdi      # 0x1e19b
leaq 0x7fbb(%rip), %rsi      # 0x21228
leaq 0x8479(%rip), %rcx      # 0x216ed
movl $0xfd, %edx
callq 0x30d0