// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_parse_expression_list
static subtilis_exp_t **
prv_parse_expression_list(subtilis_parser_t *p, subtilis_exp_t *e,
			  const subtilis_type_t *el_type, subtilis_token_t *t,
			  size_t *len, subtilis_arr_ct_t check_type,
			  subtilis_error_t *err)
{
	size_t i;
	const char *tbuf;
	subtilis_exp_t **ee;
	subtilis_exp_t **ee_tmp;
	size_t new_max;
	size_t max = SUBTILIS_CONFIG_CONSTANT_ARRAY_GRAN;
	size_t count = 0;

	ee = malloc(sizeof(*ee) * max);
	if (!ee) {
		subtilis_error_set_oom(err);
		return NULL;
	}

	ee[count++] = subtilis_type_if_dup(e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	e = NULL;

	tbuf = subtilis_token_get_text(t);
	while ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, ",")) {
		if (count == max) {
			new_max = max + SUBTILIS_CONFIG_CONSTANT_ARRAY_GRAN;
			ee_tmp = realloc(ee, new_max * sizeof(*ee));
			if (!*ee_tmp) {
				subtilis_error_set_oom(err);
				goto cleanup;
			}
			ee = ee_tmp;
			max = new_max;
		}
		e = subtilis_parser_expression(p, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		check_type(p, e, el_type, err);
		if (err->type != SUBTILIS_ERROR_OK) {
			subtilis_exp_delete(e);
			goto cleanup;
		}

		ee[count++] = e;
		e = NULL;
		tbuf = subtilis_token_get_text(t);
	}

	*len = count;
	return ee;

cleanup:

	for (i = 0; i < count; i++)
		subtilis_exp_delete(ee[i]);
	free(ee);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, %r15
movq %rcx, (%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
movq 0x60(%rsp), %r13
movl $0x800, %edi            # imm = 0x800
callq 0x121d0
testq %rax, %rax
je 0x176bb
movq %rax, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0x341c4
movq %rax, (%rbx)
cmpl $0x0, (%r13)
je 0x176e6
pushq $0x1
popq %rbp
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x176b1
movq (%rbx,%r14,8), %rdi
callq 0x29d88
incq %r14
jmp 0x1769e
movq %rbx, %rdi
callq 0x122c0
jmp 0x176d2
leaq 0x55e26(%rip), %rdx     # 0x6d4e8
pushq $0x1
popq %rsi
movq %r13, %rdi
movl $0x2b6, %ecx            # imm = 0x2B6
callq 0x1429e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %r12
movq %r12, %rdi
callq 0x12a25
pushq $0x1
popq %r15
movl $0x100, %ebp            # imm = 0x100
movq 0x10(%rsp), %r14
cmpl $0x2, (%r12)
jne 0x1778f
cmpb $0x2c, (%rax)
jne 0x1778f
cmpb $0x0, 0x1(%rax)
jne 0x1778f
cmpq %rbp, %r15
jne 0x17741
leaq 0x800(,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x12210
cmpq $0x0, (%rax)
je 0x177ac
addq $0x100, %rbp            # imm = 0x100
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
movq 0x60(%rsp), %r13
movq %r13, %rdx
callq 0x1dfd5
cmpl $0x0, (%r13)
jne 0x177a4
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq *0x20(%rsp)
cmpl $0x0, (%r13)
jne 0x1779c
movq %r12, (%rbx,%r15,8)
incq %r15
movq (%rsp), %r12
movq %r12, %rdi
callq 0x12a25
jmp 0x1770a
movq 0x8(%rsp), %rax
movq %r15, (%rax)
jmp 0x176d4
movq %r12, %rdi
callq 0x29d88
movq %r15, %rbp
jmp 0x1769b
leaq 0x55d35(%rip), %rdx     # 0x6d4e8
pushq $0x1
popq %rsi
movq %r13, %rdi
movl $0x2c5, %ecx            # imm = 0x2C5
callq 0x1429e
jmp 0x1769b