// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/float64_type.c
// Function: prv_to_string
static subtilis_exp_t *prv_to_string(subtilis_parser_t *p, subtilis_exp_t *e,
				     subtilis_error_t *err)
{
	size_t size_reg;
	subtilis_exp_t *sizee;
	const subtilis_symbol_t *s;
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;

	op1.integer = FLOAT64_TYPE_IF_FORMAT_BUFFER_SIZE;
	size_reg = subtilis_ir_section_add_instr2(
	    p->current, SUBTILIS_OP_INSTR_MOVI_I32, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	s = subtilis_symbol_table_insert_tmp(p->local_st, &subtilis_type_string,
					     NULL, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	/*
	 * Here we allocate more memory then we probably need but it saves
	 * us a memcpy.
	 */

	op0.reg = subtilis_reference_type_alloc(p, &subtilis_type_string,
						s->loc, SUBTILIS_IR_REG_LOCAL,
						size_reg, true, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	if (p->backend.caps & SUBTILIS_BACKEND_HAVE_REAL_TO_DEC) {
		size_reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_REALTODEC, e->exp.ir_op, op0,
		    err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
	} else {
		sizee = subtilis_builtin_ir_call_fp_to_str(p, e->exp.ir_op.reg,
							   op0.reg, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		size_reg = sizee->exp.ir_op.reg;
		subtilis_exp_delete(sizee);
	}

	subtilis_exp_delete(e);
	e = NULL;

	subtilis_reference_type_set_size(p, SUBTILIS_IR_REG_LOCAL, s->loc,
					 size_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	op0.reg = subtilis_reference_get_pointer(p, SUBTILIS_IR_REG_LOCAL,
						 s->loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	return subtilis_exp_new_var(&subtilis_type_string, op0.reg, err);

on_error:

	subtilis_exp_delete(e);
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x48(%rdi), %rdi
movl $0x18, %edx
movl $0x1b, %esi
movq %rbx, %rcx
callq 0x2be09
cmpl $0x0, (%rbx)
jne 0x38a25
movq %rax, %r13
movq 0x68(%r14), %rdi
leaq 0x3c1be(%rip), %rsi     # 0x74ba8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x2e6f1
cmpl $0x0, (%rbx)
jne 0x38a25
movq %rax, %r12
movq (%rax), %rdx
movq %rbx, (%rsp)
leaq 0x3c19e(%rip), %rsi     # 0x74ba8
movl $0x2, %ecx
movq %r14, %rdi
movq %r13, %r8
movl $0x1, %r9d
callq 0x4ddaa
cmpl $0x0, (%rbx)
je 0x38a3d
movq %r15, %rdi
callq 0x2b166
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
testb $0x2, 0x8(%r14)
jne 0x38a6f
movq 0x148(%r15), %rsi
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x33899
cmpl $0x0, (%rbx)
jne 0x38a25
movq 0x148(%rax), %r13
movq %rax, %rdi
callq 0x2b166
jmp 0x38a92
movq 0x48(%r14), %rdi
movq 0x148(%r15), %rdx
movl $0x85, %esi
movq %rax, %rcx
movq %rbx, %r8
callq 0x2bc8f
cmpl $0x0, (%rbx)
jne 0x38a25
movq %rax, %r13
movq %r15, %rdi
callq 0x2b166
movq (%r12), %rdx
movl $0x2, %esi
movq %r14, %rdi
movq %r13, %rcx
movq %rbx, %r8
callq 0x4d8dd
cmpl $0x0, (%rbx)
jne 0x38a2d
movq (%r12), %rdx
movl $0x2, %esi
movq %r14, %rdi
movq %rbx, %rcx
callq 0x4d71f
cmpl $0x0, (%rbx)
jne 0x38a2d
leaq 0x3c0ca(%rip), %rdi     # 0x74ba8
movl %eax, %esi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2b5fb