This is a “Leica M5” with Elmar 50mm f2.8 Compur shutter, designed by Leitz in the early 60’s. Calling this an “M5 prototype” is misleading. If memory serves me correctly, this was Leica’s first attempt at a metered M, dating to the early 60’s while the M4 was on the drawing board but not yet produced, and long before any plans for the actual M5. In actuality, it’s a prototype M7.
Yes it’s ugly, and Leica might have tanked in short order had they been stupid enough to produce it, but it’s still an amazing bit of Leitz history. As for the two ‘rangefinder windows’, the second window appears to be to read the shutter speed of the Compur lens.