// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0xf, %eax
ja 0x81a0
movq -0x20(%rbp), %rax
leaq 0x112c5(%rip), %rcx     # 0x192f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x8072
movq -0x18(%rbp), %rax
cmpl $0xc, (%rax)
je 0x8072
movq -0x18(%rbp), %rax
cmpl $0x11, (%rax)
je 0x8072
leaq 0x1a148(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x11765(%rip), %rsi     # 0x197d0
movb $0x0, %al
callq 0x11190
jmp 0x81fa
movq -0x8(%rbp), %rdi
callq 0x8210
testb $0x1, %al
jne 0x8086
jmp 0x808b
jmp 0x81fa
movq -0x18(%rbp), %rax
cmpl $0xc, (%rax)
je 0x80ad
leaq 0x1a10d(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x11771(%rip), %rsi     # 0x19817
movb $0x0, %al
callq 0x11190
movq -0x10(%rbp), %rax
leaq 0x19980(%rip), %rcx     # 0x21a38
cmpq %rcx, 0x20(%rax)
je 0x8101
movq -0x18(%rbp), %rax
leaq 0x1996f(%rip), %rcx     # 0x21a38
cmpq %rcx, 0x20(%rax)
je 0x8101
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x11890
testb $0x1, %al
jne 0x8101
leaq 0x1a0b9(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x11761(%rip), %rsi     # 0x1985b
movb $0x0, %al
callq 0x11190
movq -0x18(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x10(%rbp), %rcx
andl 0x38(%rcx), %eax
movq -0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
je 0x8131
leaq 0x1a089(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x1176d(%rip), %rsi     # 0x19897
movb $0x0, %al
callq 0x11190
jmp 0x81fa
movq -0x8(%rbp), %rdi
callq 0x8210
testb $0x1, %al
jne 0x815c
leaq 0x1a05e(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x1176c(%rip), %rsi     # 0x198c1
movb $0x0, %al
callq 0x11190
jmp 0x81fa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11890
testb $0x1, %al
jne 0x819e
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %ecx
leaq 0x1952f(%rip), %rax     # 0x216b0
movq (%rax,%rcx,8), %rdx
leaq 0x1a01c(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x11787(%rip), %rsi     # 0x1991e
movb $0x0, %al
callq 0x11190
jmp 0x81fa
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x81b1
jmp 0x81d0
leaq 0x11799(%rip), %rdi     # 0x19951
leaq 0x117a6(%rip), %rsi     # 0x19965
movl $0xe0, %edx
leaq 0x117a1(%rip), %rcx     # 0x1996c
callq 0x30f0
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x81f8
leaq 0x19fc2(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x117b1(%rip), %rsi     # 0x199a2
movb $0x0, %al
callq 0x11190
jmp 0x81fa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8290
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)