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

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