// File: /workspace/github_c_makefile_star2_O2/michaelforney[P]cproc/expr.c
// Function: exprassign
struct expr *
exprassign(struct expr *e, struct type *t)
{
	struct type *et;

	et = e->type;
	switch (t->kind) {
	case TYPEBOOL:
		if (!(et->prop & PROPARITH) && et->kind != TYPEPOINTER && et->kind != TYPENULLPTR)
			error(&tok.loc, "assignment to bool must be from arithmetic, pointer, or nullptr_t type");
		break;
	case TYPEPOINTER:
		if (nullpointer(e))
			break;
		if (et->kind != TYPEPOINTER)
			error(&tok.loc, "assignment to pointer must be from pointer or null pointer constant");
		if (t->base != &typevoid && et->base != &typevoid && !typecompatible(t->base, et->base))
			error(&tok.loc, "base types of pointer assignment must be compatible or void");
		if ((et->qual & t->qual) != et->qual)
			error(&tok.loc, "assignment to pointer discards qualifiers");
		break;
	case TYPENULLPTR:
		if (!nullpointer(e))
			error(&tok.loc, "assignment to nullptr_t must be from null pointer constant or expression with type nullptr_t");
		break;
	case TYPESTRUCT:
	case TYPEUNION:
		if (!typecompatible(t, et))
			error(&tok.loc, "assignment to %s type must be from compatible type", tokstr[t->kind]);
		break;
	default:
		assert(t->prop & PROPARITH);
		if (!(et->prop & PROPARITH))
			error(&tok.loc, "assignment to arithmetic type must be from arithmetic type");
		break;
	}
	return exprconvert(e, t);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
movl (%rsi), %eax
leal -0xf(%rax), %ecx
cmpl $0x2, %ecx
jb 0x64a8
cmpl $0x11, %eax
je 0x6570
cmpl $0xc, %eax
je 0x64e6
cmpl $0x2, %eax
jne 0x6590
testb $0x8, 0x4(%r15)
jne 0x65b6
movl (%r15), %eax
cmpl $0xc, %eax
je 0x65b6
cmpl $0x11, %eax
je 0x65b6
leaq 0x15c70(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xbefd(%rip), %rsi      # 0x123a0
jmp 0x65af
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc85a
testb %al, %al
jne 0x65b6
movl (%rbx), %eax
leaq 0x1514c(%rip), %rcx     # 0x1b610
movq (%rcx,%rax,8), %rdx
leaq 0x15c39(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc014(%rip), %rsi      # 0x124ee
xorl %eax, %eax
callq 0xc536
jmp 0x65b6
movq %r14, %rdi
callq 0x65e2
testb %al, %al
jne 0x65b6
cmpl $0xc, (%r15)
je 0x6515
leaq 0x15c05(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xbed9(%rip), %rsi      # 0x123e7
xorl %eax, %eax
callq 0xc536
movq 0x20(%rbx), %rdi
cmpq 0x14a80(%rip), %rdi     # 0x1afa0
je 0x6551
movq 0x20(%r15), %rsi
cmpq 0x14a73(%rip), %rsi     # 0x1afa0
je 0x6551
callq 0xc85a
testb %al, %al
jne 0x6551
leaq 0x15bc9(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xbee1(%rip), %rsi      # 0x1242b
xorl %eax, %eax
callq 0xc536
movl 0x38(%rbx), %eax
notl %eax
testl %eax, 0x38(%r15)
je 0x65b6
leaq 0x15ba5(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xbef9(%rip), %rsi      # 0x12467
jmp 0x65af
movq %r14, %rdi
callq 0x65e2
testb %al, %al
jne 0x65b6
leaq 0x15b85(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xbf03(%rip), %rsi      # 0x12491
jmp 0x65af
testb $0x8, 0x4(%rbx)
je 0x65c3
testb $0x8, 0x4(%r15)
jne 0x65b6
leaq 0x15b64(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xbfc3(%rip), %rsi      # 0x12572
xorl %eax, %eax
callq 0xc536
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6618
leaq 0xbf57(%rip), %rdi      # 0x12521
leaq 0xbf64(%rip), %rsi      # 0x12535
leaq 0xbf64(%rip), %rcx      # 0x1253c
movl $0xe0, %edx
callq 0x30e0