// File: /workspace/github_c_makefile_star2_O1/Oric4ever[P]lcc65/6502/build/../src/enode.c
// Function: subnode
static Tree subnode(int op, Tree l, Tree r) {
	int n;
	Type ty = inttype;

	if (isarith(l->type) && isarith(r->type)) {
		ty = binary(l->type, r->type);
		l = cast(l, ty);
		r = cast(r, ty);
	} else if (isptr(l->type) && isint(r->type)) {
		ty = unqual(l->type);
		if ((n = ty->type->size) == 0)
			error("unknown size of type `%t'\n", ty->type);
		r = cast(r, promote(r->type));
		if (n > 1)
			r = mulnode(MUL, constnode(n, inttype), r);
		return simplify(SUB+P, ty, l, r);
	} else if (compatible(l->type, r->type)) {
		if ((n = deref(l->type)->size) == 0)
			error("unknown size of type `%t'\n", deref(l->type));
		l = simplify(SUB+U, unsignedtype, cast(l, unsignedtype),
			cast(r, unsignedtype));
		return simplify(DIV+I, inttype, cast(l, inttype), constnode(n, inttype));
	} else
		typeerror(op, l, r);
	return simplify(op, ty, l, r);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x298d4(%rip), %r13     # 0x31f98
movq 0x8(%rsi), %r15
movl (%r15), %eax
movq %r15, %rcx
cmpl $0xf, %eax
jb 0x86d7
movq 0x10(%r15), %rcx
movq (%r13), %r12
cmpl $0x6, (%rcx)
ja 0x8721
movq 0x8(%r14), %rsi
cmpl $0xf, (%rsi)
movq %rsi, %rcx
jb 0x86f0
movq 0x10(%rsi), %rcx
cmpl $0x6, (%rcx)
ja 0x8721
movq %r15, %rdi
callq 0x9092
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa341
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0xa341
movq %rax, %r14
jmp 0x8874
movq %r15, %rcx
cmpl $0xf, %eax
jb 0x872d
movq 0x10(%r15), %rcx
cmpl $0x7, (%rcx)
jne 0x87c4
movq 0x8(%r14), %rcx
movl (%rcx), %edx
movq %rcx, %rsi
cmpl $0xf, %edx
jb 0x8748
movq 0x10(%rcx), %rsi
cmpl $0x3, (%rsi)
jb 0x87c4
cmpl $0xf, %edx
jb 0x8756
movq 0x10(%rcx), %rcx
cmpl $0x6, (%rcx)
ja 0x87c4
cmpl $0xf, %eax
jb 0x8764
movq 0x10(%r15), %r15
movq 0x10(%r15), %rsi
movl 0x8(%rsi), %ebp
testl %ebp, %ebp
jne 0x877d
leaq 0x16588(%rip), %rdi     # 0x1ecfe
xorl %eax, %eax
callq 0x9720
movq 0x8(%r14), %rdi
callq 0xacd9
movq %r14, %rdi
movq %rax, %rsi
callq 0xa341
movq %rax, %r14
cmpl $0x2, %ebp
jl 0x87b7
movq (%r13), %rsi
movl %ebp, %edi
callq 0x9044
movl $0x1d0, %edi            # imm = 0x1D0
movq %rax, %rsi
movq %r14, %rdx
callq 0x861a
movq %rax, %r14
movl $0x147, %edi            # imm = 0x147
movq %r15, %rsi
jmp 0x8879
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x96b5
testl %eax, %eax
je 0x8867
movq 0x8(%rbx), %rdi
callq 0x19254
movl 0x8(%rax), %ebp
testl %ebp, %ebp
jne 0x8802
movq 0x8(%rbx), %rdi
callq 0x19254
leaq 0x16506(%rip), %rdi     # 0x1ecfe
movq %rax, %rsi
xorl %eax, %eax
callq 0x9720
leaq 0x297cf(%rip), %r12     # 0x31fd8
movq (%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa341
movq %rax, %rbx
movq (%r12), %rsi
movq %r14, %rdi
callq 0xa341
movl $0x146, %edi            # imm = 0x146
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x12653
movq (%r13), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa341
movq %rax, %r14
movq (%r13), %rsi
movl %ebp, %edi
callq 0x9044
movl $0x1c5, %edi            # imm = 0x1C5
movq %rbx, %rsi
movq %r14, %rdx
movq %rax, %rcx
jmp 0x887f
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8fcb
movl %ebp, %edi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12653