// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_string.c
// Function: prv_val_real
static subtilis_exp_t *prv_val_real(subtilis_parser_t *p, subtilis_token_t *t,
				    subtilis_exp_t *e, subtilis_error_t *err)
{
	const char *str;
	char *copy;
	char *ptr;
	size_t str_size;
	size_t str_reg;
	double ret_val = 0.0;

	if (e->type.type == SUBTILIS_TYPE_CONST_STRING) {
		str = subtilis_buffer_get_string(&e->exp.str);
		str_size = subtilis_buffer_get_size(&e->exp.str) - 1;
		if (str_size < 2 || (strcmp(str, "0x") && strcmp(str, "0X"))) {
			copy = malloc(str_size + 1);
			if (!copy) {
				subtilis_error_set_oom(err);
				subtilis_exp_delete(e);
				return NULL;
			}
			strcpy(copy, str);
			ptr = strchr(copy, 'e');
			if (ptr) {
				*ptr = 0;
			} else {
				ptr = strchr(copy, 'E');
				if (ptr)
					*ptr = 0;
			}
			ret_val = strtod(copy, NULL);
			if (isinf(ret_val)) {
				subtilis_error_set_number_too_long(
				    err, copy, p->l->stream->name, p->l->line);
				free(copy);
				subtilis_exp_delete(e);
				return NULL;
			}
			free(copy);
		}
		subtilis_exp_delete(e);
		return subtilis_exp_new_real(ret_val, err);
	} else if (e->type.type == SUBTILIS_TYPE_STRING) {
		str_reg = e->exp.ir_op.reg;
		subtilis_exp_delete(e);
		return subtilis_builtin_ir_call_str_to_fp(p, str_reg, err);
	}

	subtilis_error_set_string_expected(err, p->l->stream->name, p->l->line);
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movl (%rsi), %eax
cmpl $0x7, %eax
je 0x28a3a
cmpl $0x3, %eax
jne 0x28a64
leaq 0x148(%rbx), %r12
movq %r12, %rdi
callq 0x14db1
movq %rax, %r13
movq %r12, %rdi
callq 0x14b57
leaq -0x1(%rax), %rcx
cmpq $0x2, %rcx
jb 0x28990
cmpb $0x30, (%r13)
jne 0x28990
cmpb $0x78, 0x1(%r13)
jne 0x2897e
cmpb $0x0, 0x2(%r13)
je 0x28acb
cmpb $0x58, 0x1(%r13)
jne 0x28990
cmpb $0x0, 0x2(%r13)
je 0x28acb
movq %rax, %rdi
callq 0x121d0
testq %rax, %rax
je 0x28a8a
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x12070
movq %r12, %rdi
movl $0x65, %esi
callq 0x12100
testq %rax, %rax
jne 0x289d3
movq %r12, %rdi
movl $0x45, %esi
callq 0x12100
testq %rax, %rax
je 0x289d6
movb $0x0, (%rax)
movq %r12, %rdi
xorl %esi, %esi
callq 0x120b0
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x28abb
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4b0bb(%rip), %rax     # 0x73aca
leaq 0x4b3ff(%rip), %rcx     # 0x73e15
movq %r14, %rdi
movl $0x8, %esi
movq %r12, %rdx
pushq $0x1e8                  # imm = 0x1E8
pushq %rax
callq 0x143da
addq $0x10, %rsp
movq %r12, %rdi
callq 0x122c0
jmp 0x28aa3
movq 0x148(%rbx), %r12
movq %rbx, %rdi
callq 0x2b166
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3394f
movq (%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x4b055(%rip), %r8      # 0x73aca
movq %r14, %rdi
movl $0x49, %esi
movl $0x1f7, %r9d            # imm = 0x1F7
callq 0x145c8
jmp 0x28aab
leaq 0x4b039(%rip), %rdx     # 0x73aca
movq %r14, %rdi
movl $0x1, %esi
movl $0x1d8, %ecx            # imm = 0x1D8
callq 0x145a4
movq %rbx, %rdi
callq 0x2b166
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x122c0
jmp 0x28ad5
pxor %xmm0, %xmm0
movq %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x2b166
movsd 0x8(%rsp), %xmm0
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2b7fe