// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rsi, %r14
testq %rsi, %rsi
js 0x6646
movq 0x15fba(%rip), %rax     # 0x1c5e0
testb $0x1, (%rax,%r14)
je 0x6646
movq 0x15b3c(%rip), %rax     # 0x1c170
cmpq $-0x18, (%rax,%r14,8)
jne 0x6646
movq %r14, %rdi
callq 0x5580
movq %rax, %r14
movq 0x15b23(%rip), %rdx     # 0x1c170
movq 0x15f6c(%rip), %rax     # 0x1c5c0
movq (%rax,%r14,8), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, (%rdx,%rcx,8)
jne 0x6672
cmpq $-0x1, (%rax,%rcx,8)
je 0x6837
movq 0x15aaf(%rip), %rsi     # 0x1c128
movq %r14, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x15a9e(%rip)     # 0x1c128
testq %rbx, %rbx
js 0x66bc
movq 0x15f4a(%rip), %rcx     # 0x1c5e0
testb $0x1, (%rcx,%rbx)
je 0x66bc
movq 0x15acd(%rip), %rcx     # 0x1c170
cmpq $-0x18, (%rcx,%rbx,8)
jne 0x66bc
movq %rbx, %rdi
callq 0x5580
movq %rax, %rbx
movq 0x15a6c(%rip), %rax     # 0x1c128
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x15a58(%rip)     # 0x1c128
movq 0x15a99(%rip), %rax     # 0x1c170
movq 0x15ee2(%rip), %rcx     # 0x1c5c0
movq (%rcx,%r14,8), %rdx
movq (%rcx,%rbx,8), %rsi
movq (%rax,%rsi,8), %rdi
xorq (%rax,%rdx,8), %rdi
movq %rdi, -0x38(%rbp)
movq (%rcx,%rdx,8), %rdx
movq (%rax,%rdx,8), %r15
movq (%rcx,%rsi,8), %rsi
movq (%rax,%rsi,8), %rax
movq %rax, -0x30(%rbp)
movq (%rcx,%rdx,8), %rsi
pushq $-0x18
popq %r14
pushq $0x1
popq %r13
movq %r14, %rdi
movl %r13d, %edx
callq 0x3613
movq %rax, %r12
movq 0x15a49(%rip), %rax     # 0x1c170
movq 0x15e92(%rip), %rcx     # 0x1c5c0
movq 0x159f3(%rip), %rdx     # 0x1c128
movq (%rcx,%rdx,8), %rdx
movq %r12, (%rax,%rdx,8)
movq (%rcx,%rbx,8), %rax
movq (%rcx,%rax,8), %rax
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movl %r13d, %edx
callq 0x3613
movq %rax, %rbx
movq 0x15a12(%rip), %rcx     # 0x1c170
movq 0x159c3(%rip), %rax     # 0x1c128
movq %rbx, (%rcx,%rax,8)
movq 0x15e50(%rip), %rax     # 0x1c5c0
movq (%rax,%rbx,8), %r14
cmpq $0x0, (%rcx,%r14,8)
jne 0x6786
cmpq $-0x1, (%rax,%r14,8)
je 0x6860
movq (%rax,%r12,8), %rdi
callq 0x52d5
movq %rax, %r13
movq %r14, %rdi
callq 0x52d5
movq %rax, %r14
addl $0x24, %r14d
subq -0x30(%rbp), %r15
cmpl %r14d, %r13d
jge 0x67dc
movq %r12, %rdi
xorl %esi, %esi
callq 0x4986
movq %rax, %r12
movq 0x159b2(%rip), %rax     # 0x1c170
movq 0x15dfb(%rip), %rcx     # 0x1c5c0
movq 0x1595c(%rip), %rdx     # 0x1c128
movq (%rcx,%rdx,8), %rcx
movq %r12, (%rax,%rcx,8)
incl %r13d
decq %r15
jmp 0x67a5
pushq $-0x8
popq %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x5200
movq %rax, %rbx
pushq $0x2
popq %rdi
callq 0x3775
movq -0x38(%rbp), %rdi
andl $0x1, %edi
movq 0x15dbd(%rip), %rax     # 0x1c5c0
movq 0x15966(%rip), %rcx     # 0x1c170
movq (%rcx,%rbx,8), %rcx
movq (%rax,%rcx,8), %rdx
movq %r15, %rsi
callq 0x529a
leaq 0xd99d(%rip), %rsi      # 0x141be
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5321
xorl %edi, %edi
callq 0x35ed
movq 0x15d7b(%rip), %rcx     # 0x1c5c0
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 0x529a
pushq $0x2
popq %rdi
callq 0x3775
pushq $-0x7
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq