// File: /workspace/github_c_makefile_star2_O1/Oric4ever[P]lcc65/6502/build/../src/expr.c
// Function: assign
Type assign(xty, p) Type xty; Tree p; {
	Type yty = unqual(p->type);

	if (yty->size == 0)
		return 0;
	xty = unqual(xty);
	if (isenum(xty))
		xty = xty->type;
	if (isarith(xty) && isarith(yty))
		return xty;
	if (isstruct(xty) && xty == yty)
		return xty;
	if (isstruct(xty) && isstruct(yty) && extends(yty, xty))
		return xty;
	if (isptr(xty) && isptr(yty)) {
		Type lty = xty->type, rty = yty->type;
		if (isstruct(lty) && isstruct(rty) && extends(rty, lty))
			return xty;
		if (eqtype(lty, rty, 1)
		|| (eqtype(unqual(lty), unqual(rty), 1)
		&& (   !isconst(rty) || isconst(lty))
		&& (!isvolatile(rty) || isvolatile(lty))))
			return yty;
		if (xty == voidptype || unqual(lty) == voidtype
		||  yty == voidptype || unqual(rty) == voidtype)
			return xty;
		if (lty == inttype && isenum(rty) || rty == inttype && isenum(lty)) {
			if (Aflag >= 1)
				warning("assignment between `%t' and `%t' is compiler-dependent\n",
					xty, yty);
			return xty;
		}
	}
	if (isptr(xty) && isint(p->type) && generic(p->op) == CNST
	&& cast(p, unsignedtype)->u.v.u == 0)
		return xty;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
cmpl $0xf, (%r15)
jb 0xa000
movq 0x10(%r15), %r15
cmpl $0x0, 0x8(%r15)
je 0xa1f1
cmpl $0xf, (%rbx)
jb 0xa014
movq 0x10(%rbx), %rbx
cmpl $0xf, (%rbx)
movq %rbx, %rax
jb 0xa020
movq 0x10(%rbx), %rax
cmpl $0xd, (%rax)
jne 0xa029
movq 0x10(%rbx), %rbx
movl (%rbx), %eax
movq %rbx, %rcx
cmpl $0xf, %eax
jb 0xa037
movq 0x10(%rbx), %rcx
cmpl $0x6, (%rcx)
ja 0xa052
cmpl $0xf, (%r15)
movq %r15, %rcx
jb 0xa049
movq 0x10(%r15), %rcx
cmpl $0x7, (%rcx)
jb 0xa0d7
movq %rbx, %rcx
cmpl $0xf, %eax
jb 0xa05e
movq 0x10(%rbx), %rcx
cmpl $0x9, (%rcx)
jne 0xa06a
cmpq %r15, %rbx
jne 0xa080
jmp 0xa0d7
movq %rbx, %rcx
cmpl $0xf, %eax
jb 0xa076
movq 0x10(%rbx), %rcx
cmpq %r15, %rbx
jne 0xa080
cmpl $0xa, (%rcx)
je 0xa0d7
movq %rbx, %rcx
cmpl $0xf, %eax
jb 0xa08c
movq 0x10(%rbx), %rcx
cmpl $0x9, (%rcx)
je 0xa0a2
movq %rbx, %rcx
cmpl $0xf, %eax
jb 0xa09d
movq 0x10(%rbx), %rcx
cmpl $0xa, (%rcx)
jne 0xa0df
movl (%r15), %eax
movq %r15, %rcx
cmpl $0xf, %eax
jb 0xa0b1
movq 0x10(%r15), %rcx
cmpl $0x9, (%rcx)
je 0xa0c7
movq %r15, %rcx
cmpl $0xf, %eax
jb 0xa0c2
movq 0x10(%r15), %rcx
cmpl $0xa, (%rcx)
jne 0xa0df
movq %r15, %rdi
movq %rbx, %rsi
callq 0x19489
testq %rax, %rax
je 0xa0df
movq %rbx, %rax
jmp 0xa1f3
cmpl $0xf, (%rbx)
movq %rbx, %rax
jb 0xa0eb
movq 0x10(%rbx), %rax
cmpl $0x7, (%rax)
jne 0xa195
cmpl $0xf, (%r15)
movq %r15, %rax
jb 0xa101
movq 0x10(%r15), %rax
cmpl $0x7, (%rax)
jne 0xa195
movq 0x10(%rbx), %r12
movl (%r12), %eax
movq %r12, %rcx
cmpl $0xf, %eax
jb 0xa11f
movq 0x10(%r12), %rcx
movq 0x10(%r15), %r13
cmpl $0x9, (%rcx)
je 0xa13a
movq %r12, %rcx
cmpl $0xf, %eax
jb 0xa135
movq 0x10(%r12), %rcx
cmpl $0xa, (%rcx)
jne 0xa177
movl (%r13), %eax
movq %r13, %rcx
cmpl $0xf, %eax
jb 0xa14a
movq 0x10(%r13), %rcx
cmpl $0x9, (%rcx)
je 0xa160
movq %r13, %rcx
cmpl $0xf, %eax
jb 0xa15b
movq 0x10(%r13), %rcx
cmpl $0xa, (%rcx)
jne 0xa177
movq %r13, %rdi
movq %r12, %rsi
callq 0x19489
testq %rax, %rax
je 0xa177
xorl %ebp, %ebp
movq %rbx, %rax
jmp 0xa190
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x192a9
testl %eax, %eax
je 0xa202
xorl %ebp, %ebp
movq %r15, %rax
testb %bpl, %bpl
je 0xa1f3
cmpl $0xf, (%rbx)
movq %rbx, %rax
jb 0xa1a1
movq 0x10(%rbx), %rax
cmpl $0x7, (%rax)
jne 0xa1f1
movq 0x8(%r14), %rax
movl (%rax), %ecx
movq %rax, %rdx
cmpl $0xf, %ecx
jb 0xa1b8
movq 0x10(%rax), %rdx
cmpl $0x3, (%rdx)
jb 0xa1f1
cmpl $0xf, %ecx
jb 0xa1c6
movq 0x10(%rax), %rax
cmpl $0x6, (%rax)
ja 0xa1f1
movl (%r14), %eax
andl $-0x10, %eax
cmpl $0x10, %eax
jne 0xa1f1
leaq 0x27dfb(%rip), %rax     # 0x31fd8
movq (%rax), %rsi
movq %r14, %rdi
callq 0xa341
cmpl $0x0, 0x28(%rax)
movq %rbx, %rax
je 0xa1f3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xf, (%r12)
movq %r12, %rdi
jb 0xa211
movq 0x10(%r12), %rdi
cmpl $0xf, (%r13)
movq %r13, %rsi
jb 0xa21f
movq 0x10(%r13), %rsi
movl $0x1, %edx
callq 0x192a9
testl %eax, %eax
je 0xa276
movl (%r13), %eax
cmpl $0x1f, %eax
je 0xa244
cmpl $0x10, %eax
je 0xa25e
cmpl $0xf, %eax
jne 0xa18b
movl (%r12), %ecx
orl $0x10, %ecx
cmpl $0x1f, %ecx
jne 0xa276
cmpl $0x1f, %eax
je 0xa25e
cmpl $0x10, %eax
jne 0xa18b
movl (%r12), %eax
xorl %ebp, %ebp
cmpl $0x10, %eax
je 0xa18d
cmpl $0x1f, %eax
je 0xa18d
leaq 0x27d73(%rip), %rax     # 0x31ff0
movq (%rax), %rax
cmpq %rax, %rbx
je 0xa170
movl (%r12), %ecx
movq %r12, %rsi
cmpl $0xf, %ecx
jb 0xa29a
movq 0x10(%r12), %rsi
xorl %ebp, %ebp
cmpq %rax, %r15
je 0xa172
leaq 0x27d34(%rip), %rax     # 0x31fe0
movq (%rax), %rdx
movq %rbx, %rax
cmpq %rdx, %rsi
je 0xa190
movl (%r13), %eax
movq %r13, %rsi
cmpl $0xf, %eax
jb 0xa2cb
movq 0x10(%r13), %rsi
cmpq %rdx, %rsi
je 0xa170
leaq 0x27cbd(%rip), %rdx     # 0x31f98
movq (%rdx), %rdx
cmpq %rdx, %r12
jne 0xa2f4
movq %r13, %rsi
cmpl $0xf, %eax
jb 0xa2ef
movq 0x10(%r13), %rsi
cmpl $0xd, (%rsi)
je 0xa316
movb $0x1, %bpl
cmpq %rdx, %r13
je 0xa301
jmp 0xa190
cmpl $0xf, %ecx
jb 0xa30b
movq 0x10(%r12), %r12
cmpl $0xd, (%r12)
jne 0xa190
leaq 0x2173b(%rip), %rax     # 0x2ba58
cmpl $0x0, (%rax)
jle 0xa170
leaq 0x14dc5(%rip), %rdi     # 0x1f0f2
xorl %ebp, %ebp
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9be3
jmp 0xa172