// File: /workspace/github_c_makefile_star2_O0/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
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)
movb $0x1, -0x31(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x6(%rax)
je 0x78c9b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x40(%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 0x78c44
jmp 0x78d56
testb $0x1, -0x31(%rbp)
jne 0x78c99
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x90, %rcx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %r8
callq 0x77010
movl %eax, -0x38(%rbp)
cmpl $-0x1, -0x38(%rbp)
jne 0x78c97
movq -0x40(%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 0x78c99
jmp 0x78c9b
movq -0x20(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x78cb3
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x78ccb
movq -0x20(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x78cc9
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x78ccb
cmpq $0x0, -0x50(%rbp)
je 0x78d0b
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
leaq -0x48(%rbp), %r8
movq $-0x1, %r9
movq %rax, (%rsp)
callq 0x77130
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x78d09
jmp 0x78d56
jmp 0x78d0b
movq -0x20(%rbp), %rax
testb $0x1, 0x6(%rax)
je 0x78d35
testb $0x1, -0x31(%rbp)
jne 0x78d35
movl -0x38(%rbp), %edx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7b7d0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)