// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
testq %rdi, %rdi
js 0x680c
movq 0x17e31(%rip), %rax     # 0x1e5e0
testb $0x1, (%rax,%r14)
je 0x680c
testq %rbx, %rbx
js 0x67ef
movq 0x179ae(%rip), %rcx     # 0x1e170
cmpq $-0x18, (%rcx,%r14,8)
jne 0x67ef
testb $0x1, (%rax,%rbx)
je 0x67ef
cmpq $-0x18, (%rcx,%rbx,8)
jne 0x67ef
movq %r14, %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x472e
movq 0x1797a(%rip), %rax     # 0x1e170
cmpq $-0x18, (%rax,%r14,8)
jne 0x680c
movq %r14, %rdi
callq 0x5b40
movq %rax, %r14
movq %rax, -0x38(%rbp)
movq 0x17915(%rip), %rsi     # 0x1e128
movq %r14, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x17904(%rip)     # 0x1e128
testq %rbx, %rbx
js 0x685a
movq 0x17db0(%rip), %rcx     # 0x1e5e0
testb $0x1, (%rcx,%rbx)
je 0x685a
movq 0x17933(%rip), %rcx     # 0x1e170
cmpq $-0x18, (%rcx,%rbx,8)
jne 0x685a
movq %rbx, %rdi
callq 0x5b40
movq %rax, %rbx
movq %rax, -0x30(%rbp)
movq 0x178ce(%rip), %rax     # 0x1e128
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x178ba(%rip)     # 0x1e128
movq 0x178fb(%rip), %rcx     # 0x1e170
movq 0x17d44(%rip), %rax     # 0x1e5c0
movq (%rax,%r14,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x689a
cmpq $-0x1, (%rax,%rdx,8)
je 0x6adf
movq (%rax,%rbx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x68b8
cmpq $-0x1, (%rax,%rdx,8)
je 0x6aeb
leaq -0x38(%rbp), %rbx
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6046
movq (%rbx), %rdx
cmpq $-0x1, %rdx
sete %al
movq (%r14), %r15
cmpq $-0x1, %r15
sete %cl
orb %al, %cl
movq 0x17888(%rip), %rax     # 0x1e170
cmpb $0x1, %cl
jne 0x6978
movq 0x17830(%rip), %rcx     # 0x1e128
movq (%rax,%rcx,8), %rdi
callq 0x5e17
movq %rax, %r14
movq 0x1781d(%rip), %rsi     # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x1780c(%rip)     # 0x1e128
movq 0x1784d(%rip), %rcx     # 0x1e170
movq 0x17c96(%rip), %rdx     # 0x1e5c0
movq (%rdx,%rax,8), %rax
movq (%rdx,%rax,8), %rax
movq (%rcx,%rax,8), %rdi
callq 0x5e17
movq %rax, %r15
movl $0x1, %edi
callq 0x384f
movl $0x1, %edi
callq 0x384f
movq %rax, %r12
movl $0x1, %edi
callq 0x384f
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x638b
testl %eax, %eax
cmovneq %r12, %rbx
jmp 0x6af8
movq 0x17c41(%rip), %rcx     # 0x1e5c0
movq 0x177a2(%rip), %rsi     # 0x1e128
movq (%rcx,%rsi,8), %rsi
movq %rdx, (%rax,%rsi,8)
movq 0x17793(%rip), %rsi     # 0x1e128
movq %r15, (%rax,%rsi,8)
movq (%rcx,%rdx,8), %rsi
movq (%rcx,%rsi,8), %rdx
testb $0x1, (%rax,%rsi,8)
jne 0x69ac
xorl %r13d, %r13d
jmp 0x69c3
movq (%rcx,%rdx,8), %rsi
movb $0x1, %r13b
cmpq $0x0, (%rax,%rsi,8)
jne 0x69c3
cmpq $-0x1, (%rcx,%rsi,8)
setne %r13b
movq (%rcx,%r15,8), %rsi
testb $0x1, (%rax,%rsi,8)
jne 0x69d2
xorl %r12d, %r12d
jmp 0x69ed
movq (%rcx,%rsi,8), %rsi
movq (%rcx,%rsi,8), %rsi
movb $0x1, %r12b
cmpq $0x0, (%rax,%rsi,8)
jne 0x69ed
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, %r14
testb %r13b, %r13b
je 0x6a19
movq %r14, %rdi
callq 0x43d9
movq %rax, %r14
movq 0x17750(%rip), %rax     # 0x1e170
movq 0x17b99(%rip), %rcx     # 0x1e5c0
movq 0x176fa(%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
testb %r12b, %r12b
je 0x6a60
movq %rax, %rdi
callq 0x43d9
movq 0x17709(%rip), %rcx     # 0x1e170
movq 0x176ba(%rip), %rdx     # 0x1e128
movq %rax, (%rcx,%rdx,8)
movq %r14, %rdi
movq %rax, %rsi
callq 0x472e
movq %rax, %r14
movl $0x2, %edi
callq 0x384f
movq 0x176df(%rip), %rax     # 0x1e170
movq 0x17b28(%rip), %rcx     # 0x1e5c0
movq (%rcx,%r14,8), %rcx
movq (%rax,%rcx,8), %r15
shrq $0x3f, %r15
movq %r14, %rdi
callq 0x4392
movq 0x17b0d(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rax,8), %rdx
movl %r15d, %edi
movq %rbx, %rsi
callq 0x5768
leaq 0xf6e9(%rip), %rsi      # 0x161b2
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x580e
movl $0x2, %edi
callq 0x384f
jmp 0x6af8
movl $0x2, %edi
callq 0x384f
movq %r14, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq