-- addDependentFile examples/golden/types/structs/bitfields.h
{-| __C declaration:__ @struct flags@

    __defined at:__ @types\/structs\/bitfields.h 1:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data Flags
    = Flags {flags_fieldX :: CChar
             {- ^ __C declaration:__ @fieldX@

                  __defined at:__ @types\/structs\/bitfields.h 2:10@

                  __exported by:__ @types\/structs\/bitfields.h@
             -},
             flags_flagA :: CInt
             {- ^ __C declaration:__ @flagA@

                  __defined at:__ @types\/structs\/bitfields.h 3:9@

                  __exported by:__ @types\/structs\/bitfields.h@
             -},
             flags_flagB :: CInt
             {- ^ __C declaration:__ @flagB@

                  __defined at:__ @types\/structs\/bitfields.h 4:9@

                  __exported by:__ @types\/structs\/bitfields.h@
             -},
             flags_flagC :: CInt
             {- ^ __C declaration:__ @flagC@

                  __defined at:__ @types\/structs\/bitfields.h 5:9@

                  __exported by:__ @types\/structs\/bitfields.h@
             -},
             flags_fieldY :: CChar
             {- ^ __C declaration:__ @fieldY@

                  __defined at:__ @types\/structs\/bitfields.h 6:10@

                  __exported by:__ @types\/structs\/bitfields.h@
             -},
             flags_bits :: CInt
             {- ^ __C declaration:__ @bits@

                  __defined at:__ @types\/structs\/bitfields.h 7:9@

                  __exported by:__ @types\/structs\/bitfields.h@
             -}}
      {- ^ __C declaration:__ @struct flags@

           __defined at:__ @types\/structs\/bitfields.h 1:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Flags
    where staticSizeOf = \_ -> 4 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Flags
    where readRaw = \ptr_0 -> (((((pure Flags <*> readRaw (Proxy @"flags_fieldX") ptr_0) <*> peek (Proxy @"flags_flagA") ptr_0) <*> peek (Proxy @"flags_flagB") ptr_0) <*> peek (Proxy @"flags_flagC") ptr_0) <*> readRaw (Proxy @"flags_fieldY") ptr_0) <*> peek (Proxy @"flags_bits") ptr_0
instance WriteRaw Flags
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Flags flags_fieldX_2
                                             flags_flagA_3
                                             flags_flagB_4
                                             flags_flagC_5
                                             flags_fieldY_6
                                             flags_bits_7 -> writeRaw (Proxy @"flags_fieldX") ptr_0 flags_fieldX_2 >> (poke (Proxy @"flags_flagA") ptr_0 flags_flagA_3 >> (poke (Proxy @"flags_flagB") ptr_0 flags_flagB_4 >> (poke (Proxy @"flags_flagC") ptr_0 flags_flagC_5 >> (writeRaw (Proxy @"flags_fieldY") ptr_0 flags_fieldY_6 >> poke (Proxy @"flags_bits") ptr_0 flags_bits_7))))
deriving via (EquivStorable Flags) instance Storable Flags
instance HasCField Flags "flags_fieldX"
    where type CFieldType Flags "flags_fieldX" = CChar
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Flags "flags_fieldX") =>
         HasField "flags_fieldX" (Ptr Flags) (Ptr ty)
    where getField = fromPtr (Proxy @"flags_fieldX")
instance HasCBitfield Flags "flags_flagA"
    where type CBitfieldType Flags "flags_flagA" = CInt
          bitfieldOffset# = \_ -> \_ -> 8
          bitfieldWidth# = \_ -> \_ -> 1
instance TyEq ty (CBitfieldType Flags "flags_flagA") =>
         HasField "flags_flagA" (Ptr Flags) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"flags_flagA")
instance HasCBitfield Flags "flags_flagB"
    where type CBitfieldType Flags "flags_flagB" = CInt
          bitfieldOffset# = \_ -> \_ -> 9
          bitfieldWidth# = \_ -> \_ -> 1
