#ifndef SIM_INLINE_H
#define SIM_INLINE_H
#define H_REVEALS_MODULE 1
#define C_REVEALS_MODULE 2
#define INLINE_GLOBALS 4
#define INLINE_LOCALS 8
#define REGPARM_MODULE 32
#define ALL_H_INLINE (H_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
#define ALL_C_INLINE (C_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
#ifndef DEFAULT_INLINE
#define DEFAULT_INLINE INLINE_LOCALS
#endif
#define REVEAL_MODULE_P(X) (X & (H_REVEALS_MODULE | C_REVEALS_MODULE))
#define H_REVEALS_MODULE_P(X) ((X & H_REVEALS_MODULE))
#define C_REVEALS_MODULE_P(X) ((X & C_REVEALS_MODULE))
#ifndef HAVE_INLINE
#ifdef __GNUC__
#define HAVE_INLINE
#endif
#endif
#ifndef INLINE
#if defined (__GNUC__) && defined (__OPTIMIZE__)
#define INLINE __inline__
#else
#define INLINE
#endif
#endif
#ifndef INLINE2
#if defined (__GNUC__)
#define INLINE2 __inline__
#else
#define INLINE2
#endif
#endif
#ifndef STATIC_INLINE
#define STATIC_INLINE static INLINE
#endif
#ifndef EXTERN_INLINE
#define EXTERN_INLINE extern INLINE2
#endif
#ifndef NORETURN
#define NORETURN
#endif
#if !defined (UNUSED)
#if (!defined (__GNUC__) \
|| (__GNUC__ < 2) \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
#define UNUSED
#else
#define UNUSED __attribute__((__unused__))
#endif
#endif
#if !defined REGPARM
#if defined (__GNUC__) && (defined (__i386__) || defined (__i486__) || defined (__i586__) || defined (__i686__))
#if (WITH_REGPARM && WITH_STDCALL)
#define REGPARM __attribute__((__regparm__(WITH_REGPARM),__stdcall__))
#else
#if (WITH_REGPARM && !WITH_STDCALL)
#define REGPARM __attribute__((__regparm__(WITH_REGPARM)))
#else
#if (!WITH_REGPARM && WITH_STDCALL)
#define REGPARM __attribute__((__stdcall__))
#endif
#endif
#endif
#endif
#endif
#if !defined REGPARM
#define REGPARM
#endif
#if !defined (SIM_BITS_INLINE) && (DEFAULT_INLINE)
# define SIM_BITS_INLINE (ALL_H_INLINE)
#endif
#if (SIM_BITS_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_BITS REGPARM
#else
# define REGPARM_SIM_BITS
#endif
#if ((H_REVEALS_MODULE_P (SIM_BITS_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_BITS_C) \
&& (REVEAL_MODULE_P (SIM_BITS_INLINE)))
# if (SIM_BITS_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_BITS(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_BITS_P 0
# else
# define INLINE_SIM_BITS(TYPE) static TYPE UNUSED REGPARM_SIM_BITS
# define EXTERN_SIM_BITS_P 0
# endif
#else
# define INLINE_SIM_BITS(TYPE) TYPE REGPARM_SIM_BITS
# define EXTERN_SIM_BITS_P 1
#endif
#if (SIM_BITS_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_BITS(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_BITS(TYPE) static TYPE REGPARM_SIM_BITS
#endif
#define STATIC_SIM_BITS(TYPE) static TYPE
#if !defined (SIM_CORE_INLINE) && (DEFAULT_INLINE)
# define SIM_CORE_INLINE ALL_C_INLINE
#endif
#if (SIM_CORE_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_CORE REGPARM
#else
# define REGPARM_SIM_CORE
#endif
#if ((H_REVEALS_MODULE_P (SIM_CORE_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_CORE_C) \
&& (REVEAL_MODULE_P (SIM_CORE_INLINE)))
# if (SIM_CORE_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_CORE(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_CORE_P 0
#else
# define INLINE_SIM_CORE(TYPE) static TYPE UNUSED REGPARM_SIM_CORE
# define EXTERN_SIM_CORE_P 0
#endif
#else
# define INLINE_SIM_CORE(TYPE) TYPE REGPARM_SIM_CORE
# define EXTERN_SIM_CORE_P 1
#endif
#if (SIM_CORE_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_CORE(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_CORE(TYPE) static TYPE REGPARM_SIM_CORE
#endif
#define STATIC_SIM_CORE(TYPE) static TYPE
#if !defined (SIM_ENDIAN_INLINE) && (DEFAULT_INLINE)
# define SIM_ENDIAN_INLINE ALL_H_INLINE
#endif
#if (SIM_ENDIAN_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_ENDIAN REGPARM
#else
# define REGPARM_SIM_ENDIAN
#endif
#if ((H_REVEALS_MODULE_P (SIM_ENDIAN_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_ENDIAN_C) \
&& (REVEAL_MODULE_P (SIM_ENDIAN_INLINE)))
# if (SIM_ENDIAN_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_ENDIAN_P 0
# else
# define INLINE_SIM_ENDIAN(TYPE) static TYPE UNUSED REGPARM_SIM_ENDIAN
# define EXTERN_SIM_ENDIAN_P 0
# endif
#else
# define INLINE_SIM_ENDIAN(TYPE) TYPE REGPARM_SIM_ENDIAN
# define EXTERN_SIM_ENDIAN_P 1
#endif
#if (SIM_ENDIAN_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_ENDIAN(TYPE) static TYPE REGPARM_SIM_ENDIAN
#endif
#define STATIC_SIM_ENDIAN(TYPE) static TYPE
#if !defined (SIM_EVENTS_INLINE) && (DEFAULT_INLINE)
# define SIM_EVENTS_INLINE ALL_C_INLINE
#endif
#if (SIM_EVENTS_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_EVENTS REGPARM
#else
# define REGPARM_SIM_EVENTS
#endif
#if ((H_REVEALS_MODULE_P (SIM_EVENTS_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_EVENTS_C) \
&& (REVEAL_MODULE_P (SIM_EVENTS_INLINE)))
# if (SIM_EVENTS_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_EVENTS(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_EVENTS_P 0
# else
# define INLINE_SIM_EVENTS(TYPE) static TYPE UNUSED REGPARM_SIM_EVENTS
# define EXTERN_SIM_EVENTS_P 0
# endif
#else
# define INLINE_SIM_EVENTS(TYPE) TYPE REGPARM_SIM_EVENTS
# define EXTERN_SIM_EVENTS_P 1
#endif
#if (SIM_EVENTS_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_EVENTS(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_EVENTS(TYPE) static TYPE REGPARM_SIM_EVENTS
#endif
#define STATIC_SIM_EVENTS(TYPE) static TYPE
#if !defined (SIM_FPU_INLINE) && (DEFAULT_INLINE)
# define SIM_FPU_INLINE ALL_C_INLINE
#endif
#if (SIM_FPU_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_FPU REGPARM
#else
# define REGPARM_SIM_FPU
#endif
#if ((H_REVEALS_MODULE_P (SIM_FPU_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_FPU_C) \
&& (REVEAL_MODULE_P (SIM_FPU_INLINE)))
# if (SIM_FPU_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_FPU(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_FPU_P 0
# else
# define INLINE_SIM_FPU(TYPE) static TYPE UNUSED REGPARM_SIM_FPU
# define EXTERN_SIM_FPU_P 0
# endif
#else
# define INLINE_SIM_FPU(TYPE) TYPE REGPARM_SIM_FPU
# define EXTERN_SIM_FPU_P 1
#endif
#if (SIM_FPU_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_FPU(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_FPU(TYPE) static TYPE REGPARM_SIM_FPU
#endif
#define STATIC_SIM_FPU(TYPE) static TYPE
#if (SIM_TYPES_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_TYPES REGPARM
#else
# define REGPARM_SIM_TYPES
#endif
#if ((H_REVEALS_MODULE_P (SIM_TYPES_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_TYPES_C) \
&& (REVEAL_MODULE_P (SIM_TYPES_INLINE)))
# if (SIM_TYPES_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_TYPES(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_TYPES_P 0
# else
# define INLINE_SIM_TYPES(TYPE) static TYPE UNUSED REGPARM_SIM_TYPES
# define EXTERN_SIM_TYPES_P 0
# endif
#else
# define INLINE_SIM_TYPES(TYPE) TYPE REGPARM_SIM_TYPES
# define EXTERN_SIM_TYPES_P 1
#endif
#if (SIM_TYPES_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_TYPES(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_TYPES(TYPE) static TYPE REGPARM_SIM_TYPES
#endif
#define STATIC_SIM_TYPES(TYPE) static TYPE
#if !defined (SIM_MAIN_INLINE) && (DEFAULT_INLINE)
# define SIM_MAIN_INLINE (ALL_C_INLINE)
#endif
#if (SIM_MAIN_INLINE & REGPARM_MODULE)
# define REGPARM_SIM_MAIN REGPARM
#else
# define REGPARM_SIM_MAIN
#endif
#if ((H_REVEALS_MODULE_P (SIM_MAIN_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SIM_MAIN_C) \
&& (REVEAL_MODULE_P (SIM_MAIN_INLINE)))
# if (SIM_MAIN_INLINE & INLINE_GLOBALS)
# define INLINE_SIM_MAIN(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SIM_MAIN_P 0
# else
# define INLINE_SIM_MAIN(TYPE) static TYPE UNUSED REGPARM_SIM_MAIN
# define EXTERN_SIM_MAIN_P 0
# endif
#else
# define INLINE_SIM_MAIN(TYPE) TYPE REGPARM_SIM_MAIN
# define EXTERN_SIM_MAIN_P 1
#endif
#if (SIM_MAIN_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SIM_MAIN(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SIM_MAIN(TYPE) static TYPE REGPARM_SIM_MAIN
#endif
#define STATIC_SIM_MAIN(TYPE) static TYPE
#if (ENGINE_INLINE & REGPARM_MODULE)
# define REGPARM_ENGINE REGPARM
#else
# define REGPARM_ENGINE
#endif
#if ((H_REVEALS_MODULE_P (ENGINE_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (ENGINE_C) \
&& (REVEAL_MODULE_P (ENGINE_INLINE)))
# if (ENGINE_INLINE & INLINE_GLOBALS)
# define INLINE_ENGINE(TYPE) static INLINE TYPE UNUSED
# define EXTERN_ENGINE_P 0
# else
# define INLINE_ENGINE(TYPE) static TYPE UNUSED REGPARM_ENGINE
# define EXTERN_ENGINE_P 0
# endif
#else
# define INLINE_ENGINE(TYPE) TYPE REGPARM_ENGINE
# define EXTERN_ENGINE_P 1
#endif
#if (ENGINE_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_ENGINE(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_ENGINE(TYPE) static TYPE REGPARM_ENGINE
#endif
#define STATIC_ENGINE(TYPE) static TYPE
#if (ICACHE_INLINE & REGPARM_MODULE)
# define REGPARM_ICACHE REGPARM
#else
# define REGPARM_ICACHE
#endif
#if ((H_REVEALS_MODULE_P (ICACHE_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (ICACHE_C) \
&& (REVEAL_MODULE_P (ICACHE_INLINE)))
# if (ICACHE_INLINE & INLINE_GLOBALS)
# define INLINE_ICACHE(TYPE) static INLINE TYPE UNUSED
# define EXTERN_ICACHE_P 0
#else
# define INLINE_ICACHE(TYPE) static TYPE UNUSED REGPARM_ICACHE
# define EXTERN_ICACHE_P 0
#endif
#else
# define INLINE_ICACHE(TYPE) TYPE REGPARM_ICACHE
# define EXTERN_ICACHE_P 1
#endif
#if (ICACHE_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_ICACHE(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_ICACHE(TYPE) static TYPE REGPARM_ICACHE
#endif
#define STATIC_ICACHE(TYPE) static TYPE
#if (IDECODE_INLINE & REGPARM_MODULE)
# define REGPARM_IDECODE REGPARM
#else
# define REGPARM_IDECODE
#endif
#if ((H_REVEALS_MODULE_P (IDECODE_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (IDECODE_C) \
&& (REVEAL_MODULE_P (IDECODE_INLINE)))
# if (IDECODE_INLINE & INLINE_GLOBALS)
# define INLINE_IDECODE(TYPE) static INLINE TYPE UNUSED
# define EXTERN_IDECODE_P 0
#else
# define INLINE_IDECODE(TYPE) static TYPE UNUSED REGPARM_IDECODE
# define EXTERN_IDECODE_P 0
#endif
#else
# define INLINE_IDECODE(TYPE) TYPE REGPARM_IDECODE
# define EXTERN_IDECODE_P 1
#endif
#if (IDECODE_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_IDECODE(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_IDECODE(TYPE) static TYPE REGPARM_IDECODE
#endif
#define STATIC_IDECODE(TYPE) static TYPE
#if (SEMANTICS_INLINE & REGPARM_MODULE)
# define REGPARM_SEMANTICS REGPARM
#else
# define REGPARM_SEMANTICS
#endif
#if ((H_REVEALS_MODULE_P (SEMANTICS_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SEMANTICS_C) \
&& (REVEAL_MODULE_P (SEMANTICS_INLINE)))
# if (SEMANTICS_INLINE & INLINE_GLOBALS)
# define INLINE_SEMANTICS(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SEMANTICS_P 0
#else
# define INLINE_SEMANTICS(TYPE) static TYPE UNUSED REGPARM_SEMANTICS
# define EXTERN_SEMANTICS_P 0
#endif
#else
# define INLINE_SEMANTICS(TYPE) TYPE REGPARM_SEMANTICS
# define EXTERN_SEMANTICS_P 1
#endif
#if EXTERN_SEMANTICS_P
# define EXTERN_SEMANTICS(TYPE) TYPE REGPARM_SEMANTICS
#else
# define EXTERN_SEMANTICS(TYPE) static TYPE UNUSED REGPARM_SEMANTICS
#endif
#if (SEMANTICS_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SEMANTICS(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SEMANTICS(TYPE) static TYPE REGPARM_SEMANTICS
#endif
#define STATIC_SEMANTICS(TYPE) static TYPE
#if !defined (SUPPORT_INLINE) && (DEFAULT_INLINE)
# define SUPPORT_INLINE ALL_C_INLINE
#endif
#if (SUPPORT_INLINE & REGPARM_MODULE)
# define REGPARM_SUPPORT REGPARM
#else
# define REGPARM_SUPPORT
#endif
#if ((H_REVEALS_MODULE_P (SUPPORT_INLINE) || defined (SIM_INLINE_C)) \
&& !defined (SUPPORT_C) \
&& (REVEAL_MODULE_P (SUPPORT_INLINE)))
# if (SUPPORT_INLINE & INLINE_GLOBALS)
# define INLINE_SUPPORT(TYPE) static INLINE TYPE UNUSED
# define EXTERN_SUPPORT_P 0
#else
# define INLINE_SUPPORT(TYPE) static TYPE UNUSED REGPARM_SUPPORT
# define EXTERN_SUPPORT_P 0
#endif
#else
# define INLINE_SUPPORT(TYPE) TYPE REGPARM_SUPPORT
# define EXTERN_SUPPORT_P 1
#endif
#if (SUPPORT_INLINE & INLINE_LOCALS)
# define STATIC_INLINE_SUPPORT(TYPE) static INLINE TYPE
#else
# define STATIC_INLINE_SUPPORT(TYPE) static TYPE REGPARM_SUPPORT
#endif
#define STATIC_SUPPORT(TYPE) static TYPE
#endif