// File: /workspace/github_c_makefile_star2_O1/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
movq 0x9c30(%rip), %rbp      # 0x1afc0
leaq 0x4ea0(%rip), %r12      # 0x16237
leaq 0xad6a(%rip), %r15      # 0x1c108
addq $0x8, %r15
leaq 0x4e65(%rip), %r13      # 0x1620e
movl (%rbx), %eax
cmpl $0x9, %eax
jne 0x113f5
cmpl $0x4c, 0x14(%rbx)
jne 0x113c8
movq 0x30(%rbx), %rax
cmpl $0x7, (%rax)
jne 0x113c8
movq 0x38(%rbx), %rax
cmpl $0x1, (%rax)
je 0x113d5
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0xd56a
movq 0x30(%rbx), %rdi
xorl %esi, %esi
callq 0x11378
movq (%rbp), %rsi
movq %r12, %rdi
callq 0x30f0
movq 0x38(%rbx), %rbx
xorl %r14d, %r14d
jmp 0x113a9
cmpl $0x1, %eax
je 0x11472
cmpl $0x2, %eax
je 0x11490
cmpl $0x7, %eax
jne 0x11524
cmpl $0x4a, 0x14(%rbx)
je 0x11420
leaq 0x4de2(%rip), %rdi      # 0x161fb
xorl %eax, %eax
callq 0xe054
movq 0x18(%rbx), %rbx
cmpl $0x0, (%rbx)
je 0x1143a
leaq 0x4dde(%rip), %rsi      # 0x1620e
movq %r15, %rdi
xorl %eax, %eax
callq 0xd56a
movq 0x30(%rbx), %rbx
cmpl $0x1, 0x8(%rbx)
jne 0x1145b
cmpl $0x0, 0x44(%rbx)
je 0x1145b
leaq 0x4dbd(%rip), %rsi      # 0x1620e
movq %r15, %rdi
xorl %eax, %eax
callq 0xd56a
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10ec1
movq 0x8(%rbx), %rax
testb $0x20, 0x4(%rax)
jne 0x11543
movq 0x30(%rbx), %rsi
leaq 0x11b4(%rip), %rdi      # 0x1263f
jmp 0x11607
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %r13
cmpq $0x1, %r13
jne 0x11576
movq (%rbp), %rsi
movl $0x22, %edi
callq 0x3110
xorl %r12d, %r12d
testq %r14, %r14
je 0x115e1
cmpq $0x0, 0x30(%rbx)
je 0x115e1
callq 0x3240
movq %rax, %r15
xorl %r12d, %r12d
movq 0x38(%rbx), %rax
movzbl (%rax,%r12), %esi
movq (%r15), %rax
movzwl (%rax,%rsi,2), %eax
btl $0xe, %eax
jae 0x114f6
cmpl $0x22, %esi
je 0x114f6
cmpl $0x5c, %esi
jne 0x1151b
leaq 0x4d47(%rip), %rdi      # 0x16244
xorl %eax, %eax
callq 0x30b0
incq %r12
cmpq %r14, %r12
jae 0x115e1
cmpq 0x30(%rbx), %r12
jb 0x114d6
jmp 0x115e1
movl %esi, %edi
callq 0x3030
jmp 0x11504
leaq 0x4ce3(%rip), %rsi      # 0x1620e
movq %r15, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd56a
cmpq $0x4, 0x10(%rax)
movl $0x73, %eax
movl $0x64, %esi
cmovel %eax, %esi
movsd 0x30(%rbx), %xmm0
leaq 0x4cda(%rip), %rdi      # 0x1623b
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30b0
cmpq $0x0, 0x30(%rbx)
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x115f1
cmpq $0x4, %r13
je 0x11598
cmpq $0x2, %r13
jne 0x1162b
leaq 0x4cab(%rip), %r15      # 0x1624a
movq %r13, %rbp
xorl %r12d, %r12d
cmpq $0x2, %r13
jne 0x115b6
movq 0x38(%rbx), %rax
movzwl (%rax,%r12,2), %esi
jmp 0x115be
movq 0x38(%rbx), %rax
movl (%rax,%r12,4), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x30b0
incq %r12
cmpq 0x30(%rbx), %r12
jae 0x115f4
movq %rbp, %rax
addq %r13, %rax
cmpq %r14, %rbp
movq %rax, %rbp
jb 0x115a5
jmp 0x115f4
movq (%rbp), %rsi
movl $0x22, %edi
callq 0x3110
jmp 0x115f4
xorl %r12d, %r12d
imulq %r13, %r12
subq %r12, %r14
jbe 0x1161c
leaq 0x4c7b(%rip), %rdi      # 0x1627f
movq %r14, %rsi
xorl %eax, %eax
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 0x468c(%rip), %rdi      # 0x15cbe
leaq 0x421b(%rip), %rsi      # 0x15854
leaq 0x4c0e(%rip), %rcx      # 0x1624e
movl $0x563, %edx            # imm = 0x563
callq 0x30e0