instance TyEq ty (CBitfieldType Flags "flags_flagB") =>
         HasField "flags_flagB" (Ptr Flags) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"flags_flagB")
instance HasCBitfield Flags "flags_flagC"
    where type CBitfieldType Flags "flags_flagC" = CInt
          bitfieldOffset# = \_ -> \_ -> 10
          bitfieldWidth# = \_ -> \_ -> 1
instance TyEq ty (CBitfieldType Flags "flags_flagC") =>
         HasField "flags_flagC" (Ptr Flags) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"flags_flagC")
instance HasCField Flags "flags_fieldY"
    where type CFieldType Flags "flags_fieldY" = CChar
          offset# = \_ -> \_ -> 2
instance TyEq ty (CFieldType Flags "flags_fieldY") =>
         HasField "flags_fieldY" (Ptr Flags) (Ptr ty)
    where getField = fromPtr (Proxy @"flags_fieldY")
instance HasCBitfield Flags "flags_bits"
    where type CBitfieldType Flags "flags_bits" = CInt
          bitfieldOffset# = \_ -> \_ -> 24
          bitfieldWidth# = \_ -> \_ -> 2
instance TyEq ty (CBitfieldType Flags "flags_bits") =>
         HasField "flags_bits" (Ptr Flags) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"flags_bits")
{-| __C declaration:__ @struct overflow32@

    __defined at:__ @types\/structs\/bitfields.h 12:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data Overflow32
    = Overflow32 {overflow32_x :: CInt
                  {- ^ __C declaration:__ @x@

                       __defined at:__ @types\/structs\/bitfields.h 13:9@

                       __exported by:__ @types\/structs\/bitfields.h@
                  -},
                  overflow32_y :: CInt
                  {- ^ __C declaration:__ @y@

                       __defined at:__ @types\/structs\/bitfields.h 14:9@

                       __exported by:__ @types\/structs\/bitfields.h@
                  -},
                  overflow32_z :: CInt
                  {- ^ __C declaration:__ @z@

                       __defined at:__ @types\/structs\/bitfields.h 15:9@

                       __exported by:__ @types\/structs\/bitfields.h@
                  -}}
      {- ^ __C declaration:__ @struct overflow32@

           __defined at:__ @types\/structs\/bitfields.h 12:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Overflow32
    where staticSizeOf = \_ -> 12 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Overflow32
    where readRaw = \ptr_0 -> ((pure Overflow32 <*> peek (Proxy @"overflow32_x") ptr_0) <*> peek (Proxy @"overflow32_y") ptr_0) <*> peek (Proxy @"overflow32_z") ptr_0
instance WriteRaw Overflow32
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Overflow32 overflow32_x_2
                                                  overflow32_y_3
                                                  overflow32_z_4 -> poke (Proxy @"overflow32_x") ptr_0 overflow32_x_2 >> (poke (Proxy @"overflow32_y") ptr_0 overflow32_y_3 >> poke (Proxy @"overflow32_z") ptr_0 overflow32_z_4)
deriving via (EquivStorable Overflow32) instance Storable Overflow32
instance HasCBitfield Overflow32 "overflow32_x"
    where type CBitfieldType Overflow32 "overflow32_x" = CInt
          bitfieldOffset# = \_ -> \_ -> 0
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32 "overflow32_x") =>
         HasField "overflow32_x" (Ptr Overflow32) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32_x")
instance HasCBitfield Overflow32 "overflow32_y"
    where type CBitfieldType Overflow32 "overflow32_y" = CInt
          bitfieldOffset# = \_ -> \_ -> 32
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32 "overflow32_y") =>
         HasField "overflow32_y" (Ptr Overflow32) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32_y")
