// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_stran_misc_post
static void prv_stran_misc_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_arm_exp_val_t *val,
				subtilis_error_t *err)
/* clang-format on */
{
	int8_t int_offset;
	subtilis_arm_instr_t *instr;
	subtilis_arm_stran_misc_instr_t *stran_misc;
	subtilis_arm_reg_t reg;
	bool reg_offset;
	bool subtract = false;

	if (val->type == SUBTILIS_ARM_EXP_TYPE_INT) {
		prv_parse_stran_misc_int_offset(c, val, &int_offset, &subtract,
						err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		reg_offset = false;
	} else if (val->type == SUBTILIS_ARM_EXP_TYPE_REG) {
		reg_offset = true;
		reg = val->val.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_misc = &instr->operands.stran_misc;

	prv_stran_misc_set_type(stran_misc, modifiers, err);
	if (err->type)
		goto cleanup;

	stran_misc->ccode = ccode;
	stran_misc->dest = dest;
	stran_misc->base = base;
	stran_misc->reg_offset = reg_offset;
	if (reg_offset)
		stran_misc->offset.reg = reg;
	else
		stran_misc->offset.imm = int_offset;
	stran_misc->pre_indexed = false;
	stran_misc->write_back = true;
	stran_misc->subtract = subtract;

cleanup:

	subtilis_arm_exp_val_free(val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movb $0x0, -0x4a(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x99680
movq -0x8(%rbp), %rdi
movq 0x10(%rbp), %rsi
movq 0x18(%rbp), %r8
leaq -0x29(%rbp), %rdx
leaq -0x4a(%rbp), %rcx
callq 0x99a30
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9967a
jmp 0x997ad
movb $0x0, -0x49(%rbp)
jmp 0x996f6
movq 0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x9969b
movb $0x1, -0x49(%rbp)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x996f4
movq 0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq 0x10(%rbp), %rdi
callq 0x9b550
movq -0x58(%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 0x14b40(%rip), %rdx     # 0xae217
leaq 0x14a42(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0x58b, 0x8(%rsp)       # imm = 0x58B
callq 0x156d0
jmp 0x997ad
jmp 0x996f6
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movq 0x18(%rbp), %rdx
callq 0x70b50
movq %rax, -0x38(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9971b
jmp 0x997ad
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x99990
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x99743
jmp 0x997ad
movl -0x10(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movb -0x49(%rbp), %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x18(%rax)
testb $0x1, -0x49(%rbp)
je 0x99786
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x99790
movb -0x29(%rbp), %cl
movq -0x40(%rbp), %rax
movb %cl, 0x20(%rax)
movq -0x40(%rbp), %rax
movb $0x0, 0x28(%rax)
movq -0x40(%rbp), %rax
movb $0x1, 0x29(%rax)
movb -0x4a(%rbp), %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x2a(%rax)
movq 0x10(%rbp), %rdi
callq 0x9a4c0
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)