// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_left_right_non_const
static size_t prv_left_right_non_const(subtilis_parser_t *p, size_t str_reg,
				       size_t arg2_reg, bool arg2_const,
				       subtilis_ir_operand_t partial,
				       subtilis_error_t *err)
{
	subtilis_ir_operand_t less_zero;
	subtilis_ir_operand_t gt_len;
	subtilis_ir_operand_t str_len_zero;
	subtilis_ir_operand_t condee;
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t full_string;
	size_t len_reg;

	op0.reg = str_reg;
	op1.integer = SUBTIILIS_STRING_SIZE_OFF;
	len_reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LOADO_I32, op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

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

	if (!arg2_const) {
		op0.reg = arg2_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)
			return SIZE_MAX;

		op0.reg = arg2_reg;
		op1.reg = len_reg;
		gt_len.reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_GTE_I32, op0, op1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return SIZE_MAX;

		condee.reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_OR_I32, less_zero, gt_len,
		    err);
	} else {
		op0.reg = arg2_reg;
		op1.reg = len_reg;
		condee.reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_GTE_I32, op0, op1, err);
	}
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	op0.reg = len_reg;
	op1.integer = 0;
	str_len_zero.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_EQI_I32, op0, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	condee.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_OR_I32, condee, str_len_zero, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

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

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

	return len_reg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
movq %r8, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq %r9, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b72d
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x70(%rbp)
testb $0x1, -0x29(%rbp)
jne 0x6b7fb
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0x3d, %esi
callq 0x38230
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b78f
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0x3f, %esi
callq 0x38230
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b7d7
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x18(%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, -0x58(%rbp)
jmp 0x6b82d
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0x3f, %esi
callq 0x38230
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b843
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0x2d, %esi
callq 0x38230
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b88a
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r8
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
movl $0x26, %esi
callq 0x38230
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b8bf
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %r9
movq -0x58(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b8f4
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x70(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x39960
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b91c
movq $-0x1, -0x8(%rbp)
jmp 0x6b924
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)