// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1b
popq %rsi
pushq $0x18
popq %rdx
movq %rbx, %rcx
callq 0x2a981
cmpl $0x0, (%rbx)
jne 0x36a9a
movq %rax, %r13
movq 0x68(%r14), %rdi
leaq 0x380f5(%rip), %rsi     # 0x6eb58
xorl %edx, %edx
movq %rbx, %rcx
callq 0x2cee3
cmpl $0x0, (%rbx)
jne 0x36a9a
movq %rax, %r12
movq (%rax), %rdx
movq %rbx, (%rsp)
leaq 0x380d5(%rip), %rsi     # 0x6eb58
pushq $0x2
popq %rcx
pushq $0x1
popq %r9
movq %r14, %rdi
movq %r13, %r8
callq 0x4b101
cmpl $0x0, (%rbx)
je 0x36ab2
movq %r15, %rdi
callq 0x29d88
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
testb $0x2, 0x8(%r14)
jne 0x36ae4
movq 0x148(%r15), %rsi
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x31b63
cmpl $0x0, (%rbx)
jne 0x36a9a
movq 0x148(%rax), %r13
movq %rax, %rdi
callq 0x29d88
jmp 0x36b07
movq 0x48(%r14), %rdi
movq 0x148(%r15), %rdx
movl $0x85, %esi
movq %rax, %rcx
movq %rbx, %r8
callq 0x2a819
cmpl $0x0, (%rbx)
jne 0x36a9a
movq %rax, %r13
movq %r15, %rdi
callq 0x29d88
movq (%r12), %rdx
pushq $0x2
popq %rsi
movq %r14, %rdi
movq %r13, %rcx
movq %rbx, %r8
callq 0x4acc2
cmpl $0x0, (%rbx)
jne 0x36aa2
movq (%r12), %rdx
pushq $0x2
popq %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq 0x4ab28
cmpl $0x0, (%rbx)
jne 0x36aa2
leaq 0x38009(%rip), %rdi     # 0x6eb58
movl %eax, %esi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2a226