// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_exp.c
// Function: prv_slice_have_b
static size_t prv_slice_have_b(subtilis_parser_t *p, subtilis_token_t *t,
			       const char *b, subtilis_exp_t **ee,
			       subtilis_error_t *err)
{
	const char *tbuf;
	char expected[3];

	ee[0] = NULL;
	ee[1] = NULL;

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	tbuf = subtilis_token_get_text(t);
	if ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, b))
		return 0;

	if ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, ":")) {
		ee[0] = subtilis_exp_new_int32(0, err);
	} else {
		ee[0] = subtilis_parser_priority7(p, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return 0;

		ee[0] = subtilis_type_if_to_int(p, ee[0], err);
	}
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	tbuf = subtilis_token_get_text(t);
	if ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, b))
		return 1;

	if ((t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, ":")) {
		subtilis_error_set_expected(err, ":", tbuf, p->l->stream->name,
					    p->l->line);
		goto cleanup;
	}

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	tbuf = subtilis_token_get_text(t);
	if ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, b)) {
		/*
		 * If ee[0] is constant 0, either because the programmer
		 * specified 0 or omitted the first slice parameter, there's no
		 * point in slicing the vector.  We want to return 0 to indicate
		 * that we should take a vector reference instead.
		 */
		if ((ee[0]->type.type == SUBTILIS_TYPE_CONST_INTEGER) &&
		    (ee[0]->exp.ir_op.integer == 0))
			return 0;
		ee[1] = NULL;
		return 2;
	}

	ee[1] = subtilis_parser_priority7(p, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	ee[1] = subtilis_type_if_to_int(p, ee[1], err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	tbuf = subtilis_token_get_text(t);
	if ((t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, b)) {
		expected[0] = b[0];
		expected[1] = ' ';
		expected[2] = 0;
		subtilis_error_set_expected(err, expected, tbuf,
					    p->l->stream->name, p->l->line);
		goto cleanup;
	}

	return 2;

cleanup:
	subtilis_exp_delete(ee[1]);
	subtilis_exp_delete(ee[0]);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x133f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2568d
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x256c2
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x12140
cmpl $0x0, %eax
jne 0x256c2
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x256f7
movq -0x38(%rbp), %rdi
leaq 0x85283(%rip), %rsi     # 0xaa959
callq 0x12140
cmpl $0x0, %eax
jne 0x256f7
movq -0x30(%rbp), %rsi
xorl %edi, %edi
callq 0x37800
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x25746
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x24550
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x25728
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x488b0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2575c
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x25791
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x12140
cmpl $0x0, %eax
jne 0x25791
movq $0x1, -0x8(%rbp)
jmp 0x2598f
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x257af
movq -0x38(%rbp), %rdi
leaq 0x851b4(%rip), %rsi     # 0xaa959
callq 0x12140
cmpl $0x0, %eax
je 0x257f6
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x85180(%rip), %rdx     # 0xaa959
leaq 0x8510c(%rip), %rax     # 0xaa8ec
movq %rax, (%rsp)
movl $0x4e9, 0x8(%rsp)       # imm = 0x4E9
callq 0x156d0
jmp 0x2596e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x133f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x25818
jmp 0x2596e
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x25882
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x12140
cmpl $0x0, %eax
jne 0x25882
movq -0x28(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x25869
movq -0x28(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x148(%rax)
jne 0x25869
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq $0x2, -0x8(%rbp)
jmp 0x2598f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x24550
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x258b4
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x488b0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x258ea
movq $0x0, -0x8(%rbp)
jmp 0x2598f
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x25912
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x12140
cmpl $0x0, %eax
je 0x25964
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x3b(%rbp)
movb $0x20, -0x3a(%rbp)
movb $0x0, -0x39(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x3b(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x84f9b(%rip), %rax     # 0xaa8ec
movq %rax, (%rsp)
movl $0x50e, 0x8(%rsp)       # imm = 0x50E
callq 0x156d0
jmp 0x2596e
movq $0x2, -0x8(%rbp)
jmp 0x2598f
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x36ee0
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)