// File: /workspace/github_c_makefile_star2_O3/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 0xe9b9
leaq 0xd761(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x72a8(%rip), %rsi      # 0x15c5a
xorl %eax, %eax
callq 0xd55c
testb $0x2, %bpl
je 0xe9d8
leaq 0xd742(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x72ad(%rip), %rsi      # 0x15c7e
xorl %eax, %eax
callq 0xd55c
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 0xecf7
movl (%r12), %ecx
leal -0xf(%rcx), %edx
cmpl $0x2, %edx
jb 0xea1a
cmpl $0xc, %ecx
je 0xeb77
cmpl $0xd, %ecx
jne 0xeb7e
movl 0x8(%r12), %ecx
leal -0x1(%rcx), %eax
testl %eax, %ecx
jne 0xed16
movq %r15, 0x18(%rsp)
movq 0x10(%r12), %rcx
movq %rcx, 0x20(%rsp)
cmpl $0x3, %eax
ja 0xea72
movl %eax, %eax
leaq 0x78e9(%rip), %rcx      # 0x16330
movq (%rcx,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x6d09(%rip), %rcx      # 0x15760
movl (%rcx,%rax,4), %r15d
leaq 0x6d0e(%rip), %rcx      # 0x15770
movl (%rcx,%rax,4), %r12d
leaq 0x6d13(%rip), %rcx      # 0x15780
movl (%rcx,%rax,4), %ebp
jmp 0xea8d
movl $0x6c, %ebp
movl $0x11, %r12d
movl $0x17, %r15d
movl $0x8, %eax
movq %rax, 0x10(%rsp)
movl $0x10, %edi
callq 0xe142
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 0x10201
movq %r15, %rdi
movl %r12d, 0x28(%rsp)
movl %r12d, %esi
xorl %edx, %edx
movq %rax, %rcx
movq %rbx, %r8
callq 0x10201
movq 0x20(%rsp), %rax
cmpq %rax, %r13
jae 0xece5
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 0x10201
movq %rax, %rbp
movq %r13, %rdi
movl $0x1, %esi
movl $0x6c, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x10201
movq %rax, %rbx
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r15d, %edx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x10201
movq %r13, %rdi
movl 0x28(%rsp), %esi
xorl %edx, %edx
movq %rax, %rcx
movq %rbx, %r8
callq 0x10201
addq 0x10(%rsp), %r12
cmpq 0x20(%rsp), %r12
jb 0xeb02
movq 0x8(%rsp), %rbp
jmp 0xece5
leaq 0xd18a(%rip), %r12      # 0x1bd08
testb $0x10, %al
je 0xed35
movq %r12, %rdi
callq 0x102e0
movswl %r14w, %esi
movswl %r13w, %ecx
addl %esi, %ecx
je 0xecd3
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 0xe142
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 0x10201
shll $0x10, %r13d
movzwl %r14w, %ecx
orl %r13d, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
movq %rax, %r12
callq 0x1167a
movq %rax, 0x8(%rsp)
movl $0x10, %edi
callq 0xe142
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 0x10201
movq %rax, %r12
movq 0x20(%rsp), %rsi
shrq $0x20, %rsi
movq %r15, %rdi
movl %r14d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x10201
movq %rax, %r13
notq %rbp
movl $0x10, %edi
callq 0xe142
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 0x10201
movq %r15, %rdi
movl $0x9, %esi
movl %r14d, %edx
movq %r12, %rcx
movq %rax, %r8
callq 0x10201
movl 0x10(%rsp), %edx
movq %rax, %rcx
jmp 0xecd6
movq %rbp, %rcx
movq %r15, %rdi
movl %edx, %esi
xorl %edx, %edx
movq %rbx, %r8
callq 0x10201
movq %rbp, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f9f(%rip), %rdi      # 0x15c9d
leaq 0x6bef(%rip), %rsi      # 0x158f4
leaq 0x6fc7(%rip), %rcx      # 0x15cd3
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x30e0
leaq 0x702a(%rip), %rdi      # 0x15d47
leaq 0x6bd0(%rip), %rsi      # 0x158f4
leaq 0x7035(%rip), %rcx      # 0x15d60
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x30e0
leaq 0x6ffb(%rip), %rdi      # 0x15d37
leaq 0x6bb1(%rip), %rsi      # 0x158f4
leaq 0x6f89(%rip), %rcx      # 0x15cd3
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x30e0