// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/types.c
// Function: composite
Type composite(ty1, ty2) Type ty1, ty2; {
	if (ty1 == ty2)
		return ty1;
	if (ty1->op != ty2->op)
		return 0;
	switch (ty1->op) {
	case CONST+VOLATILE:
		return qual(CONST, qual(VOLATILE, composite(ty1->type, ty2->type)));
	case CONST: case VOLATILE:
		return qual(ty1->op, composite(ty1->type, ty2->type));
	case POINTER:
		return ptr(composite(ty1->type, ty2->type));
	case ARRAY: {
		Type ty = composite(ty1->type, ty2->type);
		if (ty) {
			if (ty1->size && ty1->type->size && ty2->size == 0)
				return array(ty, ty1->size/ty1->type->size, ty1->align);
			if (ty2->size && ty2->type->size && ty1->size == 0)
				return array(ty, ty2->size/ty2->type->size, ty2->align);
			return array(ty, 0, 0);
		}
		break;
		}
	case FUNCTION: {
		List list = 0;
		Type ty = composite(ty1->type, ty2->type);
		if (ty) {
			Type *p1, *p2, proto = 0;
			if (ty1->u.proto && ty2->u.proto == 0)
				return func(ty, ty1->u.proto);
			if (ty2->u.proto && ty1->u.proto == 0)
				return func(ty, ty2->u.proto);
			for (p1 = ty1->u.proto, p2 = ty2->u.proto; *p1 && *p2; p1++, p2++) {
				Type ty;
				if ((ty = composite(unqual(*p1), unqual(*p2))) == 0)
					return 0;
				if (isconst(*p1) || isconst(*p2))
					ty = qual(CONST, ty);
				if (isvolatile(*p1) || isvolatile(*p2))
					ty = qual(VOLATILE, ty);
				list = append(ty, list);
			}
			if (*p1 || *p2)
				return 0;
			return funcl(ty, list);
		}
		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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x2764a
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0x27665
movq $0x0, -0x8(%rbp)
jmp 0x27a60
movq -0x10(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x1e, %eax
ja 0x27a39
movq -0x58(%rbp), %rax
leaq 0xad51(%rip), %rcx      # 0x323d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x27620
movq %rax, %rsi
movl $0x10, %edi
callq 0x27a70
movq %rax, %rsi
movl $0xf, %edi
callq 0x27a70
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x27620
movl -0x5c(%rbp), %edi
movq %rax, %rsi
callq 0x27a70
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x27620
movq %rax, %rdi
callq 0x27120
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x27620
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x277fc
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x27795
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x8(%rax)
je 0x27795
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x27795
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
cltd
idivl 0x8(%rcx)
movl %eax, %esi
movq -0x10(%rbp), %rax
movswl 0x4(%rax), %edx
callq 0x27160
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x277e6
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x8(%rax)
je 0x277e6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x277e6
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
cltd
idivl 0x8(%rcx)
movl %eax, %esi
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %edx
callq 0x27160
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x20(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x27160
movq %rax, -0x8(%rbp)
jmp 0x27a60
jmp 0x27a58
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x27620
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x27a35
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x27865
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x27865
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x27c60
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x27895
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x27895
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x27c60
movq %rax, -0x8(%rbp)
jmp 0x27a60
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, -0x5d(%rbp)
je 0x278ca
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, -0x5d(%rbp)
movb -0x5d(%rbp), %al
testb $0x1, %al
jne 0x278d6
jmp 0x27a04
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpl $0xf, (%rax)
jb 0x278f3
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x278fe
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0xf, (%rax)
jb 0x27923
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x2792e
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x27620
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x27952
movq $0x0, -0x8(%rbp)
jmp 0x27a60
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpl $0xf, (%rax)
je 0x27982
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpl $0x1f, (%rax)
je 0x27982
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0xf, (%rax)
je 0x27982
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0x1f, (%rax)
jne 0x27994
movq -0x50(%rbp), %rsi
movl $0xf, %edi
callq 0x27a70
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpl $0x10, (%rax)
je 0x279c4
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpl $0x1f, (%rax)
je 0x279c4
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0x10, (%rax)
je 0x279c4
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0x1f, (%rax)
jne 0x279d6
movq -0x50(%rbp), %rsi
movl $0x10, %edi
callq 0x27a70
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x23500
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
jmp 0x278ad
movq -0x38(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x27a18
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0x27a22
movq $0x0, -0x8(%rbp)
jmp 0x27a60
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x27d00
movq %rax, -0x8(%rbp)
jmp 0x27a60
jmp 0x27a58
jmp 0x27a58
leaq 0x7697(%rip), %rdi      # 0x2f0d7
leaq 0xac39(%rip), %rsi      # 0x32680
movl $0xb1, %edx
leaq 0xb0b9(%rip), %rcx      # 0x32b0c
callq 0x30c0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)