// File: /workspace/github_c_makefile_star2_O1/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, 0x10(%rsp)
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 0x12eda
cmpl $0x0, (%r15)
je 0x6816f
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), %r14
cmpl $0x2, (%r14)
jne 0x68199
leaq 0xb40f(%rip), %rsi      # 0x73598
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x6829a
leal -0x83(%r13), %eax
cmpl $0x1, %eax
ja 0x68236
movq %r14, %rdi
callq 0x12ad0
movq 0x10(%rbx), %r14
cmpl $0x2, (%r14)
jne 0x681d2
leaq 0xb2f7(%rip), %rsi      # 0x734b9
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x68303
xorl %r14d, %r14d
movq (%rbx), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x4f73a
cmpl $0x0, (%r15)
jne 0x68160
movq %rax, %rbx
leaq 0x8(%rax), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x68e52
cmpl $0x0, (%r15)
jne 0x68160
movl %ebp, 0xc(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 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)
movb %r14b, 0x31(%rbx)
movb %al, 0x32(%rbx)
jmp 0x68160
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 0x50(%rsp), %rcx
movq 0x58(%rsp), %r8
callq 0x689c9
addq $0x88, %rsp
jmp 0x68164
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12eda
cmpl $0x0, (%r15)
jne 0x68160
leaq 0xf(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x68aa3
cmpl $0x0, (%r15)
jne 0x68160
movq %rax, %r14
leal -0x83(%r13), %eax
cmpl $0x1, %eax
ja 0x68324
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
movq %r12, %r9
pushq %r15
pushq %r14
callq 0x68b4a
addq $0x58, %rsp
jmp 0x68164
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12eda
cmpl $0x0, (%r15)
jne 0x68160
movb $0x1, %r14b
jmp 0x681d5
movq 0x10(%rbx), %rdi
callq 0x12ad0
movl (%r14), %ecx
cmpl $0x1, %ecx
je 0x68362
cmpl $0x6, %ecx
jne 0x683f2
leaq 0x20(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %r8
callq 0x68c94
cmpl $0x0, (%r15)
jne 0x6842f
jmp 0x68393
movq 0x10(%rbx), %rcx
cmpl $0x2, (%rcx)
jne 0x68382
leaq 0xb226(%rip), %rsi      # 0x73598
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x68445
movq 0x8(%r14), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x20(%rsp)
movq (%rbx), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x4f73a
cmpl $0x0, (%r15)
jne 0x6842f
movl %ebp, 0x8(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 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 0x6842f
movq %r14, %rdi
callq 0x69abf
movq 0x8(%rbx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xe903(%rip), %r10      # 0x76d10
leaq 0xe9ec(%rip), %rdx      # 0x76e00
movq %r15, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x5ee                  # imm = 0x5EE
pushq %r10
callq 0x1442a
addq $0x10, %rsp
movq %r14, %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x69167
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x68ce9
jmp 0x68356