// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_check_slice_index1
static void
prv_check_slice_index1(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 index1_ok;
	subtilis_exp_t *index1_dup = NULL;
	subtilis_exp_t *zero = NULL;
	subtilis_exp_t *condee = NULL;

	if (index1->type.type == SUBTILIS_TYPE_CONST_INTEGER) {
		if (index1->exp.ir_op.integer < 0) {
			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 {
		index1_ok.label = subtilis_ir_section_new_label(p->current);
		index1_dup = subtilis_type_if_dup(index1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		zero = subtilis_exp_new_int32(0, err);
		if (err->type != SUBTILIS_ERROR_OK) {
			subtilis_exp_delete(index1_dup);
			return;
		}

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

// 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 0x5d433
movq -0x20(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jge 0x5d42e
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 0x4f565(%rip), %rax     # 0xac97d
movq %rax, (%rsp)
movl $0x26b, 0x8(%rsp)       # imm = 0x26B
callq 0x157b0
jmp 0x5d50c
jmp 0x5d50c
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 0x5d463
jmp 0x5d50c
movq -0x30(%rbp), %rsi
xorl %edi, %edi
callq 0x37800
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d489
movq -0x40(%rbp), %rdi
callq 0x36ee0
jmp 0x5d50c
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x497e0
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d4ad
jmp 0x5d50c
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 0x5d4ea
jmp 0x5d50c
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 0x5d50a
jmp 0x5d50c
jmp 0x5d50c
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)