// File: /workspace/github_c_makefile_star2_O2/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 0x60d3
movq 0x1656a(%rip), %rax     # 0x1c5e0
testb $0x1, (%rax,%r14)
je 0x60d3
testq %rbx, %rbx
js 0x60b6
movq 0x160e7(%rip), %rcx     # 0x1c170
cmpq $-0x18, (%rcx,%r14,8)
jne 0x60b6
testb $0x1, (%rax,%rbx)
je 0x60b6
cmpq $-0x18, (%rcx,%rbx,8)
jne 0x60b6
movq %r14, %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x44fe
movq 0x160b3(%rip), %rax     # 0x1c170
cmpq $-0x18, (%rax,%r14,8)
jne 0x60d3
movq %r14, %rdi
callq 0x5580
movq %rax, %r14
movq %rax, -0x38(%rbp)
movq 0x1604e(%rip), %rsi     # 0x1c128
movq %r14, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x1603d(%rip)     # 0x1c128
testq %rbx, %rbx
js 0x6121
movq 0x164e9(%rip), %rcx     # 0x1c5e0
testb $0x1, (%rcx,%rbx)
je 0x6121
movq 0x1606c(%rip), %rcx     # 0x1c170
cmpq $-0x18, (%rcx,%rbx,8)
jne 0x6121
movq %rbx, %rdi
callq 0x5580
movq %rax, %rbx
movq %rax, -0x30(%rbp)
movq 0x16007(%rip), %rax     # 0x1c128
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x15ff3(%rip)     # 0x1c128
movq 0x16034(%rip), %rcx     # 0x1c170
movq 0x1647d(%rip), %rax     # 0x1c5c0
movq (%rax,%r14,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x6161
cmpq $-0x1, (%rax,%rdx,8)
je 0x6392
movq (%rax,%rbx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x617f
cmpq $-0x1, (%rax,%rdx,8)
je 0x639c
leaq -0x38(%rbp), %rbx
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59dc
movq (%rbx), %rdx
cmpq $-0x1, %rdx
sete %al
movq (%r14), %r15
cmpq $-0x1, %r15
sete %cl
orb %al, %cl
movq 0x15fc1(%rip), %rax     # 0x1c170
cmpb $0x1, %cl
jne 0x6239
movq 0x15f69(%rip), %rcx     # 0x1c128
movq (%rax,%rcx,8), %rdi
callq 0x57fb
movq %rax, %r14
movq 0x15f56(%rip), %rsi     # 0x1c128
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x15f45(%rip)     # 0x1c128
movq 0x15f86(%rip), %rcx     # 0x1c170
movq 0x163cf(%rip), %rdx     # 0x1c5c0
movq (%rdx,%rax,8), %rax
movq (%rdx,%rax,8), %rax
movq (%rcx,%rax,8), %rdi
callq 0x57fb
movq %rax, %r15
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x3775
movl %ebx, %edi
callq 0x3775
movq %rax, %r12
movl %ebx, %edi
callq 0x3775
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x5cec
testl %eax, %eax
cmovneq %r12, %rbx
jmp 0x63a7
movq 0x16380(%rip), %rcx     # 0x1c5c0
movq 0x15ee1(%rip), %rsi     # 0x1c128
movq (%rcx,%rsi,8), %rsi
movq %rdx, (%rax,%rsi,8)
movq 0x15ed2(%rip), %rsi     # 0x1c128
movq %r15, (%rax,%rsi,8)
movq (%rcx,%rdx,8), %rsi
movq (%rcx,%rsi,8), %rdx
testb $0x1, (%rax,%rsi,8)
jne 0x626d
xorl %r13d, %r13d
jmp 0x6284
movq (%rcx,%rdx,8), %rsi
movb $0x1, %r13b
cmpq $0x0, (%rax,%rsi,8)
jne 0x6284
cmpq $-0x1, (%rcx,%rsi,8)
setne %r13b
movq (%rcx,%r15,8), %rsi
testb $0x1, (%rax,%rsi,8)
jne 0x6293
xorl %r12d, %r12d
jmp 0x62ae
movq (%rcx,%rsi,8), %rsi
movq (%rcx,%rsi,8), %rsi
movb $0x1, %r12b
cmpq $0x0, (%rax,%rsi,8)
jne 0x62ae
cmpq $-0x1, (%rcx,%rsi,8)
setne %r12b
movq (%rax,%rdx,8), %rbx
movq (%rcx,%rdx,8), %rsi
pushq $-0x18
popq %rdi
pushq $0x1
popq %rdx
callq 0x3613
movq %rax, %r14
testb %r13b, %r13b
je 0x62d4
movq %r14, %rdi
callq 0x426f
movq %rax, %r14
movq 0x15e95(%rip), %rax     # 0x1c170
movq 0x162de(%rip), %rcx     # 0x1c5c0
movq 0x15e3f(%rip), %rdx     # 0x1c128
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
pushq $-0x18
popq %rdi
pushq $0x1
popq %rdx
callq 0x3613
testb %r12b, %r12b
je 0x6315
movq %rax, %rdi
callq 0x426f
movq 0x15e54(%rip), %rcx     # 0x1c170
movq 0x15e05(%rip), %rdx     # 0x1c128
movq %rax, (%rcx,%rdx,8)
movq %r14, %rdi
movq %rax, %rsi
callq 0x44fe
movq %rax, %r14
pushq $0x2
popq %rdi
callq 0x3775
movq 0x15e2c(%rip), %rax     # 0x1c170
movq 0x16275(%rip), %rcx     # 0x1c5c0
movq (%rcx,%r14,8), %rcx
movq (%rax,%rcx,8), %r15
shrq $0x3f, %r15
movq %r14, %rdi
callq 0x4228
movq 0x1625a(%rip), %rcx     # 0x1c5c0
movq (%rcx,%rax,8), %rdx
movl %r15d, %edi
movq %rbx, %rsi
callq 0x529a
leaq 0xde36(%rip), %rsi      # 0x141b2
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5321
pushq $0x2
popq %rdi
callq 0x3775
jmp 0x63a7
pushq $0x2
popq %rdi
callq 0x3775
movq %r14, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq