// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x8, %eax
ja 0x172b7
movq -0x38(%rbp), %rax
leaq 0x502e(%rip), %rcx      # 0x1bf90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
cmpl $0x4a, 0x14(%rax)
je 0x16f83
leaq 0x5ab3(%rip), %rdi      # 0x1ca2f
movb $0x0, %al
callq 0x12650
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16fb1
leaq 0xb209(%rip), %rdi      # 0x221a8
addq $0x8, %rdi
leaq 0x5a98(%rip), %rsi      # 0x1ca42
movb $0x0, %al
callq 0x11190
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x16fea
movq -0x18(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x16fea
leaq 0xb1d0(%rip), %rdi      # 0x221a8
addq $0x8, %rdi
leaq 0x5a5f(%rip), %rsi      # 0x1ca42
movb $0x0, %al
callq 0x11190
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x164a0
jmp 0x172d0
movq -0x8(%rbp), %rax
cmpl $0x4c, 0x14(%rax)
jne 0x17020
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
cmpl $0x7, (%rax)
jne 0x17020
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
cmpl $0x1, (%rax)
je 0x17039
leaq 0xb181(%rip), %rdi      # 0x221a8
addq $0x8, %rdi
leaq 0x5a10(%rip), %rsi      # 0x1ca42
movb $0x0, %al
callq 0x11190
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x16f30
movq 0x9f7f(%rip), %rax      # 0x20fd0
movq (%rax), %rsi
leaq 0x5a10(%rip), %rdi      # 0x1ca6b
callq 0x3100
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x16f30
jmp 0x172d0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x4(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x170bf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movl $0x64, %esi
movl $0x73, %eax
cmpq $0x4, %rcx
cmovel %eax, %esi
movq -0x8(%rbp), %rax
movsd 0x30(%rax), %xmm0
leaq 0x59b9(%rip), %rdi      # 0x1ca6f
movb $0x1, %al
callq 0x30c0
jmp 0x170d5
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
leaq 0x16fd(%rip), %rdi      # 0x187cb
movb $0x0, %al
callq 0x30c0
jmp 0x172d0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x1, -0x28(%rbp)
jne 0x171bf
movq 0x9ed0(%rip), %rax      # 0x20fd0
movq (%rax), %rsi
movl $0x22, %edi
callq 0x3130
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq 0x30(%rdx), %rcx
movb %al, -0x39(%rbp)
jae 0x17136
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
setb %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x1713f
jmp 0x171a6
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
callq 0x3250
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x17182
cmpl $0x22, -0x2c(%rbp)
je 0x17182
cmpl $0x5c, -0x2c(%rbp)
je 0x17182
movl -0x2c(%rbp), %edi
callq 0x3030
jmp 0x17193
movl -0x2c(%rbp), %esi
leaq 0x58ec(%rip), %rdi      # 0x1ca78
movb $0x0, %al
callq 0x30c0
jmp 0x17195
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x17115
movq 0x9e23(%rip), %rax      # 0x20fd0
movq (%rax), %rsi
movl $0x22, %edi
callq 0x3130
jmp 0x17288
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq 0x30(%rdx), %rcx
movb %al, -0x3a(%rbp)
jae 0x171ed
movq -0x20(%rbp), %rax
imulq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
setb %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
testb $0x1, %al
jne 0x171f9
jmp 0x17286
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
subq $0x2, %rax
je 0x17215
jmp 0x17209
movq -0x48(%rbp), %rax
subq $0x4, %rax
je 0x17235
jmp 0x17254
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %esi
leaq 0x5852(%rip), %rdi      # 0x1ca7e
movb $0x0, %al
callq 0x30c0
jmp 0x17273
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x5833(%rip), %rdi      # 0x1ca7e
movb $0x0, %al
callq 0x30c0
jmp 0x17273
leaq 0x5297(%rip), %rdi      # 0x1c4f2
leaq 0x4e26(%rip), %rsi      # 0x1c088
movl $0x563, %edx            # imm = 0x563
leaq 0x5814(%rip), %rcx      # 0x1ca82
callq 0x30f0
jmp 0x17275
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x171c7
jmp 0x17288
movq -0x20(%rbp), %rax
imulq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x172b5
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rax
imulq -0x28(%rbp), %rax
subq %rax, %rsi
leaq 0x5805(%rip), %rdi      # 0x1cab3
movb $0x0, %al
callq 0x30c0
jmp 0x172d0
leaq 0xaeea(%rip), %rdi      # 0x221a8
addq $0x8, %rdi
leaq 0x5779(%rip), %rsi      # 0x1ca42
movb $0x0, %al
callq 0x11190
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)