// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_reg_alloc.c
// Function: prv_alloc_mul_instr
static void prv_alloc_mul_instr(void *user_data, subtilis_arm_op_t *op,
				subtilis_arm_instr_type_t type,
				subtilis_arm_mul_instr_t *instr,
				subtilis_error_t *err)
{
	size_t vreg_rm;
	bool fixed_reg_rm;
	size_t vreg_rs;
	bool fixed_reg_rs;
	int dist_rm = -1;
	int dist_rs = -1;
	subtilis_arm_reg_ud_t *ud = user_data;

	vreg_rm = instr->rm;
	fixed_reg_rm = subtilis_arm_reg_alloc_ensure(
	    ud, op, ud->int_regs, ud->int_regs, &instr->rm, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	vreg_rs = instr->rs;
	fixed_reg_rs = subtilis_arm_reg_alloc_ensure(
	    ud, op, ud->int_regs, ud->int_regs, &instr->rs, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (!fixed_reg_rm) {
		dist_rm = subtilis_arm_reg_alloc_calculate_dist(
		    ud, vreg_rm, op, &ud->int_regs->dist_walker, ud->int_regs);
		if (dist_rm == -1)
			ud->int_regs->phys_to_virt[instr->rm] = INT_MAX;
	}

	if (!fixed_reg_rs) {
		dist_rs = subtilis_arm_reg_alloc_calculate_dist(
		    ud, vreg_rs, op, &ud->int_regs->dist_walker, ud->int_regs);
		if (dist_rs == -1)
			ud->int_regs->phys_to_virt[instr->rs] = INT_MAX;
	}

	prv_allocate_dest_restricted(ud, op, &instr->dest, instr->rm, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (instr->dest == instr->rm) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	if (!fixed_reg_rm)
		ud->int_regs->next[instr->rm] = dist_rm;
	if (!fixed_reg_rs)
		ud->int_regs->next[instr->rs] = dist_rs;

	ud->instr_count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10(%rcx), %r13
movq 0x10(%rcx), %rbp
movq 0x8(%rdi), %rcx
movq %r13, %r8
movq %r14, %r9
callq 0x5315a
cmpl $0x0, (%r14)
jne 0x53ec8
leaq 0x18(%r15), %r8
movq 0x18(%r15), %rcx
movq %rcx, 0x20(%rsp)
movb %al, 0xf(%rsp)
movq 0x8(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r8, 0x18(%rsp)
movq %r14, %r9
callq 0x5315a
movb 0xf(%rsp), %cl
cmpl $0x0, (%r14)
jne 0x53ec8
movl %eax, %edx
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
jne 0x53df4
movq 0x8(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movl %edx, %ebp
movq %r12, %rdx
callq 0x52f08
movl %ebp, %edx
cmpl $-0x1, %eax
jne 0x53df4
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq (%r13), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %edx, %ebp
testb %dl, %dl
movl %eax, 0x14(%rsp)
jne 0x53e42
movq 0x8(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x52f08
movl %eax, 0x10(%rsp)
cmpl $-0x1, %eax
jne 0x53e42
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%r15), %rcx
addq $0x8, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %r8
callq 0x53378
cmpl $0x0, (%r14)
movb 0xf(%rsp), %cl
jne 0x53ec8
movq (%r13), %rax
cmpq %rax, (%r15)
jne 0x53e95
leaq 0x21d66(%rip), %rdx     # 0x75bdb
movq %r14, %rdi
movl $0xf, %esi
movl $0x491, %ecx            # imm = 0x491
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145f4
testb %cl, %cl
jne 0x53ea8
movq 0x8(%rbx), %rcx
movq 0x10(%rcx), %rcx
movl 0x14(%rsp), %edx
movl %edx, (%rcx,%rax,4)
testb %bpl, %bpl
jne 0x53ec4
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movl 0x10(%rsp), %edx
movl %edx, (%rax,%rcx,4)
incq 0x20(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq