// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_check_slice_indices
static void prv_check_slice_indices(subtilis_parser_t *p,
				    const subtilis_type_t *type,
				    subtilis_exp_t *index1,
				    subtilis_exp_t *index2,
				    subtilis_ir_operand_t error_label,
				    subtilis_error_t *err)
{
	subtilis_ir_operand_t indices_ok;
	subtilis_exp_t *index1_dup = NULL;
	subtilis_exp_t *index2_dup = NULL;
	subtilis_exp_t *condee = NULL;

	if ((index1->type.type == SUBTILIS_TYPE_CONST_INTEGER) &&
	    (index2->type.type == SUBTILIS_TYPE_CONST_INTEGER)) {
		if (index1->exp.ir_op.integer > index2->exp.ir_op.integer) {
			subtilis_error_set_bad_slice(
			    err, index1->exp.ir_op.integer,
			    index2->exp.ir_op.integer, p->l->stream->name,
			    p->l->line);
			return;
		}
	} else {
		/* We need to check the slice parameters are okay at runtime. */

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

		index1_dup = subtilis_type_if_dup(index1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		index2_dup = subtilis_type_if_dup(index2, err);
		if (err->type != SUBTILIS_ERROR_OK) {
			subtilis_exp_delete(index1_dup);
			return;
		}

		condee = subtilis_type_if_lte(p, index1_dup, index2_dup, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		subtilis_ir_section_add_instr_reg(
		    p->current, SUBTILIS_OP_INSTR_JMPC, condee->exp.ir_op,
		    indices_ok, error_label, err);
		subtilis_exp_delete(condee);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		subtilis_ir_section_add_label(p->current, indices_ok.label,
					      err);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x5d2b5
movq -0x28(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x5d2b5
movq -0x20(%rbp), %rax
movl 0x148(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x148(%rcx), %eax
jle 0x5d2b0
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x148(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x148(%rax), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x65, %esi
leaq 0x4f6e3(%rip), %rax     # 0xac97d
movq %rax, (%rsp)
movl $0x23b, 0x8(%rsp)       # imm = 0x23B
callq 0x157b0
jmp 0x5d380
jmp 0x5d380
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x47d20
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d2e5
jmp 0x5d380
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x47d20
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d30a
movq -0x40(%rbp), %rdi
callq 0x36ee0
jmp 0x5d380
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x49700
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d32e
jmp 0x5d380
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %r9
movq 0x148(%rax), %rdx
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x50(%rbp), %rdi
callq 0x36ee0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d36b
jmp 0x5d380
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)