// File: /workspace/github_c_makefile_star2_O2/michaelforney[P]cproc/qbe.c
// Function: dataitem
static void
dataitem(struct expr *expr, unsigned long long size)
{
	struct decl *decl;
	size_t i, w;
	unsigned c;

	switch (expr->kind) {
	case EXPRUNARY:
		if (expr->op != TBAND)
			fatal("not a address expr");
		expr = expr->base;
		if (expr->kind != EXPRIDENT)
			error(&tok.loc, "initializer is not a constant expression");
		decl = expr->u.ident.decl;
		if (decl->kind == DECLOBJECT && decl->u.obj.storage != SDSTATIC)
			error(&tok.loc, "initializer is not a constant expression");
		emitname(decl->value);
		break;
	case EXPRBINARY:
		if (expr->op != TADD || expr->u.binary.l->kind != EXPRUNARY || expr->u.binary.r->kind != EXPRCONST)
			error(&tok.loc, "initializer is not a constant expression");
		dataitem(expr->u.binary.l, 0);
		fputs(" + ", stdout);
		dataitem(expr->u.binary.r, 0);
		break;
	case EXPRCONST:
		if (expr->type->prop & PROPFLOAT)
			printf("%c_%.17g", expr->type->size == 4 ? 's' : 'd', expr->u.constant.f);
		else
			printf("%llu", expr->u.constant.u);
		break;
	case EXPRSTRING:
		w = expr->type->base->size;
		if (w == 1) {
			fputc('"', stdout);
			for (i = 0; i < expr->u.string.size && i < size; ++i) {
				c = ((unsigned char *)expr->u.string.data)[i];
				if (isprint(c) && c != '"' && c != '\\')
					putchar(c);
				else
					printf("\\%03o", c);
			}
			fputc('"', stdout);
		} else {
			for (i = 0; i < expr->u.string.size && i * w < size; ++i) {
				switch (w) {
				case 2: printf("%" PRIuLEAST16 " ", ((uint_least16_t *)expr->u.string.data)[i]); break;
				case 4: printf("%" PRIuLEAST32 " ", ((uint_least32_t *)expr->u.string.data)[i]); break;
				default: assert(0);
				}
			}
		}
		if (i * w < size)
			printf(", z %llu", size - (unsigned long long)i * w);
		break;
	default:
		error(&tok.loc, "initializer is not a constant expression");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4ab7(%rip), %rbp      # 0x1482c
leaq 0x551f(%rip), %r12      # 0x1529b
leaq 0xc385(%rip), %r15      # 0x1c108
addq $0x8, %r15
leaq 0x54e4(%rip), %r13      # 0x15272
movl (%rbx), %eax
decl %eax
cmpl $0x8, %eax
ja 0xfefd
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
cmpl $0x4c, 0x14(%rbx)
jne 0xfdbd
movq 0x30(%rbx), %rdi
cmpl $0x7, (%rdi)
jne 0xfdbd
movq 0x38(%rbx), %rax
cmpl $0x1, (%rax)
je 0xfdce
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0xc536
movq 0x30(%rbx), %rdi
xorl %esi, %esi
callq 0xfd5d
movq 0xb1e4(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
movq %r12, %rdi
callq 0x30f0
movq 0x38(%rbx), %rbx
xorl %r14d, %r14d
jmp 0xfd8e
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %r12
cmpq $0x1, %r12
jne 0xff1c
movq 0xb1b3(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
pushq $0x22
popq %rdi
callq 0x3110
leaq 0x5489(%rip), %r15      # 0x152a8
xorl %r13d, %r13d
cmpq %r14, %r13
jae 0xff66
cmpq 0x30(%rbx), %r13
jae 0xff66
movq 0x38(%rbx), %rax
movzbl (%rax,%r13), %r12d
callq 0x3240
movq (%rax), %rax
movzwl (%rax,%r12,2), %eax
btl $0xe, %eax
jae 0xfe5d
cmpl $0x22, %r12d
je 0xfe5d
cmpl $0x5c, %r12d
jne 0xfe6f
movq %r15, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x30b0
incq %r13
jmp 0xfe22
movl %r12d, %edi
callq 0x3030
jmp 0xfe6a
cmpl $0x4a, 0x14(%rbx)
je 0xfe8d
leaq 0x53d9(%rip), %rdi      # 0x1525f
xorl %eax, %eax
callq 0xcffb
movq 0x18(%rbx), %rbx
cmpl $0x0, (%rbx)
je 0xfea7
leaq 0x53d5(%rip), %rsi      # 0x15272
movq %r15, %rdi
xorl %eax, %eax
callq 0xc536
movq 0x30(%rbx), %rbx
cmpl $0x1, 0x8(%rbx)
jne 0xfec8
cmpl $0x0, 0x44(%rbx)
je 0xfec8
leaq 0x53b4(%rip), %rsi      # 0x15272
movq %r15, %rdi
xorl %eax, %eax
callq 0xc536
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf896
movq 0x8(%rbx), %rax
testb $0x20, 0x4(%rax)
jne 0xff9c
movq 0x30(%rbx), %rsi
leaq 0x17a7(%rip), %rdi      # 0x1169f
jmp 0xff87
leaq 0x536e(%rip), %rsi      # 0x15272
movq %r15, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc536
leaq 0x538b(%rip), %r15      # 0x152ae
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq 0x30(%rbx), %rbp
jae 0xff78
cmpq %r14, %r13
jae 0xff78
cmpq $0x4, %r12
je 0xff4d
cmpq $0x2, %r12
jne 0xffda
movq 0x38(%rbx), %rax
movzwl (%rax,%rbp,2), %esi
jmp 0xff54
movq 0x38(%rbx), %rax
movl (%rax,%rbp,4), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x30b0
incq %rbp
addq %r12, %r13
jmp 0xff28
movq 0xb053(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
pushq $0x22
popq %rdi
callq 0x3110
subq %r13, %r14
jbe 0xffcb
leaq 0x535f(%rip), %rdi      # 0x152e3
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30b0
cmpq $0x4, 0x10(%rax)
pushq $0x73
popq %rax
pushq $0x64
popq %rsi
cmovel %eax, %esi
movsd 0x30(%rbx), %xmm0
leaq 0x52e9(%rip), %rdi      # 0x1529f
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4d41(%rip), %rdi      # 0x14d22
leaq 0x48d0(%rip), %rsi      # 0x148b8
leaq 0x52c3(%rip), %rcx      # 0x152b2
movl $0x563, %edx            # imm = 0x563
callq 0x30e0