// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_parse_stran_post
static void prv_parse_stran_post(subtilis_arm_ass_context_t *c,
				 subtilis_arm_instr_type_t itype,
				 subtilis_arm_ccode_type_t ccode,
				 subtilis_arm_reg_t dest,
				 subtilis_arm_reg_t base,
				 const subtilis_arm_ass_modifiers_t *modifiers,
				 subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_arm_exp_val_t *val;
	subtilis_arm_op2_t offset;
	subtilis_arm_instr_t *instr;
	subtilis_arm_stran_instr_t *stran;
	bool subtract = false;

	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, ","))) {
		if (itype == SUBTILIS_ARM_STRAN_MISC_LDR ||
		    itype == SUBTILIS_ARM_STRAN_MISC_STR) {
			prv_stran_misc_zero(c, itype, ccode, dest, modifiers,
					    base, err);
		} else {
			offset.type = SUBTILIS_ARM_OP2_I32;
			offset.op.integer = 0;
			prv_parse_stran_pre_off(c, itype, ccode, dest, base,
						modifiers->byte, offset, false,
						err);
		}
		return;
	}

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

	val = prv_get_offset(c, &subtract, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (itype == SUBTILIS_ARM_STRAN_MISC_LDR ||
	    itype == SUBTILIS_ARM_STRAN_MISC_STR) {
		prv_stran_misc_post(c, itype, ccode, dest, base, modifiers, val,
				    err);
		return;
	}

	tbuf = subtilis_token_get_text(c->t);
	if (val->type == SUBTILIS_ARM_EXP_TYPE_INT) {
		prv_parse_int_offset(c, val, &offset, &subtract, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	} else if (val->type == SUBTILIS_ARM_EXP_TYPE_REG) {
		if ((c->t->type == SUBTILIS_TOKEN_OPERATOR) &&
		    !strcmp(tbuf, ",")) {
			prv_parse_shift_offset(c, val, &offset, err);
			if (err->type != SUBTILIS_ERROR_OK)
				goto cleanup;
		} else {
			offset.op.reg = val->val.reg;
			offset.type = SUBTILIS_ARM_OP2_REG;
		}
	} else {
		subtilis_error_set_expected(err, "integer or register",
					    subtilis_arm_exp_type_name(val),
					    c->l->stream->name, c->l->line);
		goto cleanup;
	}

	instr = subtilis_arm_section_add_instr(c->arm_s, itype, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	stran = &instr->operands.stran;
	stran->ccode = ccode;
	stran->dest = dest;
	stran->base = base;
	stran->offset = offset;
	stran->pre_indexed = false;
	stran->write_back = true;
	stran->byte = modifiers->byte;
	stran->subtract = subtract;

cleanup:

	subtilis_arm_exp_val_free(val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r12
movq %r8, 0x18(%rsp)
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %rbx
movq 0x80(%rsp), %r15
movb $0x0, 0xf(%rsp)
movq 0x8(%rdi), %rdi
movq 0x10(%rbx), %rsi
movq %r15, %rdx
callq 0x12edc
cmpl $0x0, (%r15)
je 0x67ded
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rdi
callq 0x12ad0
movq 0x10(%rbx), %rsi
cmpl $0x2, (%rsi)
jne 0x67e0e
cmpb $0x2c, (%rax)
jne 0x67e0e
cmpb $0x0, 0x1(%rax)
je 0x67f03
leal -0x83(%r13), %eax
cmpl $0x1, %eax
ja 0x67ea1
movq %rsi, %rdi
callq 0x12ad0
movq 0x10(%rbx), %rsi
cmpl $0x2, (%rsi)
jne 0x67e3e
cmpb $0x21, (%rax)
jne 0x67e3e
cmpb $0x0, 0x1(%rax)
je 0x67f63
movl $0x0, 0x10(%rsp)
movq (%rbx), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x4f6e2
cmpl $0x0, (%r15)
jne 0x67dde
movq %rax, %rbx
leaq 0x8(%rax), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x68a2a
cmpl $0x0, (%r15)
jne 0x67dde
movl %ebp, 0xc(%rbx)
movq %r14, 0x10(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rbx)
xorl %eax, %eax
movb %al, 0x20(%rbx)
movb %al, 0x28(%rbx)
movb $0x1, 0x30(%rbx)
movl 0x10(%rsp), %ecx
movb %cl, 0x31(%rbx)
movb %al, 0x32(%rbx)
jmp 0x67dde
movl $0x1, 0x20(%rsp)
xorl %eax, %eax
movl %eax, 0x28(%rsp)
movzbl 0x1(%r12), %r9d
subq $0x40, %rsp
movq 0x80(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x60(%rsp), %xmm0
movups 0x70(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, 0x30(%rsp)
movl %eax, 0x28(%rsp)
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
movq %r14, %rcx
movq 0x58(%rsp), %r8
callq 0x685d5
addq $0x88, %rsp
jmp 0x67de2
movq 0x8(%rbx), %rdi
movq %r15, %rdx
callq 0x12edc
cmpl $0x0, (%r15)
jne 0x67dde
leaq 0xf(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x6869e
cmpl $0x0, (%r15)
jne 0x67dde
leal -0x83(%r13), %ecx
cmpl $0x1, %ecx
ja 0x67f84
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
movq %r14, %rcx
movq 0x18(%rsp), %r8
movq %r12, %r9
pushq %r15
pushq %rax
callq 0x68726
addq $0x58, %rsp
jmp 0x67de2
movq 0x8(%rbx), %rdi
movq %r15, %rdx
callq 0x12edc
cmpl $0x0, (%r15)
jne 0x67dde
movb $0x1, %al
movl %eax, 0x10(%rsp)
jmp 0x67e46
movq 0x10(%rbx), %rdi
movq %rax, 0x10(%rsp)
callq 0x12ad0
movq 0x10(%rsp), %rsi
movl (%rsi), %ecx
cmpl $0x1, %ecx
je 0x67fc8
cmpl $0x6, %ecx
jne 0x68047
leaq 0x20(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %r8
callq 0x68870
cmpl $0x0, (%r15)
jne 0x68084
jmp 0x67ff1
movq 0x10(%rbx), %rcx
cmpl $0x2, (%rcx)
jne 0x67fe0
cmpb $0x2c, (%rax)
jne 0x67fe0
cmpb $0x0, 0x1(%rax)
je 0x6809c
movq 0x8(%rsi), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x20(%rsp)
movq (%rbx), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x4f6e2
cmpl $0x0, (%r15)
jne 0x68084
movl %ebp, 0x8(%rax)
movq %r14, 0x10(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x18(%rax)
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movups %xmm0, 0x20(%rax)
movups %xmm1, 0x30(%rax)
movq 0x40(%rsp), %rcx
movq %rcx, 0x40(%rax)
movw $0x100, 0x48(%rax)      # imm = 0x100
movb 0x1(%r12), %cl
movb %cl, 0x4b(%rax)
movb 0xf(%rsp), %cl
movb %cl, 0x4a(%rax)
jmp 0x68084
movq %rsi, %rdi
callq 0x6966d
movq 0x8(%rbx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xed0e(%rip), %r10      # 0x76d70
leaq 0xedf9(%rip), %rdx      # 0x76e62
movq %r15, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x5ee                  # imm = 0x5EE
pushq %r10
callq 0x143da
addq $0x10, %rsp
movq 0x10(%rsp), %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x68d41
movq 0x8(%rsi), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rcx
callq 0x688c5
jmp 0x67fbc