// File: /workspace/github_c_makefile_star2_O1/azhai[P]mlite/mlite.c
// Function: real_add
cell real_add(cell a, cell b) {
	cell	r, m, e, aa, ab;
	int	flags, nega, negb;

	if (integer_p(a) && integer_p(b))
		return bignum_add(a, b);
	if (integer_p(a))
		a = bignum_to_real(a);
	save(a);
	if (integer_p(b))
		b = bignum_to_real(b);
	save(b);
	if (x_real_zero_p(a)) {
		unsave(2);
		return b;
	}
	if (x_real_zero_p(b)) {
		unsave(2);
		return a;
	}
	autoscale(&a, &b);
	if (a == NIL || b == NIL) {
		ab = real_abs(car(Stack));
		save(ab);
		aa = real_abs(caddr(Stack));
		unsave(1);
		b = unsave(1);
		a = unsave(1);
		return real_less_p(aa, ab)? b: a;
	}
	cadr(Stack) = a;
	car(Stack) = b;
	e = x_real_exponent(a);
	nega = x_real_negative_p(a);
	negb = x_real_negative_p(b);
	a = new_atom(T_INTEGER, x_real_mantissa(a));
	if (nega)
		a = bignum_negate(a);
	cadr(Stack) = a;
	b = new_atom(T_INTEGER, x_real_mantissa(b));
	if (negb)
		b = bignum_negate(b);
	car(Stack) = b;
	m = bignum_add(a, b);
	unsave(2);
	flags = x_bignum_negative_p(m)? REAL_NEGATIVE: 0;
	r = bignum_abs(m);
	r = make_real(flags, e, cdr(r));
	return real_normalize(r, "+");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, -0x30(%rbp)
movq %rsi, -0x28(%rbp)
testq %rdi, %rdi
js 0x683e
movq 0x17dd5(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rdi)
jne 0x69e8
testq %rdi, %rdi
js 0x683e
movq 0x17dbf(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rdi)
je 0x683e
movq 0x17942(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rdi,8)
jne 0x683e
callq 0x5b51
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %r14
movq 0x178df(%rip), %rsi     # 0x1e128
movq %r14, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x178ce(%rip)     # 0x1e128
testq %rbx, %rbx
js 0x6886
movq 0x17d7a(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%rbx)
je 0x6886
movq 0x178fd(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%rbx,8)
jne 0x6886
movq %rbx, %rdi
callq 0x5b51
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rbx
movq 0x17897(%rip), %rsi     # 0x1e128
movq %rbx, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17886(%rip)     # 0x1e128
movq 0x178c7(%rip), %rcx     # 0x1e170
movq 0x17d10(%rip), %rax     # 0x1e5c0
movq (%rax,%r14,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x68ce
cmpq $-0x1, (%rax,%rdx,8)
je 0x6b6c
movq (%rax,%rbx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x68ec
cmpq $-0x1, (%rax,%rdx,8)
je 0x6b78
leaq -0x30(%rbp), %rbx
leaq -0x28(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6062
movq (%rbx), %rdx
cmpq $-0x1, %rdx
sete %al
movq (%r14), %r15
cmpq $-0x1, %r15
sete %cl
orb %al, %cl
movq 0x17854(%rip), %rax     # 0x1e170
cmpb $0x1, %cl
jne 0x69b4
movq 0x177fc(%rip), %rcx     # 0x1e128
movq (%rax,%rcx,8), %rdi
callq 0x5e33
movq %rax, %r14
movq 0x177e9(%rip), %rsi     # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x177d8(%rip)     # 0x1e128
movq 0x17819(%rip), %rcx     # 0x1e170
movq 0x17c62(%rip), %rdx     # 0x1e5c0
movq (%rdx,%rax,8), %rax
movq (%rdx,%rax,8), %rax
movq (%rcx,%rax,8), %rdi
callq 0x5e33
movq %rax, %r15
movl $0x1, %edi
callq 0x3851
movl $0x1, %edi
callq 0x3851
movq %rax, %rbx
movq %rax, -0x28(%rbp)
movl $0x1, %edi
callq 0x3851
movq %rax, %r12
movq %rax, -0x30(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x63d3
testl %eax, %eax
cmoveq %r12, %rbx
jmp 0x6b85
movq 0x17c05(%rip), %rcx     # 0x1e5c0
movq 0x17766(%rip), %rsi     # 0x1e128
movq (%rcx,%rsi,8), %rsi
movq %rdx, (%rax,%rsi,8)
movq 0x17757(%rip), %rsi     # 0x1e128
movq %r15, (%rax,%rsi,8)
movq (%rcx,%rdx,8), %rsi
movq (%rcx,%rsi,8), %rdx
testb $0x1, (%rax,%rsi,8)
jne 0x6a2c
xorl %r14d, %r14d
jmp 0x6a43
testq %rbx, %rbx
js 0x6815
movq 0x17778(%rip), %rcx     # 0x1e170
cmpq $-0x18, (%rcx,%rdi,8)
jne 0x6815
testb $0x1, (%rax,%rbx)
je 0x6815
cmpq $-0x18, (%rcx,%rbx,8)
jne 0x6815
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x473d
movq (%rcx,%rdx,8), %rsi
movb $0x1, %r14b
cmpq $0x0, (%rax,%rsi,8)
jne 0x6a43
cmpq $-0x1, (%rcx,%rsi,8)
setne %r14b
movq (%rcx,%r15,8), %rsi
testb $0x1, (%rax,%rsi,8)
jne 0x6a52
xorl %r12d, %r12d
jmp 0x6a6d
movq (%rcx,%rsi,8), %rsi
movq (%rcx,%rsi,8), %rsi
movb $0x1, %r12b
cmpq $0x0, (%rax,%rsi,8)
jne 0x6a6d
cmpq $-0x1, (%rcx,%rsi,8)
setne %r12b
movq (%rax,%rdx,8), %rbx
movq (%rcx,%rdx,8), %rsi
movq $-0x18, %rdi
movl $0x1, %edx
callq 0x36e8
movq %rax, -0x30(%rbp)
testb %r14b, %r14b
je 0x6a9b
movq %rax, %rdi
callq 0x43eb
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %r14
movq 0x176ca(%rip), %rax     # 0x1e170
movq 0x17b13(%rip), %rcx     # 0x1e5c0
movq 0x17674(%rip), %rdx     # 0x1e128
movq (%rcx,%rdx,8), %rdx
movq %r14, (%rax,%rdx,8)
movq (%rcx,%r15,8), %rax
movq (%rcx,%rax,8), %rax
movq (%rcx,%rax,8), %rsi
movq $-0x18, %rdi
movl $0x1, %edx
callq 0x36e8
movq %rax, -0x28(%rbp)
testb %r12b, %r12b
je 0x6aee
movq %rax, %rdi
callq 0x43eb
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
movq 0x17677(%rip), %rax     # 0x1e170
movq 0x17628(%rip), %rcx     # 0x1e128
movq %rsi, (%rax,%rcx,8)
movq %r14, %rdi
callq 0x473d
movq %rax, %r14
movl $0x2, %edi
callq 0x3851
movq 0x17650(%rip), %rax     # 0x1e170
movq 0x17a99(%rip), %rcx     # 0x1e5c0
movq (%rcx,%r14,8), %rcx
movq (%rax,%rcx,8), %r15
shrq $0x3f, %r15
movq %r14, %rdi
callq 0x43a4
movq 0x17a7e(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rax,8), %rdx
movl %r15d, %edi
movq %rbx, %rsi
callq 0x5778
leaq 0xf672(%rip), %rsi      # 0x161ca
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x581e
movl $0x2, %edi
callq 0x3851
jmp 0x6b85
movl $0x2, %edi
callq 0x3851
movq %r14, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq