// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %r8
addq $0x10, %r8
movq -0x28(%rbp), %r9
callq 0x774b0
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x784a9
jmp 0x78645
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %r8
addq $0x18, %r8
movq -0x28(%rbp), %r9
callq 0x774b0
andb $0x1, %al
movb %al, -0x41(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x784f1
jmp 0x78645
testb $0x1, -0x31(%rbp)
jne 0x78546
movq -0x58(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x90, %rcx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %r8
callq 0x77010
movl %eax, -0x48(%rbp)
cmpl $-0x1, -0x48(%rbp)
jne 0x78544
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
jmp 0x78546
testb $0x1, -0x41(%rbp)
jne 0x7859b
movq -0x58(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x90, %rcx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %r8
callq 0x77010
movl %eax, -0x4c(%rbp)
cmpl $-0x1, -0x4c(%rbp)
jne 0x78599
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
jmp 0x7859b
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %r8
callq 0x77840
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x785c7
jmp 0x78645
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x785f5
movq -0x28(%rbp), %rdi
movl $0xf, %esi
leaq 0x345aa(%rip), %rdx     # 0xacb93
movl $0x491, %ecx            # imm = 0x491
callq 0x158e0
jmp 0x78645
testb $0x1, -0x31(%rbp)
jne 0x78615
movl -0x48(%rbp), %edx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
testb $0x1, -0x41(%rbp)
jne 0x78635
movl -0x4c(%rbp), %edx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)