// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: subtilis_string_init_from_ptr
void subtilis_string_init_from_ptr(subtilis_parser_t *p, size_t mem_reg,
				   size_t loc, size_t source_reg,
				   size_t size_reg, size_t data_reg,
				   subtilis_error_t *err)
{
	subtilis_ir_operand_t heap_reg;
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t empty;
	subtilis_ir_operand_t not_empty;

	empty.label = subtilis_ir_section_new_label(p->current);
	not_empty.label = subtilis_ir_section_new_label(p->current);

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

	op0.reg = size_reg;
	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  op0, not_empty, empty, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_label(p->current, not_empty.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_reference_set_data(p, data_reg, mem_reg, loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	heap_reg.reg = subtilis_reference_get_heap(p, source_reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_instr_no_reg(p->current, SUBTILIS_OP_INSTR_REF,
					     heap_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_reference_set_heap(p, heap_reg.reg, mem_reg, loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_reference_type_push_reference(p, &subtilis_type_string,
					       mem_reg, loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_label(p->current, empty.label, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x6dc50
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6601d
jmp 0x6614b
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %r9
movq -0x40(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x66055
jmp 0x6614b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x50(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x66078
jmp 0x6614b
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x6d9a0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6609f
jmp 0x6614b
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq 0x10(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x6d230
movq %rax, -0x38(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x660c6
jmp 0x6614b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl $0x78, %esi
callq 0x38540
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x660eb
jmp 0x6614b
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x6da00
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6610f
jmp 0x6614b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq 0x10(%rbp), %r8
leaq 0x45a3a(%rip), %rsi     # 0xabb60
callq 0x6d540
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x66136
jmp 0x6614b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x48(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)