// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %r14
movq %rcx, %rbx
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 0x12eda
cmpl $0x0, (%r15)
jne 0x1f0af
movq %r13, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
cmpl $0x2, (%rbp)
jne 0x1f095
movq %rbp, %rdi
callq 0x12ad0
leaq 0x54a64(%rip), %rsi     # 0x73aed
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x1f0af
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1e874
movq %rax, (%r12)
cmpl $0x0, (%r15)
je 0x1f0c4
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
je 0x1f0e5
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *%r14
movq %rax, (%r12)
cmpl $0x0, (%r15)
jne 0x1f203
movl $0x1, %r13d
cmpq $0x2, 0x10(%rsp)
jb 0x1f1a3
movq %rbp, %rdi
callq 0x12ad0
movq %rax, %rbx
cmpl $0x2, (%rbp)
jne 0x1f235
movq %rbx, %rdi
leaq 0x549d7(%rip), %rsi     # 0x73aed
callq 0x12160
testl %eax, %eax
je 0x1f0b2
movq %rbx, %rdi
leaq 0x5446f(%rip), %rsi     # 0x73598
callq 0x12160
movq 0x8(%rsp), %rcx
movq (%rcx), %rdi
testl %eax, %eax
jne 0x1f265
movq %rbp, %rsi
movq %r15, %rdx
callq 0x12eda
cmpl $0x0, (%r15)
jne 0x1f203
movq %r14, %rbx
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1e874
movq %rax, (%r12,%r13,8)
cmpl $0x0, (%r15)
jne 0x1f203
testq %rbx, %rbx
je 0x1f190
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *%rbx
movq %rax, (%r12,%r13,8)
cmpl $0x0, (%r15)
jne 0x1f203
incq %r13
cmpq %r13, 0x10(%rsp)
jne 0x1f0f7
movq 0x10(%rsp), %r13
movq %rbp, %rdi
callq 0x12ad0
movq %rax, %rbx
cmpl $0x2, (%rbp)
jne 0x1f1cb
leaq 0x54932(%rip), %rsi     # 0x73aed
movq %rbx, %rdi
callq 0x12160
testl %eax, %eax
je 0x1f0b2
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x546ca(%rip), %rax     # 0x738ac
leaq 0x54c0c(%rip), %rcx     # 0x73df5
movq %r15, %rdi
movl $0x16, %esi
movq %rbx, %rdx
pushq $0x4aa                  # imm = 0x4AA
pushq %rax
callq 0x1442a
addq $0x10, %rsp
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x1f0af
xorl %r13d, %r13d
xorl %ebx, %ebx
movq (%r12,%rbx,8), %rdi
testq %rdi, %rdi
je 0x1f0b2
callq 0x2b4c3
incq %rbx
cmpq %rbx, %r15
jne 0x1f216
jmp 0x1f0b2
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x54660(%rip), %rax     # 0x738ac
leaq 0x54345(%rip), %rdx     # 0x73598
movq %r15, %rdi
movl $0x1d, %esi
movq %rbx, %rcx
pushq $0x485                  # imm = 0x485
jmp 0x1f1f9
movq 0x30(%rdi), %r8
movl 0x38(%rdi), %r9d
leaq 0x54638(%rip), %rax     # 0x738ac
leaq 0x5431d(%rip), %rdx     # 0x73598
movq %r15, %rdi
movl $0x1d, %esi
movq %rbx, %rcx
pushq $0x48e                  # imm = 0x48E
jmp 0x1f1f9