#ifndef KONAN_LIBKN_H
#define KONAN_LIBKN_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
typedef bool            libkn_KBoolean;
#else
typedef _Bool           libkn_KBoolean;
#endif
typedef unsigned short     libkn_KChar;
typedef signed char        libkn_KByte;
typedef short              libkn_KShort;
typedef int                libkn_KInt;
typedef long long          libkn_KLong;
typedef unsigned char      libkn_KUByte;
typedef unsigned short     libkn_KUShort;
typedef unsigned int       libkn_KUInt;
typedef unsigned long long libkn_KULong;
typedef float              libkn_KFloat;
typedef double             libkn_KDouble;
typedef float __attribute__ ((__vector_size__ (16))) libkn_KVector128;
typedef void*              libkn_KNativePtr;
struct libkn_KType;
typedef struct libkn_KType libkn_KType;

typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Byte;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Short;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Int;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Long;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Float;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Double;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Char;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Boolean;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_Unit;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_UByte;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_UShort;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_UInt;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_kotlin_ULong;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_com_example_arith_Arith;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_com_example_kotlin_sample_Platform;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_com_example_kotlin_sample_Greeting;
typedef struct {
  libkn_KNativePtr pinned;
} libkn_kref_com_example_kotlin_sample_OhosPlatform;

extern const char* getKotlinAnalyticsInfo();
extern const char* getKotlinGreeting();
extern const char* getKotlinUiText();
extern void triggerCpuFreeze();
extern libkn_KInt triggerKotlinHeapOverflow();
extern libkn_KInt triggerKotlinHeapUseAfterFree();
extern libkn_KInt triggerKotlinNpe();
extern libkn_KInt triggerKotlinOutOfBounds();
extern libkn_KInt triggerKotlinStackBufferOverflow();
extern void triggerKotlinToCCrash();
extern void* getStaticLibImage();
extern libkn_KInt getStaticLibImageSize();
extern libkn_KInt getStaticLibSum(libkn_KInt a, libkn_KInt b);
extern const char* getStaticLibVersion();

typedef struct {
  /* Service functions. */
  void (*DisposeStablePointer)(libkn_KNativePtr ptr);
  void (*DisposeString)(const char* string);
  libkn_KBoolean (*IsInstance)(libkn_KNativePtr ref, const libkn_KType* type);
  libkn_kref_kotlin_Byte (*createNullableByte)(libkn_KByte);
  libkn_KByte (*getNonNullValueOfByte)(libkn_kref_kotlin_Byte);
  libkn_kref_kotlin_Short (*createNullableShort)(libkn_KShort);
  libkn_KShort (*getNonNullValueOfShort)(libkn_kref_kotlin_Short);
  libkn_kref_kotlin_Int (*createNullableInt)(libkn_KInt);
  libkn_KInt (*getNonNullValueOfInt)(libkn_kref_kotlin_Int);
  libkn_kref_kotlin_Long (*createNullableLong)(libkn_KLong);
  libkn_KLong (*getNonNullValueOfLong)(libkn_kref_kotlin_Long);
  libkn_kref_kotlin_Float (*createNullableFloat)(libkn_KFloat);
  libkn_KFloat (*getNonNullValueOfFloat)(libkn_kref_kotlin_Float);
  libkn_kref_kotlin_Double (*createNullableDouble)(libkn_KDouble);
  libkn_KDouble (*getNonNullValueOfDouble)(libkn_kref_kotlin_Double);
  libkn_kref_kotlin_Char (*createNullableChar)(libkn_KChar);
  libkn_KChar (*getNonNullValueOfChar)(libkn_kref_kotlin_Char);
  libkn_kref_kotlin_Boolean (*createNullableBoolean)(libkn_KBoolean);
  libkn_KBoolean (*getNonNullValueOfBoolean)(libkn_kref_kotlin_Boolean);
  libkn_kref_kotlin_Unit (*createNullableUnit)(void);
  libkn_kref_kotlin_UByte (*createNullableUByte)(libkn_KUByte);
  libkn_KUByte (*getNonNullValueOfUByte)(libkn_kref_kotlin_UByte);
  libkn_kref_kotlin_UShort (*createNullableUShort)(libkn_KUShort);
  libkn_KUShort (*getNonNullValueOfUShort)(libkn_kref_kotlin_UShort);
  libkn_kref_kotlin_UInt (*createNullableUInt)(libkn_KUInt);
  libkn_KUInt (*getNonNullValueOfUInt)(libkn_kref_kotlin_UInt);
  libkn_kref_kotlin_ULong (*createNullableULong)(libkn_KULong);
  libkn_KULong (*getNonNullValueOfULong)(libkn_kref_kotlin_ULong);

  /* User functions. */
  struct {
    struct {
      struct {
        struct {
          struct {
            struct {
              libkn_KType* (*_type)(void);
              libkn_kref_com_example_arith_Arith (*_instance)();
              libkn_KInt (*add)(libkn_kref_com_example_arith_Arith thiz, libkn_KInt a, libkn_KInt b);
              libkn_KInt (*sub)(libkn_kref_com_example_arith_Arith thiz, libkn_KInt a, libkn_KInt b);
            } Arith;
          } arith;
          struct {
            struct {
              libkn_KType* (*_type)(void);
              libkn_kref_com_example_kotlin_sample_Greeting (*Greeting)();
              const char* (*greet)(libkn_kref_com_example_kotlin_sample_Greeting thiz);
            } Greeting;
            struct {
              libkn_KType* (*_type)(void);
              const char* (*get_name)(libkn_kref_com_example_kotlin_sample_Platform thiz);
            } Platform;
            struct {
              libkn_KType* (*_type)(void);
              libkn_kref_com_example_kotlin_sample_OhosPlatform (*OhosPlatform)();
              const char* (*get_name)(libkn_kref_com_example_kotlin_sample_OhosPlatform thiz);
            } OhosPlatform;
            const char* (*appInfo)();
            const char* (*getKotlinAnalyticsInfo_)();
            const char* (*getKotlinGreeting_)();
            const char* (*getKotlinUiText_)();
            const char* (*ohosUiText)();
            void (*triggerCpuFreeze_)();
            libkn_KInt (*triggerKotlinHeapOverflow_)();
            libkn_KInt (*triggerKotlinHeapUseAfterFree_)();
            libkn_KInt (*triggerKotlinNpe_)();
            libkn_KInt (*triggerKotlinOutOfBounds_)();
            libkn_KInt (*triggerKotlinStackBufferOverflow_)();
            void (*triggerKotlinToCCrash_)();
            void* (*getStaticLibImage_)();
            libkn_KInt (*getStaticLibImageSize_)();
            libkn_KInt (*getStaticLibSum_)(libkn_KInt a, libkn_KInt b);
            const char* (*getStaticLibVersion_)();
            libkn_kref_com_example_kotlin_sample_Platform (*getPlatform)();
          } kotlin_sample;
        } example;
      } com;
    } root;
  } kotlin;
} libkn_ExportedSymbols;
extern libkn_ExportedSymbols* libkn_symbols(void);
#ifdef __cplusplus
}  /* extern "C" */
#endif
#endif  /* KONAN_LIBKN_H */
