// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_exp.c
// Function: prv_bracketed_args_have_b
static size_t prv_bracketed_args_have_b(subtilis_parser_t *p,
					subtilis_token_t *t, subtilis_exp_t **e,
					size_t max,
					subtilis_type_if_unary_t conv,
					subtilis_error_t *err)
{
	size_t i;
	const char *tbuf;

	memset(e, 0, sizeof(*e) * max);

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

	if (t->type == SUBTILIS_TOKEN_OPERATOR) {
		tbuf = subtilis_token_get_text(t);
		if (!strcmp(tbuf, ")"))
			return 0;
	}

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

	if (conv) {
		e[0] = conv(p, e[0], err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
	}

	for (i = 1; i < max; i++) {
		tbuf = subtilis_token_get_text(t);
		if (t->type != SUBTILIS_TOKEN_OPERATOR) {
			subtilis_error_set_expected(
			    err, ",", tbuf, p->l->stream->name, p->l->line);
			goto on_error;
		}

		if (!strcmp(tbuf, ")"))
			return i;

		if (strcmp(tbuf, ",")) {
			subtilis_error_set_expected(
			    err, ",", tbuf, p->l->stream->name, p->l->line);
			goto on_error;
		}

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

		e[i] = subtilis_parser_priority7(p, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;

		if (conv) {
			e[i] = conv(p, e[i], err);
			if (err->type != SUBTILIS_ERROR_OK)
				goto on_error;
		}
	}

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

	/*
	 * Too many integers in the list
	 */

	subtilis_error_set_right_bkt_expected(err, tbuf, p->l->stream->name,
					      p->l->line);

on_error:

	for (i = 0; i < max && e[i]; i++)
		subtilis_exp_delete(e[i]);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r13
leaq (,%rcx,8), %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x12140
movq (%r13), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x12edc
cmpl $0x0, (%r15)
jne 0x1f157
movq %r13, (%rsp)
cmpl $0x2, (%rbp)
jne 0x1f13e
movq %rbp, %rdi
callq 0x12ad0
cmpb $0x29, (%rax)
jne 0x1f13e
cmpb $0x0, 0x1(%rax)
je 0x1f157
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1e938
movq %rax, (%r12)
cmpl $0x0, (%r15)
je 0x1f16c
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rbx, %rbx
je 0x1f18b
movq (%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *%rbx
movq %rax, (%r12)
cmpl $0x0, (%r15)
jne 0x1f2ec
movl $0x1, %r13d
cmpq $0x2, %r14
jb 0x1f22a
movq %rbp, %rdi
callq 0x12ad0
cmpl $0x2, (%rbp)
jne 0x1f2b4
movzbl (%rax), %ecx
cmpl $0x2c, %ecx
jne 0x1f276
cmpb $0x0, 0x1(%rax)
jne 0x1f285
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x12edc
cmpl $0x0, (%r15)
jne 0x1f2ec
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1e938
movq %rax, (%r12,%r13,8)
cmpl $0x0, (%r15)
jne 0x1f2ec
testq %rbx, %rbx
je 0x1f21b
movq (%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *%rbx
movq %rax, (%r12,%r13,8)
cmpl $0x0, (%r15)
jne 0x1f2ec
incq %r13
cmpq %r13, %r14
jne 0x1f19b
movq %r14, %r13
movq %rbp, %rdi
callq 0x12ad0
cmpl $0x2, (%rbp)
jne 0x1f247
cmpb $0x29, (%rax)
jne 0x1f247
cmpb $0x0, 0x1(%rax)
je 0x1f15a
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x54683(%rip), %r10     # 0x738e0
leaq 0x54bb1(%rip), %rcx     # 0x73e15
movq %r15, %rdi
movl $0x16, %esi
movq %rax, %rdx
pushq $0x4aa                  # imm = 0x4AA
jmp 0x1f2e1
cmpl $0x29, %ecx
jne 0x1f285
cmpb $0x0, 0x1(%rax)
je 0x1f15a
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x54645(%rip), %r10     # 0x738e0
leaq 0x542f0(%rip), %rdx     # 0x73592
movq %r15, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x48e                  # imm = 0x48E
jmp 0x1f2e1
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x54616(%rip), %r10     # 0x738e0
leaq 0x542c1(%rip), %rdx     # 0x73592
movq %r15, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x485                  # imm = 0x485
pushq %r10
callq 0x143da
addq $0x10, %rsp
testq %r14, %r14
je 0x1f157
xorl %r13d, %r13d
xorl %r15d, %r15d
movq (%r12,%r15,8), %rdi
testq %rdi, %rdi
je 0x1f15a
callq 0x2b166
incq %r15
cmpq %r15, %r14
jne 0x1f2fb
jmp 0x1f15a