instance HasCBitfield Overflow32 "overflow32_z"
    where type CBitfieldType Overflow32 "overflow32_z" = CInt
          bitfieldOffset# = \_ -> \_ -> 64
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32 "overflow32_z") =>
         HasField "overflow32_z" (Ptr Overflow32) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32_z")
{-| __C declaration:__ @struct overflow32b@

    __defined at:__ @types\/structs\/bitfields.h 18:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data Overflow32b
    = Overflow32b {overflow32b_x :: CLong
                   {- ^ __C declaration:__ @x@

                        __defined at:__ @types\/structs\/bitfields.h 19:10@

                        __exported by:__ @types\/structs\/bitfields.h@
                   -},
                   overflow32b_y :: CLong
                   {- ^ __C declaration:__ @y@

                        __defined at:__ @types\/structs\/bitfields.h 20:10@

                        __exported by:__ @types\/structs\/bitfields.h@
                   -},
                   overflow32b_z :: CLong
                   {- ^ __C declaration:__ @z@

                        __defined at:__ @types\/structs\/bitfields.h 21:10@

                        __exported by:__ @types\/structs\/bitfields.h@
                   -}}
      {- ^ __C declaration:__ @struct overflow32b@

           __defined at:__ @types\/structs\/bitfields.h 18:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Overflow32b
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw Overflow32b
    where readRaw = \ptr_0 -> ((pure Overflow32b <*> peek (Proxy @"overflow32b_x") ptr_0) <*> peek (Proxy @"overflow32b_y") ptr_0) <*> peek (Proxy @"overflow32b_z") ptr_0
instance WriteRaw Overflow32b
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Overflow32b overflow32b_x_2
                                                   overflow32b_y_3
                                                   overflow32b_z_4 -> poke (Proxy @"overflow32b_x") ptr_0 overflow32b_x_2 >> (poke (Proxy @"overflow32b_y") ptr_0 overflow32b_y_3 >> poke (Proxy @"overflow32b_z") ptr_0 overflow32b_z_4)
deriving via (EquivStorable Overflow32b) instance Storable Overflow32b
instance HasCBitfield Overflow32b "overflow32b_x"
    where type CBitfieldType Overflow32b "overflow32b_x" = CLong
          bitfieldOffset# = \_ -> \_ -> 0
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32b "overflow32b_x") =>
         HasField "overflow32b_x" (Ptr Overflow32b) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32b_x")
instance HasCBitfield Overflow32b "overflow32b_y"
    where type CBitfieldType Overflow32b "overflow32b_y" = CLong
          bitfieldOffset# = \_ -> \_ -> 17
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32b "overflow32b_y") =>
         HasField "overflow32b_y" (Ptr Overflow32b) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32b_y")
instance HasCBitfield Overflow32b "overflow32b_z"
    where type CBitfieldType Overflow32b "overflow32b_z" = CLong
          bitfieldOffset# = \_ -> \_ -> 34
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32b "overflow32b_z") =>
         HasField "overflow32b_z" (Ptr Overflow32b) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32b_z")
{-| __C declaration:__ @struct overflow32c@

    __defined at:__ @types\/structs\/bitfields.h 24:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data Overflow32c
    = Overflow32c {overflow32c_x :: CLong
                   {- ^ __C declaration:__ @x@

                        __defined at:__ @types\/structs\/bitfields.h 25:10@

                        __exported by:__ @types\/structs\/bitfields.h@
                   -},
                   overflow32c_y :: CInt
                   {- ^ __C declaration:__ @y@

                        __defined at:__ @types\/structs\/bitfields.h 26:10@

                        __exported by:__ @types\/structs\/bitfields.h@
                   -},
                   overflow32c_z :: CLong
                   {- ^ __C declaration:__ @z@

                        __defined at:__ @types\/structs\/bitfields.h 27:10@

                        __exported by:__ @types\/structs\/bitfields.h@
                   -}}
      {- ^ __C declaration:__ @struct overflow32c@

           __defined at:__ @types\/structs\/bitfields.h 24:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Overflow32c
    where staticSizeOf = \_ -> 16 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw Overflow32c
    where readRaw = \ptr_0 -> ((pure Overflow32c <*> peek (Proxy @"overflow32c_x") ptr_0) <*> peek (Proxy @"overflow32c_y") ptr_0) <*> peek (Proxy @"overflow32c_z") ptr_0
instance WriteRaw Overflow32c
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Overflow32c overflow32c_x_2
                                                   overflow32c_y_3
                                                   overflow32c_z_4 -> poke (Proxy @"overflow32c_x") ptr_0 overflow32c_x_2 >> (poke (Proxy @"overflow32c_y") ptr_0 overflow32c_y_3 >> poke (Proxy @"overflow32c_z") ptr_0 overflow32c_z_4)
deriving via (EquivStorable Overflow32c) instance Storable Overflow32c
instance HasCBitfield Overflow32c "overflow32c_x"
    where type CBitfieldType Overflow32c "overflow32c_x" = CLong
          bitfieldOffset# = \_ -> \_ -> 0
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32c "overflow32c_x") =>
         HasField "overflow32c_x" (Ptr Overflow32c) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32c_x")
instance HasCBitfield Overflow32c "overflow32c_y"
    where type CBitfieldType Overflow32c "overflow32c_y" = CInt
          bitfieldOffset# = \_ -> \_ -> 32
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32c "overflow32c_y") =>
         HasField "overflow32c_y" (Ptr Overflow32c) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32c_y")
