// File: /workspace/github_c_makefile_star2_O1/Oric4ever[P]lcc65/6502/build/../src/types.c
// Function: outtype
void outtype(ty) Type ty; {
	switch (ty->op) {
	case CONST+VOLATILE:
		print("%k %k %t", CONST, VOLATILE, ty->type);
		break;
	case CONST: case VOLATILE:
		print("%k %t", ty->op, ty->type);
		break;
	case STRUCT: case UNION: case ENUM:
		assert(ty->u.sym);
		if (ty->size == 0)
			print("incomplete ");
		assert(ty->u.sym->name);
		if (*ty->u.sym->name >= '1' && *ty->u.sym->name <= '9') {
			Symbol p = findtype(ty);
			if (p == 0)
				print("%k defined at %w", ty->op, &ty->u.sym->src);
			else
				print(p->name);
		} else {
			print("%k %s", ty->op, ty->u.sym->name);
			if (ty->size == 0)
				print(" defined at %w", &ty->u.sym->src);
		}
		break;
	case VOID: case FLOAT: case DOUBLE:
	case CHAR: case SHORT: case INT: case UNSIGNED:
		print(ty->u.sym->name);
		break;
	case POINTER:
		print("pointer to %t", ty->type);
		break;
	case FUNCTION:
		print("%t function", ty->type);
		if (ty->u.proto) {
			Type *p = ty->u.proto;
			print("(%t", *p);
			while (*++p)
				if (*p == voidtype)
					print(",...");
				else
					print(",%t", *p);
			print(")");
		}
		break;
	case ARRAY:
		if (ty->size > 0 && ty->type && ty->type->size > 0) {
			print("array %d", ty->size/ty->type->size);
			while (ty->type && isarray(ty->type) && ty->type->type->size > 0) {
				ty = ty->type;
				print(",%d", ty->size/ty->type->size);
			}
		} else
			print("incomplete array");
		if (ty->type)
			print(" of %t", ty->type);
		break;
	default:
		assert(0);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %esi
leal -0x1(%rsi), %eax
cmpl $0x1e, %eax
ja 0x19cfe
movq %rdi, %rbx
leaq 0x755a(%rip), %rcx      # 0x20ff8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1187e
cmpq $0x0, 0x18(%rbx)
je 0x19cc0
cmpl $0x0, 0x8(%rbx)
jne 0x19ada
leaq 0x7c4a(%rip), %rdi      # 0x2171d
xorl %eax, %eax
callq 0x1187e
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdx
testq %rdx, %rdx
je 0x19cdf
movb (%rdx), %al
addb $-0x31, %al
cmpb $0x8, %al
ja 0x19b2a
movq %rbx, %rdi
callq 0x17542
testq %rax, %rax
jne 0x19aab
movl (%rbx), %esi
movq 0x18(%rbx), %rdx
addq $0x28, %rdx
leaq 0x7c28(%rip), %rdi      # 0x21739
jmp 0x19b1e
movq 0x10(%rbx), %rdx
leaq 0x7bea(%rip), %rdi      # 0x21708
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1187e
movl (%rbx), %esi
leaq 0x7d07(%rip), %rdi      # 0x2183a
xorl %eax, %eax
callq 0x1187e
cmpl $0x0, 0x8(%rbx)
jne 0x19cba
movq 0x18(%rbx), %rsi
addq $0x28, %rsi
leaq 0x7be8(%rip), %rdi      # 0x2173b
jmp 0x19cae
movq 0x10(%rbx), %rsi
leaq 0x7bf5(%rip), %rdi      # 0x21758
xorl %eax, %eax
callq 0x1187e
movq 0x18(%rbx), %r15
testq %r15, %r15
je 0x19cba
movq (%r15), %rsi
leaq 0x7be3(%rip), %rdi      # 0x21764
xorl %eax, %eax
callq 0x1187e
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x19bce
addq $0x10, %r15
leaq 0x6392(%rip), %rbx      # 0x1ff2e
leaq 0x7bc5(%rip), %r14      # 0x21768
cmpq 0x18436(%rip), %rsi     # 0x31fe0
je 0x19bb8
movq %r14, %rdi
xorl %eax, %eax
callq 0x1187e
jmp 0x19bc2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1187e
movq (%r15), %rsi
addq $0x8, %r15
testq %rsi, %rsi
jne 0x19ba3
leaq 0x685d(%rip), %rdi      # 0x20432
jmp 0x19aaf
movl 0x8(%rbx), %eax
testl %eax, %eax
jle 0x19c90
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x19c90
movl 0x8(%rcx), %ecx
testl %ecx, %ecx
jle 0x19c90
xorl %edx, %edx
divl %ecx
leaq 0x7b64(%rip), %rdi      # 0x2176c
movl %eax, %esi
xorl %eax, %eax
callq 0x1187e
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x19c9e
leaq 0x838e(%rip), %r14      # 0x21fb3
movq %rax, %r15
cmpl $0xf, (%rax)
jb 0x19c31
movq 0x10(%r15), %rax
cmpl $0xc, (%rax)
jne 0x19c9e
movq 0x10(%r15), %rax
movl 0x8(%rax), %ecx
testl %ecx, %ecx
jle 0x19c9e
movl 0x8(%r15), %eax
cltd
idivl %ecx
movq %r14, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1187e
movq 0x10(%r15), %rax
movq %r15, %rbx
testq %rax, %rax
jne 0x19c25
jmp 0x19c9e
movq 0x10(%rbx), %rcx
leaq 0x7a98(%rip), %rdi      # 0x21705
movl $0xf, %esi
movl $0x10, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1187e
movq 0x10(%rbx), %rsi
leaq 0x7abc(%rip), %rdi      # 0x2174a
jmp 0x19cae
leaq 0x7ade(%rip), %rdi      # 0x21775
xorl %eax, %eax
callq 0x1187e
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x19cba
leaq 0x7ad8(%rip), %rdi      # 0x21786
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1187e
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4505(%rip), %rdi      # 0x1e1cc
leaq 0x74da(%rip), %rsi      # 0x211a8
leaq 0x7a39(%rip), %rcx      # 0x2170e
movl $0x1b3, %edx            # imm = 0x1B3
callq 0x30d0
leaq 0x7a43(%rip), %rdi      # 0x21729
leaq 0x74bb(%rip), %rsi      # 0x211a8
leaq 0x7a1a(%rip), %rcx      # 0x2170e
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x30d0
leaq 0x4496(%rip), %rdi      # 0x1e19b
leaq 0x749c(%rip), %rsi      # 0x211a8
leaq 0x79fb(%rip), %rcx      # 0x2170e
movl $0x1e4, %edx            # imm = 0x1E4
callq 0x30d0