// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r13
movl %esi, %r12d
movq %rdi, %r14
movq 0x68(%rsp), %r15
movq 0x60(%rsp), %rbx
movb $0x0, 0xa(%rsp)
movl (%rbx), %ebp
cmpl $0x6, %ebp
je 0x68b99
cmpl $0x1, %ebp
jne 0x68c28
movl %edx, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %r8, 0x18(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x20(%rsp)
jmp 0x68bc9
movl %edx, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %r8, 0x18(%rsp)
leaq 0xb(%rsp), %rdx
leaq 0xa(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %r8
callq 0x68ea6
cmpl $0x0, (%r15)
jne 0x68c65
movq (%r14), %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x4f73a
cmpl $0x0, (%r15)
jne 0x68c65
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x68e52
cmpl $0x0, (%r15)
jne 0x68c65
movl 0xc(%rsp), %eax
movl %eax, 0xc(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x18(%r14)
cmpl $0x6, %ebp
setne 0x20(%r14)
je 0x68c7b
movq 0x20(%rsp), %rax
movq %rax, 0x28(%r14)
jmp 0x68c83
movq %rbx, %rdi
callq 0x69abf
movq 0x8(%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xe0cd(%rip), %r10      # 0x76d10
leaq 0xe1b6(%rip), %rdx      # 0x76e00
movq %r15, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x58b                  # imm = 0x58B
pushq %r10
callq 0x1442a
addq $0x10, %rsp
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x69167
movb 0xb(%rsp), %al
movb %al, 0x28(%r14)
movw $0x100, 0x30(%r14)      # imm = 0x100
movb 0xa(%rsp), %al
movb %al, 0x32(%r14)
jmp 0x68c65