// File: /workspace/github_c_makefile_star2_O3/azhai[P]mlite/mlite.c
// Function: string_to_real
cell string_to_real(char *s) {
	cell	mantissa, n;
	cell	exponent;
	int	found_dp;
	int	neg = 0;
	int	i, j, sgn;

	mantissa = make_integer(0);
	save(mantissa);
	exponent = 0;
	i = 0;
	if (s[i] == '~') {
		neg = 1;
		i++;
	}
	found_dp = 0;
	while (isdigit((int) s[i]) || s[i] == '.') {
		if (s[i] == '.') {
			i++;
			found_dp++;
			continue;
		}
		if (found_dp)
			exponent--;
		mantissa = bignum_shift_left(mantissa, 0);
		car(Stack) = mantissa;
		mantissa = bignum_add(mantissa, make_integer(s[i]-'0'));
		car(Stack) = mantissa;
		i++;
	}
	j = 0;
	for (n = cdr(mantissa); n != NIL; n = cdr(n))
		j++;
	if (is_exp_char(s[i])) {
		i++;
		if (s[i] == '~') {
			sgn = -1;
			n = string_to_bignum(&s[i+1]);
		}
		else {
			sgn = 1;
			n = string_to_bignum(&s[i]);
		}
		if (cddr(n) != NIL) {
			unsave(1);
			return error(
				"exponent too big in real number literal",
				make_string(s, strlen(s)));
		}
		exponent += sgn * integer_value("", n);
	}
	unsave(1);
	if (found_dp > 1)
		return error("invalid numeric literal: ",
			make_string(s, strlen(s)));
	n = make_real((neg? REAL_NEGATIVE: 0),
			exponent, cdr(mantissa));
	return real_normalize(n, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %edi, %edi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x36e8
movq $-0x18, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x36e8
movq %rax, %r12
movq 0x16762(%rip), %rsi     # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x16751(%rip)     # 0x1e128
xorl %r14d, %r14d
cmpb $0x7e, (%rbx)
sete %r14b
callq 0x3230
movq %rax, -0x40(%rbp)
movq (%rax), %rax
movl %r14d, %r13d
movsbq (%rbx,%r13), %rcx
cmpq $0x2e, %rcx
sete %dl
movl %r14d, -0x34(%rbp)
je 0x7a1e
movzwl (%rax,%rcx,2), %esi
andl $0x800, %esi            # imm = 0x800
jne 0x7a1e
movq $0x0, -0x30(%rbp)
xorl %r15d, %r15d
jmp 0x7b17
xorl %r15d, %r15d
movq $0x0, -0x30(%rbp)
testb $0x1, %dl
je 0x7a60
movslq %r14d, %r13
incq %r13
movsbq (%rbx,%r13), %rcx
cmpq $0x2e, %rcx
je 0x7a4f
movzwl (%rax,%rcx,2), %edx
andl $0x800, %edx            # imm = 0x800
je 0x7b11
incl %r14d
incq %r13
incl %r15d
cmpb $0x2e, %cl
je 0x7a34
decq %r13
cmpl $0x1, %r15d
adcq $-0x1, -0x30(%rbp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x4caa
movq %rax, %r12
movq 0x166f3(%rip), %rax     # 0x1e170
movq 0x166a4(%rip), %rcx     # 0x1e128
movq %r12, (%rax,%rcx,8)
movsbq (%rbx,%r13), %rdi
addq $-0x30, %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x36e8
movq $-0x18, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x36e8
movq %r12, %rdi
movq %rax, %rsi
callq 0x472e
movq %rax, %r12
movq 0x166a5(%rip), %rax     # 0x1e170
movq 0x16656(%rip), %rcx     # 0x1e128
movq %r12, (%rax,%rcx,8)
movslq %r14d, %r13
movq -0x40(%rbp), %rax
movq (%rax), %rax
movsbq 0x1(%rbx,%r13), %rcx
incq %r13
movl %r13d, %r14d
cmpq $0x2e, %rcx
sete %dl
je 0x7a29
movzwl (%rax,%rcx,2), %esi
movl %r13d, %r14d
andl $0x800, %esi            # imm = 0x800
jne 0x7a29
movl %r13d, %r14d
jmp 0x7b17
incl %r15d
incl %r14d
cmpb $0x65, %cl
jne 0x7b3e
movslq %r14d, %rax
cmpb $0x7e, 0x1(%rbx,%rax)
jne 0x7b47
addq %rbx, %r13
addq $0x2, %r13
movq %r13, %rdi
callq 0x78be
movq $-0x1, %r14
jmp 0x7b59
movq -0x30(%rbp), %r14
jmp 0x7bd9
leaq (%rbx,%rax), %rdi
incq %rdi
callq 0x78be
movl $0x1, %r14d
movq 0x16a60(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rax,8), %rdx
cmpq $-0x1, (%rcx,%rdx,8)
je 0x7bbf
movl $0x1, %edi
callq 0x384f
movq %rbx, %rdi
callq 0x30a0
movq %rax, %r14
incl %r14d
movq $-0x21, %rdi
movl %r14d, %esi
callq 0x416e
movq %rax, %r15
movq 0x16a24(%rip), %rax     # 0x1e5c0
movq (%rax,%r15,8), %rdi
shlq $0x3, %rdi
addq 0x16a3d(%rip), %rdi     # 0x1e5e8
movslq %r14d, %rdx
movq %rbx, %rsi
callq 0x3050
leaq 0xe84c(%rip), %rdi      # 0x16409
jmp 0x7c31
leaq 0xfd12(%rip), %rdi      # 0x178d8
movq %rax, %rsi
callq 0x432f
imulq %r14, %rax
movq -0x30(%rbp), %r14
addq %rax, %r14
movl $0x1, %edi
callq 0x384f
cmpl $0x2, %r15d
jl 0x7c4f
movq %rbx, %rdi
callq 0x30a0
movq %rax, %r14
incl %r14d
movq $-0x21, %rdi
movl %r14d, %esi
callq 0x416e
movq %rax, %r15
movq 0x169b0(%rip), %rax     # 0x1e5c0
movq (%rax,%r15,8), %rdi
shlq $0x3, %rdi
addq 0x169c9(%rip), %rdi     # 0x1e5e8
movslq %r14d, %rdx
movq %rbx, %rsi
callq 0x3050
leaq 0xe800(%rip), %rdi      # 0x16431
movq %r15, %rsi
callq 0x33eb
movq $-0x5, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1696a(%rip), %rax     # 0x1e5c0
movq (%rax,%r12,8), %rdx
movl -0x34(%rbp), %edi
movq %r14, %rsi
callq 0x5768
movq %rax, %rdi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x580e