// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/enode.c
// Function: condnode
Tree condnode(Tree e, Tree l, Tree r) {
	Symbol t1 = 0;
	Type ty = 0, lty = l->type, rty = r->type;
	Tree p;

	if (isarith(lty) && isarith(rty)) {
		ty = binary(lty, rty);
		l = cast(l, ty);
		r = cast(r, ty);
	} else if (eqtype(lty, rty, 1)
	|| (isptr(lty) && isint(rty) && assign(lty, r)))
		ty = unqual(lty);
	else if (isptr(rty) && isint(lty) && assign(rty, l))
		ty = unqual(rty);
	else if (isptr(lty) && isptr(rty)) {
		lty = lty->type;
		rty = rty->type;
		if (unqual(lty) == voidtype || unqual(rty) == voidtype)
			ty = voidtype;
		else if (eqtype(unqual(lty), unqual(rty), 1))
			ty = unqual(lty);
		if (ty) {
			if (isconst(lty) || isconst(rty))
				ty = qual(CONST, ty);
			if (isvolatile(lty) || isvolatile(rty))
				ty = qual(VOLATILE, ty);
			ty = ptr(ty);
		}
	}
	if (ty == 0) {
		typeerror(COND, l, r);
		ty = inttype;
	} else if (e->op == CNST+D || e->op == CNST+F) {
		e = cast(e, doubletype);
		return retype(e->u.v.d != 0.0 ? l : r, ty);
	} else if (generic(e->op) == CNST) {
		e = cast(e, unsignedtype);
		return retype(e->u.v.u ? l : r, ty);
	} else if (ty != voidtype && ty->size > 0) {
		Opcode op = generic(e->op);
		t1 = temporary(REGISTER, ty);
		l = root(asgn(t1, l));
		if (op != AND && op != OR && op != NOT && op != EQ && op != NE
		&&  op !=  LE && op != LT && op !=  GE && op != GT && op != RIGHT
		&& r->op == CNST+I && r->u.v.i == 0
		&& assign(e->type, r)) {
			/* e1?e2:0 => ((t1=e1)?(t1=e2): ) */
			e = asgn(t1, cast(e, ty));
			r = 0;
		} else
			r = root(asgn(t1, r));
	}
	p = tree(COND, ty, cond(e), tree(RIGHT, ty, l, r));
	p->u.sym = t1;
	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xccb6
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xccbe
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x6, (%rax)
ja 0xcd27
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xccde
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xcce6
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpl $0x6, (%rax)
ja 0xcd27
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xc840
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xe9b0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xe9b0
movq %rax, -0x20(%rbp)
jmp 0xd110
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl $0x1, %edx
callq 0x27f80
cmpl $0x0, %eax
jne 0xcdd1
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcd59
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0xcd61
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpl $0x7, (%rax)
jne 0xcdfd
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcd85
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0xcd8d
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpl $0x3, (%rax)
jb 0xcdfd
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcdad
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0xcdb5
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0x6, (%rax)
ja 0xcdfd
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xe2d0
cmpq $0x0, %rax
je 0xcdfd
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcde8
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0xcdf0
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xd10e
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xce17
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0xce22
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpl $0x7, (%rax)
jne 0xcedc
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xce4c
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0xce57
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpl $0x3, (%rax)
jb 0xcedc
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xce7d
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0xce88
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpl $0x6, (%rax)
ja 0xcedc
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe2d0
cmpq $0x0, %rax
je 0xcedc
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcec1
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0xcecc
movq -0x40(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xd10c
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcef6
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0xcf01
movq -0x38(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
cmpl $0x7, (%rax)
jne 0xd10a
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcf2b
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0xcf36
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
cmpl $0x7, (%rax)
jne 0xd10a
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcf78
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb8(%rbp)
jmp 0xcf83
movq -0x38(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
leaq 0x372af(%rip), %rcx     # 0x44240
cmpq (%rcx), %rax
je 0xcfce
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcfb0
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
jmp 0xcfbb
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
leaq 0x37277(%rip), %rcx     # 0x44240
cmpq (%rcx), %rax
jne 0xcfe1
leaq 0x3726b(%rip), %rax     # 0x44240
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xd088
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xcffb
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc8(%rbp)
jmp 0xd006
movq -0x38(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xd02e
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xd8(%rbp)
jmp 0xd039
movq -0x40(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movl $0x1, %edx
callq 0x27f80
cmpl $0x0, %eax
je 0xd086
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
jb 0xd070
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xe0(%rbp)
jmp 0xd07b
movq -0x38(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xd088
cmpq $0x0, -0x30(%rbp)
je 0xd108
movq -0x38(%rbp), %rax
cmpl $0xf, (%rax)
je 0xd0b3
movq -0x38(%rbp), %rax
cmpl $0x1f, (%rax)
je 0xd0b3
movq -0x40(%rbp), %rax
cmpl $0xf, (%rax)
je 0xd0b3
movq -0x40(%rbp), %rax
cmpl $0x1f, (%rax)
jne 0xd0c5
movq -0x30(%rbp), %rsi
movl $0xf, %edi
callq 0x27a70
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x10, (%rax)
je 0xd0e9
movq -0x38(%rbp), %rax
cmpl $0x1f, (%rax)
je 0xd0e9
movq -0x40(%rbp), %rax
cmpl $0x10, (%rax)
je 0xd0e9
movq -0x40(%rbp), %rax
cmpl $0x1f, (%rax)
jne 0xd0fb
movq -0x30(%rbp), %rsi
movl $0x10, %edi
callq 0x27a70
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x27120
movq %rax, -0x30(%rbp)
jmp 0xd10a
jmp 0xd10c
jmp 0xd10e
jmp 0xd110
cmpq $0x0, -0x30(%rbp)
jne 0xd13c
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x290, %edi            # imm = 0x290
callq 0xc6a0
leaq 0x370c8(%rip), %rax     # 0x441f8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xd357
movq -0x10(%rbp), %rax
cmpl $0x12, (%rax)
je 0xd14e
movq -0x10(%rbp), %rax
cmpl $0x11, (%rax)
jne 0xd1ac
movq -0x10(%rbp), %rdi
leaq 0x3708f(%rip), %rax     # 0x441e8
movq (%rax), %rsi
callq 0xe9b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd17b
jp 0xd17b
jmp 0xd188
movq -0x18(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0xd193
movq -0x20(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x25a20
movq %rax, -0x8(%rbp)
jmp 0xd3bb
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $-0x10, %eax
cmpl $0x10, %eax
jne 0xd20c
movq -0x10(%rbp), %rdi
leaq 0x37073(%rip), %rax     # 0x44238
movq (%rax), %rsi
callq 0xe9b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0xd1e8
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0xd1f3
movq -0x20(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x25a20
movq %rax, -0x8(%rbp)
jmp 0xd3bb
movq -0x30(%rbp), %rax
leaq 0x37029(%rip), %rcx     # 0x44240
cmpq (%rcx), %rax
je 0xd351
movq -0x30(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0xd351
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $-0x10, %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rsi
movl $0x4e, %edi
callq 0x250c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe0f0
movq %rax, %rdi
callq 0x25a90
movq %rax, -0x18(%rbp)
cmpl $0x260, -0x4c(%rbp)     # imm = 0x260
je 0xd336
cmpl $0x280, -0x4c(%rbp)     # imm = 0x280
je 0xd336
cmpl $0x270, -0x4c(%rbp)     # imm = 0x270
je 0xd336
cmpl $0x1e0, -0x4c(%rbp)     # imm = 0x1E0
je 0xd336
cmpl $0x230, -0x4c(%rbp)     # imm = 0x230
je 0xd336
cmpl $0x210, -0x4c(%rbp)     # imm = 0x210
je 0xd336
cmpl $0x220, -0x4c(%rbp)     # imm = 0x220
je 0xd336
cmpl $0x1f0, -0x4c(%rbp)     # imm = 0x1F0
je 0xd336
cmpl $0x200, -0x4c(%rbp)     # imm = 0x200
je 0xd336
cmpl $0x2a0, -0x4c(%rbp)     # imm = 0x2A0
je 0xd336
movq -0x20(%rbp), %rax
cmpl $0x15, (%rax)
jne 0xd336
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0xd336
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xe2d0
cmpq $0x0, %rax
je 0xd336
movq -0x28(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xe9b0
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0xe0f0
movq %rax, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
jmp 0xd34f
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xe0f0
movq %rax, %rdi
callq 0x25a90
movq %rax, -0x20(%rbp)
jmp 0xd351
jmp 0xd353
jmp 0xd355
jmp 0xd357
movq -0x30(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rdi
callq 0xf820
movq %rax, -0x100(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x2a0, %edi            # imm = 0x2A0
callq 0x256f0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %rax, %rcx
movl $0x290, %edi            # imm = 0x290
callq 0x256f0
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax,%rax)