// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
testq %rdi, %rdi
js 0x6124
movq 0x184ef(%rip), %rcx     # 0x1e5e0
testb $0x1, (%rcx,%rdi)
jne 0x62bb
testq %rdi, %rdi
js 0x6124
movq 0x184d9(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rdi)
je 0x6124
movq 0x1805c(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rdi,8)
jne 0x6124
callq 0x5b51
movq %rax, -0x28(%rbp)
testq %r14, %r14
js 0x6174
movq 0x184b0(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%r14)
je 0x6174
movq 0x18032(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%r14,8)
jne 0x6174
movq -0x28(%rbp), %rdi
movq 0x17fd8(%rip), %rsi     # 0x1e128
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17fca(%rip)     # 0x1e128
movq %r14, %rdi
callq 0x5b51
movq %rax, -0x30(%rbp)
movl $0x1, %edi
callq 0x3851
movq 0x17ff5(%rip), %rcx     # 0x1e170
movq 0x1843e(%rip), %rax     # 0x1e5c0
movq -0x28(%rbp), %rdi
movq (%rax,%rdi,8), %rdx
xorl %esi, %esi
testb $0x1, (%rcx,%rdx,8)
movl $0x0, %r8d
je 0x61b9
movq (%rax,%rdx,8), %r8
movq (%rax,%r8,8), %r9
movl $0x1, %r8d
cmpq $0x0, (%rcx,%r9,8)
jne 0x61b9
xorl %r8d, %r8d
cmpq $-0x1, (%rax,%r9,8)
setne %r8b
movq -0x30(%rbp), %r15
movq (%rax,%r15,8), %r9
testb $0x1, (%rcx,%r9,8)
je 0x61e7
movq (%rax,%r9,8), %rsi
movq (%rax,%rsi,8), %r10
movl $0x1, %esi
cmpq $0x0, (%rcx,%r10,8)
jne 0x61e7
xorl %esi, %esi
cmpq $-0x1, (%rax,%r10,8)
setne %sil
cmpl %esi, %r8d
jne 0x62b4
testl %ebx, %ebx
jne 0x6236
movq (%rax,%rdx,8), %rsi
movq (%rcx,%rsi,8), %r8
movq (%rax,%r9,8), %rdx
cmpq (%rcx,%rdx,8), %r8
jne 0x62b4
movq (%rax,%rsi,8), %r14
cmpq $0x0, (%rcx,%r14,8)
jne 0x6232
cmpq $-0x1, (%rax,%r14,8)
jne 0x6232
movq (%rax,%rdx,8), %rsi
cmpq $0x0, (%rcx,%rsi,8)
jne 0x6232
cmpq $-0x1, (%rax,%rsi,8)
je 0x63b4
movq (%rax,%rdx,8), %r12
testl %ebx, %ebx
je 0x6359
movq %r15, 0x17ecb(%rip)     # 0x1e110
movq 0x17edc(%rip), %rsi     # 0x1e128
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17ece(%rip)     # 0x1e128
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17eba(%rip)     # 0x1e128
movq $-0x1, 0x17e97(%rip) # 0x1e110
leaq -0x28(%rbp), %rbx
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6062
movq (%rbx), %rax
cmpq $-0x1, %rax
sete %dl
movq (%r14), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x631d
movl $0x2, %edi
callq 0x3851
xorl %ecx, %ecx
jmp 0x639b
testq %r14, %r14
js 0x60fb
movq 0x17ea5(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rdi,8)
jne 0x60fb
testb $0x1, (%rcx,%r14)
je 0x60fb
cmpq $-0x18, (%rax,%r14,8)
jne 0x60fb
movq 0x182cd(%rip), %rdx     # 0x1e5c0
xorl %ecx, %ecx
movq (%rdx,%r14,8), %r14
movq (%rdx,%rdi,8), %rdi
cmpq $-0x1, %rdi
je 0x63ab
cmpq $-0x1, %r14
je 0x63ab
movq (%rax,%rdi,8), %rsi
cmpq (%rax,%r14,8), %rsi
je 0x62f5
jmp 0x639b
movq 0x1829c(%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), %rbx
callq 0x5ea1
movq %rax, %r14
movq %rbx, %rdi
callq 0x5ea1
movq %rax, %r12
movl $0x2, %edi
callq 0x3851
cmpq $-0x1, %r14
je 0x6395
cmpq $-0x1, %r12
je 0x6395
movq 0x17e04(%rip), %rax     # 0x1e170
movq 0x1824d(%rip), %rcx     # 0x1e5c0
movq (%rax,%r14,8), %rdx
cmpq (%rax,%r12,8), %rdx
jne 0x62b4
movq (%rcx,%r14,8), %r14
movq (%rcx,%r12,8), %r12
cmpq $-0x1, %r14
je 0x6395
cmpq $-0x1, %r12
jne 0x6373
cmpq %r12, %r14
sete %cl
movzbl %cl, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andq %r14, %rdi
cmpq $-0x1, %rdi
jmp 0x6398
movb $0x1, %cl
jmp 0x639b