// File: /workspace/github_c_makefile_star2_O2/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 0x2a1e1(%rip), %r13     # 0x31f98
movq 0x8(%rsi), %r15
movl (%r15), %eax
movl %eax, %ecx
cmpl $0xf, %eax
jb 0x7dcb
movq 0x10(%r15), %rcx
movl (%rcx), %ecx
movq (%r13), %r12
cmpl $0x6, %ecx
ja 0x7e16
movq 0x8(%r14), %rsi
movl (%rsi), %ecx
cmpl $0xf, %ecx
jb 0x7de5
movq 0x10(%rsi), %rcx
movl (%rcx), %ecx
cmpl $0x6, %ecx
ja 0x7e16
movq %r15, %rdi
callq 0x8773
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9912
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x9912
movq %rax, %r14
jmp 0x7f69
movl %eax, %ecx
cmpl $0xf, %eax
jb 0x7e23
movq 0x10(%r15), %rcx
movl (%rcx), %ecx
movq 0x8(%r14), %rsi
cmpl $0x7, %ecx
jne 0x7ebd
movl (%rsi), %ecx
cmpl $0xf, %ecx
jb 0x7e44
movq 0x10(%rsi), %rcx
movl (%rcx), %ecx
cmpl $0x2, %ecx
ja 0x7e49
jmp 0x7ebd
cmpl $0x3, %ecx
jb 0x7ebd
cmpl $0x6, %ecx
ja 0x7ebd
cmpl $0xf, %eax
jb 0x7e57
movq 0x10(%r15), %r15
movq 0x10(%r15), %rax
movl 0x8(%rax), %ebp
testl %ebp, %ebp
jne 0x7e77
leaq 0x14eae(%rip), %rdi     # 0x1cd17
movq %rax, %rsi
xorl %eax, %eax
callq 0x8dd4
movq 0x8(%r14), %rsi
movq %rsi, %rdi
callq 0xa287
movq %r14, %rdi
movq %rax, %rsi
callq 0x9912
movq %rax, %r14
cmpl $0x2, %ebp
jl 0x7eb0
movq (%r13), %rsi
movl %ebp, %edi
callq 0x8726
movl $0x1d0, %edi            # imm = 0x1D0
movq %rax, %rsi
movq %r14, %rdx
callq 0x7d0b
movq %rax, %r14
movl $0x147, %edi            # imm = 0x147
movq %r15, %rsi
jmp 0x7f6e
movq %r15, %rdi
callq 0x8d68
testl %eax, %eax
je 0x7f5c
movq 0x8(%rbx), %rdi
callq 0x17af2
movl 0x8(%rax), %ebp
testl %ebp, %ebp
jne 0x7ef7
movq 0x8(%rbx), %rdi
callq 0x17af2
leaq 0x14e2a(%rip), %rdi     # 0x1cd17
movq %rax, %rsi
xorl %eax, %eax
callq 0x8dd4
leaq 0x2a0da(%rip), %r12     # 0x31fd8
movq (%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9912
movq %rax, %rbx
movq (%r12), %rsi
movq %r14, %rdi
callq 0x9912
movl $0x146, %edi            # imm = 0x146
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x1131b
movq (%r13), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x9912
movq %rax, %r14
movq (%r13), %rsi
movl %ebp, %edi
callq 0x8726
movl $0x1c5, %edi            # imm = 0x1C5
movq %rbx, %rsi
movq %r14, %rdx
movq %rax, %rcx
jmp 0x7f74
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x86ad
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 0x1131b