// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_reg_alloc.c
// Function: prv_alloc_br_instr
static void prv_alloc_br_instr(void *user_data, subtilis_arm_op_t *op,
			       subtilis_arm_instr_type_t type,
			       subtilis_arm_br_instr_t *instr,
			       subtilis_error_t *err)
{
	size_t vreg_op1;
	bool fixed_reg_op1 = true;
	int dist_op1 = -1;
	subtilis_arm_reg_ud_t *ud = user_data;
	size_t reg = 0;
	subtilis_arm_reg_class_t *regs = NULL;

	if (instr->indirect) {
		vreg_op1 = instr->target.reg;
		fixed_reg_op1 = subtilis_arm_reg_alloc_ensure(
		    ud, op, ud->int_regs, ud->int_regs, &instr->target.reg,
		    err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		if (!fixed_reg_op1) {
			dist_op1 = subtilis_arm_reg_alloc_calculate_dist(
			    ud, vreg_op1, op, &ud->int_regs->dist_walker,
			    ud->int_regs);
			if (dist_op1 == -1)
				ud->int_regs->phys_to_virt[instr->target.reg] =
				    INT_MAX;
		}
	}

	/*
	 * We need to make sure that F0 or R0 are marked as being
	 * allocated when we return from a function.  Otherwise we
	 * can get an assertion when we ensure them later in the code.
	 */

	if (instr->link_type == SUBTILIS_ARM_BR_LINK_INT)
		regs = ud->int_regs;
	else if (instr->link_type == SUBTILIS_ARM_BR_LINK_REAL)
		regs = ud->real_regs;

	if (regs) {
		subtilis_arm_reg_alloc_alloc(ud, op, ud->int_regs, regs, &reg,
					     SIZE_MAX, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}

	if (instr->indirect && !fixed_reg_op1)
		ud->int_regs->next[instr->target.reg] = dist_op1;

	ud->instr_count++;

	prv_check_current_ss(ud, op, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r12
movq %rsi, %r9
movq %rdi, %r15
movq $0x0, 0x20(%rsp)
movb $0x1, %bpl
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
cmpb $0x1, 0x6(%rcx)
jne 0x5437f
leaq 0x10(%r12), %r14
movq 0x10(%r12), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%r15), %rcx
movq %r15, %rdi
movq %r9, %rsi
movq %r14, %r8
movq %r9, %r13
movq %rbx, %r9
callq 0x5315a
cmpl $0x0, (%rbx)
jne 0x543cd
movq %r13, %r9
movl %eax, %ebp
movq 0x18(%rsp), %rsi
testb %al, %al
jne 0x5437f
movq 0x8(%r15), %r8
leaq 0x90(%r8), %rcx
movq %r15, %rdi
movq %r9, %rdx
callq 0x52f08
cmpl $-0x1, %eax
je 0x54369
movl %eax, 0x14(%rsp)
jmp 0x5437c
movq 0x8(%r15), %rax
movq 0x8(%rax), %rax
movq (%r14), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movq %r13, %r9
movl 0x8(%r12), %eax
cmpl $0x1, %eax
je 0x54395
cmpl $0x2, %eax
jne 0x543a0
movl $0x10, %eax
jmp 0x5439a
movl $0x8, %eax
movq (%r15,%rax), %rcx
jmp 0x543a2
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x543dc
movq %rbx, (%rsp)
leaq 0x20(%rsp), %r8
movq %r15, %rdi
movq %r9, %rsi
movq %r9, %r14
movq $-0x1, %r9
callq 0x52fb3
movq %r14, %r9
cmpl $0x0, (%rbx)
je 0x543dc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb 0x6(%r12), %al
xorb $0x1, %al
orb %al, %bpl
jne 0x543fc
movq 0x8(%r15), %rax
movq 0x10(%rax), %rax
movq 0x10(%r12), %rcx
movl 0x14(%rsp), %edx
movl %edx, (%rax,%rcx,4)
incq 0x20(%r15)
movq %r15, %rdi
movq %r9, %rsi
movq %rbx, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x55d8a