// File: /workspace/github_c_makefile_star2_O3/azhai[P]mlite/mlite.c
// Function: real_divide
cell real_divide(cell x, cell a, cell b) {
	cell	r, m, e, ma, mb, ea, eb, neg;
	int	nd, dd;

	if (integer_p(a))
		a = bignum_to_real(a);
	if (x_real_zero_p(a)) {
		r = make_integer(0);
		return make_real(0, 0, cdr(r));
	}
	save(a);
	if (integer_p(b))
		b = bignum_to_real(b);
	save(b);
	neg = x_real_negative_flag(a) != x_real_negative_flag(b);
	ea = x_real_exponent(a);
	eb = x_real_exponent(b);
	ma = new_atom(T_INTEGER, x_real_mantissa(a));
	cadr(Stack) = ma;
	mb = new_atom(T_INTEGER, x_real_mantissa(b));
	car(Stack) = mb;
	if (x_bignum_zero_p(mb)) {
		unsave(2);
		return NAN;
	}
	nd = count_digits(cdr(ma));
	dd = MANTISSA_SIZE + count_digits(cdr(mb));
	while (nd < dd) {
		ma = bignum_shift_left(ma, 0);
		cadr(Stack) = ma;
		nd++;
		ea--;
	}
	e = ea - eb;
	m = bignum_divide(NOEXPR, ma, mb);
	unsave(2);
	r = make_real(neg? REAL_NEGATIVE: 0, e, cdar(m));
	return real_normalize(r, "/");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %rbx
testq %rsi, %rsi
js 0x6d93
movq 0x1786c(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rbx)
je 0x6d93
movq 0x173ef(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rbx,8)
jne 0x6d93
movq %rbx, %rdi
callq 0x5b40
movq %rax, %rbx
movq 0x173d6(%rip), %rdx     # 0x1e170
movq 0x1781f(%rip), %rax     # 0x1e5c0
movq (%rax,%rbx,8), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, (%rdx,%rcx,8)
jne 0x6dbf
cmpq $-0x1, (%rax,%rcx,8)
je 0x700b
movq 0x17362(%rip), %rsi     # 0x1e128
movq %rbx, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17351(%rip)     # 0x1e128
testq %r12, %r12
js 0x6e0a
movq 0x177fd(%rip), %rcx     # 0x1e5e0
testb $0x1, (%rcx,%r12)
je 0x6e0a
movq 0x1737f(%rip), %rcx     # 0x1e170
cmpq $-0x18, (%rcx,%r12,8)
jne 0x6e0a
movq %r12, %rdi
callq 0x5b40
movq %rax, %r12
movq 0x1731e(%rip), %rax     # 0x1e128
xorl %r13d, %r13d
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17307(%rip)     # 0x1e128
movq 0x17348(%rip), %rax     # 0x1e170
movq 0x17791(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rbx,8), %rdx
movq (%rcx,%r12,8), %rsi
movq (%rax,%rsi,8), %rbx
xorq (%rax,%rdx,8), %rbx
movq (%rcx,%rdx,8), %rdx
movq (%rax,%rdx,8), %r14
movq (%rcx,%rsi,8), %rsi
movq (%rax,%rsi,8), %rax
movq %rax, -0x38(%rbp)
movq (%rcx,%rdx,8), %rsi
movq $-0x18, %rdi
movl $0x1, %edx
callq 0x36e8
movq %rax, %r15
movq 0x172fe(%rip), %rax     # 0x1e170
movq 0x17747(%rip), %rcx     # 0x1e5c0
movq 0x172a8(%rip), %rdx     # 0x1e128
movq (%rcx,%rdx,8), %rdx
movq %r15, (%rax,%rdx,8)
movq (%rcx,%r12,8), %rax
movq (%rcx,%rax,8), %rax
movq (%rcx,%rax,8), %rsi
movq $-0x18, %rdi
movl $0x1, %edx
callq 0x36e8
movq 0x172c4(%rip), %rdx     # 0x1e170
movq 0x17275(%rip), %rcx     # 0x1e128
movq %rax, (%rdx,%rcx,8)
movq 0x17702(%rip), %rdi     # 0x1e5c0
movq (%rdi,%rax,8), %r8
movq (%rdx,%r8,8), %rcx
testq %rcx, %rcx
jne 0x6ed6
cmpq $-0x1, (%rdi,%r8,8)
je 0x7054
movq %rax, -0x30(%rbp)
movq (%rdi,%r15,8), %r10
movq (%rdx,%r10,8), %rsi
movabsq $0x6666666666666667, %r9 # imm = 0x6666666666666667
testq %rsi, %rsi
je 0x6f18
xorl %r13d, %r13d
movq %rsi, %rax
imulq %r9
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %rdx
addq %rax, %rdx
incl %r13d
addq $0x9, %rsi
cmpq $0x12, %rsi
movq %rdx, %rsi
ja 0x6ef4
cmpl $0x1, %r13d
adcl $-0x9, %r13d
movq (%rdi,%r10,8), %r10
addl $0x9, %r13d
cmpq $-0x1, %r10
jne 0x6f20
xorl %r12d, %r12d
testq %rcx, %rcx
je 0x6f5a
movq %rcx, %rax
imulq %r9
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %rdx
addq %rax, %rdx
incl %r12d
addq $0x9, %rcx
cmpq $0x12, %rcx
movq %rdx, %rcx
ja 0x6f36
cmpl $0x1, %r12d
adcl $0x1b, %r12d
movq (%rdi,%r8,8), %r8
addl $0x9, %r12d
cmpq $-0x1, %r8
jne 0x6f62
jmp 0x6fa2
movq %r15, %rdi
xorl %esi, %esi
callq 0x4caa
movq %rax, %r15
movq 0x171ea(%rip), %rax     # 0x1e170
movq 0x17633(%rip), %rcx     # 0x1e5c0
movq 0x17194(%rip), %rdx     # 0x1e128
movq (%rcx,%rdx,8), %rcx
movq %r15, (%rax,%rcx,8)
incl %r13d
decq %r14
cmpl %r12d, %r13d
jl 0x6f72
subq -0x38(%rbp), %r14
movq $-0x8, %rdi
movq %r15, %rsi
movq -0x30(%rbp), %rdx
callq 0x56c5
movq %rax, %r15
movl $0x2, %edi
callq 0x384f
andl $0x1, %ebx
movq 0x175eb(%rip), %rax     # 0x1e5c0
movq 0x17194(%rip), %rcx     # 0x1e170
movq (%rcx,%r15,8), %rcx
movq (%rax,%rcx,8), %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x5768
leaq 0xf1c9(%rip), %rsi      # 0x161be
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x580e
xorl %edi, %edi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x36e8
movq $-0x18, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x36e8
movq 0x17587(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rax,8), %rdx
xorl %edi, %edi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5768
movl $0x2, %edi
callq 0x384f
movq $-0x7, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq