Octeon branches (bbit0/bbit032/bbit1/bbit132) have an immediate operand, so it is legal to have such replacement within MipsBranchExpansion::replaceBranch().
According to the specification, a branch (e.g. bbit0 ) looks like:
bbit0 rs p offset // p is an immediate operand if !rs<p> then branch
Without this patch, an assertion triggers in the method, and the problem has been found in the real example.
This might be more cleanly expressed as a switch statement over the kind of operand, e.g.
What do you think? You'll also move line 360 into the loop.