--  Rotations and shifts of every modular width, by every amount from 0 to the width, whose
--  assertions hold in the code as in the proof (the run without proof checks each one), and
--  whose sum the run prints.
with Ada.Text_IO;
with Interfaces; use Interfaces;
procedure Main is
   B : constant Unsigned_8 := 2#1001_0110#;
   H : constant Unsigned_16 := 16#B00F#;
   W : constant Unsigned_32 := 16#DEAD_BEEF#;
   D : constant Unsigned_64 := 16#F00D_CAFE_DEAD_BEEF#;
   Sum : Unsigned_64 := 0;
begin
   for K in 0 .. 8 loop
      pragma Assert (Rotate_Right (Rotate_Left (B, K), K) = B);
      pragma Assert (Shift_Left (Shift_Right (B, K), K) = (B and Shift_Left (16#FF#, K)));
      Sum := Sum + Unsigned_64 (Rotate_Left (B, K)) + Unsigned_64 (Shift_Right (B, K));
   end loop;
   for K in 0 .. 16 loop
      pragma Assert (Rotate_Right (Rotate_Left (H, K), K) = H);
      Sum := Sum + Unsigned_64 (Rotate_Right (H, K)) + Unsigned_64 (Shift_Right (H, K));
   end loop;
   for K in 0 .. 32 loop
      Sum := Sum + Unsigned_64 (Rotate_Left (W, K)) + Unsigned_64 (Shift_Right (W, K));
   end loop;
   for K in 0 .. 64 loop
      Sum := Sum + Rotate_Left (D, K) + Shift_Right (D, K);
   end loop;
   Ada.Text_IO.Put_Line (Unsigned_64'Image (Sum) & Unsigned_8'Image (Rotate_Left (B, 3)) & Unsigned_16'Image (Rotate_Right (H, 4)));
end Main;
