// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/parser_call.c
// Function: prv_complete_array_type
static bool prv_complete_array_type(subtilis_parser_t *p, subtilis_token_t *t,
				    subtilis_type_t *fn_type,
				    subtilis_error_t *err)
{
	subtilis_type_t id_type;
	size_t i;
	const char *tbuf;

	id_type.type = SUBTILIS_TYPE_VOID;

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

	if ((t->type == SUBTILIS_TOKEN_INTEGER) &&
	    (fn_type->type != SUBTILIS_TYPE_VOID) &&
	    (!subtilis_type_if_is_vector(fn_type))) {
		/*
		 * We have a function returning an array.
		 */

		if ((t->tok.integer < 1) ||
		    (t->tok.integer > SUBTILIS_MAX_DIMENSIONS)) {
			subtilis_error_bad_dim(err, "return type",
					       p->l->stream->name, p->l->line);
			return false;
		}
		subtilis_type_init_copy(&id_type, fn_type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
		subtilis_type_if_array_of(&id_type, fn_type, err);
		subtilis_type_free(&id_type);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
		fn_type->params.array.num_dims = t->tok.integer;
		for (i = 0; i < fn_type->params.array.num_dims; i++)
			fn_type->params.array.dims[i] =
			    SUBTILIS_DYNAMIC_DIMENSION;

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

		if ((t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, ")")) {
			subtilis_error_set_right_bkt_expected(
			    err, tbuf, p->l->stream->name, p->l->line);
			return false;
		}

		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
		tbuf = subtilis_token_get_text(t);
		if ((t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, "("))
			return false;
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movl $0x8, 0x8(%rsp)
movq (%rdi), %rdi
movq %rcx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
je 0x1c764
xorl %eax, %eax
jmp 0x1c77f
cmpl $0x4, (%r14)
jne 0x1c77d
cmpl $0x8, (%r12)
je 0x1c77d
movq %r12, %rdi
callq 0x37815
testb %al, %al
je 0x1c790
movb $0x1, %al
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl 0x8(%r14), %eax
addl $-0xb, %eax
cmpl $-0xb, %eax
ja 0x1c7d5
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x56e72(%rip), %rax     # 0x73620
leaq 0x56e82(%rip), %rdx     # 0x73637
leaq 0x57639(%rip), %rcx     # 0x73df5
movq %rbx, %rdi
movl $0x38, %esi
pushq $0x2dc                  # imm = 0x2DC
pushq %rax
callq 0x1442a
addq $0x10, %rsp
jmp 0x1c760
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2f72e
cmpl $0x0, (%rbx)
jne 0x1c760
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3610f
movq %r13, %rdi
callq 0x2f843
cmpl $0x0, (%rbx)
jne 0x1c760
movl 0x8(%r14), %eax
movl %eax, 0x8(%r12)
testl %eax, %eax
je 0x1c837
xorl %eax, %eax
movl $0xffffffff, 0xc(%r12,%rax,4) # imm = 0xFFFFFFFF
incq %rax
movslq 0x8(%r12), %rcx
cmpq %rcx, %rax
jb 0x1c821
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x1c760
movq %r14, %rdi
callq 0x12ad0
movq %rax, %r12
cmpl $0x2, (%r14)
jne 0x1c872
leaq 0x57287(%rip), %rsi     # 0x73aed
movq %r12, %rdi
callq 0x12160
testl %eax, %eax
je 0x1c8a0
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x56d9c(%rip), %rax     # 0x73620
leaq 0x5756a(%rip), %rcx     # 0x73df5
movq %rbx, %rdi
movl $0x16, %esi
movq %r12, %rdx
pushq $0x2f2                  # imm = 0x2F2
jmp 0x1c7c9
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x1c760
movq %r14, %rdi
callq 0x12ad0
cmpl $0x2, (%r14)
jne 0x1c760
leaq 0x57942(%rip), %rsi     # 0x74212
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
jne 0x1c760
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x1c760
jmp 0x1c77d