instance HasCBitfield Overflow32c "overflow32c_z"
    where type CBitfieldType Overflow32c "overflow32c_z" = CLong
          bitfieldOffset# = \_ -> \_ -> 64
          bitfieldWidth# = \_ -> \_ -> 17
instance TyEq ty (CBitfieldType Overflow32c "overflow32c_z") =>
         HasField "overflow32c_z" (Ptr Overflow32c) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow32c_z")
{-| __C declaration:__ @struct overflow64@

    __defined at:__ @types\/structs\/bitfields.h 30:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data Overflow64
    = Overflow64 {overflow64_x :: CLong
                  {- ^ __C declaration:__ @x@

                       __defined at:__ @types\/structs\/bitfields.h 31:10@

                       __exported by:__ @types\/structs\/bitfields.h@
                  -},
                  overflow64_y :: CLong
                  {- ^ __C declaration:__ @y@

                       __defined at:__ @types\/structs\/bitfields.h 32:10@

                       __exported by:__ @types\/structs\/bitfields.h@
                  -}}
      {- ^ __C declaration:__ @struct overflow64@

           __defined at:__ @types\/structs\/bitfields.h 30:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Overflow64
    where staticSizeOf = \_ -> 16 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw Overflow64
    where readRaw = \ptr_0 -> (pure Overflow64 <*> peek (Proxy @"overflow64_x") ptr_0) <*> peek (Proxy @"overflow64_y") ptr_0
instance WriteRaw Overflow64
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Overflow64 overflow64_x_2
                                                  overflow64_y_3 -> poke (Proxy @"overflow64_x") ptr_0 overflow64_x_2 >> poke (Proxy @"overflow64_y") ptr_0 overflow64_y_3
deriving via (EquivStorable Overflow64) instance Storable Overflow64
instance HasCBitfield Overflow64 "overflow64_x"
    where type CBitfieldType Overflow64 "overflow64_x" = CLong
          bitfieldOffset# = \_ -> \_ -> 0
          bitfieldWidth# = \_ -> \_ -> 33
instance TyEq ty (CBitfieldType Overflow64 "overflow64_x") =>
         HasField "overflow64_x" (Ptr Overflow64) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow64_x")
instance HasCBitfield Overflow64 "overflow64_y"
    where type CBitfieldType Overflow64 "overflow64_y" = CLong
          bitfieldOffset# = \_ -> \_ -> 64
          bitfieldWidth# = \_ -> \_ -> 33
instance TyEq ty (CBitfieldType Overflow64 "overflow64_y") =>
         HasField "overflow64_y" (Ptr Overflow64) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"overflow64_y")
{-| __C declaration:__ @struct alignA@

    __defined at:__ @types\/structs\/bitfields.h 36:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data AlignA
    = AlignA {alignA_x :: CUChar
              {- ^ __C declaration:__ @x@

                   __defined at:__ @types\/structs\/bitfields.h 37:16@

                   __exported by:__ @types\/structs\/bitfields.h@
              -},
              alignA_y :: CInt
              {- ^ __C declaration:__ @y@

                   __defined at:__ @types\/structs\/bitfields.h 38:6@

                   __exported by:__ @types\/structs\/bitfields.h@
              -}}
      {- ^ __C declaration:__ @struct alignA@

           __defined at:__ @types\/structs\/bitfields.h 36:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize AlignA
    where staticSizeOf = \_ -> 4 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw AlignA
    where readRaw = \ptr_0 -> (pure AlignA <*> peek (Proxy @"alignA_x") ptr_0) <*> peek (Proxy @"alignA_y") ptr_0
instance WriteRaw AlignA
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       AlignA alignA_x_2
                                              alignA_y_3 -> poke (Proxy @"alignA_x") ptr_0 alignA_x_2 >> poke (Proxy @"alignA_y") ptr_0 alignA_y_3
deriving via (EquivStorable AlignA) instance Storable AlignA
instance HasCBitfield AlignA "alignA_x"
    where type CBitfieldType AlignA "alignA_x" = CUChar
          bitfieldOffset# = \_ -> \_ -> 0
          bitfieldWidth# = \_ -> \_ -> 1
instance TyEq ty (CBitfieldType AlignA "alignA_x") =>
         HasField "alignA_x" (Ptr AlignA) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"alignA_x")
instance HasCBitfield AlignA "alignA_y"
    where type CBitfieldType AlignA "alignA_y" = CInt
          bitfieldOffset# = \_ -> \_ -> 1
          bitfieldWidth# = \_ -> \_ -> 10
instance TyEq ty (CBitfieldType AlignA "alignA_y") =>
         HasField "alignA_y" (Ptr AlignA) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"alignA_y")
{-| __C declaration:__ @struct alignB@

    __defined at:__ @types\/structs\/bitfields.h 41:8@

    __exported by:__ @types\/structs\/bitfields.h@
-}
data AlignB
    = AlignB {alignB_x :: CUChar
              {- ^ __C declaration:__ @x@

                   __defined at:__ @types\/structs\/bitfields.h 42:16@

                   __exported by:__ @types\/structs\/bitfields.h@
              -},
              alignB_y :: CInt
              {- ^ __C declaration:__ @y@

                   __defined at:__ @types\/structs\/bitfields.h 43:6@

                   __exported by:__ @types\/structs\/bitfields.h@
              -}}
      {- ^ __C declaration:__ @struct alignB@

           __defined at:__ @types\/structs\/bitfields.h 41:8@

           __exported by:__ @types\/structs\/bitfields.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize AlignB
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw AlignB
    where readRaw = \ptr_0 -> (pure AlignB <*> peek (Proxy @"alignB_x") ptr_0) <*> peek (Proxy @"alignB_y") ptr_0
instance WriteRaw AlignB
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       AlignB alignB_x_2
                                              alignB_y_3 -> poke (Proxy @"alignB_x") ptr_0 alignB_x_2 >> poke (Proxy @"alignB_y") ptr_0 alignB_y_3
deriving via (EquivStorable AlignB) instance Storable AlignB
instance HasCBitfield AlignB "alignB_x"
    where type CBitfieldType AlignB "alignB_x" = CUChar
          bitfieldOffset# = \_ -> \_ -> 0
          bitfieldWidth# = \_ -> \_ -> 7
instance TyEq ty (CBitfieldType AlignB "alignB_x") =>
         HasField "alignB_x" (Ptr AlignB) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"alignB_x")
instance HasCBitfield AlignB "alignB_y"
    where type CBitfieldType AlignB "alignB_y" = CInt
          bitfieldOffset# = \_ -> \_ -> 32
          bitfieldWidth# = \_ -> \_ -> 31
instance TyEq ty (CBitfieldType AlignB "alignB_y") =>
         HasField "alignB_y" (Ptr AlignB) (BitfieldPtr ty)
    where getField = toPtr (Proxy @"alignB_y")
