// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0xe, %eax
jle 0x697c
leal -0xf(%rax), %ecx
cmpl $0x2, %ecx
jae 0x6a1c
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd8c4
testb %al, %al
jne 0x6a8f
movl (%rbx), %eax
leaq 0x14cb6(%rip), %rcx     # 0x1b610
movq (%rcx,%rax,8), %rdx
leaq 0x157a3(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xcb1e(%rip), %rsi      # 0x1348e
xorl %eax, %eax
callq 0xd56a
jmp 0x6a8f
cmpl $0x2, %eax
je 0x6a41
cmpl $0xc, %eax
jne 0x6a69
movq %r14, %rdi
callq 0x6abb
testb %al, %al
jne 0x6a8f
cmpl $0xc, (%r15)
je 0x69bd
leaq 0x1575d(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc9d1(%rip), %rsi      # 0x13387
xorl %eax, %eax
callq 0xd56a
movq 0x20(%rbx), %rdi
cmpq 0x145d8(%rip), %rdi     # 0x1afa0
je 0x69f9
movq 0x20(%r15), %rsi
cmpq 0x145cb(%rip), %rsi     # 0x1afa0
je 0x69f9
callq 0xd8c4
testb %al, %al
jne 0x69f9
leaq 0x15721(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc9d9(%rip), %rsi      # 0x133cb
xorl %eax, %eax
callq 0xd56a
movl 0x38(%rbx), %eax
notl %eax
testl %eax, 0x38(%r15)
je 0x6a8f
leaq 0x156f9(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc9ed(%rip), %rsi      # 0x13407
jmp 0x6a88
cmpl $0x11, %eax
jne 0x6a69
movq %r14, %rdi
callq 0x6abb
testb %al, %al
jne 0x6a8f
leaq 0x156d4(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc9f2(%rip), %rsi      # 0x13431
jmp 0x6a88
testb $0x8, 0x4(%r15)
jne 0x6a8f
movl (%r15), %eax
cmpl $0xc, %eax
je 0x6a8f
cmpl $0x11, %eax
je 0x6a8f
leaq 0x156ac(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc8d9(%rip), %rsi      # 0x13340
jmp 0x6a88
testb $0x8, 0x4(%rbx)
je 0x6a9c
testb $0x8, 0x4(%r15)
jne 0x6a8f
leaq 0x1568b(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xca8a(%rip), %rsi      # 0x13512
xorl %eax, %eax
callq 0xd56a
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6af1
leaq 0xca1e(%rip), %rdi      # 0x134c1
leaq 0xca2b(%rip), %rsi      # 0x134d5
leaq 0xca2b(%rip), %rcx      # 0x134dc
movl $0xe0, %edx
callq 0x30e0