// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_left_non_const
static subtilis_exp_t *prv_left_non_const(subtilis_parser_t *p, size_t str_reg,
					  size_t left_reg, bool left_const,
					  subtilis_error_t *err)
{
	subtilis_ir_operand_t end;
	const subtilis_symbol_t *s;
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	size_t ptr_reg;
	size_t len_reg;
	subtilis_ir_operand_t partial;
	size_t dest_data_reg;
	char *tmp_name = NULL;
	size_t dest_len_reg = p->current->reg_counter++;

	partial.label = subtilis_ir_section_new_label(p->current);
	end.label = subtilis_ir_section_new_label(p->current);
	s = subtilis_symbol_table_insert_tmp(p->local_st, &subtilis_type_string,
					     &tmp_name, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	len_reg = prv_left_right_non_const(p, str_reg, left_reg, left_const,
					   partial, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	/*
	 * Code for dealing with the full string goes here.
	 */

	op0.reg = dest_len_reg;
	op1.reg = len_reg;
	subtilis_ir_section_add_instr_no_reg2(p->current, SUBTILIS_OP_INSTR_MOV,
					      op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_instr_no_reg(p->current, SUBTILIS_OP_INSTR_JMP,
					     end, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	/* If we're actually slicing, we end up here. */

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

	op0.reg = dest_len_reg;
	op1.reg = left_reg;
	subtilis_ir_section_add_instr_no_reg2(p->current, SUBTILIS_OP_INSTR_MOV,
					      op0, op1, 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;

	dest_data_reg = subtilis_reference_get_data(p, str_reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_string_init_from_ptr(p, SUBTILIS_IR_REG_LOCAL, s->loc, str_reg,
				      dest_len_reg, dest_data_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	ptr_reg = 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_reg,
					tmp_name, err);

cleanup:
	free(tmp_name);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq %r8, -0x30(%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, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x30(%rbp), %rcx
leaq 0x43926(%rip), %rsi     # 0xabb60
leaq -0x78(%rbp), %rdx
callq 0x3c920
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6825d
movq $0x0, -0x8(%rbp)
jmp 0x68427
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movb -0x21(%rbp), %al
movq -0x30(%rbp), %r9
movq -0x68(%rbp), %r8
andb $0x1, %al
movzbl %al, %ecx
callq 0x6b6c0
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68290
jmp 0x68416
movq -0x80(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %r8
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movl $0x1d, %esi
callq 0x385a0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x682cc
jmp 0x68416
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl $0x45, %esi
callq 0x38540
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x682f4
jmp 0x68416
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x68(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68317
jmp 0x68416
movq -0x80(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %r8
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movl $0x1d, %esi
callq 0x385a0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68353
jmp 0x68416
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68376
jmp 0x68416
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x6d1e0
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6839a
jmp 0x68416
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rcx
movq -0x80(%rbp), %r8
movq -0x70(%rbp), %r9
movq -0x30(%rbp), %rax
movl $0x2, %esi
movq %rax, (%rsp)
callq 0x65fb0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x683ce
jmp 0x68416
movq -0x10(%rbp), %rdi
movq -0x40(%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 0x683f6
jmp 0x68416
movq -0x58(%rbp), %rax
movl %eax, %esi
movq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x43755(%rip), %rdi     # 0xabb60
callq 0x375f0
movq %rax, -0x8(%rbp)
jmp 0x68427
movq -0x78(%rbp), %rdi
callq 0x12290
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)