// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rdi, %rbx
movq $0x0, -0x38(%rbp)
xorl %edi, %edi
callq 0x35ed
movq %rax, %r12
movq 0x15079(%rip), %rsi     # 0x1c128
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x15068(%rip)     # 0x1c128
xorl %r14d, %r14d
cmpb $0x7e, (%rbx)
sete %r14b
callq 0x3230
movq %rax, %r13
movabsq $0x100000000, %r15      # imm = 0x100000000
xorl %edi, %edi
movl %r14d, -0x3c(%rbp)
movl %r14d, %r9d
movq %rbx, -0x30(%rbp)
movq (%r13), %rcx
movslq %r9d, %rax
addq %rax, %rbx
shlq $0x20, %rax
xorl %r14d, %r14d
movsbq (%rbx,%r14), %rdx
cmpq $0x2e, %rdx
je 0x7115
movzwl (%rcx,%rdx,2), %esi
andl $0x800, %esi            # imm = 0x800
je 0x7198
cmpb $0x2e, %dl
jne 0x7122
incq %r14
addq %r15, %rax
jmp 0x70fa
xorl %eax, %eax
addl %r14d, %edi
movl %edi, -0x40(%rbp)
setne %al
subq %rax, -0x38(%rbp)
movq %r12, %rdi
xorl %esi, %esi
movq %r9, -0x48(%rbp)
callq 0x4986
movq %rax, %r12
movq 0x15027(%rip), %rax     # 0x1c170
movq 0x14fd8(%rip), %rcx     # 0x1c128
movq %r12, (%rax,%rcx,8)
movsbq (%r14,%rbx), %rdi
addq $-0x30, %rdi
callq 0x35ed
movq %r12, %rdi
movq %rax, %rsi
callq 0x44fe
movq -0x48(%rbp), %r9
movl -0x40(%rbp), %edi
movq %rax, %r12
movq 0x14ff2(%rip), %rax     # 0x1c170
movq 0x14fa3(%rip), %rcx     # 0x1c128
movq %r12, (%rax,%rcx,8)
addl %r14d, %r9d
incl %r9d
movq -0x30(%rbp), %rbx
jmp 0x70e9
cmpb $0x65, %dl
jne 0x7226
movl %edi, %r15d
sarq $0x20, %rax
movq -0x30(%rbp), %rcx
cmpb $0x7e, 0x1(%rcx,%rax)
jne 0x71c4
leaq (%r14,%rbx), %rdi
addq $0x2, %rdi
callq 0x6fdb
pushq $-0x1
jmp 0x71d2
leaq (%rcx,%rax), %rdi
incq %rdi
callq 0x6fdb
pushq $0x1
popq %rbx
movq 0x153e6(%rip), %rcx     # 0x1c5c0
movq (%rcx,%rax,8), %rdx
cmpq $-0x1, (%rcx,%rdx,8)
je 0x720c
pushq $0x1
popq %rdi
callq 0x3775
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x30a0
movq %rbx, %rdi
movl %eax, %esi
callq 0x729e
leaq 0xd1ff(%rip), %rdi      # 0x14409
jmp 0x7255
leaq 0xe6c5(%rip), %rdi      # 0x158d8
movq %rax, %rsi
callq 0x41c5
imulq %rbx, %rax
addq %rax, -0x38(%rbp)
movl %r15d, %edi
movl %edi, %ebx
addq %r14, %rbx
pushq $0x1
popq %rdi
callq 0x3775
cmpl $0x2, %ebx
jl 0x726f
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x30a0
movq %rbx, %rdi
movl %eax, %esi
callq 0x729e
leaq 0xd1dc(%rip), %rdi      # 0x14431
movq %rax, %rsi
callq 0x33e4
pushq $-0x5
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1534a(%rip), %rax     # 0x1c5c0
movq (%rax,%r12,8), %rdx
movl -0x3c(%rbp), %edi
movq -0x38(%rbp), %rsi
callq 0x529a
movq %rax, %rdi
xorl %esi, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5321