Module IndexedMreg <: INDEXED_TYPE.
Definition t := mreg.
Definition eq := mreg_eq.
Definition index (r: mreg): positive :=
match r with
| R3 => 1  | R4 => 2  | R5 => 3  | R6 => 4
| R7 => 5  | R8 => 6  | R9 => 7  | R10 => 8
| R11 => 9 | R12 => 10
| R14 => 11 | R15 => 12 | R16 => 13
| R17 => 14 | R18 => 15 | R19 => 16 | R20 => 17
| R21 => 18 | R22 => 19 | R23 => 20 | R24 => 21
| R25 => 22 | R26 => 23 | R27 => 24 | R28 => 25
| R29 => 26 | R30 => 27 | R31 => 28
| F0 => 29
| F1 => 30  | F2 => 31  | F3 => 32  | F4 => 33
| F5 => 34  | F6 => 35  | F7 => 36  | F8 => 37
| F9 => 38  | F10 => 39 | F11 => 40 | F12 => 41
| F13 => 42 | F14 => 43 | F15 => 44
| F16 => 45 | F17 => 46 | F18 => 47 | F19 => 48
| F20 => 49 | F21 => 50 | F22 => 51 | F23 => 52
| F24 => 53 | F25 => 54 | F26 => 55 | F27 => 56
| F28 => 57 | F29 => 58 | F30 => 59 | F31 => 60
end.

Lemma index_inj:
forall r1 r2, index r1 = index r2 -> r1 = r2.