// File: /workspace/github_c_makefile_star2_O2/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, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
leaq (,%rcx,8), %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x12140
movq (%r14), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x12e0e
cmpl $0x0, (%r15)
jne 0x1e4bc
movq %r14, (%rsp)
cmpl $0x2, (%rbp)
jne 0x1e4a3
movq %rbp, %rdi
callq 0x12a25
cmpb $0x29, (%rax)
jne 0x1e4a3
cmpb $0x0, 0x1(%rax)
je 0x1e4bc
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1dccf
movq %rax, (%r13)
cmpl $0x0, (%r15)
je 0x1e4d1
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %r14
testq %rbx, %rbx
je 0x1e4f2
movq (%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *%rbx
movq %rax, (%r14)
cmpl $0x0, (%r15)
jne 0x1e632
pushq $0x1
popq %r13
movq %rbp, %rdi
callq 0x12a25
movl (%rbp), %ecx
cmpq %r12, %r13
jae 0x1e5bd
cmpl $0x2, %ecx
jne 0x1e5fe
movzbl (%rax), %ecx
cmpl $0x2c, %ecx
jne 0x1e581
cmpb $0x0, 0x1(%rax)
jne 0x1e590
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x12e0e
cmpl $0x0, (%r15)
jne 0x1e632
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1dccf
movq %rax, (%r14,%r13,8)
cmpl $0x0, (%r15)
jne 0x1e632
testq %rbx, %rbx
je 0x1e579
movq (%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *%rbx
movq %rax, (%r14,%r13,8)
cmpl $0x0, (%r15)
jne 0x1e632
incq %r13
jmp 0x1e4f6
cmpl $0x29, %ecx
jne 0x1e590
cmpb $0x0, 0x1(%rax)
je 0x1e4bf
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x4f2f6(%rip), %r10     # 0x6d89c
leaq 0x4efe5(%rip), %rdx     # 0x6d592
pushq $0x1d
popq %rsi
movq %r15, %rdi
movq %rax, %rcx
pushq $0x48e                  # imm = 0x48E
jmp 0x1e629
cmpl $0x2, %ecx
jne 0x1e5d1
cmpb $0x29, (%rax)
jne 0x1e5d1
cmpb $0x0, 0x1(%rax)
je 0x1e4bf
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x4f2b5(%rip), %r10     # 0x6d89c
leaq 0x4f7d7(%rip), %rcx     # 0x6ddc5
pushq $0x16
popq %rsi
movq %r15, %rdi
movq %rax, %rdx
pushq $0x4aa                  # imm = 0x4AA
jmp 0x1e629
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x4f288(%rip), %r10     # 0x6d89c
leaq 0x4ef77(%rip), %rdx     # 0x6d592
pushq $0x1d
popq %rsi
movq %r15, %rdi
movq %rax, %rcx
pushq $0x485                  # imm = 0x485
pushq %r10
callq 0x140cd
popq %rax
popq %rcx
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x1e4bf
movq (%r14,%r15,8), %rdi
testq %rdi, %rdi
je 0x1e4bf
callq 0x29d88
incq %r15
jmp 0x1e638