// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebx
movq %rsi, %rbp
movq %rdi, %r14
movq %r8, %r13
shrq $0x10, %r13
testb $0x8, %bl
je 0xd872
leaq 0xe8a8(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x73b3(%rip), %rsi      # 0x14c1e
xorl %eax, %eax
callq 0xc536
testb $0x2, %bl
je 0xd890
leaq 0xe88a(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x73b9(%rip), %rsi      # 0x14c42
xorl %eax, %eax
callq 0xc536
movl 0x4(%rbp), %eax
movl %r15d, %ecx
orw %r13w, %cx
setne %cl
testb $0x2, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0xdb05
movl (%rbp), %ecx
leal -0xf(%rcx), %edx
cmpl $0x2, %edx
jb 0xd8ca
cmpl $0xc, %ecx
je 0xd9cc
cmpl $0xd, %ecx
jne 0xd9d3
movl 0x8(%rbp), %ecx
leal -0x1(%rcx), %eax
testl %eax, %ecx
jne 0xdb24
movq %rbp, %rdx
movq %r14, %rbp
movq %r12, %r14
cmpl $0x3, %eax
ja 0xd91f
movl %eax, %eax
leaq 0x7a01(%rip), %rcx      # 0x152f0
movq (%rcx,%rax,8), %r12
leaq 0x7a16(%rip), %rcx      # 0x15310
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x10(%rsp)
leaq 0x7a18(%rip), %rcx      # 0x15320
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x4(%rsp)
leaq 0x7a1a(%rip), %rcx      # 0x15330
movl (%rcx,%rax,4), %eax
movl %eax, 0x18(%rsp)
jmp 0xd938
pushq $0x6c
popq %rax
movl %eax, 0x18(%rsp)
pushq $0x11
popq %rax
movl %eax, 0x4(%rsp)
pushq $0x17
popq %rax
movl %eax, 0x10(%rsp)
pushq $0x8
popq %r12
movq 0x10(%rdx), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
callq 0xd317
movq %rax, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq 0x8(%rsp), %r13
pushq $0x1
popq %r15
pushq $0x6c
popq %rbx
movq %rbp, %rdi
movl 0x10(%rsp), %esi
movl 0x18(%rsp), %edx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xed68
movq %rbp, %rdi
movl 0x4(%rsp), %esi
xorl %edx, %edx
movq %rax, %rcx
movq %r14, %r8
callq 0xed68
cmpq 0x20(%rsp), %r12
jae 0xdaf1
movq %rbp, %rdi
movl %r15d, %esi
movl %ebx, %edx
movq %r13, %rcx
movq 0x28(%rsp), %r13
movq %r13, %r8
callq 0xed68
movq %rbp, %rdi
movl %r15d, %esi
movl %ebx, %edx
movq %r14, %rcx
movq %r13, %r8
movq %rax, %r13
callq 0xed68
movq %rax, %r14
addq 0x30(%rsp), %r12
jmp 0xd95f
leaq 0xe335(%rip), %rbp      # 0x1bd08
testb $0x10, %al
je 0xdb43
movq %rbp, %rdi
callq 0xee06
movswl %r15w, %esi
movswl %r13w, %ecx
addl %esi, %ecx
je 0xdadd
movl %edx, 0x4(%rsp)
movl 0x10(%rbp), %edx
shll $0x3, %edx
subl %edx, %ecx
movq %r12, 0x10(%rsp)
pushq $-0x1
popq %r12
shrq %cl, %r12
movl %esi, %ecx
shlq %cl, %r12
movq %rbp, 0x20(%rsp)
movsbl %al, %ebp
movswq %r15w, %rdi
movq %rax, 0x18(%rsp)
callq 0xd317
pushq $0xe
popq %rsi
movq %r14, %rdi
movl %ebp, %edx
movq 0x8(%rsp), %rcx
movq %rax, %r8
callq 0xed68
movq %rax, %rbx
shll $0x10, %r13d
movzwl %r15w, %ecx
orl %r13d, %ecx
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0xfff9
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0xd317
pushq $0xb
popq %r13
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
movq %rbx, %rcx
movq %rax, %r8
callq 0xed68
movq %rax, %rbx
movq 0x18(%rsp), %rsi
shrq $0x20, %rsi
movq %r14, %rdi
movl %ebp, %edx
movq 0x10(%rsp), %rcx
xorl %r8d, %r8d
callq 0xed68
movq %rax, %r15
notq %r12
movq %r12, %rdi
movq 0x10(%rsp), %r12
callq 0xd317
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
movq %r15, %rcx
movq %rax, %r8
callq 0xed68
pushq $0x9
popq %rsi
movq %r14, %rdi
movl %ebp, %edx
movq %rbx, %rcx
movq %rax, %r8
callq 0xed68
movl 0x4(%rsp), %edx
movq %rax, %rcx
jmp 0xdae2
movq 0x8(%rsp), %rcx
movq %r14, %rdi
movl %edx, %esi
xorl %edx, %edx
movq %r12, %r8
callq 0xed68
movq 0x8(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7155(%rip), %rdi      # 0x14c61
leaq 0x6da5(%rip), %rsi      # 0x148b8
leaq 0x717d(%rip), %rcx      # 0x14c97
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x30e0
leaq 0x71e0(%rip), %rdi      # 0x14d0b
leaq 0x6d86(%rip), %rsi      # 0x148b8
leaq 0x71eb(%rip), %rcx      # 0x14d24
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x30e0
leaq 0x71b1(%rip), %rdi      # 0x14cfb
leaq 0x6d67(%rip), %rsi      # 0x148b8
leaq 0x713f(%rip), %rcx      # 0x14c97
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x30e0