// File: /workspace/github_c_makefile_star2_O3/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 0x12edc
cmpl $0x0, (%rbx)
je 0x1c8a2
xorl %eax, %eax
jmp 0x1c8bd
cmpl $0x4, (%r14)
jne 0x1c8bb
cmpl $0x8, (%r12)
je 0x1c8bb
movq %r12, %rdi
callq 0x376d3
testb %al, %al
je 0x1c8ce
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 0x1c913
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x56d67(%rip), %rax     # 0x73653
leaq 0x56d77(%rip), %rdx     # 0x7366a
leaq 0x5751b(%rip), %rcx     # 0x73e15
movq %rbx, %rdi
movl $0x38, %esi
pushq $0x2dc                  # imm = 0x2DC
pushq %rax
callq 0x143da
addq $0x10, %rsp
jmp 0x1c89e
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2f457
cmpl $0x0, (%rbx)
jne 0x1c89e
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x35fbf
movq %r13, %rdi
callq 0x2f56e
cmpl $0x0, (%rbx)
jne 0x1c89e
movl 0x8(%r14), %eax
movl %eax, 0x8(%r12)
testl %eax, %eax
je 0x1c975
xorl %eax, %eax
movl $0xffffffff, 0xc(%r12,%rax,4) # imm = 0xFFFFFFFF
incq %rax
movslq 0x8(%r12), %rcx
cmpq %rcx, %rax
jb 0x1c95f
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12edc
cmpl $0x0, (%rbx)
jne 0x1c89e
movq %r14, %rdi
callq 0x12ad0
cmpl $0x2, (%r14)
jne 0x1c9a5
cmpb $0x29, (%rax)
jne 0x1c9a5
cmpb $0x0, 0x1(%rax)
je 0x1c9d5
movq (%r15), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x56c9c(%rip), %r10     # 0x73653
leaq 0x57457(%rip), %rcx     # 0x73e15
movq %rbx, %rdi
movl $0x16, %esi
movq %rax, %rdx
pushq $0x2f2                  # imm = 0x2F2
pushq %r10
jmp 0x1c908
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12edc
cmpl $0x0, (%rbx)
jne 0x1c89e
movq %r14, %rdi
callq 0x12ad0
cmpl $0x2, (%r14)
jne 0x1c89e
cmpb $0x28, (%rax)
jne 0x1c89e
cmpb $0x0, 0x1(%rax)
jne 0x1c89e
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12edc
cmpl $0x0, (%rbx)
jne 0x1c89e
jmp 0x1c8bb