// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_init_for_var
static char *prv_init_for_var(subtilis_parser_t *p, subtilis_token_t *t,
			      subtilis_for_context_t *for_ctx, bool *new_local,
			      subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_type_t type;
	char *var_name = NULL;

	type.type = SUBTILIS_TYPE_VOID;

	var_name = subtilis_parser_get_assignment_var(p, t, &type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	tbuf = subtilis_token_get_text(t);
	if (t->type != SUBTILIS_TOKEN_OPERATOR) {
		subtilis_error_set_assignment_op_expected(
		    err, tbuf, p->l->stream->name, p->l->line);
		goto cleanup;
	}

	if (!strcmp(tbuf, "(")) {
		prv_init_array_var(p, t, for_ctx, var_name, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	} else if (!strcmp(tbuf, "{")) {
		prv_init_vector_var(p, t, for_ctx, var_name, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	} else {
		if (!strcmp(tbuf, ":=")) {
			if (*new_local) {
				subtilis_error_set_expected(err, "=", tbuf,
							    p->l->stream->name,
							    p->l->line);
				goto cleanup;
			}
			*new_local = true;
		}

		prv_init_scalar_var(p, t, for_ctx, var_name, *new_local, &type,
				    err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	return var_name;

cleanup:
	subtilis_type_free(&type);
	free(var_name);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x188(%rbp)
movl $0x8, -0x180(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq -0x180(%rbp), %rdx
callq 0x1b590
movq %rax, -0x188(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2ad99
movq $0x0, -0x8(%rbp)
jmp 0x2af59
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
je 0x2adf6
movq -0x30(%rbp), %rdi
movq -0x38(%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 $0x14, %esi
leaq 0x8049d(%rip), %rcx     # 0xab276
leaq 0x7fbca(%rip), %rax     # 0xaa9aa
movq %rax, (%rsp)
movl $0x17b, 0x8(%rsp)       # imm = 0x17B
callq 0x156d0
jmp 0x2af39
movq -0x38(%rbp), %rdi
leaq 0x8049b(%rip), %rsi     # 0xab29c
callq 0x12140
cmpl $0x0, %eax
jne 0x2ae3a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x188(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x2af70
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2ae35
jmp 0x2af39
jmp 0x2af2c
movq -0x38(%rbp), %rdi
leaq 0x827c6(%rip), %rsi     # 0xad60b
callq 0x12140
cmpl $0x0, %eax
jne 0x2ae7e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x188(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x2b040
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2ae79
jmp 0x2af39
jmp 0x2af2a
movq -0x38(%rbp), %rdi
leaq 0x7fb3e(%rip), %rsi     # 0xaa9c7
callq 0x12140
cmpl $0x0, %eax
jne 0x2aee7
movq -0x28(%rbp), %rax
testb $0x1, (%rax)
je 0x2aee0
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x7f74e(%rip), %rdx     # 0xaa614
leaq 0x7fadd(%rip), %rax     # 0xaa9aa
movq %rax, (%rsp)
movl $0x18c, 0x8(%rsp)       # imm = 0x18C
callq 0x156d0
jmp 0x2af39
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x188(%rbp), %rcx
movq -0x28(%rbp), %rax
movb (%rax), %r8b
movq -0x30(%rbp), %rax
leaq -0x180(%rbp), %r9
andb $0x1, %r8b
movzbl %r8b, %r8d
movq %rax, (%rsp)
callq 0x2b110
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2af28
jmp 0x2af39
jmp 0x2af2a
jmp 0x2af2c
movq -0x188(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2af59
leaq -0x180(%rbp), %rdi
callq 0x3e100
movq -0x188(%rbp), %rdi
callq 0x12290
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)