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

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