// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_mid_str_vvv
static subtilis_exp_t *prv_mid_str_vvv(subtilis_parser_t *p,
				       subtilis_exp_t *str, size_t start_reg,
				       size_t len_reg, subtilis_error_t *err)
{
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t end;
	const subtilis_symbol_t *s;
	size_t ptr;
	size_t src_reg;
	subtilis_ir_operand_t to_copy;
	subtilis_exp_t *str_len = NULL;
	char *tmp_name = NULL;

	to_copy.reg = p->current->reg_counter++;
	end.label = subtilis_ir_section_new_label(p->current);

	op1.integer = SUBTIILIS_STRING_SIZE_OFF;
	op1.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LOADO_I32, str->exp.ir_op, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	str_len = subtilis_exp_new_int32_var(op1.reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	start_reg = prv_mid_str_check(p, start_reg, len_reg, to_copy, end,
				      str_len, &s, &tmp_name, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	ptr = subtilis_reference_get_data(p, str->exp.ir_op.reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	op0.reg = ptr;
	op1.reg = start_reg;
	src_reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_ADD_I32, op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_string_init_from_ptr(p, SUBTILIS_IR_REG_LOCAL, s->loc,
				      str->exp.ir_op.reg, to_copy.reg, src_reg,
				      err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, end.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	ptr = subtilis_reference_get_pointer(p, SUBTILIS_IR_REG_LOCAL, s->loc,
					     err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return subtilis_exp_new_tmp_var(&subtilis_type_string, ptr, tmp_name,
					err);

cleanup:

	free(tmp_name);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
movq 0x18(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rcx)
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %r8
movq 0x148(%rax), %rdx
movq -0x40(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x694a1
movq $0x0, -0x8(%rbp)
jmp 0x6963a
movq -0x40(%rbp), %rax
movl %eax, %edi
movq -0x30(%rbp), %rsi
callq 0x37770
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x694ca
movq $0x0, -0x8(%rbp)
jmp 0x6963a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x70(%rbp), %r9
movq -0x30(%rbp), %rax
movq -0x68(%rbp), %rcx
movq -0x48(%rbp), %r8
leaq -0x50(%rbp), %r11
leaq -0x78(%rbp), %r10
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x6bdd0
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6951b
movq $0x0, -0x8(%rbp)
jmp 0x6963a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x148(%rax), %rsi
movq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x6d1e0
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x69549
jmp 0x69629
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
xorl %esi, %esi
callq 0x38230
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x69586
jmp 0x69629
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x148(%rax), %rcx
movq -0x68(%rbp), %r8
movq -0x60(%rbp), %r9
movq -0x30(%rbp), %rax
movl $0x2, %esi
movq %rax, (%rsp)
callq 0x65fb0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x695c1
jmp 0x69629
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x695e1
jmp 0x69629
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movq (%rax), %rdx
movq -0x30(%rbp), %rcx
movl $0x2, %esi
callq 0x6d920
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x69609
jmp 0x69629
movq -0x58(%rbp), %rax
movl %eax, %esi
movq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x42542(%rip), %rdi     # 0xabb60
callq 0x375f0
movq %rax, -0x8(%rbp)
jmp 0x6963a
movq -0x78(%rbp), %rdi
callq 0x12290
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)