// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_get_varnames
static subtilis_range_var_t *prv_get_varnames(subtilis_parser_t *p,
					      subtilis_token_t *t,
					      size_t *count,
					      subtilis_error_t *err)
{
	size_t i;
	subtilis_range_var_t *range_vars;
	size_t var_count = 0;
	const char *tbuf;

	range_vars = calloc(SUBTILIS_MAX_DIMENSIONS + 1, sizeof(*range_vars));
	if (!range_vars) {
		subtilis_error_set_oom(err);
		return NULL;
	}

	for (i = 0; i < SUBTILIS_MAX_DIMENSIONS + 1; i++) {
		range_vars[i].type.type = SUBTILIS_TYPE_VOID;
		range_vars[i].for_ctx.type.type = SUBTILIS_TYPE_VOID;
	}

	tbuf = subtilis_token_get_text(t);
	if (t->type == SUBTILIS_TOKEN_IDENTIFIER) {
		range_vars[0].name = subtilis_parser_get_assignment_var(
		    p, t, &range_vars[0].type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	} else if ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, "~")) {
		/*
		 * We can't set the type of the range variable until we've
		 * evaluated the collection.
		 */

		range_vars[0].name = NULL;
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	} else {
		subtilis_error_set_id_expected(err, tbuf, p->l->stream->name,
					       p->l->line);
		goto cleanup;
	}

	var_count = 1;
	tbuf = subtilis_token_get_text(t);
	while ((t->type == SUBTILIS_TOKEN_OPERATOR) && (!strcmp(tbuf, ","))) {
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		range_vars[var_count].name = subtilis_parser_get_assignment_var(
		    p, t, &range_vars[var_count].type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		var_count++;
		if (range_vars[var_count - 1].type.type !=
		    SUBTILIS_TYPE_INTEGER) {
			subtilis_error_set_integer_variable_expected(
			    err,
			    subtilis_type_name(&range_vars[var_count - 1].type),
			    p->l->stream->name, p->l->line);
			goto cleanup;
		}

		tbuf = subtilis_token_get_text(t);
	}

	if ((t->type == SUBTILIS_TOKEN_OPERATOR) &&
	    (!strcmp(tbuf, "{") || !strcmp(tbuf, "("))) {
		subtilis_error_set_array_in_range(
		    err, range_vars[var_count - 1].name, p->l->stream->name,
		    p->l->line);
		goto cleanup;
	}

	*count = var_count;
	return range_vars;

cleanup:

	for (i = 0; i < var_count; i++) {
		subtilis_type_free(&range_vars[i].type);
		subtilis_type_free(&range_vars[i].for_ctx.type);
		free(range_vars[i].name);
	}
	free(range_vars);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
movl $0xb, %edi
movl $0x2c8, %esi            # imm = 0x2C8
callq 0x12130
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2b891
movq -0x28(%rbp), %rdi
movl $0x1, %esi
leaq 0x7f130(%rip), %rdx     # 0xaa9aa
movl $0x431, %ecx            # imm = 0x431
callq 0x158e0
movq $0x0, -0x8(%rbp)
jmp 0x2bc3d
movq $0x0, -0x30(%rbp)
cmpq $0xb, -0x30(%rbp)
jae 0x2b8dd
movq -0x38(%rbp), %rax
imulq $0x2c8, -0x30(%rbp), %rcx # imm = 0x2C8
addq %rcx, %rax
movl $0x8, 0x8(%rax)
movq -0x38(%rbp), %rax
imulq $0x2c8, -0x30(%rbp), %rcx # imm = 0x2C8
addq %rcx, %rax
movl $0x8, 0x168(%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2b899
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x2b929
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq $0x8, %rdx
movq -0x28(%rbp), %rcx
callq 0x1b590
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2b924
jmp 0x2bbbe
jmp 0x2b9bf
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x2b976
movq -0x48(%rbp), %rdi
leaq 0x7f1f1(%rip), %rsi     # 0xaab2e
callq 0x12140
cmpl $0x0, %eax
jne 0x2b976
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x133f0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2b974
jmp 0x2bbbe
jmp 0x2b9bd
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x12, %esi
leaq 0x7f8d6(%rip), %rcx     # 0xab276
leaq 0x7f003(%rip), %rax     # 0xaa9aa
movq %rax, (%rsp)
movl $0x44c, 0x8(%rsp)       # imm = 0x44C
callq 0x156d0
jmp 0x2bbbe
jmp 0x2b9bf
movq $0x1, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpl $0x2, (%rcx)
movb %al, -0x49(%rbp)
jne 0x2b9fd
movq -0x48(%rbp), %rdi
leaq 0x7ebbc(%rip), %rsi     # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x2ba09
jmp 0x2bb19
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x133f0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2ba2b
jmp 0x2bbbe
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
imulq $0x2c8, -0x40(%rbp), %rax # imm = 0x2C8
addq %rax, %rdx
addq $0x8, %rdx
movq -0x28(%rbp), %rcx
callq 0x1b590
movq %rax, %rcx
movq -0x38(%rbp), %rax
imulq $0x2c8, -0x40(%rbp), %rdx # imm = 0x2C8
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2ba72
jmp 0x2bbbe
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
imulq $0x2c8, %rcx, %rcx      # imm = 0x2C8
addq %rcx, %rax
cmpl $0x5, 0x8(%rax)
je 0x2bb07
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rax
subq $0x1, %rax
imulq $0x2c8, %rax, %rax      # imm = 0x2C8
addq %rax, %rdi
addq $0x8, %rdi
callq 0x3e190
movq -0x58(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x4f, %esi
leaq 0x7f78c(%rip), %rcx     # 0xab276
leaq 0x7eeb9(%rip), %rax     # 0xaa9aa
movq %rax, (%rsp)
movl $0x460, 0x8(%rsp)       # imm = 0x460
callq 0x156d0
jmp 0x2bbbe
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x48(%rbp)
jmp 0x2b9d4
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x2bba9
movq -0x48(%rbp), %rdi
leaq 0x81ada(%rip), %rsi     # 0xad60b
callq 0x12140
cmpl $0x0, %eax
je 0x2bb50
movq -0x48(%rbp), %rdi
leaq 0x7f756(%rip), %rsi     # 0xab29c
callq 0x12140
cmpl $0x0, %eax
jne 0x2bba9
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
imulq $0x2c8, %rcx, %rcx      # imm = 0x2C8
addq %rcx, %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x55, %esi
leaq 0x7f6e7(%rip), %rcx     # 0xab276
leaq 0x7ee14(%rip), %rax     # 0xaa9aa
movq %rax, (%rsp)
movl $0x46b, 0x8(%rsp)       # imm = 0x46B
callq 0x156d0
jmp 0x2bbbe
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2bc3d
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2bc2c
movq -0x38(%rbp), %rdi
imulq $0x2c8, -0x30(%rbp), %rax # imm = 0x2C8
addq %rax, %rdi
addq $0x8, %rdi
callq 0x3e100
movq -0x38(%rbp), %rdi
imulq $0x2c8, -0x30(%rbp), %rax # imm = 0x2C8
addq %rax, %rdi
addq $0x150, %rdi            # imm = 0x150
addq $0x18, %rdi
callq 0x3e100
movq -0x38(%rbp), %rax
imulq $0x2c8, -0x30(%rbp), %rcx # imm = 0x2C8
addq %rcx, %rax
movq (%rax), %rdi
callq 0x12290
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2bbc6
movq -0x38(%rbp), %rdi
callq 0x12290
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)