// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_parse_for
static void prv_parse_for(subtilis_arm_ass_context_t *c, subtilis_error_t *err)
{
	size_t var;
	const char *tbuf;
	subtilis_arm_exp_val_t *index_var;
	subtilis_arm_exp_val_t *upto = NULL;

	prv_parse_def(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	var = c->def_count - 1;
	index_var = c->defs[var].val;

	if ((index_var->type != SUBTILIS_ARM_EXP_TYPE_INT) &&
	    (index_var->type != SUBTILIS_ARM_EXP_TYPE_REAL) &&
	    (index_var->type != SUBTILIS_ARM_EXP_TYPE_FREG) &&
	    (index_var->type != SUBTILIS_ARM_EXP_TYPE_REG)) {
		subtilis_error_set_expected(
		    err, "numeric", subtilis_arm_exp_type_name(index_var),
		    c->l->stream->name, c->l->line);
		return;
	}

	tbuf = subtilis_token_get_text(c->t);
	if ((c->t->type != SUBTILIS_TOKEN_KEYWORD) ||
	    (c->t->tok.keyword.type != SUBTILIS_ARM_KEYWORD_TO)) {
		subtilis_error_set_expected(err, "TO", tbuf, c->l->stream->name,
					    c->l->line);
		return;
	}

	upto = subtilis_arm_exp_val_get(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (index_var->type != upto->type) {
		switch (index_var->type) {
		case SUBTILIS_ARM_EXP_TYPE_INT:
			if (upto->type != SUBTILIS_ARM_EXP_TYPE_REAL) {
				subtilis_error_set_expected(
				    err, "numeric",
				    subtilis_arm_exp_type_name(upto),
				    c->l->stream->name, c->l->line);
				goto cleanup;
			}
			index_var->type = SUBTILIS_ARM_EXP_TYPE_REAL;
			index_var->val.real = (double)index_var->val.integer;
			break;
		case SUBTILIS_ARM_EXP_TYPE_REAL:
			if (upto->type != SUBTILIS_ARM_EXP_TYPE_INT) {
				subtilis_error_set_expected(
				    err, "numeric",
				    subtilis_arm_exp_type_name(upto),
				    c->l->stream->name, c->l->line);
				goto cleanup;
			}
			upto->type = SUBTILIS_ARM_EXP_TYPE_REAL;
			upto->val.real = (double)upto->val.integer;
			break;
		default:
			subtilis_error_set_bad_conversion(
			    err, subtilis_arm_exp_type_name(index_var),
			    subtilis_arm_exp_type_name(upto),
			    c->l->stream->name, c->l->line);
			goto cleanup;
		}
	}

	if (c->num_blocks == c->max_blocks) {
		if (c->blocks) {
			subtilis_error_set_too_many_blocks(
			    err, c->l->stream->name, c->l->line);
			goto cleanup;
		}
		c->blocks = malloc(sizeof(*c->blocks) * 32);
		if (!c->blocks) {
			subtilis_error_set_oom(err);
			goto cleanup;
		}
		c->max_blocks = 32;
	}
	c->blocks[c->num_blocks].def_start = var;
	c->blocks[c->num_blocks].upto = upto;
	c->num_blocks++;

	subtilis_lexer_push_block(c->l, c->t, err);
	return;

cleanup:

	subtilis_arm_exp_val_free(upto);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x91f30
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x92733
jmp 0x92b1b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
subq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x6, (%rax)
je 0x927db
movq -0x28(%rbp), %rax
cmpl $0x7, (%rax)
je 0x927db
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x927db
movq -0x28(%rbp), %rax
cmpl $0x1, (%rax)
je 0x927db
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x9b550
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x1b9a0(%rip), %rdx     # 0xae15e
leaq 0x1b95b(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0xfdf, 0x8(%rsp)       # imm = 0xFDF
callq 0x156d0
jmp 0x92b1b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x1, (%rax)
jne 0x92807
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x25, 0x8(%rax)
je 0x92850
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x179aa(%rip), %rdx     # 0xaa1dd
leaq 0x1b8e6(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0xfe7, 0x8(%rsp)       # imm = 0xFE7
callq 0x156d0
jmp 0x92b1b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9b4f0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9286f
jmp 0x92b1b
movq -0x28(%rbp), %rax
movl (%rax), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
je 0x92a0a
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x6, %eax
je 0x928a2
jmp 0x92891
movl -0x3c(%rbp), %eax
subl $0x7, %eax
je 0x92925
jmp 0x929a5
movq -0x30(%rbp), %rax
cmpl $0x7, (%rax)
je 0x92904
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9b550
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x1b877(%rip), %rdx     # 0xae15e
leaq 0x1b832(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0xff6, 0x8(%rsp)       # imm = 0xFF6
callq 0x156d0
jmp 0x92b12
movq -0x28(%rbp), %rax
movl $0x7, (%rax)
movq -0x28(%rbp), %rax
cvtsi2sdl 0x8(%rax), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x92a08
movq -0x30(%rbp), %rax
cmpl $0x6, (%rax)
je 0x92987
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9b550
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x1b7f4(%rip), %rdx     # 0xae15e
leaq 0x1b7af(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x1001, 0x8(%rsp)      # imm = 0x1001
callq 0x156d0
jmp 0x92b12
movq -0x30(%rbp), %rax
movl $0x7, (%rax)
movq -0x30(%rbp), %rax
cvtsi2sdl 0x8(%rax), %xmm0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x92a08
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rdi
callq 0x9b550
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9b550
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x45, %esi
leaq 0x1b72e(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x100b, 0x8(%rsp)      # imm = 0x100B
callq 0x156d0
jmp 0x92b12
jmp 0x92a0a
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x78(%rcx), %rax
jne 0x92aaa
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x92a62
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %ecx
movl $0x40, %esi
leaq 0x1b6ce(%rip), %r8      # 0xae120
movl $0x1013, %r9d           # imm = 0x1013
callq 0x15930
jmp 0x92b12
movl $0x200, %edi            # imm = 0x200
callq 0x121b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x92a9e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x1b68e(%rip), %rdx     # 0xae120
movl $0x1018, %ecx           # imm = 0x1018
callq 0x158e0
jmp 0x92b12
movq -0x8(%rbp), %rax
movq $0x20, 0x78(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x70(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x70(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0x13180
jmp 0x92b1b
movq -0x30(%rbp), %rdi
callq 0x9a4c0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)