// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_left_right_const
static size_t prv_left_right_const(subtilis_parser_t *p,
				   const subtilis_buffer_t *str,
				   size_t size_reg,
				   const subtilis_symbol_t **sym,
				   char **tmp_name, subtilis_error_t *err)
{
	subtilis_ir_operand_t less_zero;
	subtilis_ir_operand_t gt_len;
	subtilis_ir_operand_t condee;
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t full_string;
	subtilis_ir_operand_t partial;
	const subtilis_symbol_t *s;
	size_t id;
	char *tmp_name_local = NULL;
	size_t buf_size = subtilis_buffer_get_size(str) - 1;

	full_string.label = subtilis_ir_section_new_label(p->current);
	partial.label = subtilis_ir_section_new_label(p->current);

	s = subtilis_symbol_table_insert_tmp(p->local_st, &subtilis_type_string,
					     &tmp_name_local, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	op0.reg = size_reg;
	op1.integer = 0;
	less_zero.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LTI_I32, op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	op1.integer = buf_size;
	gt_len.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_GTEI_I32, op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	condee.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_OR_I32, less_zero, gt_len, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  condee, full_string, partial, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

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

	op1.integer = buf_size;
	subtilis_ir_section_add_instr_no_reg2(
	    p->current, SUBTILIS_OP_INSTR_MOVI_I32, op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

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

	id = prv_add_string_constant(p, subtilis_buffer_get_string(str),
				     buf_size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	*sym = s;
	*tmp_name = tmp_name_local;
	return id;

cleanup:

	free(tmp_name_local);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x18(%rbp), %rdi
callq 0x16270
subq $0x1, %rax
movq %rax, -0x90(%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, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x38(%rbp), %rcx
leaq 0x40699(%rip), %rsi     # 0xabb60
leaq -0x88(%rbp), %rdx
callq 0x3c920
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b4e5
jmp 0x6b697
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl $0x3d, %esi
callq 0x38230
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b524
jmp 0x6b697
movq -0x90(%rbp), %rax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl $0x41, %esi
callq 0x38230
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b55e
jmp 0x6b697
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
movl $0x26, %esi
callq 0x38230
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b58e
jmp 0x6b697
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r9
movq -0x50(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x70(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b5be
jmp 0x6b697
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x68(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x39960
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b5e1
jmp 0x6b697
movq -0x90(%rbp), %rax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl $0x1b, %esi
callq 0x385a0
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b617
jmp 0x6b697
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x70(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x39960
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b637
jmp 0x6b697
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rdi
callq 0x16760
movq -0x98(%rbp), %rdi
movq %rax, %rsi
movq -0x90(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x65e00
movq %rax, -0x80(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b674
jmp 0x6b697
movq -0x78(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x88(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x80(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6b6ab
movq -0x88(%rbp), %rdi
callq 0x12290
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)