// File: /workspace/github_c_makefile_star2_O3/azhai[P]mlite/mlite.c
// Function: real_equal
int real_equal(cell a, cell b, int approx) {
	cell	ma, mb;

	if (integer_p(a) && integer_p(b))
		return bignum_equal_p(a, b);
	if (integer_p(a))
		a = bignum_to_real(a);
	if (integer_p(b)) {
		save(a);
		b = bignum_to_real(b);
		unsave(1);
	}
	if (x_real_negative_p(a) != x_real_negative_p(b))
		return 0;
	if (!approx) {
		if (x_real_exponent(a) != x_real_exponent(b))
			return 0;
		if (x_real_zero_p(a) && x_real_zero_p(b))
			return 1;
		ma = x_real_mantissa(a);
		mb = x_real_mantissa(b);
	}
	if (approx) {
		Tmp = b;
		save(a);
		save(b);
		Tmp = NIL;
		autoscale(&a, &b);
		if (a == NIL || b == NIL) {
			unsave(2);
			return 0;
		}
		ma = x_real_mantissa(a);
		mb = x_real_mantissa(b);
		ma = shift_mantissa(ma);
		mb = shift_mantissa(mb);
		unsave(2);
	}
	while (ma != NIL && mb != NIL) {
		if (car(ma) != car(mb))
			return 0;
		ma = cdr(ma);
		mb = cdr(mb);
	}
	if (ma != mb)
		return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, -0x28(%rbp)
movq %rsi, -0x20(%rbp)
testq %rdi, %rdi
js 0x614f
movq 0x18509(%rip), %rcx     # 0x1e5e0
testb $0x1, (%rcx,%r14)
je 0x614f
testq %rbx, %rbx
js 0x6132
movq 0x18086(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%r14,8)
jne 0x6132
testb $0x1, (%rcx,%rbx)
je 0x6132
cmpq $-0x18, (%rax,%rbx,8)
jne 0x6132
movq 0x184bb(%rip), %rdx     # 0x1e5c0
xorl %ecx, %ecx
movq (%rdx,%rbx,8), %rbx
movq (%rdx,%r14,8), %r14
cmpq $-0x1, %r14
je 0x6363
cmpq $-0x1, %rbx
je 0x6363
movq (%rax,%r14,8), %rsi
cmpq (%rax,%rbx,8), %rsi
je 0x6107
jmp 0x6355
movq 0x18037(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%r14,8)
jne 0x614f
movq %r14, %rdi
callq 0x5b40
movq %rax, %r14
movq %rax, -0x28(%rbp)
testq %rbx, %rbx
js 0x61a0
movq 0x18485(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rbx)
je 0x61a0
movq 0x18008(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rbx,8)
jne 0x61a0
movq 0x17fb2(%rip), %rsi     # 0x1e128
movq %r14, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17fa1(%rip)     # 0x1e128
movq %rbx, %rdi
callq 0x5b40
movq %rax, %rbx
movq %rax, -0x20(%rbp)
movl $0x1, %edi
callq 0x384f
movq 0x17fc9(%rip), %rcx     # 0x1e170
movq 0x18412(%rip), %rax     # 0x1e5c0
movq (%rax,%r14,8), %rdx
xorl %esi, %esi
testb $0x1, (%rcx,%rdx,8)
movl $0x0, %edi
je 0x61de
movq (%rax,%rdx,8), %rdi
movq (%rax,%rdi,8), %r8
movl $0x1, %edi
cmpq $0x0, (%rcx,%r8,8)
jne 0x61de
xorl %edi, %edi
cmpq $-0x1, (%rax,%r8,8)
setne %dil
movq (%rax,%rbx,8), %r8
testb $0x1, (%rcx,%r8,8)
je 0x6208
movq (%rax,%r8,8), %rsi
movq (%rax,%rsi,8), %r9
movl $0x1, %esi
cmpq $0x0, (%rcx,%r9,8)
jne 0x6208
xorl %esi, %esi
cmpq $-0x1, (%rax,%r9,8)
setne %sil
cmpl %esi, %edi
jne 0x6353
testl %r15d, %r15d
je 0x6293
movq %rbx, 0x17ef4(%rip)     # 0x1e110
movq 0x17f05(%rip), %rsi     # 0x1e128
movq %r14, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17ef4(%rip)     # 0x1e128
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17ee0(%rip)     # 0x1e128
movq $-0x1, 0x17ebd(%rip) # 0x1e110
leaq -0x28(%rbp), %rbx
leaq -0x20(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6046
movq (%rbx), %rax
cmpq $-0x1, %rax
sete %dl
movq (%r14), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x62d7
movl $0x2, %edi
callq 0x384f
jmp 0x6353
movq (%rax,%rdx,8), %rsi
movq (%rcx,%rsi,8), %rdi
movq (%rax,%r8,8), %rdx
cmpq (%rcx,%rdx,8), %rdi
jne 0x6353
movq (%rax,%rsi,8), %rbx
cmpq $0x0, (%rcx,%rbx,8)
jne 0x62d1
cmpq $-0x1, (%rax,%rbx,8)
jne 0x62d1
movq (%rax,%rdx,8), %rsi
cmpq $0x0, (%rcx,%rsi,8)
jne 0x62d1
cmpq $-0x1, (%rax,%rsi,8)
je 0x636c
movq (%rax,%rdx,8), %r14
jmp 0x6313
movq 0x182e2(%rip), %rdx     # 0x1e5c0
movq (%rdx,%rax,8), %rax
movq (%rdx,%rax,8), %rax
movq (%rdx,%rax,8), %rdi
movq (%rdx,%rcx,8), %rax
movq (%rdx,%rax,8), %rax
movq (%rdx,%rax,8), %r14
callq 0x5e85
movq %rax, %rbx
movq %r14, %rdi
callq 0x5e85
movq %rax, %r14
movl $0x2, %edi
callq 0x384f
cmpq $-0x1, %rbx
je 0x634b
cmpq $-0x1, %r14
je 0x634b
movq 0x17e4a(%rip), %rax     # 0x1e170
movq 0x18293(%rip), %rcx     # 0x1e5c0
movq (%rax,%rbx,8), %rdx
cmpq (%rax,%r14,8), %rdx
jne 0x6353
movq (%rcx,%rbx,8), %rbx
movq (%rcx,%r14,8), %r14
cmpq $-0x1, %rbx
je 0x634b
cmpq $-0x1, %r14
jne 0x632d
cmpq %r14, %rbx
sete %cl
jmp 0x6355
xorl %ecx, %ecx
movzbl %cl, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
andq %rbx, %r14
cmpq $-0x1, %r14
jmp 0x634e
movb $0x1, %cl
jmp 0x6355