// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_compute_step_type
static subtilis_step_type_t prv_compute_step_type(subtilis_parser_t *p,
						  subtilis_exp_t *step,
						  subtilis_error_t *err)
{
	subtilis_step_type_t retval;
	subtilis_exp_t *e = NULL;
	subtilis_exp_t *step_dup = NULL;

	if (!subtilis_type_if_is_numeric(&step->type)) {
		subtilis_error_set_numeric_exp_expected(err, p->l->stream->name,
							p->l->line);
		return SUBTILIS_STEP_MAX;
	}

	if (!subtilis_type_if_is_const(&step->type))
		return SUBTILIS_STEP_VAR;

	e = subtilis_type_if_zero(p, &step->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SUBTILIS_STEP_MAX;

	step_dup = subtilis_type_if_dup(step, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	e = subtilis_type_if_eq(p, step_dup, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	if (!subtilis_type_if_is_const(&e->type)) {
		subtilis_error_set_assertion_failed(err);
		goto on_error;
	}

	if (e->exp.ir_op.integer == -1) {
		subtilis_error_set_zero_step(err, p->l->stream->name,
					     p->l->line);
		goto on_error;
	}

	subtilis_exp_delete(e);
	e = subtilis_type_if_zero(p, &step->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	step_dup = subtilis_type_if_dup(step, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	e = subtilis_type_if_lt(p, step_dup, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	if (!subtilis_type_if_is_const(&e->type)) {
		subtilis_error_set_assertion_failed(err);
		goto on_error;
	}

	retval = (e->exp.ir_op.integer == -1) ? SUBTILIS_STEP_CONST_DEC
					      : SUBTILIS_STEP_CONST_INC;
	subtilis_exp_delete(e);

	return retval;

on_error:

	subtilis_exp_delete(e);

	return SUBTILIS_STEP_MAX;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
movq %rsi, %rdi
callq 0x37676
testb %al, %al
je 0x2221e
movq %r13, %rdi
callq 0x36a5a
movl $0x2, %ebx
testb %al, %al
je 0x22248
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x35f70
movl $0x3, %ebx
cmpl $0x0, (%r14)
jne 0x22248
movq %rax, %r15
movq %r13, %rdi
movq %r14, %rsi
callq 0x362d2
cmpl $0x0, (%r14)
jne 0x22282
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x36e9d
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x22282
movq %r15, %rdi
callq 0x36a5a
testb %al, %al
je 0x22254
cmpl $-0x1, 0x148(%r15)
je 0x2226a
movq %r15, %rdi
callq 0x2b4c3
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x35f70
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x22282
movq %r13, %rdi
movq %r14, %rsi
callq 0x362d2
cmpl $0x0, (%r14)
jne 0x22282
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x37258
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x22282
movq %r15, %rdi
callq 0x36a5a
testb %al, %al
je 0x2228c
xorl %ebx, %ebx
cmpl $-0x1, 0x148(%r15)
sete %bl
jmp 0x22282
movq (%r12), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x5173a(%rip), %r8      # 0x7396a
movq %r14, %rdi
movl $0x44, %esi
movl $0x46, %r9d
callq 0x14618
movl $0x3, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5170f(%rip), %rdx     # 0x7396a
movq %r14, %rdi
movl $0xf, %esi
movl $0x5a, %ecx
jmp 0x2227d
movq (%r12), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
movq %r14, %rdi
movl $0x2b, %esi
callq 0x145f4
movq %r15, %rdi
callq 0x2b4c3
jmp 0x22248
leaq 0x516d7(%rip), %rdx     # 0x7396a
movq %r14, %rdi
movl $0xf, %esi
movl $0x72, %ecx
jmp 0x2227d