-- addDependentFile examples/golden/functions/heap_types/struct_const_member.h
-- #include <functions/heap_types/struct_const_member.h>
-- void hs_bindgen_67465eb5641985dc (
--   T *arg1,
--   T *arg2
-- )
-- {
--   *arg2 = fun(*arg1);
-- }
-- void hs_bindgen_4351e21e32969011 (
--   T *arg1,
--   T *arg2
-- )
-- {
--   *arg2 = fun(*arg1);
-- }
-- /* test_functionsheap_typesstruct_co_Example_get_fun */
-- __attribute__ ((const))
-- T (*hs_bindgen_564814e9ac709cad (void)) (
--   T arg1
-- )
-- {
--   return &fun;
-- }
{-| __C declaration:__ @struct S@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 3:8@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
data T
    = T {t_x :: CInt
         {- ^ __C declaration:__ @x@

              __defined at:__ @functions\/heap_types\/struct_const_member.h 4:13@

              __exported by:__ @functions\/heap_types\/struct_const_member.h@
         -}}
      {- ^ __C declaration:__ @struct S@

           __defined at:__ @functions\/heap_types\/struct_const_member.h 3:8@

           __exported by:__ @functions\/heap_types\/struct_const_member.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize T
    where staticSizeOf = \_ -> 4 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw T
    where readRaw = \ptr_0 -> pure T <*> readRaw (Proxy @"t_x") ptr_0
instance WriteRaw T
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       T t_x_2 -> writeRaw (Proxy @"t_x") ptr_0 t_x_2
deriving via (EquivStorable T) instance Storable T
instance HasCField T "t_x"
    where type CFieldType T "t_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType T "t_x") =>
         HasField "t_x" (Ptr T) (Ptr ty)
    where getField = fromPtr (Proxy @"t_x")
-- __unique:__ @test_functionsheap_typesstruct_co_Example_Safe_fun@
foreign import ccall safe "hs_bindgen_67465eb5641985dc" hs_bindgen_67465eb5641985dc_base ::
    Ptr Void
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_co_Example_Safe_fun@
hs_bindgen_67465eb5641985dc :: Ptr T -> Ptr T -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_co_Example_Safe_fun@
hs_bindgen_67465eb5641985dc = fromFFIType hs_bindgen_67465eb5641985dc_base
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
fun :: T -> IO T
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
fun = \x_0 -> with x_0 (\x_1 -> allocaAndPeek (\res_2 -> hs_bindgen_67465eb5641985dc x_1 res_2))
-- __unique:__ @test_functionsheap_typesstruct_co_Example_Unsafe_fun@
foreign import ccall unsafe "hs_bindgen_4351e21e32969011" hs_bindgen_4351e21e32969011_base ::
    Ptr Void
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_co_Example_Unsafe_fun@
hs_bindgen_4351e21e32969011 :: Ptr T -> Ptr T -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_co_Example_Unsafe_fun@
hs_bindgen_4351e21e32969011 = fromFFIType hs_bindgen_4351e21e32969011_base
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
fun :: T -> IO T
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
fun = \x_0 -> with x_0 (\x_1 -> allocaAndPeek (\res_2 -> hs_bindgen_4351e21e32969011 x_1 res_2))
-- __unique:__ @test_functionsheap_typesstruct_co_Example_get_fun@
foreign import ccall unsafe "hs_bindgen_564814e9ac709cad" hs_bindgen_564814e9ac709cad_base ::
    IO (FunPtr Void)
-- __unique:__ @test_functionsheap_typesstruct_co_Example_get_fun@
hs_bindgen_564814e9ac709cad :: IO (FunPtr (T -> IO T))
-- __unique:__ @test_functionsheap_typesstruct_co_Example_get_fun@
hs_bindgen_564814e9ac709cad = fromFFIType hs_bindgen_564814e9ac709cad_base
{-# NOINLINE fun #-}
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
fun :: FunPtr (T -> IO T)
{-| __C declaration:__ @fun@

    __defined at:__ @functions\/heap_types\/struct_const_member.h 9:3@

    __exported by:__ @functions\/heap_types\/struct_const_member.h@
-}
fun = unsafePerformIO hs_bindgen_564814e9ac709cad
