-- addDependentFile examples/golden/types/structs/struct_arg.h
-- #include <types/structs/struct_arg.h>
-- signed int hs_bindgen_4ad25504590fdd2b (
--   struct thing *arg1
-- )
-- {
--   return thing_fun_1(*arg1);
-- }
-- void hs_bindgen_04a435522bf64978 (
--   signed int arg1,
--   struct thing *arg2
-- )
-- {
--   *arg2 = thing_fun_2(arg1);
-- }
-- void hs_bindgen_5e3271324df7ced2 (
--   signed int arg1,
--   struct thing *arg2,
--   double arg3,
--   struct thing *arg4
-- )
-- {
--   *arg4 = thing_fun_3a(arg1, *arg2, arg3);
-- }
-- char hs_bindgen_3525c7d1c72f2fae (
--   signed int arg1,
--   struct thing *arg2,
--   double arg3
-- )
-- {
--   return thing_fun_3b(arg1, *arg2, arg3);
-- }
-- signed int hs_bindgen_0bdddf60550fc97b (
--   struct thing *arg1
-- )
-- {
--   return thing_fun_1(*arg1);
-- }
-- void hs_bindgen_c293d866e22be6fc (
--   signed int arg1,
--   struct thing *arg2
-- )
-- {
--   *arg2 = thing_fun_2(arg1);
-- }
-- void hs_bindgen_cfd51a9e490a997c (
--   signed int arg1,
--   struct thing *arg2,
--   double arg3,
--   struct thing *arg4
-- )
-- {
--   *arg4 = thing_fun_3a(arg1, *arg2, arg3);
-- }
-- char hs_bindgen_23fac8ee5044da6e (
--   signed int arg1,
--   struct thing *arg2,
--   double arg3
-- )
-- {
--   return thing_fun_3b(arg1, *arg2, arg3);
-- }
-- /* test_typesstructsstruct_arg_Example_get_thing_fun_1 */
-- __attribute__ ((const))
-- signed int (*hs_bindgen_17a14e7ffaa1e2e5 (void)) (
--   struct thing arg1
-- )
-- {
--   return &thing_fun_1;
-- }
-- /* test_typesstructsstruct_arg_Example_get_thing_fun_2 */
-- __attribute__ ((const))
-- struct thing (*hs_bindgen_91748ffd57eae163 (void)) (
--   signed int arg1
-- )
-- {
--   return &thing_fun_2;
-- }
-- /* test_typesstructsstruct_arg_Example_get_thing_fun_3a */
-- __attribute__ ((const))
-- struct thing (*hs_bindgen_84d98a03314ff518 (void)) (
--   signed int arg1,
--   struct thing arg2,
--   double arg3
-- )
-- {
--   return &thing_fun_3a;
-- }
-- /* test_typesstructsstruct_arg_Example_get_thing_fun_3b */
-- __attribute__ ((const))
-- char (*hs_bindgen_855ae9088b15005e (void)) (
--   signed int arg1,
--   struct thing arg2,
--   double arg3
-- )
-- {
--   return &thing_fun_3b;
-- }
{-| __C declaration:__ @struct thing@

    __defined at:__ @types\/structs\/struct_arg.h 2:8@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
data Thing
    = Thing {thing_x :: CInt
             {- ^ __C declaration:__ @x@

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

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

           __defined at:__ @types\/structs\/struct_arg.h 2:8@

           __exported by:__ @types\/structs\/struct_arg.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Thing
    where staticSizeOf = \_ -> 4 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Thing
    where readRaw = \ptr_0 -> pure Thing <*> readRaw (Proxy @"thing_x") ptr_0
instance WriteRaw Thing
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Thing thing_x_2 -> writeRaw (Proxy @"thing_x") ptr_0 thing_x_2
deriving via (EquivStorable Thing) instance Storable Thing
instance HasCField Thing "thing_x"
    where type CFieldType Thing "thing_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Thing "thing_x") =>
         HasField "thing_x" (Ptr Thing) (Ptr ty)
    where getField = fromPtr (Proxy @"thing_x")
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_1@
foreign import ccall safe "hs_bindgen_4ad25504590fdd2b" hs_bindgen_4ad25504590fdd2b_base ::
    Ptr Void
 -> IO Int32
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_1@
hs_bindgen_4ad25504590fdd2b :: Ptr Thing -> IO CInt
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_1@
hs_bindgen_4ad25504590fdd2b = fromFFIType hs_bindgen_4ad25504590fdd2b_base
{-| __C declaration:__ @thing_fun_1@

    __defined at:__ @types\/structs\/struct_arg.h 6:5@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_1 :: Thing -> IO CInt
{-| __C declaration:__ @thing_fun_1@

    __defined at:__ @types\/structs\/struct_arg.h 6:5@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_1 = \x_0 -> with x_0 (\x_1 -> hs_bindgen_4ad25504590fdd2b x_1)
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_2@
foreign import ccall safe "hs_bindgen_04a435522bf64978" hs_bindgen_04a435522bf64978_base ::
    Int32
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_2@
hs_bindgen_04a435522bf64978 :: CInt -> Ptr Thing -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_2@
hs_bindgen_04a435522bf64978 = fromFFIType hs_bindgen_04a435522bf64978_base
{-| __C declaration:__ @thing_fun_2@

    __defined at:__ @types\/structs\/struct_arg.h 7:14@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_2 :: CInt -> IO Thing
{-| __C declaration:__ @thing_fun_2@

    __defined at:__ @types\/structs\/struct_arg.h 7:14@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_2 = \x_0 -> allocaAndPeek (\res_1 -> hs_bindgen_04a435522bf64978 x_0 res_1)
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_3a@
foreign import ccall safe "hs_bindgen_5e3271324df7ced2" hs_bindgen_5e3271324df7ced2_base ::
    Int32
 -> Ptr Void
 -> Double
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_3a@
hs_bindgen_5e3271324df7ced2 :: CInt ->
                               Ptr Thing -> CDouble -> Ptr Thing -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_3a@
hs_bindgen_5e3271324df7ced2 = fromFFIType hs_bindgen_5e3271324df7ced2_base
{-| __C declaration:__ @thing_fun_3a@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3a :: CInt -> Thing -> CDouble -> IO Thing
{-| __C declaration:__ @thing_fun_3a@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3a = \x_0 -> \y_1 -> \z_2 -> with y_1 (\y_3 -> allocaAndPeek (\res_4 -> hs_bindgen_5e3271324df7ced2 x_0 y_3 z_2 res_4))
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_3b@
foreign import ccall safe "hs_bindgen_3525c7d1c72f2fae" hs_bindgen_3525c7d1c72f2fae_base ::
    Int32
 -> Ptr Void
 -> Double
 -> IO Int8
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_3b@
hs_bindgen_3525c7d1c72f2fae :: CInt ->
                               Ptr Thing -> CDouble -> IO CChar
-- __unique:__ @test_typesstructsstruct_arg_Example_Safe_thing_fun_3b@
hs_bindgen_3525c7d1c72f2fae = fromFFIType hs_bindgen_3525c7d1c72f2fae_base
{-| __C declaration:__ @thing_fun_3b@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3b :: CInt -> Thing -> CDouble -> IO CChar
{-| __C declaration:__ @thing_fun_3b@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3b = \x_0 -> \y_1 -> \z_2 -> with y_1 (\y_3 -> hs_bindgen_3525c7d1c72f2fae x_0 y_3 z_2)
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_1@
foreign import ccall unsafe "hs_bindgen_0bdddf60550fc97b" hs_bindgen_0bdddf60550fc97b_base ::
    Ptr Void
 -> IO Int32
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_1@
hs_bindgen_0bdddf60550fc97b :: Ptr Thing -> IO CInt
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_1@
hs_bindgen_0bdddf60550fc97b = fromFFIType hs_bindgen_0bdddf60550fc97b_base
{-| __C declaration:__ @thing_fun_1@

    __defined at:__ @types\/structs\/struct_arg.h 6:5@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_1 :: Thing -> IO CInt
{-| __C declaration:__ @thing_fun_1@

    __defined at:__ @types\/structs\/struct_arg.h 6:5@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_1 = \x_0 -> with x_0 (\x_1 -> hs_bindgen_0bdddf60550fc97b x_1)
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_2@
foreign import ccall unsafe "hs_bindgen_c293d866e22be6fc" hs_bindgen_c293d866e22be6fc_base ::
    Int32
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_2@
hs_bindgen_c293d866e22be6fc :: CInt -> Ptr Thing -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_2@
hs_bindgen_c293d866e22be6fc = fromFFIType hs_bindgen_c293d866e22be6fc_base
{-| __C declaration:__ @thing_fun_2@

    __defined at:__ @types\/structs\/struct_arg.h 7:14@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_2 :: CInt -> IO Thing
{-| __C declaration:__ @thing_fun_2@

    __defined at:__ @types\/structs\/struct_arg.h 7:14@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_2 = \x_0 -> allocaAndPeek (\res_1 -> hs_bindgen_c293d866e22be6fc x_0 res_1)
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_3a@
foreign import ccall unsafe "hs_bindgen_cfd51a9e490a997c" hs_bindgen_cfd51a9e490a997c_base ::
    Int32
 -> Ptr Void
 -> Double
 -> Ptr Void
 -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_3a@
hs_bindgen_cfd51a9e490a997c :: CInt ->
                               Ptr Thing -> CDouble -> Ptr Thing -> IO Unit
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_3a@
hs_bindgen_cfd51a9e490a997c = fromFFIType hs_bindgen_cfd51a9e490a997c_base
{-| __C declaration:__ @thing_fun_3a@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3a :: CInt -> Thing -> CDouble -> IO Thing
{-| __C declaration:__ @thing_fun_3a@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3a = \x_0 -> \y_1 -> \z_2 -> with y_1 (\y_3 -> allocaAndPeek (\res_4 -> hs_bindgen_cfd51a9e490a997c x_0 y_3 z_2 res_4))
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_3b@
foreign import ccall unsafe "hs_bindgen_23fac8ee5044da6e" hs_bindgen_23fac8ee5044da6e_base ::
    Int32
 -> Ptr Void
 -> Double
 -> IO Int8
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_3b@
hs_bindgen_23fac8ee5044da6e :: CInt ->
                               Ptr Thing -> CDouble -> IO CChar
-- __unique:__ @test_typesstructsstruct_arg_Example_Unsafe_thing_fun_3b@
hs_bindgen_23fac8ee5044da6e = fromFFIType hs_bindgen_23fac8ee5044da6e_base
{-| __C declaration:__ @thing_fun_3b@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3b :: CInt -> Thing -> CDouble -> IO CChar
{-| __C declaration:__ @thing_fun_3b@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3b = \x_0 -> \y_1 -> \z_2 -> with y_1 (\y_3 -> hs_bindgen_23fac8ee5044da6e x_0 y_3 z_2)
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_1@
foreign import ccall unsafe "hs_bindgen_17a14e7ffaa1e2e5" hs_bindgen_17a14e7ffaa1e2e5_base ::
    IO (FunPtr Void)
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_1@
hs_bindgen_17a14e7ffaa1e2e5 :: IO (FunPtr (Thing -> IO CInt))
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_1@
hs_bindgen_17a14e7ffaa1e2e5 = fromFFIType hs_bindgen_17a14e7ffaa1e2e5_base
{-# NOINLINE thing_fun_1 #-}
{-| __C declaration:__ @thing_fun_1@

    __defined at:__ @types\/structs\/struct_arg.h 6:5@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_1 :: FunPtr (Thing -> IO CInt)
{-| __C declaration:__ @thing_fun_1@

    __defined at:__ @types\/structs\/struct_arg.h 6:5@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_1 = unsafePerformIO hs_bindgen_17a14e7ffaa1e2e5
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_2@
foreign import ccall unsafe "hs_bindgen_91748ffd57eae163" hs_bindgen_91748ffd57eae163_base ::
    IO (FunPtr Void)
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_2@
hs_bindgen_91748ffd57eae163 :: IO (FunPtr (CInt -> IO Thing))
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_2@
hs_bindgen_91748ffd57eae163 = fromFFIType hs_bindgen_91748ffd57eae163_base
{-# NOINLINE thing_fun_2 #-}
{-| __C declaration:__ @thing_fun_2@

    __defined at:__ @types\/structs\/struct_arg.h 7:14@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_2 :: FunPtr (CInt -> IO Thing)
{-| __C declaration:__ @thing_fun_2@

    __defined at:__ @types\/structs\/struct_arg.h 7:14@

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_2 = unsafePerformIO hs_bindgen_91748ffd57eae163
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_3a@
foreign import ccall unsafe "hs_bindgen_84d98a03314ff518" hs_bindgen_84d98a03314ff518_base ::
    IO (FunPtr Void)
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_3a@
hs_bindgen_84d98a03314ff518 :: IO (FunPtr (CInt ->
                                           Thing -> CDouble -> IO Thing))
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_3a@
hs_bindgen_84d98a03314ff518 = fromFFIType hs_bindgen_84d98a03314ff518_base
{-# NOINLINE thing_fun_3a #-}
{-| __C declaration:__ @thing_fun_3a@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3a :: FunPtr (CInt -> Thing -> CDouble -> IO Thing)
{-| __C declaration:__ @thing_fun_3a@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3a = unsafePerformIO hs_bindgen_84d98a03314ff518
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_3b@
foreign import ccall unsafe "hs_bindgen_855ae9088b15005e" hs_bindgen_855ae9088b15005e_base ::
    IO (FunPtr Void)
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_3b@
hs_bindgen_855ae9088b15005e :: IO (FunPtr (CInt ->
                                           Thing -> CDouble -> IO CChar))
-- __unique:__ @test_typesstructsstruct_arg_Example_get_thing_fun_3b@
hs_bindgen_855ae9088b15005e = fromFFIType hs_bindgen_855ae9088b15005e_base
{-# NOINLINE thing_fun_3b #-}
{-| __C declaration:__ @thing_fun_3b@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3b :: FunPtr (CInt -> Thing -> CDouble -> IO CChar)
{-| __C declaration:__ @thing_fun_3b@

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

    __exported by:__ @types\/structs\/struct_arg.h@
-}
thing_fun_3b = unsafePerformIO hs_bindgen_855ae9088b15005e
