
-- 1: --------------------------------
-- 2: -- Ivan Levashew aka OCTAGRAM --
-- 3: --              Barnaul, 2010 --
-- 4: --------------------------------

-- 5:
-- 6: -- Turbo_Private.Bits, 32bit version

-- 7:

-- 8: with System, Interfaces, System.Storage_Elements;
with system;
with system;
with interfaces;
with system.system__storage_elements;
with system;

-- 9:

-- 10: package body Turbo_Private.Bits is
package body turbo_private.turbo_private__bits is

-- 11:
-- 12:    ---------
-- 13:    -- "+" --
-- 14:    ---------

-- 15:

-- 16:    function "+" (Item : Integer_Addr) return System.Storage_Elements.Storage_Offset is
   function turbo_private__bits__Oadd (item :
     turbo_private__bits__integer_addr) return system.
     system__storage_elements.system__storage_elements__storage_offset is

-- 17:    begin
   begin

-- 18:       return System.Storage_Elements.Storage_Offset (Item);
      null;
      null;
      return system.system__storage_elements.
        system__storage_elements__storage_offset(item);

-- 19:    end "+";
   end turbo_private__bits__Oadd;

-- 20:
-- 21:    ---------
-- 22:    -- "+" --
-- 23:    ---------

-- 24:

-- 25:    function "+" (Item : System.Storage_Elements.Storage_Offset) return Integer_Addr is
   function turbo_private__bits__Oadd (item : system.
     system__storage_elements.system__storage_elements__storage_offset)
     return turbo_private__bits__integer_addr is

-- 26:    begin
   begin

-- 27:       return Integer_Addr (Item);
      null;
      null;
      return turbo_private__bits__integer_addr(item);

-- 28:    end "+";
   end turbo_private__bits__Oadd;

-- 29:
-- 30:    ---------
-- 31:    -- "+" --
-- 32:    ---------

-- 33:

-- 34:    function "+" (Item : Unsigned_Addr) return System.Address is
   function turbo_private__bits__Oadd (item :
     turbo_private__bits__unsigned_addr) return system.system__address is

-- 35:    begin
   begin

-- 36:       return System.Storage_Elements.To_Address
      return system__address!(system.system__storage_elements.
        system__storage_elements__integer_address(item));
   end turbo_private__bits__Oadd;

-- 37:          (System.Storage_Elements.Integer_Address (Item));

-- 38:    end "+";

-- 39:
-- 40:    ---------
-- 41:    -- "+" --
-- 42:    ---------

-- 43:

-- 44:    function "+" (Item : System.Address) return Unsigned_Addr is
   function turbo_private__bits__Oadd (item : system.system__address)
     return turbo_private__bits__unsigned_addr is

-- 45:    begin
   begin

-- 46:       return Unsigned_Addr (System.Storage_Elements.To_Integer (Item));
      null;
      return turbo_private__bits__unsigned_addr(
        system__storage_elements__integer_address(item));

-- 47:    end "+";
   end turbo_private__bits__Oadd;

-- 48:
-- 49:    ---------
-- 50:    -- "+" --
-- 51:    ---------

-- 52:

-- 53:    function "+" (Item : Unsigned_Addr) return System.Storage_Elements.Integer_Address is
   function turbo_private__bits__Oadd (item :
     turbo_private__bits__unsigned_addr) return system.
     system__storage_elements.system__storage_elements__integer_address is

-- 54:    begin
   begin

-- 55:       return System.Storage_Elements.Integer_Address (Item);
      return system.system__storage_elements.
        system__storage_elements__integer_address(item);

-- 56:    end "+";
   end turbo_private__bits__Oadd;

-- 57:
-- 58:    ---------
-- 59:    -- "+" --
-- 60:    ---------

-- 61:

-- 62:    function "+" (Item : System.Storage_Elements.Integer_Address) return Unsigned_Addr is
   function turbo_private__bits__Oadd (item : system.
     system__storage_elements.system__storage_elements__integer_address)
     return turbo_private__bits__unsigned_addr is

-- 63:    begin
   begin

-- 64:       return Unsigned_Addr (Item);
      return turbo_private__bits__unsigned_addr(item);

-- 65:    end "+";
   end turbo_private__bits__Oadd;

-- 66:
-- 67:    ---------
-- 68:    -- "+" --
-- 69:    ---------

-- 70:

