// File: /workspace/github_c_makefile_star2_O1/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 0x6e1a
movq 0x177e5(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rbx)
je 0x6e1a
movq 0x17368(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rbx,8)
jne 0x6e1a
movq %rbx, %rdi
callq 0x5b51
movq %rax, %rbx
movq 0x1734f(%rip), %rdx     # 0x1e170
movq 0x17798(%rip), %rax     # 0x1e5c0
movq (%rax,%rbx,8), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, (%rdx,%rcx,8)
jne 0x6e46
cmpq $-0x1, (%rax,%rcx,8)
je 0x708f
movq 0x172db(%rip), %rsi     # 0x1e128
movq %rbx, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x172ca(%rip)     # 0x1e128
testq %r12, %r12
js 0x6e8a
movq 0x17776(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%r12)
je 0x6e8a
movq 0x172f8(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%r12,8)
jne 0x6e8a
movq %r12, %rdi
callq 0x5b51
movq %rax, %r12
movq 0x17297(%rip), %rsi     # 0x1e128
xorl %r13d, %r13d
movq %r12, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17283(%rip)     # 0x1e128
movq 0x172c4(%rip), %rax     # 0x1e170
movq 0x1770d(%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 0x1727a(%rip), %rax     # 0x1e170
movq 0x176c3(%rip), %rcx     # 0x1e5c0
movq 0x17224(%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 0x17240(%rip), %rdx     # 0x1e170
movq 0x171f1(%rip), %rcx     # 0x1e128
movq %rax, (%rdx,%rcx,8)
movq 0x1767e(%rip), %rdi     # 0x1e5c0
movq (%rdi,%rax,8), %r8
movq (%rdx,%r8,8), %rcx
testq %rcx, %rcx
jne 0x6f5a
cmpq $-0x1, (%rdi,%r8,8)
je 0x70d8
movq %rax, -0x30(%rbp)
movq (%rdi,%r15,8), %r10
movq (%rdx,%r10,8), %rsi
movabsq $0x6666666666666667, %r9 # imm = 0x6666666666666667
testq %rsi, %rsi
je 0x6f9c
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 0x6f78
cmpl $0x1, %r13d
adcl $-0x9, %r13d
movq (%rdi,%r10,8), %r10
addl $0x9, %r13d
cmpq $-0x1, %r10
jne 0x6fa4
xorl %r12d, %r12d
testq %rcx, %rcx
je 0x6fde
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 0x6fba
cmpl $0x1, %r12d
adcl $0x1b, %r12d
movq (%rdi,%r8,8), %r8
addl $0x9, %r12d
cmpq $-0x1, %r8
jne 0x6fe6
jmp 0x7026
movq %r15, %rdi
xorl %esi, %esi
callq 0x4cb6
movq %rax, %r15
movq 0x17166(%rip), %rax     # 0x1e170
movq 0x175af(%rip), %rcx     # 0x1e5c0
movq 0x17110(%rip), %rdx     # 0x1e128
movq (%rcx,%rdx,8), %rcx
movq %r15, (%rax,%rcx,8)
incl %r13d
decq %r14
cmpl %r12d, %r13d
jl 0x6ff6
subq -0x38(%rbp), %r14
movq $-0x8, %rdi
movq %r15, %rsi
movq -0x30(%rbp), %rdx
callq 0x56d5
movq %rax, %r15
movl $0x2, %edi
callq 0x3851
andl $0x1, %ebx
movq 0x17567(%rip), %rax     # 0x1e5c0
movq 0x17110(%rip), %rcx     # 0x1e170
movq (%rcx,%r15,8), %rcx
movq (%rax,%rcx,8), %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x5778
leaq 0xf15d(%rip), %rsi      # 0x161d6
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x581e
xorl %edi, %edi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x36e8
movq $-0x18, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x36e8
movq 0x17503(%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 0x5778
movl $0x2, %edi
callq 0x3851
movq $-0x7, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq