// File: /workspace/github_c_makefile_star2_O3/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 0x2a875(%rip), %r13     # 0x32f98
movq 0x8(%rsi), %r15
movl (%r15), %eax
movl %eax, %ecx
cmpl $0xf, %eax
jb 0x8737
movq 0x10(%r15), %rcx
movl (%rcx), %ecx
movq (%r13), %r12
cmpl $0x6, %ecx
ja 0x8782
movq 0x8(%r14), %rsi
movl (%rsi), %ecx
cmpl $0xf, %ecx
jb 0x8751
movq 0x10(%rsi), %rcx
movl (%rcx), %ecx
cmpl $0x6, %ecx
ja 0x8782
movq %r15, %rdi
callq 0x90de
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa2f7
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0xa2f7
movq %rax, %r14
jmp 0x88d5
movl %eax, %ecx
cmpl $0xf, %eax
jb 0x878f
movq 0x10(%r15), %rcx
movl (%rcx), %ecx
movq 0x8(%r14), %rsi
cmpl $0x7, %ecx
jne 0x8829
movl (%rsi), %ecx
cmpl $0xf, %ecx
jb 0x87b0
movq 0x10(%rsi), %rcx
movl (%rcx), %ecx
cmpl $0x2, %ecx
ja 0x87b5
jmp 0x8829
cmpl $0x3, %ecx
jb 0x8829
cmpl $0x6, %ecx
ja 0x8829
cmpl $0xf, %eax
jb 0x87c3
movq 0x10(%r15), %r15
movq 0x10(%r15), %rax
movl 0x8(%rax), %ebp
testl %ebp, %ebp
jne 0x87e3
leaq 0x16542(%rip), %rdi     # 0x1ed17
movq %rax, %rsi
xorl %eax, %eax
callq 0x974c
movq 0x8(%r14), %rsi
movq %rsi, %rdi
callq 0xac7b
movq %r14, %rdi
movq %rax, %rsi
callq 0xa2f7
movq %rax, %r14
cmpl $0x2, %ebp
jl 0x881c
movq (%r13), %rsi
movl %ebp, %edi
callq 0x908f
movl $0x1d0, %edi            # imm = 0x1D0
movq %rax, %rsi
movq %r14, %rdx
callq 0x8677
movq %rax, %r14
movl $0x147, %edi            # imm = 0x147
movq %r15, %rsi
jmp 0x88da
movq %r15, %rdi
callq 0x96df
testl %eax, %eax
je 0x88c8
movq 0x8(%rbx), %rdi
callq 0x19085
movl 0x8(%rax), %ebp
testl %ebp, %ebp
jne 0x8863
movq 0x8(%rbx), %rdi
callq 0x19085
leaq 0x164be(%rip), %rdi     # 0x1ed17
movq %rax, %rsi
xorl %eax, %eax
callq 0x974c
leaq 0x2a76e(%rip), %r12     # 0x32fd8
movq (%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa2f7
movq %rax, %rbx
movq (%r12), %rsi
movq %r14, %rdi
callq 0xa2f7
movl $0x146, %edi            # imm = 0x146
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x12443
movq (%r13), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa2f7
movq %rax, %r14
movq (%r13), %rsi
movl %ebp, %edi
callq 0x908f
movl $0x1c5, %edi            # imm = 0x1C5
movq %rbx, %rsi
movq %r14, %rdx
movq %rax, %rcx
jmp 0x88e0
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x9016
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 0x12443