// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x1e, %eax
ja 0x29301
movq -0x20(%rbp), %rax
leaq 0x9542(%rip), %rcx      # 0x324d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x9c37(%rip), %rdi      # 0x32bdd
movl $0xf, %esi
movl $0x10, %edx
movb $0x0, %al
callq 0x1a890
jmp 0x29320
movq -0x8(%rbp), %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x9c0f(%rip), %rdi      # 0x32be0
movb $0x0, %al
callq 0x1a890
jmp 0x29320
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x28fea
jmp 0x29009
leaq 0x6117(%rip), %rdi      # 0x2f108
leaq 0x9688(%rip), %rsi      # 0x32680
movl $0x1b3, %edx            # imm = 0x1B3
leaq 0x9be2(%rip), %rcx      # 0x32be6
callq 0x30c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x29021
leaq 0x9bdb(%rip), %rdi      # 0x32bf5
movb $0x0, %al
callq 0x1a890
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x29032
jmp 0x29051
leaq 0x9bc8(%rip), %rdi      # 0x32c01
leaq 0x9640(%rip), %rsi      # 0x32680
movl $0x1b6, %edx            # imm = 0x1B6
leaq 0x9b9a(%rip), %rcx      # 0x32be6
callq 0x30c0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
jl 0x290c0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x290c0
movq -0x8(%rbp), %rdi
callq 0x24a20
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x290af
movq -0x8(%rbp), %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
addq $0x28, %rdx
leaq 0x9b6b(%rip), %rdi      # 0x32c11
movb $0x0, %al
callq 0x1a890
jmp 0x290be
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movb $0x0, %al
callq 0x1a890
jmp 0x29106
movq -0x8(%rbp), %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdx
leaq 0x9c39(%rip), %rdi      # 0x32d12
movb $0x0, %al
callq 0x1a890
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x29104
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
addq $0x28, %rsi
leaq 0x9b16(%rip), %rdi      # 0x32c13
movb $0x0, %al
callq 0x1a890
jmp 0x29106
jmp 0x29320
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdi
movb $0x0, %al
callq 0x1a890
jmp 0x29320
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x9af0(%rip), %rdi      # 0x32c22
movb $0x0, %al
callq 0x1a890
jmp 0x29320
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x9ae3(%rip), %rdi      # 0x32c30
movb $0x0, %al
callq 0x1a890
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x291db
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rsi
leaq 0x9ac3(%rip), %rdi      # 0x32c3c
movb $0x0, %al
callq 0x1a890
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
cmpq $0x0, 0x8(%rax)
je 0x291cd
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq 0x1b09c(%rip), %rax     # 0x44240
jne 0x291b6
leaq 0x7d79(%rip), %rdi      # 0x30f26
movb $0x0, %al
callq 0x1a890
jmp 0x291cb
movq -0x18(%rbp), %rax
movq (%rax), %rsi
leaq 0x9a7c(%rip), %rdi      # 0x32c40
movb $0x0, %al
callq 0x1a890
jmp 0x29180
leaq 0x8992(%rip), %rdi      # 0x31b66
movb $0x0, %al
callq 0x1a890
jmp 0x29320
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x292d0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x292d0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x8(%rax)
jle 0x292d0
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
cltd
idivl 0x8(%rcx)
movl %eax, %esi
leaq 0x9a19(%rip), %rdi      # 0x32c44
movb $0x0, %al
callq 0x1a890
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x10(%rcx)
movb %al, -0x21(%rbp)
je 0x29291
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0xf, (%rax)
jb 0x29261
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x2926d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpl $0xc, (%rcx)
movb %al, -0x21(%rbp)
jne 0x29291
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x8(%rax)
setg %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x2929a
jmp 0x292ce
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
cltd
idivl 0x8(%rcx)
movl %eax, %esi
leaq 0xafac(%rip), %rdi      # 0x3426e
movb $0x0, %al
callq 0x1a890
jmp 0x29232
jmp 0x292de
leaq 0x9976(%rip), %rdi      # 0x32c4d
movb $0x0, %al
callq 0x1a890
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x292ff
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x9966(%rip), %rdi      # 0x32c5e
movb $0x0, %al
callq 0x1a890
jmp 0x29320
leaq 0x5dcf(%rip), %rdi      # 0x2f0d7
leaq 0x9371(%rip), %rsi      # 0x32680
movl $0x1e4, %edx            # imm = 0x1E4
leaq 0x98cb(%rip), %rcx      # 0x32be6
callq 0x30c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)