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

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

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

              __defined at:__ @functions\/heap_types\/struct.h 4:7@

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

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

           __exported by:__ @functions\/heap_types\/struct.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_Example_Safe_fun@
foreign import ccall safe "hs_bindgen_a5d53f538e59b1fc" hs_bindgen_a5d53f538e59b1fc_base ::
    Ptr Void
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_Example_Safe_fun@
hs_bindgen_a5d53f538e59b1fc :: Ptr T -> Ptr T -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_Example_Safe_fun@
hs_bindgen_a5d53f538e59b1fc = fromFFIType hs_bindgen_a5d53f538e59b1fc_base
{-| __C declaration:__ @fun@

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

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

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

    __exported by:__ @functions\/heap_types\/struct.h@
-}
fun = \x_0 -> with x_0 (\x_1 -> allocaAndPeek (\res_2 -> hs_bindgen_a5d53f538e59b1fc x_1 res_2))
-- __unique:__ @test_functionsheap_typesstruct_Example_Unsafe_fun@
foreign import ccall unsafe "hs_bindgen_c4af6bb824712c6a" hs_bindgen_c4af6bb824712c6a_base ::
    Ptr Void
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_Example_Unsafe_fun@
hs_bindgen_c4af6bb824712c6a :: Ptr T -> Ptr T -> IO Unit
-- __unique:__ @test_functionsheap_typesstruct_Example_Unsafe_fun@
hs_bindgen_c4af6bb824712c6a = fromFFIType hs_bindgen_c4af6bb824712c6a_base
{-| __C declaration:__ @fun@

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

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

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

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

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

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

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

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