// File: /workspace/github_c_makefile_star2_O1/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 0x28ca6
cmpl $0x3, %eax
jne 0x28cd0
leaq 0x148(%rbx), %r12
movq %r12, %rdi
callq 0x14dfb
movq %rax, %r13
movq %r12, %rdi
callq 0x14ba1
movq %rax, %r12
decq %rax
cmpq $0x2, %rax
jb 0x28bfc
leaq 0x4af01(%rip), %rsi     # 0x73acc
movq %r13, %rdi
callq 0x12160
pxor %xmm0, %xmm0
movq %xmm0, 0x8(%rsp)
testl %eax, %eax
je 0x28d35
leaq 0x4aee3(%rip), %rsi     # 0x73acf
movq %r13, %rdi
callq 0x12160
testl %eax, %eax
je 0x28d35
movq %r12, %rdi
callq 0x121d0
testq %rax, %rax
je 0x28cf6
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x12070
movq %r12, %rdi
movl $0x65, %esi
callq 0x12100
testq %rax, %rax
jne 0x28c3f
movq %r12, %rdi
movl $0x45, %esi
callq 0x12100
testq %rax, %rax
je 0x28c42
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 0x28d27
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4ae31(%rip), %rax     # 0x73aac
leaq 0x4b173(%rip), %rcx     # 0x73df5
movq %r14, %rdi
movl $0x8, %esi
movq %r12, %rdx
pushq $0x1e8                  # imm = 0x1E8
pushq %rax
callq 0x1442a
addq $0x10, %rsp
movq %r12, %rdi
callq 0x122c0
jmp 0x28d0f
movq 0x148(%rbx), %r12
movq %rbx, %rdi
callq 0x2b4c3
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x33af5
movq (%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x4adcb(%rip), %r8      # 0x73aac
movq %r14, %rdi
movl $0x49, %esi
movl $0x1f7, %r9d            # imm = 0x1F7
callq 0x14618
jmp 0x28d17
leaq 0x4adaf(%rip), %rdx     # 0x73aac
movq %r14, %rdi
movl $0x1, %esi
movl $0x1d8, %ecx            # imm = 0x1D8
callq 0x145f4
movq %rbx, %rdi
callq 0x2b4c3
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
movq %rbx, %rdi
callq 0x2b4c3
movsd 0x8(%rsp), %xmm0
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2bb75