// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_parse_stran
static void prv_parse_stran(subtilis_arm_ass_context_t *c,
			    subtilis_arm_instr_type_t itype,
			    subtilis_arm_ccode_type_t ccode,
			    const subtilis_arm_ass_modifiers_t *modifiers,
			    subtilis_error_t *err)
{
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t base;
	const char *tbuf;
	char buffer[32];

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

	if (modifiers->dword && (dest & 1)) {
		sprintf(buffer, "R%zu", dest);
		subtilis_error_set_ass_bad_reg(err, buffer, c->l->stream->name,
					       c->l->line);
		return;
	}

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

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

	tbuf = subtilis_token_get_text(c->t);
	if ((c->t->type != SUBTILIS_TOKEN_OPERATOR) || (strcmp(tbuf, "["))) {
		subtilis_error_set_expected(err, "[", tbuf, c->l->stream->name,
					    c->l->line);
		return;
	}

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

	tbuf = subtilis_token_get_text(c->t);
	if (c->t->type == SUBTILIS_TOKEN_OPERATOR) {
		if (!strcmp(tbuf, "]")) {
			prv_parse_stran_post(c, itype, ccode, dest, base,
					     modifiers, err);
			return;
		}
		if (!strcmp(tbuf, ",")) {
			prv_parse_stran_pre(c, itype, ccode, dest, base,
					    modifiers, err);
			return;
		}
	}

	subtilis_error_set_expected(err, ", or ]", tbuf, c->l->stream->name,
				    c->l->line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x94690
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x975f9
jmp 0x97889
movq -0x18(%rbp), %rax
testb $0x1, 0x4(%rax)
je 0x97670
movq -0x28(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x97670
leaq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x16199(%rip), %rsi     # 0xad7b9
movb $0x0, %al
callq 0x12250
movq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rdx
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 $0x58, %esi
leaq 0x13c23(%rip), %rcx     # 0xab276
leaq 0x16ac6(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x616, 0x8(%rsp)       # imm = 0x616
callq 0x156d0
jmp 0x97889
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x976a3
movq -0x38(%rbp), %rdi
leaq 0x12f10(%rip), %rsi     # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
je 0x976ec
movq -0x20(%rbp), %rdi
movq -0x38(%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 0x12eda(%rip), %rdx     # 0xaa5a9
leaq 0x16a4a(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x61d, 0x8(%rsp)       # imm = 0x61D
callq 0x156d0
jmp 0x97889
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x133f0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x97713
jmp 0x97889
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x97746
movq -0x38(%rbp), %rdi
leaq 0x12f1c(%rip), %rsi     # 0xaa658
callq 0x12140
cmpl $0x0, %eax
je 0x9778f
movq -0x20(%rbp), %rdi
movq -0x38(%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 0x12ee6(%rip), %rdx     # 0xaa658
leaq 0x169a7(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x628, 0x8(%rsp)       # imm = 0x628
callq 0x156d0
jmp 0x97889
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x94690
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x977ae
jmp 0x97889
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x97845
movq -0x38(%rbp), %rdi
leaq 0x16a74(%rip), %rsi     # 0xae24b
callq 0x12140
cmpl $0x0, %eax
jne 0x97809
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x18(%rbp), %r9
movq -0x20(%rbp), %rax
movq %rax, (%rsp)
callq 0x98b80
jmp 0x97889
movq -0x38(%rbp), %rdi
leaq 0x12d95(%rip), %rsi     # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
jne 0x97843
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x18(%rbp), %r9
movq -0x20(%rbp), %rax
movq %rax, (%rsp)
callq 0x98ee0
jmp 0x97889
jmp 0x97845
movq -0x20(%rbp), %rdi
movq -0x38(%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 0x169d5(%rip), %rdx     # 0xae246
leaq 0x168a8(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x63f, 0x8(%rsp)       # imm = 0x63F
callq 0x156d0
addq $0x70, %rsp
popq %rbp
retq
nop