// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq 0x166ce(%rip), %rsi     # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x166bd(%rip)     # 0x1e128
movb (%rbx), %al
xorl %r13d, %r13d
movb %al, -0x29(%rbp)
cmpb $0x7e, %al
sete %r13b
callq 0x3230
movq %rax, -0x40(%rbp)
movq (%rax), %rax
movl %r13d, %r12d
movsbq (%rbx,%r12), %rcx
cmpq $0x2e, %rcx
sete %dl
je 0x7ab2
movzwl (%rax,%rcx,2), %esi
andl $0x800, %esi            # imm = 0x800
jne 0x7ab2
movq $0x0, -0x38(%rbp)
xorl %r14d, %r14d
jmp 0x7bab
xorl %r14d, %r14d
movq $0x0, -0x38(%rbp)
testb $0x1, %dl
je 0x7af4
movslq %r13d, %r12
incq %r12
movsbq (%rbx,%r12), %rcx
cmpq $0x2e, %rcx
je 0x7ae3
movzwl (%rax,%rcx,2), %edx
andl $0x800, %edx            # imm = 0x800
je 0x7ba5
incq %r12
incl %r13d
incl %r14d
cmpb $0x2e, %cl
je 0x7ac8
decq %r12
cmpl $0x1, %r14d
adcq $-0x1, -0x38(%rbp)
movq %r15, %rdi
xorl %esi, %esi
callq 0x4cb6
movq %rax, %r15
movq 0x1665f(%rip), %rax     # 0x1e170
movq 0x16610(%rip), %rcx     # 0x1e128
movq %r15, (%rax,%rcx,8)
movsbq (%rbx,%r12), %rdi
addq $-0x30, %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x36e8
movq $-0x18, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x36e8
movq %r15, %rdi
movq %rax, %rsi
callq 0x473d
movq %rax, %r15
movq 0x16611(%rip), %rax     # 0x1e170
movq 0x165c2(%rip), %rcx     # 0x1e128
movq %r15, (%rax,%rcx,8)
movslq %r13d, %r12
movq -0x40(%rbp), %rax
movq (%rax), %rax
movsbq 0x1(%rbx,%r12), %rcx
incq %r12
movl %r12d, %r13d
cmpq $0x2e, %rcx
sete %dl
je 0x7abd
movzwl (%rax,%rcx,2), %esi
movl %r12d, %r13d
andl $0x800, %esi            # imm = 0x800
jne 0x7abd
movl %r12d, %r13d
jmp 0x7bab
incl %r14d
incl %r13d
cmpb $0x65, %cl
jne 0x7c65
movslq %r13d, %rax
cmpb $0x7e, 0x1(%rbx,%rax)
jne 0x7bd6
addq %rbx, %r12
addq $0x2, %r12
movq %r12, %rdi
callq 0x7954
movq $-0x1, %r12
jmp 0x7be8
leaq (%rbx,%rax), %rdi
incq %rdi
callq 0x7954
movl $0x1, %r12d
movq 0x169d1(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rax,8), %rdx
cmpq $-0x1, (%rcx,%rdx,8)
je 0x7c4e
movl $0x1, %edi
callq 0x3851
movq %rbx, %rdi
callq 0x30a0
movq %rax, %r14
incl %r14d
movq $-0x21, %rdi
movl %r14d, %esi
callq 0x417e
movq %rax, %r15
movq 0x16995(%rip), %rax     # 0x1e5c0
movq (%rax,%r15,8), %rdi
shlq $0x3, %rdi
addq 0x169ae(%rip), %rdi     # 0x1e5e8
movslq %r14d, %rdx
movq %rbx, %rsi
callq 0x3050
leaq 0xe7d5(%rip), %rdi      # 0x16421
jmp 0x7cbd
leaq 0xfca1(%rip), %rdi      # 0x178f6
movq %rax, %rsi
callq 0x4341
imulq %r12, %rax
addq %rax, -0x38(%rbp)
movl $0x1, %edi
callq 0x3851
cmpl $0x2, %r14d
jl 0x7cdb
movq %rbx, %rdi
callq 0x30a0
movq %rax, %r14
incl %r14d
movq $-0x21, %rdi
movl %r14d, %esi
callq 0x417e
movq %rax, %r15
movq 0x16924(%rip), %rax     # 0x1e5c0
movq (%rax,%r15,8), %rdi
shlq $0x3, %rdi
addq 0x1693d(%rip), %rdi     # 0x1e5e8
movslq %r14d, %rdx
movq %rbx, %rsi
callq 0x3050
leaq 0xe78c(%rip), %rdi      # 0x16449
movq %r15, %rsi
callq 0x33eb
movq $-0x5, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
cmpb $0x7e, -0x29(%rbp)
sete %dil
movq 0x168d4(%rip), %rax     # 0x1e5c0
movq (%rax,%r15,8), %rdx
movq -0x38(%rbp), %rsi
callq 0x5778
movq %rax, %rdi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x581e