// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]cproc/qbe.c
// Function: funcstore
static struct value *
funcstore(struct func *f, struct type *t, enum typequal tq, struct lvalue lval, struct value *v)
{
	struct value *r;
	enum typeprop tp;
	unsigned long long mask;
	struct qbetype qt;
	int bits;

	if (tq & QUALVOLATILE)
		error(&tok.loc, "volatile store is not yet supported");
	if (tq & QUALCONST)
		error(&tok.loc, "cannot store to 'const' object");
	tp = t->prop;
	assert(!lval.bits.before && !lval.bits.after || tp & PROPINT);
	r = v;
	switch (t->kind) {
	case TYPESTRUCT:
	case TYPEUNION:
	case TYPEARRAY:
		funccopy(f, lval.addr, v, t->size, t->align);
		break;
	case TYPEPOINTER:
		t = &typeulong;
		/* fallthrough */
	default:
		assert(tp & PROPSCALAR);
		qt = qbetype(t);
		bits = lval.bits.before + lval.bits.after;
		if (bits) {
			mask = 0xffffffffffffffffu >> 64 - t->size * 8 + bits << lval.bits.before;
			v = funcinst(f, ISHL, qt.base, v, mkintconst(lval.bits.before));
			r = funcbits(f, t, v, lval.bits);
			v = funcinst(f, IAND, qt.base, v, mkintconst(mask));
			v = funcinst(f, IOR, qt.base, v,
				funcinst(f, IAND, qt.base,
					funcinst(f, qt.load, qt.base, lval.addr, NULL),
					mkintconst(~mask)
				)
			);
		}
		funcinst(f, qt.store, 0, v, lval.addr);
		break;
	}
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rcx, -0x10(%rbp)
movq %r8, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl -0x24(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x13526
leaq 0xec94(%rip), %rdi      # 0x221a8
addq $0x8, %rdi
leaq 0x8ecf(%rip), %rsi      # 0x1c3ee
movb $0x0, %al
callq 0x11190
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1354a
leaq 0xec70(%rip), %rdi      # 0x221a8
addq $0x8, %rdi
leaq 0x8ecf(%rip), %rsi      # 0x1c412
movb $0x0, %al
callq 0x11190
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
cmpw $0x0, -0x8(%rbp)
jne 0x13562
cmpw $0x0, -0x6(%rbp)
je 0x1356d
movl -0x3c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1356f
jmp 0x1358e
leaq 0x8ebb(%rip), %rdi      # 0x1c431
leaq 0x8b0b(%rip), %rsi      # 0x1c088
movl $0x1c4, %edx            # imm = 0x1C4
leaq 0x8ede(%rip), %rcx      # 0x1c467
callq 0x30f0
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
subl $0xc, %eax
je 0x135e3
jmp 0x135a6
movl -0x7c(%rbp), %eax
subl $0xd, %eax
je 0x135bd
jmp 0x135b0
movl -0x7c(%rbp), %eax
addl $-0xf, %eax
subl $0x1, %eax
ja 0x135ee
jmp 0x135bd
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movl 0x8(%rax), %r8d
callq 0x172e0
jmp 0x13802
leaq 0xe7be(%rip), %rax      # 0x21da8
movq %rax, -0x20(%rbp)
movl -0x3c(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x135fb
jmp 0x1361a
leaq 0x8ec9(%rip), %rdi      # 0x1c4cb
leaq 0x8a7f(%rip), %rsi      # 0x1c088
movl $0x1d0, %edx            # imm = 0x1D0
leaq 0x8e52(%rip), %rcx      # 0x1c467
callq 0x30f0
movq -0x20(%rbp), %rdi
callq 0x158f0
movl %edx, -0x70(%rbp)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x64(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x64(%rbp), %rax
movq %rax, -0x54(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movswl -0x8(%rbp), %eax
movswl -0x6(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
je 0x137ec
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x3, %rax
movl $0x40, %ecx
subq %rax, %rcx
movslq -0x58(%rbp), %rax
addq %rax, %rcx
movq $-0x1, %rax
shrq %cl, %rax
movswl -0x8(%rbp), %ecx
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xe0(%rbp)
movsbl -0x54(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xd0(%rbp)
movswq -0x8(%rbp), %rdi
callq 0x12cc0
movq -0xe0(%rbp), %rdi
movl -0xd4(%rbp), %edx
movq -0xd0(%rbp), %rcx
movq %rax, %r8
movl $0xe, %esi
callq 0x15860
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x8(%rbp), %ecx
callq 0x17450
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
movsbl -0x54(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rdi
callq 0x12cc0
movq -0xc8(%rbp), %rdi
movl -0xbc(%rbp), %edx
movq -0xb8(%rbp), %rcx
movq %rax, %r8
movl $0xb, %esi
callq 0x15860
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x98(%rbp)
movsbl -0x54(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
movsbl -0x54(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x18(%rbp), %rdi
movl -0x50(%rbp), %esi
movsbl -0x54(%rbp), %edx
movq -0x10(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x15860
movq %rax, -0xa0(%rbp)
movq -0x48(%rbp), %rdi
xorq $-0x1, %rdi
callq 0x12cc0
movq -0xb0(%rbp), %rdi
movl -0xa4(%rbp), %edx
movq -0xa0(%rbp), %rcx
movq %rax, %r8
movl $0xb, %esi
callq 0x15860
movq -0x98(%rbp), %rdi
movl -0x8c(%rbp), %edx
movq -0x88(%rbp), %rcx
movq %rax, %r8
movl $0x9, %esi
callq 0x15860
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl -0x4c(%rbp), %esi
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %r8
xorl %edx, %edx
callq 0x15860
movq -0x38(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nop