// File: /workspace/github_c_makefile_star2_O3/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 0x9bfc(%rip), %rbp      # 0x1afc0
leaq 0x4f0c(%rip), %r12      # 0x162d7
leaq 0xad36(%rip), %r15      # 0x1c108
addq $0x8, %r15
leaq 0x4ed1(%rip), %r13      # 0x162ae
movl (%rbx), %eax
cmpl $0x9, %eax
jne 0x11429
cmpl $0x4c, 0x14(%rbx)
jne 0x113fc
movq 0x30(%rbx), %rdi
cmpl $0x7, (%rdi)
jne 0x113fc
movq 0x38(%rbx), %rax
cmpl $0x1, (%rax)
je 0x1140d
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0xd55c
movq 0x30(%rbx), %rdi
xorl %esi, %esi
callq 0x113ac
movq (%rbp), %rsi
movq %r12, %rdi
callq 0x30f0
movq 0x38(%rbx), %rbx
xorl %r14d, %r14d
jmp 0x113dd
cmpl $0x1, %eax
je 0x114a6
cmpl $0x2, %eax
je 0x114c4
cmpl $0x7, %eax
jne 0x11558
cmpl $0x4a, 0x14(%rbx)
je 0x11454
leaq 0x4e4e(%rip), %rdi      # 0x1629b
xorl %eax, %eax
callq 0xe058
movq 0x18(%rbx), %rbx
cmpl $0x0, (%rbx)
je 0x1146e
leaq 0x4e4a(%rip), %rsi      # 0x162ae
movq %r15, %rdi
xorl %eax, %eax
callq 0xd55c
movq 0x30(%rbx), %rbx
cmpl $0x1, 0x8(%rbx)
jne 0x1148f
cmpl $0x0, 0x44(%rbx)
je 0x1148f
leaq 0x4e29(%rip), %rsi      # 0x162ae
movq %r15, %rdi
xorl %eax, %eax
callq 0xd55c
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10edd
movq 0x8(%rbx), %rax
testb $0x20, 0x4(%rax)
jne 0x11577
movq 0x30(%rbx), %rsi
leaq 0x11e0(%rip), %rdi      # 0x1269f
jmp 0x11637
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %r13
cmpq $0x1, %r13
jne 0x115aa
movq (%rbp), %rsi
movl $0x22, %edi
callq 0x3110
xorl %r12d, %r12d
testq %r14, %r14
je 0x11611
cmpq $0x0, 0x30(%rbx)
je 0x11611
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 0x1152a
cmpl $0x22, %esi
je 0x1152a
cmpl $0x5c, %esi
jne 0x1154f
leaq 0x4db3(%rip), %rdi      # 0x162e4
xorl %eax, %eax
callq 0x30b0
incq %r12
cmpq %r14, %r12
jae 0x11611
cmpq 0x30(%rbx), %r12
jb 0x1150a
jmp 0x11611
movl %esi, %edi
callq 0x3030
jmp 0x11538
leaq 0x4d4f(%rip), %rsi      # 0x162ae
movq %r15, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd55c
cmpq $0x4, 0x10(%rax)
movl $0x73, %eax
movl $0x64, %esi
cmovel %eax, %esi
movsd 0x30(%rbx), %xmm0
leaq 0x4d46(%rip), %rdi      # 0x162db
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 0x11621
cmpq $0x4, %r13
je 0x115cc
cmpq $0x2, %r13
jne 0x1165b
leaq 0x4d17(%rip), %r15      # 0x162ea
movq %r13, %rbp
xorl %r12d, %r12d
movq 0x38(%rbx), %rax
cmpq $0x2, %r13
jne 0x115ea
movzwl (%rax,%r12,2), %esi
jmp 0x115ee
movl (%rax,%r12,4), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x30b0
incq %r12
cmpq 0x30(%rbx), %r12
jae 0x11624
movq %rbp, %rax
addq %r13, %rax
cmpq %r14, %rbp
movq %rax, %rbp
jb 0x115d9
jmp 0x11624
movq (%rbp), %rsi
movl $0x22, %edi
callq 0x3110
jmp 0x11624
xorl %r12d, %r12d
imulq %r13, %r12
subq %r12, %r14
jbe 0x1164c
leaq 0x4ceb(%rip), %rdi      # 0x1631f
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 0x46fc(%rip), %rdi      # 0x15d5e
leaq 0x428b(%rip), %rsi      # 0x158f4
leaq 0x4c7e(%rip), %rcx      # 0x162ee
movl $0x563, %edx            # imm = 0x563
callq 0x30e0