// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
cmpl $0xf, (%r15)
jb 0xa00e
movq 0x10(%r15), %r15
cmpl $0x0, 0x8(%r15)
je 0xa2e8
movl (%rbx), %eax
cmpl $0xf, %eax
jb 0xa033
movq 0x10(%rbx), %rbx
movl (%rbx), %eax
cmpl $0xf, %eax
jb 0xa033
movq 0x10(%rbx), %rcx
movl (%rcx), %ecx
jmp 0xa035
movl %eax, %ecx
cmpl $0xd, %ecx
jne 0xa040
movq 0x10(%rbx), %rbx
movl (%rbx), %eax
movl %eax, %ecx
cmpl $0xf, %eax
jb 0xa04d
movq 0x10(%rbx), %rcx
movl (%rcx), %ecx
cmpl $0x6, %ecx
ja 0xa069
movl (%r15), %ecx
cmpl $0xf, %ecx
jb 0xa060
movq 0x10(%r15), %rcx
movl (%rcx), %ecx
cmpl $0x7, %ecx
jb 0xa2ea
cmpl $0xf, %eax
jb 0xa089
movq 0x10(%rbx), %rcx
movl (%rcx), %ecx
cmpl $0x9, %ecx
je 0xa090
cmpq %r15, %rbx
jne 0xa099
cmpl $0xa, %ecx
je 0xa2ea
jmp 0xa099
movl %eax, %ecx
cmpl $0x9, %eax
jne 0xa079
cmpq %r15, %rbx
je 0xa2ea
cmpl $0xf, %eax
jb 0xa0ab
movq 0x10(%rbx), %rcx
movl (%rcx), %ecx
cmpl $0x9, %ecx
jne 0xa0b2
jmp 0xa0b7
movl %eax, %ecx
cmpl $0x9, %eax
je 0xa0b7
cmpl $0xa, %ecx
jne 0xa0e5
movl (%r15), %ecx
cmpl $0xf, %ecx
jb 0xa0c5
movq 0x10(%r15), %rcx
movl (%rcx), %ecx
cmpl $0x9, %ecx
je 0xa0cf
cmpl $0xa, %ecx
jne 0xa0e5
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1927e
testq %rax, %rax
jne 0xa2ea
movl (%rbx), %eax
cmpl $0xf, %eax
jb 0xa0f0
movq 0x10(%rbx), %rax
movl (%rax), %eax
cmpl $0x7, %eax
jne 0xa291
movl (%r15), %eax
cmpl $0xf, %eax
jb 0xa107
movq 0x10(%r15), %rax
movl (%rax), %eax
cmpl $0x7, %eax
jne 0xa291
movq 0x10(%rbx), %r12
movq 0x10(%r15), %r13
movl (%r12), %eax
cmpl $0xf, %eax
jb 0xa128
movq 0x10(%r12), %rax
movl (%rax), %eax
cmpl $0x9, %eax
je 0xa132
cmpl $0xa, %eax
jne 0xa15f
movl (%r13), %eax
cmpl $0xf, %eax
jb 0xa141
movq 0x10(%r13), %rax
movl (%rax), %eax
cmpl $0x9, %eax
je 0xa14b
cmpl $0xa, %eax
jne 0xa15f
movq %r13, %rdi
movq %r12, %rsi
callq 0x1927e
testq %rax, %rax
jne 0xa2ea
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x190d9
testl %eax, %eax
je 0xa17b
movq %r15, %rbx
jmp 0xa2ea
cmpl $0xf, (%r12)
movq %r12, %rdi
jb 0xa18a
movq 0x10(%r12), %rdi
cmpl $0xf, (%r13)
movq %r13, %rsi
jb 0xa198
movq 0x10(%r13), %rsi
movl $0x1, %edx
callq 0x190d9
testl %eax, %eax
je 0xa1e1
movl (%r13), %ecx
cmpl $0xf, %ecx
je 0xa1bf
cmpl $0x1f, %ecx
je 0xa1bf
cmpl $0x10, %ecx
jne 0xa173
movl (%r12), %eax
jmp 0xa1d7
movl (%r12), %eax
movl %eax, %edx
orl $0x10, %edx
cmpl $0x1f, %edx
jne 0xa1e1
cmpl $0x1f, %ecx
je 0xa1d7
cmpl $0x10, %ecx
jne 0xa173
cmpl $0x10, %eax
je 0xa173
cmpl $0x1f, %eax
je 0xa173
leaq 0x28e08(%rip), %rax     # 0x32ff0
movq (%rax), %rcx
cmpq %rcx, %rbx
je 0xa2ea
movl (%r12), %eax
movq %r12, %rsi
cmpl $0xf, %eax
jb 0xa205
movq 0x10(%r12), %rsi
cmpq %rcx, %r15
je 0xa2ea
leaq 0x28dcb(%rip), %rcx     # 0x32fe0
movq (%rcx), %rdx
cmpq %rdx, %rsi
je 0xa2ea
movl (%r13), %ecx
movq %r13, %rsi
cmpl $0xf, %ecx
jb 0xa231
movq 0x10(%r13), %rsi
cmpq %rdx, %rsi
je 0xa2ea
leaq 0x28d57(%rip), %rdx     # 0x32f98
movq (%rdx), %rdx
cmpq %rdx, %r12
jne 0xa259
cmpl $0xf, %ecx
jb 0xa254
movq 0x10(%r13), %rcx
movl (%rcx), %ecx
cmpl $0xd, %ecx
je 0xa26f
cmpq %rdx, %r13
jne 0xa291
cmpl $0xf, %eax
jb 0xa26a
movq 0x10(%r12), %rax
movl (%rax), %eax
cmpl $0xd, %eax
jne 0xa291
leaq 0x227e2(%rip), %rax     # 0x2ca58
cmpl $0x0, (%rax)
jle 0xa2ea
leaq 0x14ec0(%rip), %rdi     # 0x1f142
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9bfd
jmp 0xa2ea
movl (%rbx), %eax
cmpl $0xf, %eax
jb 0xa29e
movq 0x10(%rbx), %rax
movl (%rax), %eax
cmpl $0x7, %eax
jne 0xa2e8
movq 0x8(%r14), %rcx
movl (%rcx), %eax
cmpl $0xf, %eax
jb 0xa2bb
movq 0x10(%rcx), %rax
movl (%rax), %eax
cmpl $0x2, %eax
ja 0xa2c0
jmp 0xa2e8
cmpl $0x3, %eax
jb 0xa2e8
cmpl $0x6, %eax
ja 0xa2e8
movl (%r14), %eax
andl $-0x10, %eax
cmpl $0x10, %eax
jne 0xa2e8
leaq 0x28d01(%rip), %rax     # 0x32fd8
movq (%rax), %rsi
movq %r14, %rdi
callq 0xa2f7
cmpl $0x0, 0x28(%rax)
je 0xa2ea
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq