// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_left_const
static subtilis_exp_t *prv_left_const(subtilis_parser_t *p,
				      const subtilis_buffer_t *str,
				      size_t size_reg, subtilis_error_t *err)
{
	size_t id;
	size_t ptr;
	size_t src_reg;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t zero_len;
	subtilis_ir_operand_t gt_zero;
	subtilis_ir_operand_t getp;
	const subtilis_symbol_t *s;
	char *tmp_name = NULL;

	zero_len.label = subtilis_ir_section_new_label(p->current);
	gt_zero.label = subtilis_ir_section_new_label(p->current);
	getp.label = subtilis_ir_section_new_label(p->current);

	id = prv_left_right_const(p, str, size_reg, &s, &tmp_name, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	op1.reg = size_reg;
	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  op1, gt_zero, zero_len, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

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

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

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

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

	op1.integer = (int32_t)id;
	src_reg = subtilis_ir_section_add_instr2(
	    p->current, SUBTILIS_OP_INSTR_LCA, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_string_init_from_lca(p, SUBTILIS_IR_REG_LOCAL, s->loc, src_reg,
				      size_reg, true, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, getp.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 $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %r9
leaq -0x68(%rbp), %rcx
leaq -0x70(%rbp), %r8
callq 0x6b450
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x67ffd
movq $0x0, -0x8(%rbp)
jmp 0x681b0
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %r9
movq -0x48(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68035
jmp 0x6819f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x39960
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68058
jmp 0x6819f
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movl $0x2, %esi
callq 0x6dc50
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68083
jmp 0x6819f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rcx
movq -0x60(%rbp), %rdx
movl $0x45, %esi
callq 0x38540
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x680ab
jmp 0x6819f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x58(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x39960
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x680ce
jmp 0x6819f
movq -0x30(%rbp), %rax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %rdx
movl $0x7d, %esi
callq 0x38490
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68101
jmp 0x6819f
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rdx
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %rax
movl $0x2, %esi
movl $0x1, %r9d
movq %rax, (%rsp)
callq 0x66160
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68137
jmp 0x6819f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x60(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x39960
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x68157
jmp 0x6819f
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %rcx
movl $0x2, %esi
callq 0x6d920
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6817f
jmp 0x6819f
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x70(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x439cc(%rip), %rdi     # 0xabb60
callq 0x375f0
movq %rax, -0x8(%rbp)
jmp 0x681b0
movq -0x70(%rbp), %rdi
callq 0x12290
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)