// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r15
movq %r8, %r13
shrq $0x10, %r13
testb $0x8, %bpl
je 0xe9ac
leaq 0xd76e(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x7215(%rip), %rsi      # 0x15bba
xorl %eax, %eax
callq 0xd56a
testb $0x2, %bpl
je 0xe9cb
leaq 0xd74f(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x721a(%rip), %rsi      # 0x15bde
xorl %eax, %eax
callq 0xd56a
movl 0x4(%r12), %eax
movl %r14d, %ecx
orw %r13w, %cx
setne %cl
testb $0x2, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
movq 0x8(%rsp), %rbp
je 0xecea
movl (%r12), %ecx
leal -0xf(%rcx), %edx
cmpl $0x2, %edx
jb 0xea0d
cmpl $0xc, %ecx
je 0xeb6a
cmpl $0xd, %ecx
jne 0xeb71
movl 0x8(%r12), %ecx
leal -0x1(%rcx), %eax
testl %eax, %ecx
jne 0xed09
movq %r15, 0x18(%rsp)
movq 0x10(%r12), %rcx
movq %rcx, 0x20(%rsp)
cmpl $0x3, %eax
ja 0xea65
movl %eax, %eax
leaq 0x7856(%rip), %rcx      # 0x16290
movq (%rcx,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x6c76(%rip), %rcx      # 0x156c0
movl (%rcx,%rax,4), %r15d
leaq 0x6c7b(%rip), %rcx      # 0x156d0
movl (%rcx,%rax,4), %r12d
leaq 0x6c80(%rip), %rcx      # 0x156e0
movl (%rcx,%rax,4), %ebp
jmp 0xea80
movl $0x6c, %ebp
movl $0x11, %r12d
movl $0x17, %r15d
movl $0x8, %eax
movq %rax, 0x10(%rsp)
movl $0x10, %edi
callq 0xe13e
movq %rax, %r14
movl $0x2, (%rax)
movq 0x10(%rsp), %r13
movq %r13, 0x8(%rax)
movq 0x18(%rsp), %rdi
movl %r15d, 0x4(%rsp)
movl %r15d, %esi
movq %rdi, %r15
movl %ebp, 0x34(%rsp)
movl %ebp, %edx
movq 0x8(%rsp), %rbp
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x101fd
movq %r15, %rdi
movl %r12d, 0x28(%rsp)
movl %r12d, %esi
xorl %edx, %edx
movq %rax, %rcx
movq %rbx, %r8
callq 0x101fd
movq 0x20(%rsp), %rax
cmpq %rax, %r13
jae 0xecd8
movq 0x10(%rsp), %r12
movq %r15, %r13
movl 0x34(%rsp), %r15d
movq %r13, %rdi
movl $0x1, %esi
movl $0x6c, %edx
movq %rbp, %rcx
movq %r14, %r8
callq 0x101fd
movq %rax, %rbp
movq %r13, %rdi
movl $0x1, %esi
movl $0x6c, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x101fd
movq %rax, %rbx
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r15d, %edx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x101fd
movq %r13, %rdi
movl 0x28(%rsp), %esi
xorl %edx, %edx
movq %rax, %rcx
movq %rbx, %r8
callq 0x101fd
addq 0x10(%rsp), %r12
cmpq 0x20(%rsp), %r12
jb 0xeaf5
movq 0x8(%rsp), %rbp
jmp 0xecd8
leaq 0xd197(%rip), %r12      # 0x1bd08
testb $0x10, %al
je 0xed28
movq %r12, %rdi
callq 0x102ec
movswl %r14w, %esi
movswl %r13w, %ecx
addl %esi, %ecx
je 0xecc6
movl %edx, 0x10(%rsp)
movl 0x10(%r12), %edx
shll $0x3, %edx
subl %edx, %ecx
movq $-0x1, %rbp
shrq %cl, %rbp
movl %esi, %ecx
shlq %cl, %rbp
movq %r15, 0x18(%rsp)
movsbl %al, %r15d
movl %r15d, 0x4(%rsp)
movswq %r14w, %rcx
movq %rcx, 0x28(%rsp)
movl $0x10, %edi
movq %rax, 0x20(%rsp)
callq 0xe13e
movl $0x2, %ecx
movl %ecx, (%rax)
movq 0x28(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rdi
movl $0xe, %esi
movl %r15d, %edx
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %rcx
movq %rax, %r8
callq 0x101fd
shll $0x10, %r13d
movzwl %r14w, %ecx
orl %r13d, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
movq %rax, %r12
callq 0x1164a
movq %rax, 0x8(%rsp)
movl $0x10, %edi
callq 0xe13e
movl $0x2, %ecx
movl %ecx, (%rax)
movq %rbp, 0x8(%rax)
movq %r15, %rdi
movl $0xb, %esi
movl 0x4(%rsp), %r14d
movl %r14d, %edx
movq %r12, %rcx
movq %rax, %r8
callq 0x101fd
movq %rax, %r12
movq 0x20(%rsp), %rsi
shrq $0x20, %rsi
movq %r15, %rdi
movl %r14d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x101fd
movq %rax, %r13
notq %rbp
movl $0x10, %edi
callq 0xe13e
movl $0x2, %ecx
movl %ecx, (%rax)
movq %rbp, 0x8(%rax)
movq 0x8(%rsp), %rbp
movq %r15, %rdi
movl $0xb, %esi
movl %r14d, %edx
movq %r13, %rcx
movq %rax, %r8
callq 0x101fd
movq %r15, %rdi
movl $0x9, %esi
movl %r14d, %edx
movq %r12, %rcx
movq %rax, %r8
callq 0x101fd
movl 0x10(%rsp), %edx
movq %rax, %rcx
jmp 0xecc9
movq %rbp, %rcx
movq %r15, %rdi
movl %edx, %esi
xorl %edx, %edx
movq %rbx, %r8
callq 0x101fd
movq %rbp, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f0c(%rip), %rdi      # 0x15bfd
leaq 0x6b5c(%rip), %rsi      # 0x15854
leaq 0x6f34(%rip), %rcx      # 0x15c33
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x30e0
leaq 0x6f97(%rip), %rdi      # 0x15ca7
leaq 0x6b3d(%rip), %rsi      # 0x15854
leaq 0x6fa2(%rip), %rcx      # 0x15cc0
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x30e0
leaq 0x6f68(%rip), %rdi      # 0x15c97
leaq 0x6b1e(%rip), %rsi      # 0x15854
leaq 0x6ef6(%rip), %rcx      # 0x15c33
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x30e0