-- 71:    function "+" (Left : System.Address; Right : Integer_Addr)
   function turbo_private__bits__Oadd__11 (left : system.
     system__address; right : turbo_private__bits__integer_addr)
     return system.system__address is
   begin

-- 72:      return System.Address

-- 73:    is

-- 74:    begin

-- 75:       return System.Storage_Elements."+" (Left, +Right);
      null;
      R11b : constant system__storage_elements__storage_offset :=
        turbo_private__bits__Oadd (right);
      null;
      C12b : system__address;
      B14b : declare
      begin
         null;
         C18b : constant system__address := system__address!(
           system__storage_elements__to_addressGP2750__sourceXn(R11b));
         null;
         C12b := system__address!(
           system__storage_elements__integer_address(left) +
           system__storage_elements__integer_address(C18b));

-- 76:    end "+";
      end B14b;
      return C12b;
   end turbo_private__bits__Oadd__11;

-- 77:
-- 78:    ---------
-- 79:    -- "+" --
-- 80:    ---------

-- 81:

-- 82:    function "+" (Left : Integer_Addr; Right : System.Address)
   function turbo_private__bits__Oadd__12 (left :
     turbo_private__bits__integer_addr; right : system.system__address)
     return system.system__address is
   begin

-- 83:      return System.Address is

-- 84:    begin

-- 85:       return System.Storage_Elements."+" (+Left, Right);
      null;
      R23b : constant system__storage_elements__storage_offset :=
        turbo_private__bits__Oadd (left);
      null;
      C24b : system__address;
      B26b : declare
      begin
         C27b : constant system__address := system__address!(
           system__storage_elements__to_addressGP2750__sourceXn(R23b));
         null;
         null;
         C24b := system__address!(
           system__storage_elements__integer_address(C27b) +
           system__storage_elements__integer_address(right));

-- 86:    end "+";
      end B26b;
      return C24b;
   end turbo_private__bits__Oadd__12;

-- 87:
-- 88:    ---------
-- 89:    -- "-" --
-- 90:    ---------

-- 91:

-- 92:    function "-" (Left : System.Address; Right : Integer_Addr)
   function turbo_private__bits__Osubtract__3 (left : system.
     system__address; right : turbo_private__bits__integer_addr)
     return system.system__address is
   begin

-- 93:      return System.Address is

-- 94:    begin

-- 95:       return System.Storage_Elements."-" (Left, +Right);
      null;
      R35b : constant system__storage_elements__storage_offset :=
        turbo_private__bits__Oadd (right);
      null;
      C36b : system__address;
      B38b : declare
      begin
         null;
         C42b : constant system__address := system__address!(
           system__storage_elements__to_addressGP2750__sourceXn(R35b));
         null;
         C36b := system__address!(
           system__storage_elements__integer_address(left) -
           system__storage_elements__integer_address(C42b));

-- 96:    end "-";
      end B38b;
      return C36b;
   end turbo_private__bits__Osubtract__3;

-- 97:
-- 98:    ---------
-- 99:    -- "-" --
-- 100:    ---------

-- 101:

-- 102:    function "-" (Left, Right : System.Address)
   function turbo_private__bits__Osubtract__4 (left : system.
     system__address; right : system.system__address) return
     turbo_private__bits__integer_addr is
   begin
      C47b : system__storage_elements__storage_offset;

-- 103:      return Integer_Addr is

-- 104:    begin

-- 105:       return +System.Storage_Elements."-" (Left, Right);
      B49b : declare
      begin
         null;
         null;
         C47b := system__storage_elements__storage_offset!(
           system__storage_elements__to_offsetGP2837__sourceXn(
           system__address!(system__storage_elements__integer_address
           (left) - system__storage_elements__integer_address(right))));

-- 106:    end "-";
      end B49b;
      R56b : constant turbo_private__bits__integer_addr :=
        turbo_private__bits__Oadd__2 (C47b);
      null;
      return R56b;
   end turbo_private__bits__Osubtract__4;

-- 107:
-- 108:    -----------
-- 109:    -- "mod" --
-- 110:    -----------

-- 111:

-- 112:    function "mod" (Left : System.Address; Right : Integer_Addr)
   function turbo_private__bits__Omod__2 (left : system.system__address;
     right : turbo_private__bits__integer_addr) return
     turbo_private__bits__integer_addr is
   begin

-- 113:      return Integer_Addr is

