// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x7cb9(%rip), %rax      # 0x20f7c
movl $0x1, %ebx
cmpq %r15, %r14
je 0x19447
movl (%r14), %ecx
cmpl (%r15), %ecx
jne 0x19445
decl %ecx
cmpl $0x1e, %ecx
ja 0x1946a
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%r14), %r14
movq 0x10(%r15), %r15
jmp 0x192c8
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
movl %ebp, %edx
callq 0x192a9
testl %eax, %eax
je 0x19445
movl 0x8(%r14), %ecx
movl 0x8(%r15), %eax
cmpl %eax, %ecx
je 0x19447
testl %ecx, %ecx
jne 0x19458
testl %eax, %eax
jle 0x19458
movl %ebp, %ebx
jmp 0x19447
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
movl %ebp, %edx
callq 0x192a9
testl %eax, %eax
je 0x19445
movq 0x18(%r14), %r13
movq 0x18(%r15), %r12
movl $0x1, %ebx
cmpq %r12, %r13
je 0x1943f
testq %r13, %r13
je 0x193de
testq %r12, %r12
je 0x193de
movq (%r13), %rdi
testq %rdi, %rdi
sete %al
je 0x193d3
movq (%r12), %rsi
testq %rsi, %rsi
je 0x193cf
addq $0x8, %r13
addq $0x8, %r12
cmpl $0xf, (%rdi)
jb 0x19396
movq 0x10(%rdi), %rdi
cmpl $0xf, (%rsi)
jb 0x1939f
movq 0x10(%rsi), %rsi
movl %ebp, %edx
callq 0x192a9
testl %eax, %eax
je 0x19464
movq (%r13), %rdi
testq %rdi, %rdi
sete %al
je 0x193d3
movq (%r12), %rsi
addq $0x8, %r13
addq $0x8, %r12
testq %rsi, %rsi
jne 0x1938d
addq $-0x8, %r12
testb %al, %al
je 0x193da
cmpq $0x0, (%r12)
je 0x1943f
movb $0x1, %cl
jmp 0x19441
testq %r13, %r13
cmoveq %r15, %r14
cmovneq %r13, %r12
movq (%r12), %r15
testq %r15, %r15
je 0x1943f
movl $0x0, %ebx
cmpl $0xf, (%r15)
jb 0x19401
movq 0x10(%r15), %r15
movq %r15, %rdi
callq 0xacd9
xorl %ecx, %ecx
cmpq %r15, %rax
jne 0x19466
cmpq 0x18b79(%rip), %r15     # 0x31f90
je 0x19441
cmpq 0x18bc0(%rip), %r15     # 0x31fe0
jne 0x19428
cmpq 0x18(%r14), %r12
jne 0x19464
movq 0x8(%r12), %r15
addq $0x8, %r12
testq %r15, %r15
jne 0x193f7
xorl %ecx, %ecx
movl $0x1, %ebx
jmp 0x19441
xorl %ecx, %ecx
testb %cl, %cl
je 0x19447
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ecx, %ecx
jle 0x19445
movl %ebp, %ebx
testl %eax, %eax
je 0x19447
jmp 0x19445
xorl %ecx, %ecx
xorl %ebx, %ebx
jmp 0x19441
leaq 0x4d2a(%rip), %rdi      # 0x1e19b
leaq 0x7d30(%rip), %rsi      # 0x211a8
leaq 0x81ee(%rip), %rcx      # 0x2166d
movl $0xfd, %edx
callq 0x30d0