// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x30(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3740
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq 0x1e2dd(%rip), %rsi     # 0x28138
xorl %edx, %edx
callq 0x3780
movq %rax, 0x1e2cf(%rip)     # 0x28138
movq $0x0, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7e, %eax
jne 0x9e99
movl $0x1, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
callq 0x3240
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x3d(%rbp)
jne 0x9ee0
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
sete %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x9eec
jmp 0x9f9b
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0x9f11
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9ea0
cmpl $0x0, -0x2c(%rbp)
je 0x9f23
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x55d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdx
movq 0x1e243(%rip), %rax     # 0x28180
movq 0x1e1f4(%rip), %rcx     # 0x28138
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movslq %eax, %rdi
callq 0x3740
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x4e50
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdx
movq 0x1e1fe(%rip), %rax     # 0x28180
movq 0x1e1af(%rip), %rcx     # 0x28138
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9ea0
movl $0x0, -0x38(%rbp)
movq 0x1e627(%rip), %rax     # 0x285d0
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $-0x1, -0x20(%rbp)
je 0x9fda
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq 0x1e604(%rip), %rax     # 0x285d0
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
jmp 0x9fb5
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x65, %eax
jne 0xa0cb
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7e, %eax
jne 0xa02a
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rdi
callq 0x9ce0
movq %rax, -0x20(%rbp)
jmp 0xa045
movl $0x1, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rax
addq %rax, %rdi
callq 0x9ce0
movq %rax, -0x20(%rbp)
movq 0x1e584(%rip), %rax     # 0x285d0
movq 0x1e57d(%rip), %rcx     # 0x285d0
movq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpq $-0x1, (%rax,%rcx,8)
je 0xa0a0
movl $0x1, %edi
callq 0x3950
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30a0
movq -0x50(%rbp), %rdi
movl %eax, %esi
callq 0xa160
movq %rax, %rsi
leaq 0x1643f(%rip), %rdi     # 0x204d1
callq 0x34b0
movq %rax, -0x8(%rbp)
jmp 0xa149
movslq -0x3c(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rsi
leaq 0x17921(%rip), %rdi     # 0x219d4
callq 0x4960
movq %rax, %rcx
movq -0x58(%rbp), %rax
imulq %rcx, %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x1, %edi
callq 0x3950
cmpl $0x1, -0x2c(%rbp)
jle 0xa10c
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30a0
movq -0x60(%rbp), %rdi
movl %eax, %esi
callq 0xa160
movq %rax, %rsi
leaq 0x163f8(%rip), %rdi     # 0x204f9
callq 0x34b0
movq %rax, -0x8(%rbp)
jmp 0xa149
movl -0x30(%rbp), %ecx
xorl %edi, %edi
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
movq -0x28(%rbp), %rsi
movq 0x1e4a9(%rip), %rax     # 0x285d0
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x6350
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6460
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)