-- 114:    begin

-- 115:       return +System.Storage_Elements."mod" (Left, +Right);
      null;
      R58b : constant system__storage_elements__storage_offset :=
        turbo_private__bits__Oadd (right);
      null;
      C59b : constant system__storage_elements__storage_offset := R58b;
      C60b : system__storage_elements__storage_offset;
      B62b : declare
         L61b : label
      begin
         if C59b > 0 then
            null;
            C60b := system__storage_elements__storage_offset(
              system__storage_elements__integer_address(left) rem
              system__storage_elements__integer_address(C59b));
            goto L61b;
         else
            [constraint_error "explicit raise"]
         end if;
         <<L61b>>

-- 116:    end "mod";
      end B62b;
      R66b : constant turbo_private__bits__integer_addr :=
        turbo_private__bits__Oadd__2 (C60b);
      null;
      return R66b;
   end turbo_private__bits__Omod__2;

-- 117:
-- 118:    ---------
-- 119:    -- "+" --
-- 120:    ---------

-- 121:

-- 122:    function "+" (Left : System.Address; Right : Unsigned_Addr)
   function turbo_private__bits__Oadd (left : system.system__address;
     right : turbo_private__bits__unsigned_addr) return system.
     system__address is
   begin

-- 123:      return System.Address is

-- 124:    begin

-- 125:       return +(+Left + Right);
      return turbo_private__bits__Oadd__3 ((
        turbo_private__bits__Oadd__4 (left) + right));

-- 126:    end "+";
   end turbo_private__bits__Oadd;

-- 127:
-- 128:    ---------
-- 129:    -- "+" --
-- 130:    ---------

-- 131:

-- 132:    function "+" (Left : Unsigned_Addr; Right : System.Address)
   function turbo_private__bits__Oadd (left :
     turbo_private__bits__unsigned_addr; right : system.system__address)
     return system.system__address is
   begin

-- 133:      return System.Address is

-- 134:    begin

-- 135:       return +(Left + (+Right));
      return turbo_private__bits__Oadd__3 ((left + (
        turbo_private__bits__Oadd__4 (right))));

-- 136:    end "+";
   end turbo_private__bits__Oadd;

-- 137:
-- 138:    ---------
-- 139:    -- "-" --
-- 140:    ---------

-- 141:

-- 142:    function "-" (Left : System.Address; Right : Unsigned_Addr)
   function turbo_private__bits__Osubtract (left : system.
     system__address; right : turbo_private__bits__unsigned_addr)
     return system.system__address is
   begin

-- 143:      return System.Address is

-- 144:    begin

-- 145:       return +(+Left - Right);
      return turbo_private__bits__Oadd__3 ((
        turbo_private__bits__Oadd__4 (left) - right));

-- 146:    end "-";
   end turbo_private__bits__Osubtract;

-- 147:
-- 148:    ---------
-- 149:    -- "-" --
-- 150:    ---------

-- 151:

-- 152:    function "-" (Left, Right : System.Address)
   function turbo_private__bits__Osubtract (left : system.
     system__address; right : system.system__address) return
     turbo_private__bits__unsigned_addr is
   begin

-- 153:      return Unsigned_Addr is

-- 154:    begin

-- 155:       return (+Left) - (+Right);
      return turbo_private__bits__unsigned_addr((
        turbo_private__bits__Oadd__4 (left)) - (
        turbo_private__bits__Oadd__4 (right)));

-- 156:    end "-";
   end turbo_private__bits__Osubtract;

-- 157:
-- 158:    -----------
-- 159:    -- "mod" --
-- 160:    -----------

-- 161:

-- 162:    function "mod" (Left : System.Address; Right : Unsigned_Addr)
   function turbo_private__bits__Omod (left : system.system__address;
     right : turbo_private__bits__unsigned_addr) return
     turbo_private__bits__unsigned_addr is
   begin

-- 163:      return Unsigned_Addr is

-- 164:    begin

-- 165:       return (+Left) mod Right;
      [constraint_error when
        right = 0
        "divide by zero"]
      return turbo_private__bits__unsigned_addr((
        turbo_private__bits__Oadd__4 (left)) rem right);

-- 166:    end "mod";
   end turbo_private__bits__Omod;
begin

-- 167:

-- 168: end Turbo_Private.Bits;
   null;
end turbo_private.turbo_private__bits;
