+/**
+ * Gets the index in the register pair array where the out register
+ * corresponds to reg_idx.
+ *
+ * @param pairs The array of register pairs
+ * @param n The number of pairs
+ * @param reg The register index to look for
+ *
+ * @return The corresponding index in pairs or -1 if not found
+ */
+static int get_pairidx_for_out_regidx(reg_pair_t *pairs, int n, unsigned reg_idx) {
+ int i;
+
+ for (i = 0; i < n; i++) {
+ /* out register matches */
+ if ((int) pairs[i].out_reg->index == reg_idx)
+ return i;
+ }