// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x18, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rcx
movq -0x48(%rbp), %rdx
movl $0x1b, %esi
callq 0x38490
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c2a7
jmp 0x4c430
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x20(%rbp), %rcx
leaq 0x5f8a6(%rip), %rsi     # 0xabb60
xorl %eax, %eax
movl %eax, %edx
callq 0x3c920
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c2d5
jmp 0x4c430
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %r8
movq -0x20(%rbp), %rax
leaq 0x5f871(%rip), %rsi     # 0xabb60
movl $0x2, %ecx
movl $0x1, %r9d
movq %rax, (%rsp)
callq 0x6e3e0
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c315
jmp 0x4c430
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4c35d
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %r8
movq 0x148(%rax), %rdx
movq -0x40(%rbp), %rcx
movl $0x85, %esi
callq 0x38230
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c35b
jmp 0x4c430
jmp 0x4c3a3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x148(%rax), %rsi
movq -0x40(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x43e80
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c38b
jmp 0x4c430
movq -0x30(%rbp), %rax
movq 0x148(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
callq 0x36ee0
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %r8
movl $0x2, %esi
callq 0x6dc50
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c3e4
movq $0x0, -0x8(%rbp)
jmp 0x4c441
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rcx
movl $0x2, %esi
callq 0x6d920
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4c414
movq $0x0, -0x8(%rbp)
jmp 0x4c441
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x20(%rbp), %rdx
leaq 0x5f73b(%rip), %rdi     # 0xabb60
callq 0x37590
movq %rax, -0x8(%rbp)
jmp 0x4c441
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)