#include "omc_simulation_settings.h"
#include "NFInst.h"
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT0,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT0 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT0)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT1,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT1 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT1)
#define _OMC_LIT2_data "Cannot instantiate %s due to class specialization %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,53,_OMC_LIT2_data);
#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT3,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT2}};
#define _OMC_LIT3 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT3)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT4,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(525)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT3}};
#define _OMC_LIT4 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT4)
#define _OMC_LIT5_data "."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,1,_OMC_LIT5_data);
#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
#define _OMC_LIT6_data "Illegal to instantiate partial class %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,40,_OMC_LIT6_data);
#define _OMC_LIT6 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT7,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT6}};
#define _OMC_LIT7 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT7)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT8,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(38)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT7}};
#define _OMC_LIT8 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "fixed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,5,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
#define _OMC_LIT10_data "stateSelect"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT10,11,_OMC_LIT10_data);
#define _OMC_LIT10 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT10)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT11,2,1) {_OMC_LIT10,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT11 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT11)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT12,2,1) {_OMC_LIT9,_OMC_LIT11}};
#define _OMC_LIT12 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT12)
#define _OMC_LIT13_data "An inner declaration for outer element '%s' could not be found, and could not be automatically generated due to an existing declaration of that name."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT13,149,_OMC_LIT13_data);
#define _OMC_LIT13 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT13)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT14,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT13}};
#define _OMC_LIT14 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT14)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT15,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(380)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT14}};
#define _OMC_LIT15 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT15)
#define _OMC_LIT16_data "allowNonStandardModelica"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT16,24,_OMC_LIT16_data);
#define _OMC_LIT16 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT16)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT17,1,4) {&Flags_FlagVisibility_EXTERNAL__desc,}};
#define _OMC_LIT17 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT17)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT18,2,9) {&Flags_FlagData_STRING__LIST__FLAG__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT18 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT18)
#define _OMC_LIT19_data "nonStdMultipleExternalDeclarations"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT19,34,_OMC_LIT19_data);
#define _OMC_LIT19 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT19)
#define _OMC_LIT20_data "Allow several external declarations in functions.\nSee: https://specification.modelica.org/maint/3.5/functions.html#function-as-a-specialized-class"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT20,146,_OMC_LIT20_data);
#define _OMC_LIT20 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT20)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT21,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT20}};
#define _OMC_LIT21 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT21)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT22,2,0) {_OMC_LIT19,_OMC_LIT21}};
#define _OMC_LIT22 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT22)
#define _OMC_LIT23_data "nonStdEnumerationAsIntegers"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT23,27,_OMC_LIT23_data);
#define _OMC_LIT23 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT23)
#define _OMC_LIT24_data "Allow enumeration as integer without casting via Integer(Enum).\nSee: https://specification.modelica.org/maint/3.5/class-predefined-types-and-declarations.html#type-conversion-of-enumeration-values-to-string-or-integer"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT24,217,_OMC_LIT24_data);
#define _OMC_LIT24 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT24)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT25,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT24}};
#define _OMC_LIT25 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT25)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT26,2,0) {_OMC_LIT23,_OMC_LIT25}};
#define _OMC_LIT26 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT26)
#define _OMC_LIT27_data "nonStdIntegersAsEnumeration"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT27,27,_OMC_LIT27_data);
#define _OMC_LIT27 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT27)
#define _OMC_LIT28_data "Allow integer as enumeration without casting via Enum(Integer).\nSee: https://specification.modelica.org/maint/3.5/class-predefined-types-and-declarations.html#type-conversion-of-integer-to-enumeration-values"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT28,207,_OMC_LIT28_data);
#define _OMC_LIT28 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT28)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT29,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT28}};
#define _OMC_LIT29 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT29)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT30,2,0) {_OMC_LIT27,_OMC_LIT29}};
#define _OMC_LIT30 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT30)
#define _OMC_LIT31_data "nonStdDifferentCaseFileVsClassName"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT31,34,_OMC_LIT31_data);
#define _OMC_LIT31 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT31)
#define _OMC_LIT32_data "Allow directory or file with different case in the name than the contained class name.\nSee: https://specification.modelica.org/maint/3.5/packages.html#mapping-package-class-structures-to-a-hierarchical-file-system"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT32,213,_OMC_LIT32_data);
#define _OMC_LIT32 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT32)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT33,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT32}};
#define _OMC_LIT33 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT33)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT34,2,0) {_OMC_LIT31,_OMC_LIT33}};
#define _OMC_LIT34 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "nonStdTopLevelOuter"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,19,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
#define _OMC_LIT36_data "Allow top level outer.\nSee: https://specification.modelica.org/maint/3.6/scoping-name-lookup-and-flattening.html#S4.p1"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT36,118,_OMC_LIT36_data);
#define _OMC_LIT36 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT36)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT37,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT36}};
#define _OMC_LIT37 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT37)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT38,2,0) {_OMC_LIT35,_OMC_LIT37}};
#define _OMC_LIT38 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT38)
#define _OMC_LIT39_data "protectedAccess"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT39,15,_OMC_LIT39_data);
#define _OMC_LIT39 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data "Allow access of protected elements"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,34,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT41,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT40}};
#define _OMC_LIT41 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,2,0) {_OMC_LIT39,_OMC_LIT41}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
#define _OMC_LIT43_data "reinitInAlgorithms"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT43,18,_OMC_LIT43_data);
#define _OMC_LIT43 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT43)
#define _OMC_LIT44_data "Allow reinit in algorithm sections"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT44,34,_OMC_LIT44_data);
#define _OMC_LIT44 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT44)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT45,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT44}};
#define _OMC_LIT45 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT45)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT46,2,0) {_OMC_LIT43,_OMC_LIT45}};
#define _OMC_LIT46 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT46)
#define _OMC_LIT47_data "unbalancedModel"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT47,15,_OMC_LIT47_data);
#define _OMC_LIT47 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT47)
#define _OMC_LIT48_data "Allow models to be locally unbalanced and to have unbalanced connectors"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT48,71,_OMC_LIT48_data);
#define _OMC_LIT48 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT48)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT49,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT48}};
#define _OMC_LIT49 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT49)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT50,2,0) {_OMC_LIT47,_OMC_LIT49}};
#define _OMC_LIT50 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT50)
#define _OMC_LIT51_data "implicitParameterStartAttribute"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT51,31,_OMC_LIT51_data);
#define _OMC_LIT51 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data "Allow fixed parameters with no binding or start attribute"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,57,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT53,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT52}};
#define _OMC_LIT53 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT53)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT54,2,0) {_OMC_LIT51,_OMC_LIT53}};
#define _OMC_LIT54 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT54)
#define _OMC_LIT55_data "initialSimplified"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT55,17,_OMC_LIT55_data);
#define _OMC_LIT55 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT55)
#define _OMC_LIT56_data "Allow use of experimental operator `initialSimplified()`"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT56,56,_OMC_LIT56_data);
#define _OMC_LIT56 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT56)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT57,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT56}};
#define _OMC_LIT57 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT57)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT58,2,0) {_OMC_LIT55,_OMC_LIT57}};
#define _OMC_LIT58 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data "illegalConditionalContext"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,25,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data "Allow use of components with false conditions in illegal contexts"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,65,_OMC_LIT60_data);
#define _OMC_LIT60 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT60)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT61,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT60}};
#define _OMC_LIT61 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT61)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT62,2,0) {_OMC_LIT59,_OMC_LIT61}};
#define _OMC_LIT62 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT62)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT63,2,1) {_OMC_LIT62,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT63 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT63)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT64,2,1) {_OMC_LIT58,_OMC_LIT63}};
#define _OMC_LIT64 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT64)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT65,2,1) {_OMC_LIT54,_OMC_LIT64}};
#define _OMC_LIT65 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT65)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT66,2,1) {_OMC_LIT50,_OMC_LIT65}};
#define _OMC_LIT66 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT66)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT67,2,1) {_OMC_LIT46,_OMC_LIT66}};
#define _OMC_LIT67 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT67)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT68,2,1) {_OMC_LIT42,_OMC_LIT67}};
#define _OMC_LIT68 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT68)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT69,2,1) {_OMC_LIT38,_OMC_LIT68}};
#define _OMC_LIT69 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT69)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT70,2,1) {_OMC_LIT34,_OMC_LIT69}};
#define _OMC_LIT70 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT70)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT71,2,1) {_OMC_LIT30,_OMC_LIT70}};
#define _OMC_LIT71 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT71)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT72,2,1) {_OMC_LIT26,_OMC_LIT71}};
#define _OMC_LIT72 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT72)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT73,2,1) {_OMC_LIT22,_OMC_LIT72}};
#define _OMC_LIT73 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT73)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT74,2,4) {&Flags_ValidOptions_STRING__DESC__OPTION__desc,_OMC_LIT73}};
#define _OMC_LIT74 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT74)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT75,1,1) {_OMC_LIT74}};
#define _OMC_LIT75 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT75)
#define _OMC_LIT76_data "Flags to allow non-standard Modelica."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT76,37,_OMC_LIT76_data);
#define _OMC_LIT76 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT76)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT77,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT76}};
#define _OMC_LIT77 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT77)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT78,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(143)),_OMC_LIT16,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT17,_OMC_LIT18,_OMC_LIT75,_OMC_LIT77}};
#define _OMC_LIT78 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT78)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT79,1,5) {&ErrorTypes_Severity_WARNING__desc,}};
#define _OMC_LIT79 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT79)
#define _OMC_LIT80_data "The model can't be instantiated due to top-level outer element '%s', it may only be used as part of a simulation model."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT80,119,_OMC_LIT80_data);
#define _OMC_LIT80 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT80)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT81,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT80}};
#define _OMC_LIT81 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT81)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT82,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(379)),_OMC_LIT0,_OMC_LIT79,_OMC_LIT81}};
#define _OMC_LIT82 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT82)
#define _OMC_LIT83_data "An inner declaration for outer %s %s could not be found and was automatically generated."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT83,88,_OMC_LIT83_data);
#define _OMC_LIT83 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT83)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT84,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT83}};
#define _OMC_LIT84 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT84)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT85,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(309)),_OMC_LIT0,_OMC_LIT79,_OMC_LIT84}};
#define _OMC_LIT85 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT85)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT86,1,4) {&NFPrefixes_Replaceable_NOT__REPLACEABLE__desc,}};
#define _OMC_LIT86 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT86)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT87,10,3) {&NFAttributes_ATTRIBUTES__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT86,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT87 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT87)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT88,1,5) {&NFModifier_Modifier_NOMOD__desc,}};
#define _OMC_LIT88 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data "missingInnerMessage"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,19,_OMC_LIT89_data);
#define _OMC_LIT89 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT89)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT90,1,6) {&ErrorTypes_Severity_NOTIFICATION__desc,}};
#define _OMC_LIT90 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT90)
#define _OMC_LIT91_data "The diagnostics message for the missing inner is: %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT91,52,_OMC_LIT91_data);
#define _OMC_LIT91 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT91)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT92,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT91}};
#define _OMC_LIT92 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT92)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT93,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(310)),_OMC_LIT0,_OMC_LIT90,_OMC_LIT92}};
#define _OMC_LIT93 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT93)
#define _OMC_LIT94_data "An iterator named '%s' is already declared in this scope."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT94,57,_OMC_LIT94_data);
#define _OMC_LIT94 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT94)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT95,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT94}};
#define _OMC_LIT95 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT95)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT96,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(360)),_OMC_LIT0,_OMC_LIT79,_OMC_LIT95}};
#define _OMC_LIT96 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT96)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT97,1,13) {&NFType_UNKNOWN__desc,}};
#define _OMC_LIT97 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "Assignment to iterator '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,28,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT99,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT98}};
#define _OMC_LIT99 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT99)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT100,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(415)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT99}};
#define _OMC_LIT100 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT100)
#define _OMC_LIT101_data "Component '%s' may not be assigned to due to class specialization '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT101,71,_OMC_LIT101_data);
#define _OMC_LIT101 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT101)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT102,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT101}};
#define _OMC_LIT102 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT102)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT103,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(401)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT102}};
#define _OMC_LIT103 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT103)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT104,1,3) {&NFStatement_ForType_NORMAL__desc,}};
#define _OMC_LIT104 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT104)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT105,2,4) {&NFStatement_ForType_PARALLEL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT105 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT105)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT106,2,6) {&NFExpression_BOOLEAN__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT106 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT106)
#define _OMC_LIT107_data "A when-statement may not be used inside a function or a while, if, or for-clause."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT107,81,_OMC_LIT107_data);
#define _OMC_LIT107 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT107)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT108,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT107}};
#define _OMC_LIT108 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT108)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT109,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(336)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT108}};
#define _OMC_LIT109 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT109)
#define _OMC_LIT110_data "when-clause is not allowed in initial section."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT110,46,_OMC_LIT110_data);
#define _OMC_LIT110 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT110)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT111,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT110}};
#define _OMC_LIT111 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT111)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT112,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(139)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT111}};
#define _OMC_LIT112 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data "Nested when statements are not allowed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,39,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT114,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT113}};
#define _OMC_LIT114 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT114)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT115,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(126)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT114}};
#define _OMC_LIT115 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT115)
#define _OMC_LIT116_data "Operator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT116,135,_OMC_LIT116_data);
#define _OMC_LIT116 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT116)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT117,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT116}};
#define _OMC_LIT117 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(618)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT117}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
#define _OMC_LIT119_data "Operator reinit may only be used in the body of a when equation."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT119,64,_OMC_LIT119_data);
#define _OMC_LIT119 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT119}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(563)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT120}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
#define _OMC_LIT122_data "'return' may not be used outside function."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT122,42,_OMC_LIT122_data);
#define _OMC_LIT122 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT122}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(281)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT123}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
#define _OMC_LIT125_data "'break' may only be used in a while- or for-loop."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT125,49,_OMC_LIT125_data);
#define _OMC_LIT125 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT125}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT127,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(378)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT126}};
#define _OMC_LIT127 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "NFInst.instStatement got unknown statement"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,42,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
#define _OMC_LIT129_data "/home/per/workspace/OpenModelica/OMCompiler/Compiler/NFFrontEnd/NFInst.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT129,73,_OMC_LIT129_data);
#define _OMC_LIT129 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT129)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT130_6,1.772187825e9);
#define _OMC_LIT130_6 MMC_REFREALLIT(_OMC_LIT_STRUCT130_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT130,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3687)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3687)),MMC_IMMEDIATE(MMC_TAGFIXNUM(91)),_OMC_LIT130_6}};
#define _OMC_LIT130 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT130)
#define _OMC_LIT131_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT131,0,_OMC_LIT131_data);
#define _OMC_LIT131 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT131)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT132,0.0);
#define _OMC_LIT132 MMC_REFREALLIT(_OMC_LIT_STRUCT132)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT133,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT131,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT132}};
#define _OMC_LIT133 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT133)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT134,1,4) {&DAE_ComponentPrefix_NOCOMPPRE__desc,}};
#define _OMC_LIT134 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,8,3) {&DAE_ElementSource_SOURCE__desc,_OMC_LIT133,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT134,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
#define _OMC_LIT136_data "connect may not be used inside when-equations (found connect(%s, %s))."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT136,70,_OMC_LIT136_data);
#define _OMC_LIT136 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT136)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT137,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT136}};
#define _OMC_LIT137 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT137)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT138,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(117)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT137}};
#define _OMC_LIT138 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT138)
#define _OMC_LIT139_data "Connect equations are not allowed in initial equation sections."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT139,63,_OMC_LIT139_data);
#define _OMC_LIT139 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT139)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT140,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT139}};
#define _OMC_LIT140 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT140)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT141,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(221)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT140}};
#define _OMC_LIT141 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT141)
#define _OMC_LIT142_data "NFInst.instEquation got unknown equation"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT142,40,_OMC_LIT142_data);
#define _OMC_LIT142 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT142)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT143_6,1.772187825e9);
#define _OMC_LIT143_6 MMC_REFREALLIT(_OMC_LIT_STRUCT143_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT143,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3469)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3469)),MMC_IMMEDIATE(MMC_TAGFIXNUM(90)),_OMC_LIT143_6}};
#define _OMC_LIT143 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT143)
#define _OMC_LIT144_data "transition"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT144,10,_OMC_LIT144_data);
#define _OMC_LIT144 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "initialState"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,12,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
#define _OMC_LIT146_data "'%s' is not a valid language for an external function."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT146,54,_OMC_LIT146_data);
#define _OMC_LIT146 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT146)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT147,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT146}};
#define _OMC_LIT147 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT147)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT148,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(316)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT147}};
#define _OMC_LIT148 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT148)
#define _OMC_LIT149_data "C"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT149,1,_OMC_LIT149_data);
#define _OMC_LIT149 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT149)
#define _OMC_LIT150_data "FORTRAN 77"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT150,10,_OMC_LIT150_data);
#define _OMC_LIT150 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT150)
#define _OMC_LIT151_data "Fortran 77"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT151,10,_OMC_LIT151_data);
#define _OMC_LIT151 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "builtin"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,7,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,1,4) {&NFComponentRef_EMPTY__desc,}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
#define _OMC_LIT154_data "Function %s has more than one algorithm section or external declaration."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT154,72,_OMC_LIT154_data);
#define _OMC_LIT154 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT154)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT155,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT154}};
#define _OMC_LIT155 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT155)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT156,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(315)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT155}};
#define _OMC_LIT156 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT156)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT157,1,8) {&NFSubscript_WHOLE__desc,}};
#define _OMC_LIT157 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT157)
#define _OMC_LIT158_data "Wrong number of subscripts in %s (%s subscripts for %s dimensions)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT158,67,_OMC_LIT158_data);
#define _OMC_LIT158 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT158)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT159,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT158}};
#define _OMC_LIT159 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT159)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT160,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(154)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT159}};
#define _OMC_LIT160 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT160)
#define _OMC_LIT161_data "0"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT161,1,_OMC_LIT161_data);
#define _OMC_LIT161 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT161)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT162,1,6) {&NFDimension_BOOLEAN__desc,}};
#define _OMC_LIT162 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT162)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT163,2,1) {_OMC_LIT162,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT163 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT163)
#define _OMC_LIT164_data "NFInst.instCrefTypename got unknown class node "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT164,47,_OMC_LIT164_data);
#define _OMC_LIT164 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT165_6,1.772187825e9);
#define _OMC_LIT165_6 MMC_REFREALLIT(_OMC_LIT_STRUCT165_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3048)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3049)),MMC_IMMEDIATE(MMC_TAGFIXNUM(44)),_OMC_LIT165_6}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
#define _OMC_LIT166_data "Variable %s not found in scope %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT166,34,_OMC_LIT166_data);
#define _OMC_LIT166 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT166)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT167,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT166}};
#define _OMC_LIT167 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT167)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT168,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT167}};
#define _OMC_LIT168 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT168)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT169,1,5) {&NFComponentRef_WILD__desc,}};
#define _OMC_LIT169 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT169)
#define _OMC_LIT170_data "NFInst.instCref got invalid instance node"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT170,41,_OMC_LIT170_data);
#define _OMC_LIT170 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT170)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT171_6,1.772187825e9);
#define _OMC_LIT171_6 MMC_REFREALLIT(_OMC_LIT_STRUCT171_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT171,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2973)),MMC_IMMEDIATE(MMC_TAGFIXNUM(15)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2973)),MMC_IMMEDIATE(MMC_TAGFIXNUM(101)),_OMC_LIT171_6}};
#define _OMC_LIT171 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,1,18) {&NFExpression_END__desc,}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
#define _OMC_LIT173_data "NFInst.instExp got unknown expression: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT173,39,_OMC_LIT173_data);
#define _OMC_LIT173 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT173)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT174_6,1.772187825e9);
#define _OMC_LIT174_6 MMC_REFREALLIT(_OMC_LIT_STRUCT174_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT174,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2933)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2933)),MMC_IMMEDIATE(MMC_TAGFIXNUM(123)),_OMC_LIT174_6}};
#define _OMC_LIT174 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT174)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT175,1,3) {&NFBinding_UNBOUND__desc,}};
#define _OMC_LIT175 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT175)
#define _OMC_LIT176_data "NFInst.instBinding"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT176,18,_OMC_LIT176_data);
#define _OMC_LIT176 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT176)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT177,1,5) {&NFSections_EMPTY__desc,}};
#define _OMC_LIT177 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT177)
#define _OMC_LIT178_data "NFInst.instComponentExpressions got invalid component"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT178,53,_OMC_LIT178_data);
#define _OMC_LIT178 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT179_6,1.772187825e9);
#define _OMC_LIT179_6 MMC_REFREALLIT(_OMC_LIT_STRUCT179_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2745)),MMC_IMMEDIATE(MMC_TAGFIXNUM(11)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2745)),MMC_IMMEDIATE(MMC_TAGFIXNUM(93)),_OMC_LIT179_6}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
#define _OMC_LIT180_data "Invalid redeclaration of %s, attributes of basic types may not be redeclared."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT180,77,_OMC_LIT180_data);
#define _OMC_LIT180 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT180)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT181,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT180}};
#define _OMC_LIT181 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT181)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT182,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(215)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT181}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,1,3) {&NFComplexType_CLASS__desc,}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
#define _OMC_LIT184_data "Type '%s' does not extend a basic type."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT184,39,_OMC_LIT184_data);
#define _OMC_LIT184 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT184)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT185,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT184}};
#define _OMC_LIT185 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(330)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT185}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
#define _OMC_LIT187_data "__OpenModelica_builtinType"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT187,26,_OMC_LIT187_data);
#define _OMC_LIT187 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT187)
#define _OMC_LIT188_data "NFInst.instExpressions got invalid class"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT188,40,_OMC_LIT188_data);
#define _OMC_LIT188 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT188)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT189_6,1.772187825e9);
#define _OMC_LIT189_6 MMC_REFREALLIT(_OMC_LIT_STRUCT189_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT189,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2579)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2579)),MMC_IMMEDIATE(MMC_TAGFIXNUM(87)),_OMC_LIT189_6}};
#define _OMC_LIT189 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT189)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT190,1,10) {&NFDimension_UNKNOWN__desc,}};
#define _OMC_LIT190 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT190)
#define _OMC_LIT191_data "start"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT191,5,_OMC_LIT191_data);
#define _OMC_LIT191 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT191)
#define _OMC_LIT192_data "Parameter %s has no value, and is fixed during initialization (fixed=true), using available start value (start=%s) as default value."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT192,132,_OMC_LIT192_data);
#define _OMC_LIT192 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT192)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT193,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT192}};
#define _OMC_LIT193 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT193)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT194,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(499)),_OMC_LIT0,_OMC_LIT79,_OMC_LIT193}};
#define _OMC_LIT194 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT194)
#define _OMC_LIT195_data "Declaration of element %s causes recursive definition of class %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT195,66,_OMC_LIT195_data);
#define _OMC_LIT195 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT195)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT196,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT195}};
#define _OMC_LIT196 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT196)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT197,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(92)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT196}};
#define _OMC_LIT197 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT197)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT198,1,11) {&NFInstNode_InstNode_EMPTY__NODE__desc,}};
#define _OMC_LIT198 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT198)
#define _OMC_LIT199_data "Recursion limit reached while instantiating '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT199,49,_OMC_LIT199_data);
#define _OMC_LIT199 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT199}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT201,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(349)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT200}};
#define _OMC_LIT201 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT201)
#define _OMC_LIT202_data "NFInst.instTypeSpec: TCOMPLEX not implemented.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT202,47,_OMC_LIT202_data);
#define _OMC_LIT202 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT202)
#define _OMC_LIT203_data "Modifier '%s' found on outer element %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT203,40,_OMC_LIT203_data);
#define _OMC_LIT203 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT203)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT204,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT203}};
#define _OMC_LIT204 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT204)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT205,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(307)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT204}};
#define _OMC_LIT205 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT205)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT206,10,3) {&SCodeDump_SCodeDumpOptions_OPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT206 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT206)
#define _OMC_LIT207_data "Invalid redeclaration of %s %s as %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT207,37,_OMC_LIT207_data);
#define _OMC_LIT207 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT207)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT208,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT207}};
#define _OMC_LIT208 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT208)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(40)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT208}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209)
#define _OMC_LIT210_data "Redeclaration with a new type requires '%s' to be replaceable."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT210,62,_OMC_LIT210_data);
#define _OMC_LIT210 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT210)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT211,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT210}};
#define _OMC_LIT211 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT211)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT212,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(41)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT211}};
#define _OMC_LIT212 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT212)
#define _OMC_LIT213_data "Invalid redeclaration of %s, a redeclare may not have a condition attribute."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT213,76,_OMC_LIT213_data);
#define _OMC_LIT213 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT213}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(325)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT214}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
#define _OMC_LIT216_data "NFInst.redeclareComponent got unknown components"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT216,48,_OMC_LIT216_data);
#define _OMC_LIT216 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT216)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT217_6,1.772187825e9);
#define _OMC_LIT217_6 MMC_REFREALLIT(_OMC_LIT_STRUCT217_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT217,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2239)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2239)),MMC_IMMEDIATE(MMC_TAGFIXNUM(92)),_OMC_LIT217_6}};
#define _OMC_LIT217 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT217)
#define _OMC_LIT218_data "Component '%s' may not have a binding equation due to class specialization '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT218,80,_OMC_LIT218_data);
#define _OMC_LIT218 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT218)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT219,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT218}};
#define _OMC_LIT219 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT219)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT220,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(400)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT219}};
#define _OMC_LIT220 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT220)
#define _OMC_LIT221_data "Component '%s' has partial type '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT221,37,_OMC_LIT221_data);
#define _OMC_LIT221 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT221)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT222,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT221}};
#define _OMC_LIT222 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT222)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT223,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(375)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT222}};
#define _OMC_LIT223 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT223)
#define _OMC_LIT224_data "%s is used as a function reference, but doesn't specify the partial prefix."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT224,75,_OMC_LIT224_data);
#define _OMC_LIT224 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT224)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT225,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT224}};
#define _OMC_LIT225 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT225)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT226,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5003)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT225}};
#define _OMC_LIT226 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT226)
#define _OMC_LIT227_data "absoluteValue"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT227,13,_OMC_LIT227_data);
#define _OMC_LIT227 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT227)
#define _OMC_LIT228_data "Redeclaration of enumeration '%s' is not a subtype of the redeclared element (use enumeration(:) for a generic replaceable enumeration)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT228,136,_OMC_LIT228_data);
#define _OMC_LIT228 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT228)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT229,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT228}};
#define _OMC_LIT229 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT229)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT230,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(356)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT229}};
#define _OMC_LIT230 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT230)
#define _OMC_LIT231_data "Redeclaration of %s '%s' is not a subtype of the redeclared element."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT231,68,_OMC_LIT231_data);
#define _OMC_LIT231 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT231}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT233,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(355)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT232}};
#define _OMC_LIT233 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT233)
#define _OMC_LIT234_data "NFInst.redeclareClass got unknown classes"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT234,41,_OMC_LIT234_data);
#define _OMC_LIT234 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT234)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT235_6,1.772187825e9);
#define _OMC_LIT235_6 MMC_REFREALLIT(_OMC_LIT_STRUCT235_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT235,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1798)),MMC_IMMEDIATE(MMC_TAGFIXNUM(11)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1798)),MMC_IMMEDIATE(MMC_TAGFIXNUM(91)),_OMC_LIT235_6}};
#define _OMC_LIT235 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT235)
#define _OMC_LIT236_data "A class extending from builtin type %s may not have other elements."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT236,67,_OMC_LIT236_data);
#define _OMC_LIT236 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT236)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT237,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT236}};
#define _OMC_LIT237 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT237)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT238,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(293)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT237}};
#define _OMC_LIT238 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT238)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT239_6,1.772187825e9);
#define _OMC_LIT239_6 MMC_REFREALLIT(_OMC_LIT_STRUCT239_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT239,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1784)),MMC_IMMEDIATE(MMC_TAGFIXNUM(11)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1784)),MMC_IMMEDIATE(MMC_TAGFIXNUM(91)),_OMC_LIT239_6}};
#define _OMC_LIT239 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT239)
#define _OMC_LIT240_data "Modified element %s not found in class %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT240,42,_OMC_LIT240_data);
#define _OMC_LIT240 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT240)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT241,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT240}};
#define _OMC_LIT241 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT241)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT242,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(214)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT241}};
#define _OMC_LIT242 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT242)
#define _OMC_LIT243_data "Protected element '%s' may not be modified, got '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT243,53,_OMC_LIT243_data);
#define _OMC_LIT243 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT243)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT244,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT243}};
#define _OMC_LIT244 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT244)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT245,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(396)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT244}};
#define _OMC_LIT245 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT245)
#define _OMC_LIT246_data "Found other base class for extends %s after instantiating extends."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT246,66,_OMC_LIT246_data);
#define _OMC_LIT246 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT246)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT247,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT246}};
#define _OMC_LIT247 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT247)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT248,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(306)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT247}};
#define _OMC_LIT248 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT248)
#define _OMC_LIT249_data "mergeComponents"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT249,15,_OMC_LIT249_data);
#define _OMC_LIT249 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT249)
#define _OMC_LIT250_data "Enables automatic merging of components into arrays."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT250,52,_OMC_LIT250_data);
#define _OMC_LIT250 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT250)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT251,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT250}};
#define _OMC_LIT251 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT251)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT252,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(190)),_OMC_LIT249,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT251}};
#define _OMC_LIT252 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT252)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT253,3,3) {&NFInst_InstSettings_SETTINGS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT253 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT253)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT254,1,3) {&NFClass_NOT__INSTANTIATED__desc,}};
#define _OMC_LIT254 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT254)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT255,1,3) {&NFInstNode_InstNodeType_NORMAL__CLASS__desc,}};
#define _OMC_LIT255 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT255)
#define _OMC_LIT256_data "NFInst.instClassDef got unknown class."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT256,38,_OMC_LIT256_data);
#define _OMC_LIT256 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT256)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT257_6,1.772187825e9);
#define _OMC_LIT257_6 MMC_REFREALLIT(_OMC_LIT_STRUCT257_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT257,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1273)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1273)),MMC_IMMEDIATE(MMC_TAGFIXNUM(88)),_OMC_LIT257_6}};
#define _OMC_LIT257 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT257)
#define _OMC_LIT258_data "Missing redeclare keyword on attempted redeclaration of class %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT258,65,_OMC_LIT258_data);
#define _OMC_LIT258 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT258)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT259,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT258}};
#define _OMC_LIT259 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT259)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT260,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(56)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT259}};
#define _OMC_LIT260 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT260)
#define _OMC_LIT261_data "Base class %s not found in scope %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT261,36,_OMC_LIT261_data);
#define _OMC_LIT261 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT261)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT262,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT261}};
#define _OMC_LIT262 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT262)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT263,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(39)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT262}};
#define _OMC_LIT263 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT263)
#define _OMC_LIT264_data "polymorphic"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT264,11,_OMC_LIT264_data);
#define _OMC_LIT264 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT264)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT265,1,5) {&NFLookupTree_Tree_EMPTY__desc,}};
#define _OMC_LIT265 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT265)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT266,1,5) {&NFDuplicateTree_Tree_EMPTY__desc,}};
#define _OMC_LIT266 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT266)
#define _OMC_LIT267_data "Recursive short class definition of %s in terms of %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT267,54,_OMC_LIT267_data);
#define _OMC_LIT267 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT267)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT268,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT267}};
#define _OMC_LIT268 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT268)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT269,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(153)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT268}};
#define _OMC_LIT269 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT269)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT270,1,3) {&SCode_Partial_PARTIAL__desc,}};
#define _OMC_LIT270 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT270)
#define _OMC_LIT271_data "'%s' may not be replaceable."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT271,28,_OMC_LIT271_data);
#define _OMC_LIT271 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT271)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT272,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT271}};
#define _OMC_LIT272 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT272)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT273,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(408)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT272}};
#define _OMC_LIT273 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT273)
#define _OMC_LIT274_data "External object %s contains invalid element '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT274,49,_OMC_LIT274_data);
#define _OMC_LIT274 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT274)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT275,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT274}};
#define _OMC_LIT275 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT275)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT276,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(313)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT275}};
#define _OMC_LIT276 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT276)
#define _OMC_LIT277_data "extends "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT277,8,_OMC_LIT277_data);
#define _OMC_LIT277 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT277)
#define _OMC_LIT278_data "ExternalObject"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT278,14,_OMC_LIT278_data);
#define _OMC_LIT278 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT278)
#define _OMC_LIT279_data "constructor"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT279,11,_OMC_LIT279_data);
#define _OMC_LIT279 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT279)
#define _OMC_LIT280_data "destructor"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT280,10,_OMC_LIT280_data);
#define _OMC_LIT280 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT280)
#define _OMC_LIT281_data "External object %s is missing a %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT281,35,_OMC_LIT281_data);
#define _OMC_LIT281 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT281)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT282,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT281}};
#define _OMC_LIT282 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT282)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT283,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(314)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT282}};
#define _OMC_LIT283 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT283)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT284,1,4) {&SCode_Encapsulated_NOT__ENCAPSULATED__desc,}};
#define _OMC_LIT284 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT284)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT285,1,4) {&SCode_Partial_NOT__PARTIAL__desc,}};
#define _OMC_LIT285 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT285)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT286,1,4) {&SCode_Final_NOT__FINAL__desc,}};
#define _OMC_LIT286 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT286)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT287,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc,}};
#define _OMC_LIT287 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT287)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT288,1,4) {&SCode_Replaceable_NOT__REPLACEABLE__desc,}};
#define _OMC_LIT288 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT288)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT289,6,3) {&NFClass_Prefixes_PREFIXES__desc,_OMC_LIT284,_OMC_LIT285,_OMC_LIT286,_OMC_LIT287,_OMC_LIT288}};
#define _OMC_LIT289 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT289)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT290,1,8) {&NFRestriction_EXTERNAL__OBJECT__desc,}};
#define _OMC_LIT290 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT290)
#define _OMC_LIT291_data "<"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT291,1,_OMC_LIT291_data);
#define _OMC_LIT291 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT291)
#define _OMC_LIT292_data ">"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT292,1,_OMC_LIT292_data);
#define _OMC_LIT292 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT292)
#define _OMC_LIT293_data "Class '%s' in 'extends %s' is replaceable, the base class name must be transitively non-replaceable."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT293,100,_OMC_LIT293_data);
#define _OMC_LIT293 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT293)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT294,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT293}};
#define _OMC_LIT294 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT294)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT295,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(172)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT294}};
#define _OMC_LIT295 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT295)
#define _OMC_LIT296_data "extends %s causes an instantiation loop."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT296,40,_OMC_LIT296_data);
#define _OMC_LIT296 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT296)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT297,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT296}};
#define _OMC_LIT297 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT297)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT298,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(19)),_OMC_LIT0,_OMC_LIT1,_OMC_LIT297}};
#define _OMC_LIT298 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT298)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT299,1,7) {&SCode_Mod_NOMOD__desc,}};
#define _OMC_LIT299 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT299)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT300,1,3) {&SCode_ConnectorType_POTENTIAL__desc,}};
#define _OMC_LIT300 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT300)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT301,1,5) {&SCode_Parallelism_NON__PARALLEL__desc,}};
#define _OMC_LIT301 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT301)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT302,1,3) {&SCode_Variability_VAR__desc,}};
#define _OMC_LIT302 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT302)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT303,1,5) {&Absyn_Direction_BIDIR__desc,}};
#define _OMC_LIT303 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT303)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT304,1,3) {&Absyn_IsField_NONFIELD__desc,}};
#define _OMC_LIT304 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT304)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT305,7,3) {&SCode_Attributes_ATTR__desc,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT300,_OMC_LIT301,_OMC_LIT302,_OMC_LIT303,_OMC_LIT304}};
#define _OMC_LIT305 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT305)
#define _OMC_LIT306_data "NFInst.expandClass2 got unknown class:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT306,39,_OMC_LIT306_data);
#define _OMC_LIT306 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT306)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT307_6,1.772187825e9);
#define _OMC_LIT307_6 MMC_REFREALLIT(_OMC_LIT_STRUCT307_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT307,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(699)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(699)),MMC_IMMEDIATE(MMC_TAGFIXNUM(125)),_OMC_LIT307_6}};
#define _OMC_LIT307 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT307)
#define _OMC_LIT308_data "NFInst.partialInstClass2 got non-class element"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT308,46,_OMC_LIT308_data);
#define _OMC_LIT308 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT308)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT309_6,1.772187825e9);
#define _OMC_LIT309_6 MMC_REFREALLIT(_OMC_LIT_STRUCT309_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT309,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT129,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(563)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_IMMEDIATE(MMC_TAGFIXNUM(563)),MMC_IMMEDIATE(MMC_TAGFIXNUM(116)),_OMC_LIT309_6}};
#define _OMC_LIT309 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT309)
#define _OMC_LIT310_data "Missing redeclare prefix on class extends %s, treating like redeclare anyway."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT310,77,_OMC_LIT310_data);
#define _OMC_LIT310 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT310)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT311,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT310}};
#define _OMC_LIT311 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT311)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT312,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(299)),_OMC_LIT0,_OMC_LIT79,_OMC_LIT311}};
#define _OMC_LIT312 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT312)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT313,1,6) {&NFInstNode_InstNodeType_BUILTIN__CLASS__desc,}};
#define _OMC_LIT313 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT313)
#define _OMC_LIT314_data "__OpenModelica_builtin"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT314,22,_OMC_LIT314_data);
#define _OMC_LIT314 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT314)
#define _OMC_LIT315_data "$OMC$PositiveMax"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT315,16,_OMC_LIT315_data);
#define _OMC_LIT315 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT315)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT316,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT316 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT316)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT317,1,4) {&SCode_Redeclare_NOT__REDECLARE__desc,}};
#define _OMC_LIT317 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT317)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT318,6,3) {&SCode_Prefixes_PREFIXES__desc,_OMC_LIT316,_OMC_LIT317,_OMC_LIT286,_OMC_LIT287,_OMC_LIT288}};
#define _OMC_LIT318 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT318)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT319,1,3) {&SCode_Encapsulated_ENCAPSULATED__desc,}};
#define _OMC_LIT319 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT319)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT320,1,5) {&Absyn_FunctionPurity_NO__PURITY__desc,}};
#define _OMC_LIT320 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT320)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT321,2,3) {&SCode_FunctionRestriction_FR__NORMAL__FUNCTION__desc,_OMC_LIT320}};
#define _OMC_LIT321 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT321)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT322,2,12) {&SCode_Restriction_R__FUNCTION__desc,_OMC_LIT321}};
#define _OMC_LIT322 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT322)
#define _OMC_LIT323_data "flowValue"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT323,9,_OMC_LIT323_data);
#define _OMC_LIT323 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT323)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT324,1,3) {&Absyn_Direction_INPUT__desc,}};
#define _OMC_LIT324 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT324)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT325,7,3) {&SCode_Attributes_ATTR__desc,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT300,_OMC_LIT301,_OMC_LIT302,_OMC_LIT324,_OMC_LIT304}};
#define _OMC_LIT325 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT325)
#define _OMC_LIT326_data "Real"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT326,4,_OMC_LIT326_data);
#define _OMC_LIT326 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT326)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT327,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT326}};
#define _OMC_LIT327 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT327)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT328,3,3) {&Absyn_TypeSpec_TPATH__desc,_OMC_LIT327,MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT328 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT328)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT329,3,3) {&SCode_Comment_COMMENT__desc,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT329 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT329)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT330,9,6) {&SCode_Element_COMPONENT__desc,_OMC_LIT323,_OMC_LIT318,_OMC_LIT325,_OMC_LIT328,_OMC_LIT299,_OMC_LIT329,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT133}};
#define _OMC_LIT330 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT330)
#define _OMC_LIT331_data "eps"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT331,3,_OMC_LIT331_data);
#define _OMC_LIT331 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT331)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT332,9,6) {&SCode_Element_COMPONENT__desc,_OMC_LIT331,_OMC_LIT318,_OMC_LIT325,_OMC_LIT328,_OMC_LIT299,_OMC_LIT329,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT133}};
#define _OMC_LIT332 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT332)
#define _OMC_LIT333_data "positiveMax"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT333,11,_OMC_LIT333_data);
#define _OMC_LIT333 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT333)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT334,1,4) {&Absyn_Direction_OUTPUT__desc,}};
#define _OMC_LIT334 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT334)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT335,7,3) {&SCode_Attributes_ATTR__desc,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT300,_OMC_LIT301,_OMC_LIT302,_OMC_LIT334,_OMC_LIT304}};
#define _OMC_LIT335 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT335)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT336,9,6) {&SCode_Element_COMPONENT__desc,_OMC_LIT333,_OMC_LIT318,_OMC_LIT335,_OMC_LIT328,_OMC_LIT299,_OMC_LIT329,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT133}};
#define _OMC_LIT336 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT336)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT337,2,1) {_OMC_LIT336,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT337 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT337)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT338,2,1) {_OMC_LIT332,_OMC_LIT337}};
#define _OMC_LIT338 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT338)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT339,2,1) {_OMC_LIT330,_OMC_LIT338}};
#define _OMC_LIT339 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT339)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT340,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT333,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT340 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT340)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT341,2,5) {&Absyn_Exp_CREF__desc,_OMC_LIT340}};
#define _OMC_LIT341 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT341)
#define _OMC_LIT342_data "max"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT342,3,_OMC_LIT342_data);
#define _OMC_LIT342 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT342)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT343,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT342,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT343 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT343)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT344,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT323,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT344 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT344)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT345,2,5) {&Absyn_Exp_CREF__desc,_OMC_LIT344}};
#define _OMC_LIT345 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT345)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT346,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT331,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT346 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT346)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT347,2,5) {&Absyn_Exp_CREF__desc,_OMC_LIT346}};
#define _OMC_LIT347 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT347)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT348,2,1) {_OMC_LIT347,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT348 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT348)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT349,2,1) {_OMC_LIT345,_OMC_LIT348}};
#define _OMC_LIT349 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT349)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT350,3,3) {&Absyn_FunctionArgs_FUNCTIONARGS__desc,_OMC_LIT349,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT350 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT350)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT351,4,14) {&Absyn_Exp_CALL__desc,_OMC_LIT343,_OMC_LIT350,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT351 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT351)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT352,5,3) {&SCode_Statement_ALG__ASSIGN__desc,_OMC_LIT341,_OMC_LIT351,_OMC_LIT329,_OMC_LIT133}};
#define _OMC_LIT352 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT352)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT353,2,1) {_OMC_LIT352,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT353 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT353)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT354,2,3) {&SCode_AlgorithmSection_ALGORITHM__desc,_OMC_LIT353}};
#define _OMC_LIT354 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT354)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT355,2,1) {_OMC_LIT354,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT355 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT355)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT356,9,3) {&SCode_ClassDef_PARTS__desc,_OMC_LIT339,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT355,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT356 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT356)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT357,9,5) {&SCode_Element_CLASS__desc,_OMC_LIT315,_OMC_LIT318,_OMC_LIT319,_OMC_LIT285,_OMC_LIT322,_OMC_LIT356,_OMC_LIT329,_OMC_LIT133}};
#define _OMC_LIT357 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT357)
#define _OMC_LIT358_data "baseModelica"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT358,12,_OMC_LIT358_data);
#define _OMC_LIT358 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT358)
#define _OMC_LIT359_data "f"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT359,1,_OMC_LIT359_data);
#define _OMC_LIT359 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT359)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT360,1,1) {_OMC_LIT359}};
#define _OMC_LIT360 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT360)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT361,2,4) {&Flags_FlagData_BOOL__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT361 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT361)
#define _OMC_LIT362_data "Outputs experimental Base Modelica."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT362,35,_OMC_LIT362_data);
#define _OMC_LIT362 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT362)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT363,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT362}};
#define _OMC_LIT363 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT363)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT364,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(135)),_OMC_LIT358,_OMC_LIT360,_OMC_LIT17,_OMC_LIT361,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT363}};
#define _OMC_LIT364 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT364)
#define _OMC_LIT365_data "<top>"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT365,5,_OMC_LIT365_data);
#define _OMC_LIT365 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT365)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT366,1,11) {&SCode_Restriction_R__PACKAGE__desc,}};
#define _OMC_LIT366 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT366)
#define _OMC_LIT367_data "<annotations>"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT367,13,_OMC_LIT367_data);
#define _OMC_LIT367 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT367)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT368,1,13) {&NFInstNode_InstNodeType_IMPLICIT__SCOPE__desc,}};
#define _OMC_LIT368 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT368)
#define _OMC_LIT369_data "Clock"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT369,5,_OMC_LIT369_data);
#define _OMC_LIT369 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT369)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT370,1,19) {&SCode_Restriction_R__PREDEFINED__CLOCK__desc,}};
#define _OMC_LIT370 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT370)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT371,9,3) {&SCode_ClassDef_PARTS__desc,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT371 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT371)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT372,9,5) {&SCode_Element_CLASS__desc,_OMC_LIT369,_OMC_LIT318,_OMC_LIT284,_OMC_LIT285,_OMC_LIT370,_OMC_LIT371,_OMC_LIT329,_OMC_LIT133}};
#define _OMC_LIT372 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT372)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT373,1,7) {&NFType_CLOCK__desc,}};
#define _OMC_LIT373 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT373)
#define _OMC_LIT374_data "quantity"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT374,8,_OMC_LIT374_data);
#define _OMC_LIT374 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT374)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT375,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT375 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT375)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT376,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(3))}};
#define _OMC_LIT376 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT376)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT377,3,4) {&NFLookupTree_Tree_LEAF__desc,_OMC_LIT9,_OMC_LIT376}};
#define _OMC_LIT377 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT377)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT378,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT378 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT378)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT379,3,4) {&NFLookupTree_Tree_LEAF__desc,_OMC_LIT191,_OMC_LIT378}};
#define _OMC_LIT379 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT379)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT380,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT374,_OMC_LIT375,MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),_OMC_LIT377,_OMC_LIT379}};
#define _OMC_LIT380 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT380)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT381,1,5) {&NFType_STRING__desc,}};
#define _OMC_LIT381 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT381)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT382,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT381,_OMC_LIT88}};
#define _OMC_LIT382 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT382)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT383,1,1) {_OMC_LIT382}};
#define _OMC_LIT383 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT383)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT384,1,9) {&NFInstNode_InstNodeType_NORMAL__COMP__desc,}};
#define _OMC_LIT384 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT384)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT385,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT374,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT383,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT385 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT385)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT386,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT373,_OMC_LIT88}};
#define _OMC_LIT386 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT386)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT387,1,1) {_OMC_LIT386}};
#define _OMC_LIT387 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT387)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT388,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT191,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT387,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT388 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT388)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT389,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT9,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT387,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT389 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT389)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT390,2,1) {_OMC_LIT389,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT390 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT390)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT391,2,1) {_OMC_LIT388,_OMC_LIT390}};
#define _OMC_LIT391 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT391)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT392,2,1) {_OMC_LIT385,_OMC_LIT391}};
#define _OMC_LIT392 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT392)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT393,3,MMC_ARRAY_TAG) {_OMC_LIT385,_OMC_LIT388,_OMC_LIT389}};
#define _OMC_LIT393 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT393)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT394,1,5) {&NFRestriction_CLOCK__desc,}};
#define _OMC_LIT394 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT394)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT395,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT369}};
#define _OMC_LIT395 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT395)
#define _OMC_LIT396_data "$DummyFunction"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT396,14,_OMC_LIT396_data);
#define _OMC_LIT396 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT396)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT397,9,5) {&SCode_Element_CLASS__desc,_OMC_LIT396,_OMC_LIT318,_OMC_LIT319,_OMC_LIT285,_OMC_LIT322,_OMC_LIT371,_OMC_LIT329,_OMC_LIT133}};
#define _OMC_LIT397 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT397)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT398,1,1) {_OMC_LIT254}};
#define _OMC_LIT398 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT398)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT399,1,3) {&NFInstNode_CachedData_NO__CACHE__desc,}};
#define _OMC_LIT399 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT399)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT400,2,1) {_OMC_LIT399,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT400 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT400)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT401,2,1) {_OMC_LIT399,_OMC_LIT400}};
#define _OMC_LIT401 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT401)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT402,2,1) {_OMC_LIT399,_OMC_LIT401}};
#define _OMC_LIT402 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT402)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT403,3,MMC_ARRAY_TAG) {_OMC_LIT399,_OMC_LIT399,_OMC_LIT399}};
#define _OMC_LIT403 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT403)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT404,8,3) {&NFInstNode_InstNode_CLASS__NODE__desc,_OMC_LIT369,_OMC_LIT397,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT398,_OMC_LIT403,_OMC_LIT198,_OMC_LIT255}};
#define _OMC_LIT404 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT404)
#define _OMC_LIT405_data "s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT405,1,_OMC_LIT405_data);
#define _OMC_LIT405 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT405)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT406,9,4) {&NFComponent_COMPONENT__desc,_OMC_LIT198,_OMC_LIT373,_OMC_LIT175,_OMC_LIT175,_OMC_LIT87,_OMC_LIT329,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT133}};
#define _OMC_LIT406 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT406)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT407,1,1) {_OMC_LIT406}};
#define _OMC_LIT407 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT407)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT408,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT405,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT407,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT408 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT408)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT409,2,1) {_OMC_LIT408,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT409 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT409)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT410,1,7) {&DAE_InlineType_NO__INLINE__desc,}};
#define _OMC_LIT410 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT410)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT411,3,4) {&DAE_FunctionBuiltin_FUNCTION__BUILTIN__desc,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT411 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT411)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT412,1,3) {&DAE_FunctionParallelism_FP__NON__PARALLEL__desc,}};
#define _OMC_LIT412 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT412)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT413,7,3) {&DAE_FunctionAttributes_FUNCTION__ATTRIBUTES__desc,_OMC_LIT410,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT411,_OMC_LIT412}};
#define _OMC_LIT413 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT413)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT414,1,1) {MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT414 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT414)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT415,1,1) {MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT415 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT415)
#define _OMC_LIT416_data "i"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT416,1,_OMC_LIT416_data);
#define _OMC_LIT416 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT416)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT417,1,3) {&NFType_INTEGER__desc,}};
#define _OMC_LIT417 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT417)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT418,9,4) {&NFComponent_COMPONENT__desc,_OMC_LIT198,_OMC_LIT417,_OMC_LIT175,_OMC_LIT175,_OMC_LIT87,_OMC_LIT329,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT133}};
#define _OMC_LIT418 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT418)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT419,1,1) {_OMC_LIT418}};
#define _OMC_LIT419 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT419)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT420,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT416,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT419,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT420 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT420)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT421,2,1) {_OMC_LIT420,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT421 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT421)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT422,2,1) {_OMC_LIT420,_OMC_LIT421}};
#define _OMC_LIT422 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT422)
#define _OMC_LIT423_data "intervalCounter"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT423,15,_OMC_LIT423_data);
#define _OMC_LIT423 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT423)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT424,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT423,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT419,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT424 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT424)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT425,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT424,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT425 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT425)
#define _OMC_LIT426_data "resolution"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT426,10,_OMC_LIT426_data);
#define _OMC_LIT426 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT426)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT427,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT426,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT419,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT427 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT427)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT428,2,3) {&NFExpression_INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT428 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT428)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT429,1,1) {_OMC_LIT428}};
#define _OMC_LIT429 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT429)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT430,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT427,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),_OMC_LIT429,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT430 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT430)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT431,2,1) {_OMC_LIT430,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT431 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT431)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT432,2,1) {_OMC_LIT425,_OMC_LIT431}};
#define _OMC_LIT432 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT432)
#define _OMC_LIT433_data "r"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT433,1,_OMC_LIT433_data);
#define _OMC_LIT433 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT433)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT434,1,4) {&NFType_REAL__desc,}};
#define _OMC_LIT434 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT434)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT435,9,4) {&NFComponent_COMPONENT__desc,_OMC_LIT198,_OMC_LIT434,_OMC_LIT175,_OMC_LIT175,_OMC_LIT87,_OMC_LIT329,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT133}};
#define _OMC_LIT435 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT435)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT436,1,1) {_OMC_LIT435}};
#define _OMC_LIT436 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT436)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT437,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT433,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT436,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT437 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT437)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT438,2,1) {_OMC_LIT437,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT438 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT438)
#define _OMC_LIT439_data "interval"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT439,8,_OMC_LIT439_data);
#define _OMC_LIT439 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT439)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT440,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT439,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT436,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT440 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT440)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT441,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT440,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT441 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT441)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT442,2,1) {_OMC_LIT441,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT442 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT442)
#define _OMC_LIT443_data "b"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT443,1,_OMC_LIT443_data);
#define _OMC_LIT443 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT443)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT444,1,6) {&NFType_BOOLEAN__desc,}};
#define _OMC_LIT444 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT444)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT445,9,4) {&NFComponent_COMPONENT__desc,_OMC_LIT198,_OMC_LIT444,_OMC_LIT175,_OMC_LIT175,_OMC_LIT87,_OMC_LIT329,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT133}};
#define _OMC_LIT445 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT445)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT446,1,1) {_OMC_LIT445}};
#define _OMC_LIT446 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT446)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT447,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT443,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT446,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT447 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT447)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT448,2,1) {_OMC_LIT447,_OMC_LIT438}};
#define _OMC_LIT448 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT448)
#define _OMC_LIT449_data "condition"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT449,9,_OMC_LIT449_data);
#define _OMC_LIT449 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT449)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT450,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT449,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT446,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT450 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT450)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT451,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT450,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT451 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT451)
#define _OMC_LIT452_data "startInterval"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT452,13,_OMC_LIT452_data);
#define _OMC_LIT452 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT452)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT453,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT452,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT436,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT453 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT453)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT454,2,4) {&NFExpression_REAL__desc,_OMC_LIT132}};
#define _OMC_LIT454 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT454)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT455,1,1) {_OMC_LIT454}};
#define _OMC_LIT455 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT455)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT456,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT453,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),_OMC_LIT455,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT456 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT456)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT457,2,1) {_OMC_LIT456,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT457 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT457)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT458,2,1) {_OMC_LIT451,_OMC_LIT457}};
#define _OMC_LIT458 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT458)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT459,9,4) {&NFComponent_COMPONENT__desc,_OMC_LIT198,_OMC_LIT381,_OMC_LIT175,_OMC_LIT175,_OMC_LIT87,_OMC_LIT329,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT133}};
#define _OMC_LIT459 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT459)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT460,1,1) {_OMC_LIT459}};
#define _OMC_LIT460 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT460)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT461,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT405,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT460,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT461 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT461)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT462,2,1) {_OMC_LIT461,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT462 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT462)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT463,2,1) {_OMC_LIT408,_OMC_LIT462}};
#define _OMC_LIT463 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT463)
#define _OMC_LIT464_data "c"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT464,1,_OMC_LIT464_data);
#define _OMC_LIT464 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT464)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT465,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT464,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT407,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT465 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT465)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT466,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT465,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT466 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT466)
#define _OMC_LIT467_data "solverMethod"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT467,12,_OMC_LIT467_data);
#define _OMC_LIT467 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT467)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT468,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT467,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT460,_OMC_LIT198,_OMC_LIT384}};
#define _OMC_LIT468 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT468)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT469,7,3) {&NFFunction_Slot_SLOT__desc,_OMC_LIT468,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT469 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT469)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT470,2,1) {_OMC_LIT469,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT470 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT470)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT471,2,1) {_OMC_LIT466,_OMC_LIT470}};
#define _OMC_LIT471 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT471)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT472,1,3) {&DAE_Prefix_NOPRE__desc,}};
#define _OMC_LIT472 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT472)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT473,1,11) {&DAE_Type_T__UNKNOWN__desc,}};
#define _OMC_LIT473 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT473)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT474,4,4) {&DAE_ComponentRef_CREF__IDENT__desc,_OMC_LIT131,_OMC_LIT473,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT474 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT474)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT475,2,0) {_OMC_LIT474,_OMC_LIT474}};
#define _OMC_LIT475 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT475)
#define _OMC_LIT476_data "NFInst.lookupRootClass"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT476,22,_OMC_LIT476_data);
#define _OMC_LIT476 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT476)
#define _OMC_LIT477_data "nfScalarize"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT477,11,_OMC_LIT477_data);
#define _OMC_LIT477 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT477)
#define _OMC_LIT478_data "Run scalarization in NF, default true."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT478,38,_OMC_LIT478_data);
#define _OMC_LIT478 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT478)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT479,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT478}};
#define _OMC_LIT479 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT479)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT480,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(168)),_OMC_LIT477,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),_OMC_LIT479}};
#define _OMC_LIT480 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT480)
#define _OMC_LIT481_data "forceScalarize"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT481,14,_OMC_LIT481_data);
#define _OMC_LIT481 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT481)
#define _OMC_LIT482_data "Forces scalarization to be done when it would normally be automatically disabled."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT482,81,_OMC_LIT482_data);
#define _OMC_LIT482 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT482)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT483,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT482}};
#define _OMC_LIT483 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT483)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT484,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(196)),_OMC_LIT481,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT483}};
#define _OMC_LIT484 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT484)
#define _OMC_LIT485_data "vectorizeBindings"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT485,17,_OMC_LIT485_data);
#define _OMC_LIT485 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT485)
#define _OMC_LIT486_data "Turns on vectorization of bindings when scalarization is turned off."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT486,68,_OMC_LIT486_data);
#define _OMC_LIT486 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT486)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT487,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT486}};
#define _OMC_LIT487 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT487)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT488,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(192)),_OMC_LIT485,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT487}};
#define _OMC_LIT488 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT488)
#define _OMC_LIT489_data "newBackend"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT489,10,_OMC_LIT489_data);
#define _OMC_LIT489 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT489)
#define _OMC_LIT490_data "Activates experimental new backend for better array handling. This also activates the new frontend. [WIP]"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT490,105,_OMC_LIT490_data);
#define _OMC_LIT490 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT490)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT491,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT490}};
#define _OMC_LIT491 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT491)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT492,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(140)),_OMC_LIT489,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT17,_OMC_LIT361,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT491}};
#define _OMC_LIT492 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT492)
#define _OMC_LIT493_data "nfExpandOperations"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT493,18,_OMC_LIT493_data);
#define _OMC_LIT493 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT493)
#define _OMC_LIT494_data "Expand all unary/binary operations to scalar expressions in the new frontend."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT494,77,_OMC_LIT494_data);
#define _OMC_LIT494 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT494)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT495,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT494}};
#define _OMC_LIT495 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT495)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT496,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(170)),_OMC_LIT493,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),_OMC_LIT495}};
#define _OMC_LIT496 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT496)
#define _OMC_LIT497_data "nfExpandFuncArgs"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT497,16,_OMC_LIT497_data);
#define _OMC_LIT497 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT497)
#define _OMC_LIT498_data "Expand all function arguments in the new frontend."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT498,50,_OMC_LIT498_data);
#define _OMC_LIT498 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT498)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT499,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT498}};
#define _OMC_LIT499 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT499)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT500,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(176)),_OMC_LIT497,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT499}};
#define _OMC_LIT500 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT500)
#define _OMC_LIT501_data "checkModel"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT501,10,_OMC_LIT501_data);
#define _OMC_LIT501 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT501)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT502,1,3) {&Flags_FlagVisibility_INTERNAL__desc,}};
#define _OMC_LIT502 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT502)
#define _OMC_LIT503_data "Set when checkModel is used to turn on specific features for checking."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT503,70,_OMC_LIT503_data);
#define _OMC_LIT503 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT503)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT504,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT503}};
#define _OMC_LIT504 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT504)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT505,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(29)),_OMC_LIT501,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT502,_OMC_LIT361,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT504}};
#define _OMC_LIT505 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT505)
#define _OMC_LIT506_data "nfAPI"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT506,5,_OMC_LIT506_data);
#define _OMC_LIT506 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT506)
#define _OMC_LIT507_data "Enables experimental new instantiation use in the OMC API."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT507,58,_OMC_LIT507_data);
#define _OMC_LIT507 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT507)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT508,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT507}};
#define _OMC_LIT508 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT508)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT509,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(171)),_OMC_LIT506,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),_OMC_LIT508}};
#define _OMC_LIT509 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT509)
#define _OMC_LIT510_data "NFInst.instantiate("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT510,19,_OMC_LIT510_data);
#define _OMC_LIT510 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT510)
#define _OMC_LIT511_data ")"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT511,1,_OMC_LIT511_data);
#define _OMC_LIT511 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT511)
#define _OMC_LIT512_data "NFInst.instExpressions"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT512,22,_OMC_LIT512_data);
#define _OMC_LIT512 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT512)
#define _OMC_LIT513_data "evaluateAllParameters"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT513,21,_OMC_LIT513_data);
#define _OMC_LIT513 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT513)
#define _OMC_LIT514_data "Evaluates all parameters if set, except the ones that have annotation(Evaluate = false)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT514,88,_OMC_LIT514_data);
#define _OMC_LIT514 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT514)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT515,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT514}};
#define _OMC_LIT515 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT515)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT516,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(26)),_OMC_LIT513,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT515}};
#define _OMC_LIT516 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT516)
#define _OMC_LIT517_data "NFInst.updateImplicitVariability"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT517,32,_OMC_LIT517_data);
#define _OMC_LIT517 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT517)
#define _OMC_LIT518_data "eval"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT518,4,_OMC_LIT518_data);
#define _OMC_LIT518 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT518)
#define _OMC_LIT519_data "noSimplify"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT519,10,_OMC_LIT519_data);
#define _OMC_LIT519 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT519)
#define _OMC_LIT520_data "Do not simplify expressions if set."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT520,35,_OMC_LIT520_data);
#define _OMC_LIT520 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT520)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT521,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT520}};
#define _OMC_LIT521 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT521)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT522,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(11)),_OMC_LIT519,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT17,_OMC_LIT361,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT521}};
#define _OMC_LIT522 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT522)
#define _OMC_LIT523_data "baseModelicaOptions"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT523,19,_OMC_LIT523_data);
#define _OMC_LIT523 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT523)
#define _OMC_LIT524_data "moveBindings"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT524,12,_OMC_LIT524_data);
#define _OMC_LIT524 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT524)
#define _OMC_LIT525_data "Moves movable binding equations to normal equations."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT525,52,_OMC_LIT525_data);
#define _OMC_LIT525 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT525)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT526,2,4) {&Gettext_TranslatableContent_notrans__desc,_OMC_LIT525}};
#define _OMC_LIT526 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT526)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT527,2,0) {_OMC_LIT524,_OMC_LIT526}};
#define _OMC_LIT527 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT527)
#define _OMC_LIT528_data "scalarize"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT528,9,_OMC_LIT528_data);
#define _OMC_LIT528 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT528)
#define _OMC_LIT529_data "Fully scalarize the Base Modelica model."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT529,40,_OMC_LIT529_data);
#define _OMC_LIT529 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT529)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT530,2,4) {&Gettext_TranslatableContent_notrans__desc,_OMC_LIT529}};
#define _OMC_LIT530 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT530)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT531,2,0) {_OMC_LIT528,_OMC_LIT530}};
#define _OMC_LIT531 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT531)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT532,2,1) {_OMC_LIT531,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT532 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT532)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT533,2,1) {_OMC_LIT527,_OMC_LIT532}};
#define _OMC_LIT533 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT533)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT534,2,4) {&Flags_ValidOptions_STRING__DESC__OPTION__desc,_OMC_LIT533}};
#define _OMC_LIT534 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT534)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT535,1,1) {_OMC_LIT534}};
#define _OMC_LIT535 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT535)
#define _OMC_LIT536_data "Enables optional Base Modelica options."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT536,39,_OMC_LIT536_data);
#define _OMC_LIT536 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT536)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT537,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT536}};
#define _OMC_LIT537 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT537)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT538,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(154)),_OMC_LIT523,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT17,_OMC_LIT18,_OMC_LIT535,_OMC_LIT537}};
#define _OMC_LIT538 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT538)
#define _OMC_LIT539_data "simplify"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT539,8,_OMC_LIT539_data);
#define _OMC_LIT539 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT539)
#define _OMC_LIT540_data "combineBinaries"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT540,15,_OMC_LIT540_data);
#define _OMC_LIT540 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT540)
#define _OMC_LIT541_data "replaceArrayConstructors"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT541,24,_OMC_LIT541_data);
#define _OMC_LIT541 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT541)
#define _OMC_LIT542_data "HideResult"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT542,10,_OMC_LIT542_data);
#define _OMC_LIT542 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT542)
#define _OMC_LIT543_data "obfuscate"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT543,9,_OMC_LIT543_data);
#define _OMC_LIT543 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT543)
#define _OMC_LIT544_data "none"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT544,4,_OMC_LIT544_data);
#define _OMC_LIT544 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT544)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT545,2,8) {&Flags_FlagData_STRING__FLAG__desc,_OMC_LIT544}};
#define _OMC_LIT545 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT545)
#define _OMC_LIT546_data "No obfuscation."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT546,15,_OMC_LIT546_data);
#define _OMC_LIT546 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT546)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT547,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT546}};
#define _OMC_LIT547 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT547)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT548,2,0) {_OMC_LIT544,_OMC_LIT547}};
#define _OMC_LIT548 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT548)
#define _OMC_LIT549_data "encrypted"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT549,9,_OMC_LIT549_data);
#define _OMC_LIT549 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT549)
#define _OMC_LIT550_data "Obfuscates protected variables in encrypted models"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT550,50,_OMC_LIT550_data);
#define _OMC_LIT550 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT550)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT551,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT550}};
#define _OMC_LIT551 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT551)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT552,2,0) {_OMC_LIT549,_OMC_LIT551}};
#define _OMC_LIT552 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT552)
#define _OMC_LIT553_data "protected"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT553,9,_OMC_LIT553_data);
#define _OMC_LIT553 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT553)
#define _OMC_LIT554_data "Obfuscates protected variables in all models."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT554,45,_OMC_LIT554_data);
#define _OMC_LIT554 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT554)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT555,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT554}};
#define _OMC_LIT555 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT555)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT556,2,0) {_OMC_LIT553,_OMC_LIT555}};
#define _OMC_LIT556 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT556)
#define _OMC_LIT557_data "full"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT557,4,_OMC_LIT557_data);
#define _OMC_LIT557 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT557)
#define _OMC_LIT558_data "Obfuscates everything."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT558,22,_OMC_LIT558_data);
#define _OMC_LIT558 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT558)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT559,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT558}};
#define _OMC_LIT559 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT559)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT560,2,0) {_OMC_LIT557,_OMC_LIT559}};
#define _OMC_LIT560 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT560)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT561,2,1) {_OMC_LIT560,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT561 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT561)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT562,2,1) {_OMC_LIT556,_OMC_LIT561}};
#define _OMC_LIT562 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT562)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT563,2,1) {_OMC_LIT552,_OMC_LIT562}};
#define _OMC_LIT563 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT563)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT564,2,1) {_OMC_LIT548,_OMC_LIT563}};
#define _OMC_LIT564 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT564)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT565,2,4) {&Flags_ValidOptions_STRING__DESC__OPTION__desc,_OMC_LIT564}};
#define _OMC_LIT565 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT565)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT566,1,1) {_OMC_LIT565}};
#define _OMC_LIT566 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT566)
#define _OMC_LIT567_data "Obfuscates identifiers in the simulation model"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT567,46,_OMC_LIT567_data);
#define _OMC_LIT567 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT567)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT568,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT567}};
#define _OMC_LIT568 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT568)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT569,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(149)),_OMC_LIT543,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT17,_OMC_LIT545,_OMC_LIT566,_OMC_LIT568}};
#define _OMC_LIT569 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT569)
#define _OMC_LIT570_data "resizableArrays"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT570,15,_OMC_LIT570_data);
#define _OMC_LIT570 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT570)
#define _OMC_LIT571_data "Assumes all arrays are resizable. Only works with the new backend --newBackend."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT571,79,_OMC_LIT571_data);
#define _OMC_LIT571 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT571)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT572,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT571}};
#define _OMC_LIT572 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT572)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT573,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(157)),_OMC_LIT570,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT17,_OMC_LIT361,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT572}};
#define _OMC_LIT573 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT573)
#include "util/modelica.h"

#include "NFInst_includes.h"



DLLDirection
void omc_NFInst_checkInstanceRestriction(threadData_t *threadData, modelica_metatype _node, modelica_metatype _path, modelica_integer _context)
{
  modelica_metatype _elem = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _elem has no default value.
  if(omc_NFInstContext_inRelaxed(threadData, _context))
  {
    goto _return;
  }

  _elem = omc_NFInstNode_InstNode_definition(threadData, _node);

  if((omc_SCodeUtil_isFunction(threadData, _elem) || omc_SCodeUtil_isPackage(threadData, _elem)))
  {
    tmpMeta1 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT5, 1 /* true */, 0 /* false */), mmc_mk_cons(omc_SCodeDump_restrString(threadData, omc_SCodeUtil_getClassRestriction(threadData, _elem)), MMC_REFSTRUCTLIT(mmc_nil)));
    omc_Error_addSourceMessage(threadData, _OMC_LIT4, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _node));

    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_checkInstanceRestriction(threadData_t *threadData, modelica_metatype _node, modelica_metatype _path, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_checkInstanceRestriction(threadData, _node, _path, tmp1);
  return;
}

DLLDirection
void omc_NFInst_checkPartialClass(threadData_t *threadData, modelica_metatype _node, modelica_integer _context)
{
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if((omc_NFInstNode_InstNode_isPartial(threadData, _node) && (!omc_NFInstContext_inRelaxed(threadData, _context))))
  {
    tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), MMC_REFSTRUCTLIT(mmc_nil));
    omc_Error_addSourceMessage(threadData, _OMC_LIT8, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _node));

    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_checkPartialClass(threadData_t *threadData, modelica_metatype _node, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_checkPartialClass(threadData, _node, tmp1);
  return;
}

DLLDirection
void omc_NFInst_markImplicitWhenExp__traverser(threadData_t *threadData, modelica_metatype _exp)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _exp;
    {
      modelica_metatype _node = NULL;
      modelica_metatype _comp = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _node has no default value.
      // _comp has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,2) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,0,5) == 0) goto tmp2_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
          
          _node = tmpMeta6;
          /* Pattern matching succeeded */
          if(omc_NFInstNode_InstNode_isComponent(threadData, _node))
          {
            _comp = omc_NFInstNode_InstNode_component(threadData, _node);

            if((omc_NFComponent_variability(threadData, _comp) == 7))
            {
              _comp = omc_NFComponent_setVariability(threadData, 6, _comp);

              omc_NFInstNode_InstNode_updateComponent(threadData, _comp, _node);
            }
          }
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_NFInst_markImplicitWhenExp(threadData_t *threadData, modelica_metatype _exp)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  omc_NFExpression_apply(threadData, _exp, boxvar_NFInst_markImplicitWhenExp__traverser);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_NFInst_updateImplicitVariabilityStmt(threadData_t *threadData, modelica_metatype _stmt, modelica_boolean _inWhen)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _stmt;
    {
      int tmp3;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp3_1))) {
        case 3: {
          
          /* Pattern matching succeeded */
          if(_inWhen)
          {
            omc_NFInst_markImplicitWhenExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stmt), 2))));
          }
          goto tmp2_done;
        }
        case 5: {
          
          /* Pattern matching succeeded */
          if(_inWhen)
          {
            omc_NFInst_updateImplicitVariabilityStmts(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stmt), 4))), 1 /* true */);
          }
          goto tmp2_done;
        }
        case 6: {
          modelica_metatype tmpMeta4;
          modelica_metatype tmpMeta5;
          
          /* Pattern matching succeeded */
          if(_inWhen)
          {
            {
              modelica_metatype _branch;
              for (tmpMeta4 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stmt), 2))); !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
              {
                _branch = MMC_CAR(tmpMeta4);
                omc_NFInst_updateImplicitVariabilityStmts(threadData, omc_Util_tuple22(threadData, _branch), 1 /* true */);
              }
            }
          }
          goto tmp2_done;
        }
        case 7: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _branch;
            for (tmpMeta6 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stmt), 2))); !listEmpty(tmpMeta6); tmpMeta6=MMC_CDR(tmpMeta6))
            {
              _branch = MMC_CAR(tmpMeta6);
              omc_NFInst_updateImplicitVariabilityStmts(threadData, omc_Util_tuple22(threadData, _branch), 1 /* true */);
            }
          }
          goto tmp2_done;
        }
        case 12: {
          
          /* Pattern matching succeeded */
          if(_inWhen)
          {
            omc_NFInst_updateImplicitVariabilityStmts(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stmt), 3))), 1 /* true */);
          }
          goto tmp2_done;
        }
        default:
        tmp2_default: OMC_LABEL_UNUSED; {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateImplicitVariabilityStmt(threadData_t *threadData, modelica_metatype _stmt, modelica_metatype _inWhen)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_inWhen);
  omc_NFInst_updateImplicitVariabilityStmt(threadData, _stmt, tmp1);
  return;
}

DLLDirection
void omc_NFInst_updateImplicitVariabilityStmts(threadData_t *threadData, modelica_metatype _stmtl, modelica_boolean _inWhen)
{
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  {
    modelica_metatype _s;
    for (tmpMeta1 = _stmtl; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _s = MMC_CAR(tmpMeta1);
      omc_NFInst_updateImplicitVariabilityStmt(threadData, _s, _inWhen);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateImplicitVariabilityStmts(threadData_t *threadData, modelica_metatype _stmtl, modelica_metatype _inWhen)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_inWhen);
  omc_NFInst_updateImplicitVariabilityStmts(threadData, _stmtl, tmp1);
  return;
}

DLLDirection
void omc_NFInst_updateImplicitVariabilityAlg(threadData_t *threadData, modelica_metatype _alg)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  omc_NFInst_updateImplicitVariabilityStmts(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_alg), 2))), 0 /* false */);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_NFInst_updateImplicitVariabilityEq(threadData_t *threadData, modelica_metatype _eq, modelica_boolean _inWhen)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _eq;
    {
      int tmp3;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp3_1))) {
        case 3: {
          
          /* Pattern matching succeeded */
          if(_inWhen)
          {
            omc_NFInst_markImplicitWhenExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 2))));
          }
          goto tmp2_done;
        }
        case 5: {
          
          /* Pattern matching succeeded */
          omc_NFStructural_markSubscriptsInExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 2))));

          omc_NFStructural_markSubscriptsInExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 3))));
          goto tmp2_done;
        }
        case 6: {
          
          /* Pattern matching succeeded */
          omc_NFInst_updateImplicitVariabilityEql(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 4))), _inWhen);
          goto tmp2_done;
        }
        case 7: {
          modelica_metatype tmpMeta4;
          modelica_metatype tmpMeta9;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _branch;
            for (tmpMeta4 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 2))); !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
            {
              _branch = MMC_CAR(tmpMeta4);
              { /* match expression */
                modelica_metatype tmp7_1;
                tmp7_1 = _branch;
                {
                  volatile mmc_switch_type tmp7;
                  int tmp8;
                  tmp7 = 0;
                  for (; tmp7 < 1; tmp7++) {
                    switch (MMC_SWITCH_CAST(tmp7)) {
                    case 0: {
                      if (mmc__uniontype__metarecord__typedef__equal(tmp7_1,0,3) == 0) goto tmp6_end;
                      
                      /* Pattern matching succeeded */
                      omc_NFInst_updateImplicitVariabilityEql(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_branch), 4))), _inWhen);
                      goto tmp6_done;
                    }
                    }
                    goto tmp6_end;
                    tmp6_end: ;
                  }
                  goto goto_5;
                  goto_5:;
                  goto goto_1;
                  goto tmp6_done;
                  tmp6_done:;
                }
              }
              ;
            }
          }
          goto tmp2_done;
        }
        case 8: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta15;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _branch;
            for (tmpMeta10 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 2))); !listEmpty(tmpMeta10); tmpMeta10=MMC_CDR(tmpMeta10))
            {
              _branch = MMC_CAR(tmpMeta10);
              { /* match expression */
                modelica_metatype tmp13_1;
                tmp13_1 = _branch;
                {
                  volatile mmc_switch_type tmp13;
                  int tmp14;
                  tmp13 = 0;
                  for (; tmp13 < 1; tmp13++) {
                    switch (MMC_SWITCH_CAST(tmp13)) {
                    case 0: {
                      if (mmc__uniontype__metarecord__typedef__equal(tmp13_1,0,3) == 0) goto tmp12_end;
                      
                      /* Pattern matching succeeded */
                      omc_NFInst_updateImplicitVariabilityEql(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_branch), 4))), 1 /* true */);
                      goto tmp12_done;
                    }
                    }
                    goto tmp12_end;
                    tmp12_end: ;
                  }
                  goto goto_11;
                  goto_11:;
                  goto goto_1;
                  goto tmp12_done;
                  tmp12_done:;
                }
              }
              ;
            }
          }
          goto tmp2_done;
        }
        default:
        tmp2_default: OMC_LABEL_UNUSED; {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateImplicitVariabilityEq(threadData_t *threadData, modelica_metatype _eq, modelica_metatype _inWhen)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_inWhen);
  omc_NFInst_updateImplicitVariabilityEq(threadData, _eq, tmp1);
  return;
}

DLLDirection
void omc_NFInst_updateImplicitVariabilityEql(threadData_t *threadData, modelica_metatype _eql, modelica_boolean _inWhen)
{
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  {
    modelica_metatype _eq;
    for (tmpMeta1 = _eql; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _eq = MMC_CAR(tmpMeta1);
      omc_NFInst_updateImplicitVariabilityEq(threadData, _eq, _inWhen);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateImplicitVariabilityEql(threadData_t *threadData, modelica_metatype _eql, modelica_metatype _inWhen)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_inWhen);
  omc_NFInst_updateImplicitVariabilityEql(threadData, _eql, tmp1);
  return;
}

DLLDirection
void omc_NFInst_updateImplicitVariabilityComp(threadData_t *threadData, modelica_metatype _component, modelica_boolean _parentEval, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  modelica_metatype _c = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _c has no default value.
  if(omc_NFInstNode_InstNode_isEmpty(threadData, _component))
  {
    goto _return;
  }

  _node = omc_NFInstNode_InstNode_resolveOuter(threadData, _component);

  _c = omc_NFInstNode_InstNode_component(threadData, _node);

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _c;
    {
      modelica_metatype _binding = NULL;
      modelica_metatype _condition = NULL;
      modelica_metatype _opt_eval = NULL;
      modelica_boolean _eval;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _binding has no default value.
      // _condition has no default value.
      // _opt_eval has no default value.
      // _eval has no default value.
      tmp3 = 0;
      for (; tmp3 < 3; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,8) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 4));
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 5));
          
          _binding = tmpMeta5;
          _condition = tmpMeta6;
          /* Pattern matching succeeded */
          _opt_eval = omc_NFComponent_getEvaluateAnnotation(threadData, _c);

          _eval = mmc_unbox_boolean(omc_Util_getOptionOrDefault(threadData, _opt_eval, mmc_mk_boolean(0 /* false */)));

          if(((isSome(_opt_eval) && (!_eval)) && (mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 6)))), 4)))) == 3)))
          {
            omc_NFInstNode_InstNode_updateComponent(threadData, omc_NFComponent_setVariability(threadData, 4, _c), _node);
          }
          else
          {
            if(omc_NFStructural_isStructuralComponent(threadData, _c, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 6))), _binding, _node, _eval, _parentEval, _context))
            {
              omc_NFStructural_markComponent(threadData, _c, _node);
            }
          }

          {
            modelica_metatype _dim;
            for (tmpMeta7 = omc_NFType_arrayDims(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 3)))); !listEmpty(tmpMeta7); tmpMeta7=MMC_CDR(tmpMeta7))
            {
              _dim = MMC_CAR(tmpMeta7);
              omc_NFStructural_markDimension(threadData, _dim);
            }
          }

          if(omc_NFBinding_isBound(threadData, _binding))
          {
            omc_NFStructural_markExpSize(threadData, omc_NFBinding_getUntypedExp(threadData, _binding));
          }

          if(omc_NFBinding_isBound(threadData, _condition))
          {
            omc_NFStructural_markExp(threadData, omc_NFBinding_getUntypedExp(threadData, _condition));
          }

          if((!omc_NFInstNode_InstNode_isEmpty(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2))))))
          {
            omc_NFInst_updateImplicitVariability(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2))), (_eval || _parentEval), _context);
          }
          goto tmp2_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!listMember(omc_NFInstNode_InstNode_name(threadData, _component), _OMC_LIT12)) goto tmp2_end;
          _binding = omc_NFModifier_Modifier_binding(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 3))));

          if(omc_NFBinding_isBound(threadData, _binding))
          {
            omc_NFStructural_markExp(threadData, omc_NFBinding_getUntypedExp(threadData, _binding));
          }
          goto tmp2_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateImplicitVariabilityComp(threadData_t *threadData, modelica_metatype _component, modelica_metatype _parentEval, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  tmp1 = mmc_unbox_integer(_parentEval);
  tmp2 = mmc_unbox_integer(_context);
  omc_NFInst_updateImplicitVariabilityComp(threadData, _component, tmp1, tmp2);
  return;
}

static void closure0_NFInst_updateImplicitVariabilityEq(threadData_t *thData, modelica_metatype closure, modelica_metatype eq)
{
  modelica_metatype inWhen = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  boxptr_NFInst_updateImplicitVariabilityEq(thData, eq, inWhen);
}static void closure1_NFInst_updateImplicitVariabilityEq(threadData_t *thData, modelica_metatype closure, modelica_metatype eq)
{
  modelica_metatype inWhen = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  boxptr_NFInst_updateImplicitVariabilityEq(thData, eq, inWhen);
}
DLLDirection
void omc_NFInst_updateImplicitVariability(threadData_t *threadData, modelica_metatype _node, modelica_boolean _parentEval, modelica_integer _context)
{
  modelica_metatype _cls = NULL;
  modelica_metatype _cls_tree = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);
  // _cls_tree has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cls;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 4; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,3,5) == 0) goto tmp2_end;
          
          _cls_tree = tmpMeta5;
          /* Pattern matching succeeded */
          {
            modelica_metatype _c;
            for (tmpMeta6 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls_tree), 4))), tmp9 = arrayLength(tmpMeta6), tmp8 = 1; tmp8 <= tmp9; tmp8++)
            {
              _c = arrayGet(tmpMeta6,tmp8);
              omc_NFInst_updateImplicitVariabilityComp(threadData, _c, _parentEval, _context);
            }
          }

          tmpMeta10 = mmc_mk_box1(0, mmc_mk_boolean(0 /* false */));
          tmpMeta11 = mmc_mk_box1(0, mmc_mk_boolean(0 /* false */));
          omc_NFSections_apply(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 4))), (modelica_fnptr) mmc_mk_box2(0,closure0_NFInst_updateImplicitVariabilityEq,tmpMeta10), boxvar_NFInst_updateImplicitVariabilityAlg, (modelica_fnptr) mmc_mk_box2(0,closure1_NFInst_updateImplicitVariabilityEq,tmpMeta11), boxvar_NFInst_updateImplicitVariabilityAlg);
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_integer tmp15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,7) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _dim;
            for (tmpMeta12 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 5))), tmp15 = arrayLength(tmpMeta12), tmp14 = 1; tmp14 <= tmp15; tmp14++)
            {
              _dim = arrayGet(tmpMeta12,tmp14);
              omc_NFStructural_markDimension(threadData, _dim);
            }
          }

          /* Tail recursive call */
          _node = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2)));
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_integer tmp20;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,3) == 0) goto tmp2_end;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,3,5) == 0) goto tmp2_end;
          
          _cls_tree = tmpMeta16;
          /* Pattern matching succeeded */
          {
            modelica_metatype _c;
            for (tmpMeta17 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls_tree), 4))), tmp20 = arrayLength(tmpMeta17), tmp19 = 1; tmp19 <= tmp20; tmp19++)
            {
              _c = arrayGet(tmpMeta17,tmp19);
              omc_NFInst_updateImplicitVariabilityComp(threadData, _c, _parentEval, _context);
            }
          }
          goto tmp2_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateImplicitVariability(threadData_t *threadData, modelica_metatype _node, modelica_metatype _parentEval, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  tmp1 = mmc_unbox_integer(_parentEval);
  tmp2 = mmc_unbox_integer(_context);
  omc_NFInst_updateImplicitVariability(threadData, _node, tmp1, tmp2);
  return;
}

DLLDirection
void omc_NFInst_checkTopLevelOuter(threadData_t *threadData, modelica_string _name, modelica_metatype _outerNode, modelica_metatype _scope, modelica_integer _context)
{
  jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
  modelica_metatype _node = NULL;
  modelica_boolean _is_error;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _is_error has no default value.
  if(omc_NFInstContext_inInstanceAPI(threadData, _context))
  {
    goto _return;
  }

  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          /* Pattern matching succeeded */
          _node = omc_NFLookup_lookupSimpleName(threadData, _name, _scope, _context, NULL);

          if(omc_NFInstNode_InstNode_isInner(threadData, _node))
          {
            _is_error = (!(omc_NFInstContext_inRelaxed(threadData, _context) || omc_Flags_isConfigFlagSet(threadData, _OMC_LIT78, _OMC_LIT35)));

            if(_is_error)
            {
              tmpMeta5 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
              omc_Error_addSourceMessageAsError(threadData, _OMC_LIT82, tmpMeta5, omc_NFInstNode_InstNode_info(threadData, _node));
            }
            else
            {
              tmpMeta6 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
              omc_Error_addSourceMessage(threadData, _OMC_LIT82, tmpMeta6, omc_NFInstNode_InstNode_info(threadData, _node));
            }
          }
          else
          {
            tmpMeta7 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
            tmpMeta8 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _node), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _outerNode), MMC_REFSTRUCTLIT(mmc_nil)));
            omc_Error_addMultiSourceMessage(threadData, _OMC_LIT15, tmpMeta7, tmpMeta8);

            _is_error = 1 /* true */;
          }
          goto tmp2_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          _is_error = 0 /* false */;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 2) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;

  if(_is_error)
  {
    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  threadData->mmc_jumper = old_mmc_jumper;
  return;
}
void boxptr_NFInst_checkTopLevelOuter(threadData_t *threadData, modelica_metatype _name, modelica_metatype _outerNode, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_checkTopLevelOuter(threadData, _name, _outerNode, _scope, tmp1);
  return;
}

DLLDirection
void omc_NFInst_insertGeneratedInners(threadData_t *threadData, modelica_metatype _node, modelica_metatype _topScope, modelica_integer _context)
{
  jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
  modelica_metatype _generated_inners = NULL;
  modelica_metatype _inner_comps = NULL;
  modelica_metatype _n = NULL;
  modelica_metatype _on = NULL;
  modelica_string _name = NULL;
  modelica_string _str = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_metatype _base_node = NULL;
  modelica_boolean _name_defined;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_integer tmp17;
  modelica_integer tmp18;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _generated_inners has no default value.
  // _inner_comps has no default value.
  // _n has no default value.
  // _on has no default value.
  // _name has no default value.
  // _str has no default value.
  // _cls has no default value.
  // _cls_tree has no default value.
  // _base_node has no default value.
  // _name_defined has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = omc_NFInstNode_InstNode_nodeType(threadData, _topScope);
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,4,2) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _generated_inners = tmpMeta2;

  if(omc_UnorderedMap_isEmpty(threadData, _generated_inners))
  {
    goto _return;
  }

  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  _inner_comps = tmpMeta3;

  {
    modelica_metatype _n;
    for (tmpMeta4 = omc_UnorderedMap_valueArray(threadData, _generated_inners), tmp18 = arrayLength(tmpMeta4), tmp17 = 1; tmp17 <= tmp18; tmp17++)
    {
      _n = arrayGet(tmpMeta4,tmp17);
      _name = omc_NFInstNode_InstNode_name(threadData, _n);

      omc_NFInst_checkTopLevelOuter(threadData, _name, _n, _node, _context);

      if((!omc_NFInstContext_inInstanceAPI(threadData, _context)))
      {
        tmpMeta5 = mmc_mk_cons(omc_NFInstNode_InstNode_typeName(threadData, _n), mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil)));
        omc_Error_addSourceMessage(threadData, _OMC_LIT85, tmpMeta5, omc_NFInstNode_InstNode_info(threadData, _n));
      }

      if(omc_NFInstNode_InstNode_isComponent(threadData, _n))
      {
        tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
        omc_NFInst_instComponent(threadData, _n, _OMC_LIT87, _OMC_LIT88, 1 /* true */, ((modelica_integer) 0), ((modelica_integer) 8), mmc_mk_none(), tmpMeta6);

        if((!omc_NFInstContext_inInstanceAPI(threadData, _context)))
        {
          { /* matchcontinue expression */
            {
              volatile mmc_switch_type tmp9;
              int tmp10;
              tmp9 = 0;
              MMC_TRY_INTERNAL(mmc_jumper)
              tmp8_top:
              threadData->mmc_jumper = &new_mmc_jumper;
              for (; tmp9 < 2; tmp9++) {
                switch (MMC_SWITCH_CAST(tmp9)) {
                case 0: {
                  modelica_metatype tmpMeta11;
                  modelica_metatype tmpMeta12;
                  modelica_metatype tmpMeta13;
                  modelica_metatype tmpMeta14;
                  /* Pattern matching succeeded */
                  /* Pattern-matching assignment */
                  tmpMeta11 = omc_SCodeUtil_lookupElementAnnotationBinding(threadData, omc_NFInstNode_InstNode_definition(threadData, omc_NFInstNode_InstNode_classScope(threadData, _n)), _OMC_LIT89);
                  if (optionNone(tmpMeta11)) goto goto_7;
                  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
                  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,3,1) == 0) goto goto_7;
                  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
                  _str = tmpMeta13;

                  tmpMeta14 = mmc_mk_cons(omc_System_unescapedString(threadData, _str), MMC_REFSTRUCTLIT(mmc_nil));
                  omc_Error_addSourceMessage(threadData, _OMC_LIT93, tmpMeta14, omc_NFInstNode_InstNode_info(threadData, _n));
                  goto tmp8_done;
                }
                case 1: {
                  /* Pattern matching succeeded */
                  goto tmp8_done;
                }
                }
                goto tmp8_end;
                tmp8_end: ;
              }
              goto goto_7;
              tmp8_done:
              (void)tmp9;
              MMC_RESTORE_INTERNAL(mmc_jumper);
              goto tmp8_done2;
              goto_7:;
              MMC_CATCH_INTERNAL(mmc_jumper);
              if (++tmp9 < 2) {
                goto tmp8_top;
              }
              MMC_THROW_INTERNAL();
              tmp8_done2:;
            }
          }
          ;
        }

        tmpMeta15 = mmc_mk_cons(omc_Mutable_create(threadData, _n), _inner_comps);
        _inner_comps = tmpMeta15;
      }
    }
  }

  if((!listEmpty(_inner_comps)))
  {
    _base_node = omc_NFClass_lastBaseClass(threadData, _node);

    _cls = omc_NFInstNode_InstNode_getClass(threadData, _base_node);

    _cls_tree = omc_NFClassTree_ClassTree_appendComponentsToInstTree(threadData, _inner_comps, omc_NFClass_classTree(threadData, _cls));

    omc_NFInstNode_InstNode_updateClass(threadData, omc_NFClass_setClassTree(threadData, _cls_tree, _cls), _base_node);
  }
  _return: OMC_LABEL_UNUSED
  threadData->mmc_jumper = old_mmc_jumper;
  return;
}
void boxptr_NFInst_insertGeneratedInners(threadData_t *threadData, modelica_metatype _node, modelica_metatype _topScope, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_insertGeneratedInners(threadData, _node, _topScope, tmp1);
  return;
}

DLLDirection
void omc_NFInst_checkIteratorShadowing(threadData_t *threadData, modelica_string _name, modelica_metatype _scope, modelica_metatype _info)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _scope;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _iter;
            for (tmpMeta5 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scope), 3))); !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
            {
              _iter = MMC_CAR(tmpMeta5);
              if((stringEqual(omc_NFInstNode_InstNode_name(threadData, _iter), _name)))
              {
                tmpMeta6 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
                tmpMeta7 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _iter), mmc_mk_cons(_info, MMC_REFSTRUCTLIT(mmc_nil)));
                omc_Error_addMultiSourceMessage(threadData, _OMC_LIT96, tmpMeta6, tmpMeta7);

                goto _return;
              }
            }
          }
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_addIteratorToScope(threadData_t *threadData, modelica_string _name, modelica_metatype __omcQ_24in_5Fscope, modelica_metatype _info, modelica_metatype _iter_type, modelica_metatype *out_iterator)
{
  modelica_metatype _scope = NULL;
  modelica_metatype _iterator = NULL;
  modelica_metatype _iter_comp = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _scope = __omcQ_24in_5Fscope;
  // _iterator has no default value.
  // _iter_comp has no default value.
  _scope = omc_NFInstNode_InstNode_openImplicitScope(threadData, _scope);

  tmpMeta1 = mmc_mk_box4(5, &NFComponent_ITERATOR__desc, _iter_type, mmc_mk_integer(7), _info);
  _iter_comp = tmpMeta1;

  _iterator = omc_NFInstNode_InstNode_fromComponent(threadData, _name, _iter_comp, _scope);

  _scope = omc_NFInstNode_InstNode_addIterator(threadData, _iterator, _scope);
  _return: OMC_LABEL_UNUSED
  if (out_iterator) { *out_iterator = _iterator; }
  return _scope;
}

DLLDirection
void omc_NFInst_checkAssignmentRestriction(threadData_t *threadData, modelica_metatype _lhs, modelica_metatype _info)
{
  modelica_metatype _node = NULL;
  modelica_metatype _res = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _res has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _lhs;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 4; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!omc_NFComponentRef_isIterator(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_lhs), 3))))) goto tmp2_end;
          tmpMeta5 = mmc_mk_cons(omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_lhs), 3)))), MMC_REFSTRUCTLIT(mmc_nil));
          omc_Error_addSourceMessage(threadData, _OMC_LIT100, tmpMeta5, _info);
          goto goto_1;
          goto tmp2_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!omc_NFComponentRef_isCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_lhs), 3))))) goto tmp2_end;
          _node = omc_NFComponentRef_node(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_lhs), 3))));

          _res = omc_NFClass_restriction(threadData, omc_NFInstNode_InstNode_getClass(threadData, _node));

          { /* match expression */
            modelica_metatype tmp8_1;
            tmp8_1 = _res;
            {
              int tmp8;
              {
                switch (MMC_SWITCH_CAST(valueConstructor(tmp8_1))) {
                case 5: {
                  
                  /* Pattern matching succeeded */
                  goto tmp7_done;
                }
                case 6: {
                  
                  /* Pattern matching succeeded */
                  goto tmp7_done;
                }
                case 7: {
                  
                  /* Pattern matching succeeded */
                  goto tmp7_done;
                }
                case 13: {
                  
                  /* Pattern matching succeeded */
                  goto tmp7_done;
                }
                case 15: {
                  
                  /* Pattern matching succeeded */
                  goto tmp7_done;
                }
                default:
                tmp7_default: OMC_LABEL_UNUSED; {
                  modelica_metatype tmpMeta9;
                  
                  /* Pattern matching succeeded */
                  tmpMeta9 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(omc_NFRestriction_toString(threadData, _res), MMC_REFSTRUCTLIT(mmc_nil)));
                  omc_Error_addSourceMessage(threadData, _OMC_LIT103, tmpMeta9, _info);
                  goto goto_6;
                  goto tmp7_done;
                }
                }
                goto tmp7_end;
                tmp7_end: ;
              }
              goto goto_6;
              goto_6:;
              goto goto_1;
              goto tmp7_done;
              tmp7_done:;
            }
          }
          ;
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,11,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _e;
            for (tmpMeta10 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_lhs), 3))); !listEmpty(tmpMeta10); tmpMeta10=MMC_CDR(tmpMeta10))
            {
              _e = MMC_CAR(tmpMeta10);
              omc_NFInst_checkAssignmentRestriction(threadData, _e, _info);
            }
          }
          goto tmp2_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_instStatement(threadData_t *threadData, modelica_metatype _scodeStmt, modelica_metatype _scope, modelica_integer _context)
{
  modelica_metatype _statement = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _statement has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _scodeStmt;
    {
      modelica_metatype _exp1 = NULL;
      modelica_metatype _exp2 = NULL;
      modelica_metatype _exp3 = NULL;
      modelica_metatype _oexp = NULL;
      modelica_metatype _stmtl = NULL;
      modelica_metatype _branches = NULL;
      modelica_metatype _info = NULL;
      modelica_metatype _for_scope = NULL;
      modelica_metatype _iter = NULL;
      modelica_integer _next_context;
      int tmp4;
      // _exp1 has no default value.
      // _exp2 has no default value.
      // _exp3 has no default value.
      // _oexp has no default value.
      // _stmtl has no default value.
      // _branches has no default value.
      // _info has no default value.
      // _for_scope has no default value.
      // _iter has no default value.
      // _next_context has no default value.
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 3: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          _info = tmpMeta5;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context, _info);

          omc_NFInst_checkAssignmentRestriction(threadData, _exp1, _info);

          _exp2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _scope, _context, _info);
          tmpMeta6 = mmc_mk_box5(3, &NFStatement_ASSIGNMENT__desc, _exp1, _exp2, _OMC_LIT97, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))), _info));
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta7;
          /* Pattern matching succeeded */
          _oexp = omc_NFInst_instExpOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _scope, _context, _info);

          _for_scope = omc_NFInst_addIteratorToScope(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _info, _OMC_LIT97 ,&_iter);

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 8192));

          _stmtl = omc_NFInst_instStatements(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))), _for_scope, _next_context);
          tmpMeta8 = mmc_mk_box6(5, &NFStatement_FOR__desc, _iter, _oexp, _stmtl, _OMC_LIT104, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 5))), _info));
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,5) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta9;
          /* Pattern matching succeeded */
          _oexp = omc_NFInst_instExpOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _scope, _context, _info);

          _for_scope = omc_NFInst_addIteratorToScope(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _info, _OMC_LIT97 ,&_iter);

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 8192));

          _stmtl = omc_NFInst_instStatements(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))), _for_scope, _next_context);
          tmpMeta10 = mmc_mk_box6(5, &NFStatement_FOR__desc, _iter, _oexp, _stmtl, _OMC_LIT105, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 5))), _info));
          tmpMeta1 = tmpMeta10;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,6) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          _info = tmpMeta11;
          /* Pattern matching succeeded */
          tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
          _branches = tmpMeta12;

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 8192));

          tmpMeta18 = mmc_mk_box2(0, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))));
          tmpMeta17 = mmc_mk_cons(tmpMeta18, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))));
          {
            modelica_metatype _branch;
            for (tmpMeta13 = tmpMeta17; !listEmpty(tmpMeta13); tmpMeta13=MMC_CDR(tmpMeta13))
            {
              _branch = MMC_CAR(tmpMeta13);
              _exp1 = omc_NFInst_instExp(threadData, omc_Util_tuple21(threadData, _branch), _scope, _context, _info);

              _stmtl = omc_NFInst_instStatements(threadData, omc_Util_tuple22(threadData, _branch), _scope, _next_context);

              tmpMeta15 = mmc_mk_box2(0, _exp1, _stmtl);
              tmpMeta14 = mmc_mk_cons(tmpMeta15, _branches);
              _branches = tmpMeta14;
            }
          }

          if((!listEmpty((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 5))))))
          {
            _stmtl = omc_NFInst_instStatements(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 5))), _scope, _next_context);

            tmpMeta20 = mmc_mk_box2(0, _OMC_LIT106, _stmtl);
            tmpMeta19 = mmc_mk_cons(tmpMeta20, _branches);
            _branches = tmpMeta19;
          }
          tmpMeta21 = mmc_mk_box3(6, &NFStatement_IF__desc, listReverse(_branches), omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 6))), _info));
          tmpMeta1 = tmpMeta21;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,3) == 0) goto tmp3_end;
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _info = tmpMeta22;
          /* Pattern matching succeeded */
          if((!omc_NFInstContext_inValidWhenScope(threadData, _context)))
          {
            if(omc_NFInstContext_inWhen(threadData, _context))
            {
              tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
              omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT115, tmpMeta23, _info);
            }
            else
            {
              if(omc_NFInstContext_inInitial(threadData, _context))
              {
                tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
                omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT112, tmpMeta24, _info);
              }
              else
              {
                tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
                omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT109, tmpMeta25, _info);
              }
            }
          }

          tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
          _branches = tmpMeta26;

          {
            modelica_metatype _branch;
            for (tmpMeta27 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))); !listEmpty(tmpMeta27); tmpMeta27=MMC_CDR(tmpMeta27))
            {
              _branch = MMC_CAR(tmpMeta27);
              _exp1 = omc_NFInst_instExp(threadData, omc_Util_tuple21(threadData, _branch), _scope, _context, _info);

              _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 2048));

              _stmtl = omc_NFInst_instStatements(threadData, omc_Util_tuple22(threadData, _branch), _scope, _next_context);

              tmpMeta29 = mmc_mk_box2(0, _exp1, _stmtl);
              tmpMeta28 = mmc_mk_cons(tmpMeta29, _branches);
              _branches = tmpMeta28;
            }
          }
          tmpMeta31 = mmc_mk_box3(7, &NFStatement_WHEN__desc, listReverse(_branches), omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _info));
          tmpMeta1 = tmpMeta31;
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,5) == 0) goto tmp3_end;
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta32;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context, _info);

          _exp2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _scope, _context, _info);

          _exp3 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))), _scope, _context, _info);
          tmpMeta33 = mmc_mk_box5(8, &NFStatement_ASSERT__desc, _exp1, _exp2, _exp3, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 5))), _info));
          tmpMeta1 = tmpMeta33;
          goto tmp3_done;
        }
        case 10: {
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
          tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _info = tmpMeta34;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context, _info);
          tmpMeta35 = mmc_mk_box3(9, &NFStatement_TERMINATE__desc, _exp1, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _info));
          tmpMeta1 = tmpMeta35;
          goto tmp3_done;
        }
        case 11: {
          modelica_metatype tmpMeta36;
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_metatype tmpMeta39;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,4) == 0) goto tmp3_end;
          tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          _info = tmpMeta36;
          /* Pattern matching succeeded */
          if((!omc_Flags_isConfigFlagSet(threadData, _OMC_LIT78, _OMC_LIT43)))
          {
            tmpMeta37 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessage(threadData, _OMC_LIT118, tmpMeta37, _info);

            goto goto_2;
          }

          if((!omc_NFInstContext_inWhen(threadData, _context)))
          {
            tmpMeta38 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessage(threadData, _OMC_LIT121, tmpMeta38, _info);

            goto goto_2;
          }

          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context, _info);

          _exp2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _scope, _context, _info);
          tmpMeta39 = mmc_mk_box4(10, &NFStatement_REINIT__desc, _exp1, _exp2, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))), _info));
          tmpMeta1 = tmpMeta39;
          goto tmp3_done;
        }
        case 12: {
          modelica_metatype tmpMeta40;
          modelica_metatype tmpMeta41;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _info = tmpMeta40;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context, _info);
          tmpMeta41 = mmc_mk_box3(11, &NFStatement_NORETCALL__desc, _exp1, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _info));
          tmpMeta1 = tmpMeta41;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta42;
          modelica_metatype tmpMeta43;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,4) == 0) goto tmp3_end;
          tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          _info = tmpMeta42;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context, _info);

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 32768));

          _stmtl = omc_NFInst_instStatements(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), _scope, _next_context);
          tmpMeta43 = mmc_mk_box4(12, &NFStatement_WHILE__desc, _exp1, _stmtl, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4))), _info));
          tmpMeta1 = tmpMeta43;
          goto tmp3_done;
        }
        case 13: {
          modelica_metatype tmpMeta44;
          modelica_metatype tmpMeta45;
          
          /* Pattern matching succeeded */
          if((!omc_NFInstContext_inFunction(threadData, _context)))
          {
            tmpMeta44 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessage(threadData, _OMC_LIT124, tmpMeta44, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))));

            goto goto_2;
          }
          tmpMeta45 = mmc_mk_box2(13, &NFStatement_RETURN__desc, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3)))));
          tmpMeta1 = tmpMeta45;
          goto tmp3_done;
        }
        case 14: {
          modelica_metatype tmpMeta46;
          modelica_metatype tmpMeta47;
          
          /* Pattern matching succeeded */
          if((!omc_NFInstContext_inLoop(threadData, _context)))
          {
            tmpMeta46 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessage(threadData, _OMC_LIT127, tmpMeta46, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))));

            goto goto_2;
          }
          tmpMeta47 = mmc_mk_box2(14, &NFStatement_BREAK__desc, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3)))));
          tmpMeta1 = tmpMeta47;
          goto tmp3_done;
        }
        case 15: {
          modelica_metatype tmpMeta48;
          
          /* Pattern matching succeeded */
          _stmtl = omc_NFInst_instStatements(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 2))), _scope, _context);
          tmpMeta48 = mmc_mk_box3(15, &NFStatement_FAILURE__desc, _stmtl, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeStmt), 4)))));
          tmpMeta1 = tmpMeta48;
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          
          /* Pattern matching succeeded */
          omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT128, _OMC_LIT130);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _statement = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _statement;
}
modelica_metatype boxptr_NFInst_instStatement(threadData_t *threadData, modelica_metatype _scodeStmt, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _statement = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _statement = omc_NFInst_instStatement(threadData, _scodeStmt, _scope, tmp1);
  /* skip box _statement; NFStatement */
  return _statement;
}

DLLDirection
modelica_metatype omc_NFInst_instStatements(threadData_t *threadData, modelica_metatype _scodeStmtl, modelica_metatype _scope, modelica_integer _context)
{
  modelica_metatype _statements = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _statements has no default value.
  {
    modelica_metatype __omcQ_24tmpVar3;
    modelica_metatype* tmp2;
    modelica_metatype tmpMeta3;
    modelica_metatype __omcQ_24tmpVar2;
    modelica_integer tmp4;
    modelica_metatype _stmt_loopVar = 0;
    modelica_metatype _stmt;
    _stmt_loopVar = _scodeStmtl;
    tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar3 = tmpMeta3; /* defaultValue */
    tmp2 = &__omcQ_24tmpVar3;
    while(1) {
      tmp4 = 1;
      if (!listEmpty(_stmt_loopVar)) {
        _stmt = MMC_CAR(_stmt_loopVar);
        _stmt_loopVar = MMC_CDR(_stmt_loopVar);
        tmp4--;
      }
      if (tmp4 == 0) {
        __omcQ_24tmpVar2 = omc_NFInst_instStatement(threadData, _stmt, _scope, _context);
        *tmp2 = mmc_mk_cons(__omcQ_24tmpVar2,0);
        tmp2 = &MMC_CDR(*tmp2);
      } else if (tmp4 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp2 = mmc_mk_nil();
    tmpMeta1 = __omcQ_24tmpVar3;
  }
  _statements = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _statements;
}
modelica_metatype boxptr_NFInst_instStatements(threadData_t *threadData, modelica_metatype _scodeStmtl, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _statements = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _statements = omc_NFInst_instStatements(threadData, _scodeStmtl, _scope, tmp1);
  /* skip box _statements; list<NFStatement> */
  return _statements;
}

DLLDirection
modelica_metatype omc_NFInst_instAlgorithmSection(threadData_t *threadData, modelica_metatype _algorithmSection, modelica_metatype _scope, modelica_integer _context)
{
  modelica_metatype _alg = NULL;
  modelica_metatype _statements = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _alg has no default value.
  // _statements has no default value.
  _statements = omc_NFInst_instStatements(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_algorithmSection), 2))), _scope, _context);

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta3 = mmc_mk_box6(3, &NFAlgorithm_ALGORITHM__desc, _statements, tmpMeta1, tmpMeta2, _scope, _OMC_LIT135);
  _alg = tmpMeta3;
  _return: OMC_LABEL_UNUSED
  return _alg;
}
modelica_metatype boxptr_NFInst_instAlgorithmSection(threadData_t *threadData, modelica_metatype _algorithmSection, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _alg = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _alg = omc_NFInst_instAlgorithmSection(threadData, _algorithmSection, _scope, tmp1);
  /* skip box _alg; NFAlgorithm */
  return _alg;
}

DLLDirection
modelica_metatype omc_NFInst_instAlgorithmSections(threadData_t *threadData, modelica_metatype _algorithmSections, modelica_metatype _scope, modelica_integer _context)
{
  modelica_metatype _algs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _algs has no default value.
  if(omc_NFInstContext_inInstanceAPI(threadData, _context))
  {
    tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
    _algs = tmpMeta1;
  }
  else
  {
    {
      modelica_metatype __omcQ_24tmpVar5;
      modelica_metatype* tmp3;
      modelica_metatype tmpMeta4;
      modelica_metatype __omcQ_24tmpVar4;
      modelica_integer tmp5;
      modelica_metatype _alg_loopVar = 0;
      modelica_metatype _alg;
      _alg_loopVar = _algorithmSections;
      tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
      __omcQ_24tmpVar5 = tmpMeta4; /* defaultValue */
      tmp3 = &__omcQ_24tmpVar5;
      while(1) {
        tmp5 = 1;
        if (!listEmpty(_alg_loopVar)) {
          _alg = MMC_CAR(_alg_loopVar);
          _alg_loopVar = MMC_CDR(_alg_loopVar);
          tmp5--;
        }
        if (tmp5 == 0) {
          __omcQ_24tmpVar4 = omc_NFInst_instAlgorithmSection(threadData, _alg, _scope, _context);
          *tmp3 = mmc_mk_cons(__omcQ_24tmpVar4,0);
          tmp3 = &MMC_CDR(*tmp3);
        } else if (tmp5 == 1) {
          break;
        } else {
          MMC_THROW_INTERNAL();
        }
      }
      *tmp3 = mmc_mk_nil();
      tmpMeta2 = __omcQ_24tmpVar5;
    }
    _algs = tmpMeta2;
  }
  _return: OMC_LABEL_UNUSED
  return _algs;
}
modelica_metatype boxptr_NFInst_instAlgorithmSections(threadData_t *threadData, modelica_metatype _algorithmSections, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _algs = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _algs = omc_NFInst_instAlgorithmSections(threadData, _algorithmSections, _scope, tmp1);
  /* skip box _algs; list<NFAlgorithm> */
  return _algs;
}

DLLDirection
modelica_metatype omc_NFInst_makeSource(threadData_t *threadData, modelica_metatype _comment, modelica_metatype _info)
{
  modelica_metatype _source = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _source has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta5 = mmc_mk_cons(_comment, MMC_REFSTRUCTLIT(mmc_nil));
  tmpMeta6 = mmc_mk_box8(3, &DAE_ElementSource_SOURCE__desc, _info, tmpMeta1, _OMC_LIT134, tmpMeta2, tmpMeta3, tmpMeta4, tmpMeta5);
  _source = tmpMeta6;
  _return: OMC_LABEL_UNUSED
  return _source;
}

DLLDirection
modelica_metatype omc_NFInst_instConnectorCref(threadData_t *threadData, modelica_metatype _absynCref, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _cref = NULL;
  modelica_metatype _prefix = NULL;
  modelica_metatype _found_scope = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _cref has no default value.
  // _prefix has no default value.
  // _found_scope has no default value.
  _cref = omc_NFLookup_lookupConnector(threadData, _absynCref, _scope, _context, _info ,&_found_scope);

  _cref = omc_NFInst_instCrefSubscripts(threadData, _cref, _scope, _context, _info);

  _cref = omc_NFComponentRef_appendScope(threadData, _found_scope, _cref, 0 /* false */);
  _return: OMC_LABEL_UNUSED
  return _cref;
}
modelica_metatype boxptr_NFInst_instConnectorCref(threadData_t *threadData, modelica_metatype _absynCref, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _cref = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _cref = omc_NFInst_instConnectorCref(threadData, _absynCref, _scope, tmp1, _info);
  /* skip box _cref; NFComponentRef */
  return _cref;
}

DLLDirection
modelica_metatype omc_NFInst_instEquation(threadData_t *threadData, modelica_metatype _scodeEq, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_integer _context, modelica_metatype __omcQ_24in_5Fequations)
{
  modelica_metatype _equations = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _equations = __omcQ_24in_5Fequations;
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _scodeEq;
    {
      modelica_metatype _exp1 = NULL;
      modelica_metatype _exp2 = NULL;
      modelica_metatype _exp3 = NULL;
      modelica_metatype _oexp = NULL;
      modelica_metatype _expl = NULL;
      modelica_metatype _eql = NULL;
      modelica_metatype _branches = NULL;
      modelica_metatype _info = NULL;
      modelica_metatype _for_scope = NULL;
      modelica_metatype _iter = NULL;
      modelica_metatype _lhs_cr = NULL;
      modelica_metatype _rhs_cr = NULL;
      modelica_integer _next_context;
      int tmp4;
      // _exp1 has no default value.
      // _exp2 has no default value.
      // _exp3 has no default value.
      // _oexp has no default value.
      // _expl has no default value.
      // _eql has no default value.
      // _branches has no default value.
      // _info has no default value.
      // _for_scope has no default value.
      // _iter has no default value.
      // _lhs_cr has no default value.
      // _rhs_cr has no default value.
      // _next_context has no default value.
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 4: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          _info = tmpMeta5;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _context, _info);

          _exp2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _context, _info);
          tmpMeta7 = mmc_mk_box6(3, &NFEquation_EQUALITY__desc, _exp1, _exp2, _OMC_LIT97, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))), _info));
          tmpMeta6 = mmc_mk_cons(tmpMeta7, _equations);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,4) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          _info = tmpMeta8;
          /* Pattern matching succeeded */
          if(omc_NFInstContext_inInitial(threadData, _context))
          {
            tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessage(threadData, _OMC_LIT141, tmpMeta9, _info);

            goto goto_2;
          }
          else
          {
            if(omc_NFInstContext_inWhen(threadData, _context))
            {
              tmpMeta10 = mmc_mk_cons(omc_Dump_printComponentRefStr(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2)))), mmc_mk_cons(omc_Dump_printComponentRefStr(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3)))), MMC_REFSTRUCTLIT(mmc_nil)));
              omc_Error_addSourceMessage(threadData, _OMC_LIT138, tmpMeta10, _info);

              goto goto_2;
            }
          }

          if((!omc_NFConnectBreakTree_isConnectBroken(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _connectBreaks)))
          {
            _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 8388608));

            _lhs_cr = omc_NFInst_instConnectorCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _next_context, _info);

            _rhs_cr = omc_NFInst_instConnectorCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _next_context, _info);

            if((!(omc_NFInstNode_InstNode_isEmpty(threadData, omc_NFComponentRef_node(threadData, _lhs_cr)) || omc_NFInstNode_InstNode_isEmpty(threadData, omc_NFComponentRef_node(threadData, _rhs_cr)))))
            {
              tmpMeta11 = mmc_mk_box3(9, &NFExpression_CREF__desc, _OMC_LIT97, _lhs_cr);
              _exp1 = tmpMeta11;

              tmpMeta12 = mmc_mk_box3(9, &NFExpression_CREF__desc, _OMC_LIT97, _rhs_cr);
              _exp2 = tmpMeta12;

              tmpMeta14 = mmc_mk_box5(5, &NFEquation_CONNECT__desc, _exp1, _exp2, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))), _info));
              tmpMeta13 = mmc_mk_cons(tmpMeta14, _equations);
              _equations = tmpMeta13;
            }
          }
          tmpMeta1 = _equations;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,5) == 0) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta15;
          /* Pattern matching succeeded */
          _oexp = omc_NFInst_instExpOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _context, _info);

          omc_NFInst_checkIteratorShadowing(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 6))));

          _for_scope = omc_NFInst_addIteratorToScope(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 6))), _OMC_LIT97 ,&_iter);

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 8192));

          _eql = omc_NFInst_instEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))), _for_scope, _connectBreaks, _next_context);
          tmpMeta17 = mmc_mk_box6(6, &NFEquation_FOR__desc, _iter, _oexp, _eql, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 5))), _info));
          tmpMeta16 = mmc_mk_cons(tmpMeta17, _equations);
          tmpMeta1 = tmpMeta16;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta18;
          /* Pattern matching succeeded */
          {
            modelica_metatype __omcQ_24tmpVar7;
            modelica_metatype* tmp20;
            modelica_metatype tmpMeta21;
            modelica_metatype __omcQ_24tmpVar6;
            modelica_integer tmp22;
            modelica_metatype _c_loopVar = 0;
            modelica_metatype _c;
            _c_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2)));
            tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar7 = tmpMeta21; /* defaultValue */
            tmp20 = &__omcQ_24tmpVar7;
            while(1) {
              tmp22 = 1;
              if (!listEmpty(_c_loopVar)) {
                _c = MMC_CAR(_c_loopVar);
                _c_loopVar = MMC_CDR(_c_loopVar);
                tmp22--;
              }
              if (tmp22 == 0) {
                __omcQ_24tmpVar6 = omc_NFInst_instExp(threadData, _c, _scope, _context, _info);
                *tmp20 = mmc_mk_cons(__omcQ_24tmpVar6,0);
                tmp20 = &MMC_CDR(*tmp20);
              } else if (tmp22 == 1) {
                break;
              } else {
                goto goto_2;
              }
            }
            *tmp20 = mmc_mk_nil();
            tmpMeta19 = __omcQ_24tmpVar7;
          }
          _expl = tmpMeta19;

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 16384));

          tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
          _branches = tmpMeta23;

          {
            modelica_metatype _branch;
            for (tmpMeta24 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))); !listEmpty(tmpMeta24); tmpMeta24=MMC_CDR(tmpMeta24))
            {
              _branch = MMC_CAR(tmpMeta24);
              _eql = omc_NFInst_instEquations(threadData, _branch, _scope, _connectBreaks, _next_context);

              /* Pattern-matching assignment */
              tmpMeta25 = _expl;
              if (listEmpty(tmpMeta25)) goto goto_2;
              tmpMeta26 = MMC_CAR(tmpMeta25);
              tmpMeta27 = MMC_CDR(tmpMeta25);
              _exp1 = tmpMeta26;
              _expl = tmpMeta27;

              tmpMeta28 = mmc_mk_cons(omc_NFEquation_makeBranch(threadData, _exp1, _eql, 7), _branches);
              _branches = tmpMeta28;
            }
          }

          if((!listEmpty((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))))))
          {
            _eql = omc_NFInst_instEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))), _scope, _connectBreaks, _next_context);

            tmpMeta30 = mmc_mk_cons(omc_NFEquation_makeBranch(threadData, _OMC_LIT106, _eql, 7), _branches);
            _branches = tmpMeta30;
          }
          tmpMeta32 = mmc_mk_box4(7, &NFEquation_IF__desc, listReverse(_branches), _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 5))), _info));
          tmpMeta31 = mmc_mk_cons(tmpMeta32, _equations);
          tmpMeta1 = tmpMeta31;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_metatype tmpMeta36;
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_metatype tmpMeta39;
          modelica_metatype tmpMeta40;
          modelica_metatype tmpMeta41;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,5) == 0) goto tmp3_end;
          tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta33;
          /* Pattern matching succeeded */
          if(omc_NFInstContext_inWhen(threadData, _context))
          {
            tmpMeta34 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT115, tmpMeta34, _info);
          }
          else
          {
            if(omc_NFInstContext_inInitial(threadData, _context))
            {
              tmpMeta35 = MMC_REFSTRUCTLIT(mmc_nil);
              omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT112, tmpMeta35, _info);
            }
          }

          _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 2048));

          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _context, _info);

          _eql = omc_NFInst_instEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _connectBreaks, _next_context);

          tmpMeta36 = mmc_mk_cons(omc_NFEquation_makeBranch(threadData, _exp1, _eql, 7), MMC_REFSTRUCTLIT(mmc_nil));
          _branches = tmpMeta36;

          {
            modelica_metatype _branch;
            for (tmpMeta37 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))); !listEmpty(tmpMeta37); tmpMeta37=MMC_CDR(tmpMeta37))
            {
              _branch = MMC_CAR(tmpMeta37);
              _exp1 = omc_NFInst_instExp(threadData, omc_Util_tuple21(threadData, _branch), _scope, _context, _info);

              _eql = omc_NFInst_instEquations(threadData, omc_Util_tuple22(threadData, _branch), _scope, _connectBreaks, _next_context);

              tmpMeta38 = mmc_mk_cons(omc_NFEquation_makeBranch(threadData, _exp1, _eql, 7), _branches);
              _branches = tmpMeta38;
            }
          }
          tmpMeta41 = mmc_mk_box4(8, &NFEquation_WHEN__desc, listReverse(_branches), _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 5))), _info));
          tmpMeta40 = mmc_mk_cons(tmpMeta41, _equations);
          tmpMeta1 = tmpMeta40;
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta42;
          modelica_metatype tmpMeta43;
          modelica_metatype tmpMeta44;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,5) == 0) goto tmp3_end;
          tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _info = tmpMeta42;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _context, _info);

          _exp2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _context, _info);

          _exp3 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))), _scope, _context, _info);
          tmpMeta44 = mmc_mk_box6(9, &NFEquation_ASSERT__desc, _exp1, _exp2, _exp3, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 5))), _info));
          tmpMeta43 = mmc_mk_cons(tmpMeta44, _equations);
          tmpMeta1 = tmpMeta43;
          goto tmp3_done;
        }
        case 10: {
          modelica_metatype tmpMeta45;
          modelica_metatype tmpMeta46;
          modelica_metatype tmpMeta47;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
          tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _info = tmpMeta45;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _context, _info);
          tmpMeta47 = mmc_mk_box4(10, &NFEquation_TERMINATE__desc, _exp1, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _info));
          tmpMeta46 = mmc_mk_cons(tmpMeta47, _equations);
          tmpMeta1 = tmpMeta46;
          goto tmp3_done;
        }
        case 11: {
          modelica_metatype tmpMeta48;
          modelica_metatype tmpMeta49;
          modelica_metatype tmpMeta50;
          modelica_metatype tmpMeta51;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,4) == 0) goto tmp3_end;
          tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          _info = tmpMeta48;
          /* Pattern matching succeeded */
          if((!omc_NFInstContext_inWhen(threadData, _context)))
          {
            tmpMeta49 = MMC_REFSTRUCTLIT(mmc_nil);
            omc_Error_addSourceMessage(threadData, _OMC_LIT121, tmpMeta49, _info);

            goto goto_2;
          }

          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _context, _info);

          _exp2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _scope, _context, _info);
          tmpMeta51 = mmc_mk_box5(11, &NFEquation_REINIT__desc, _exp1, _exp2, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 4))), _info));
          tmpMeta50 = mmc_mk_cons(tmpMeta51, _equations);
          tmpMeta1 = tmpMeta50;
          goto tmp3_done;
        }
        case 12: {
          modelica_metatype tmpMeta52;
          modelica_metatype tmpMeta53;
          modelica_metatype tmpMeta54;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
          tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _info = tmpMeta52;
          /* Pattern matching succeeded */
          _exp1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 2))), _scope, _context, _info);
          tmpMeta54 = mmc_mk_box4(12, &NFEquation_NORETCALL__desc, _exp1, _scope, omc_NFInst_makeSource(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_scodeEq), 3))), _info));
          tmpMeta53 = mmc_mk_cons(tmpMeta54, _equations);
          tmpMeta1 = tmpMeta53;
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          
          /* Pattern matching succeeded */
          omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT142, _OMC_LIT143);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _equations = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _equations;
}
modelica_metatype boxptr_NFInst_instEquation(threadData_t *threadData, modelica_metatype _scodeEq, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_metatype _context, modelica_metatype __omcQ_24in_5Fequations)
{
  modelica_integer tmp1;
  modelica_metatype _equations = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _equations = omc_NFInst_instEquation(threadData, _scodeEq, _scope, _connectBreaks, tmp1, __omcQ_24in_5Fequations);
  /* skip box _equations; list<NFEquation> */
  return _equations;
}

DLLDirection
modelica_metatype omc_NFInst_filterInstanceAPIEquations(threadData_t *threadData, modelica_metatype _eql)
{
  modelica_metatype _outEql = NULL;
  modelica_metatype tmpMeta1;
  modelica_string _name = NULL;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta26;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _outEql = tmpMeta1;
  // _name has no default value.
  {
    modelica_metatype _eq;
    for (tmpMeta2 = _eql; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _eq = MMC_CAR(tmpMeta2);
      { /* match expression */
        modelica_metatype tmp6_1;
        tmp6_1 = _eq;
        {
          volatile mmc_switch_type tmp6;
          int tmp7;
          tmp6 = 0;
          for (; tmp6 < 5; tmp6++) {
            switch (MMC_SWITCH_CAST(tmp6)) {
            case 0: {
              modelica_metatype tmpMeta8;
              if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,3,4) == 0) goto tmp5_end;
              
              /* Pattern matching succeeded */
              tmpMeta8 = mmc_mk_cons(_eq, _outEql);
              tmpMeta3 = tmpMeta8;
              goto tmp5_done;
            }
            case 1: {
              modelica_metatype tmpMeta9;
              modelica_metatype tmpMeta10;
              modelica_metatype tmpMeta11;
              modelica_metatype tmpMeta12;
              if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,9,3) == 0) goto tmp5_end;
              tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
              if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,11,3) == 0) goto tmp5_end;
              tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
              if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,2) == 0) goto tmp5_end;
              tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
              
              _name = tmpMeta11;
              /* Pattern matching succeeded */
              /* Check guard condition after assignments */
              if (!((stringEqual(_name, _OMC_LIT144)) || (stringEqual(_name, _OMC_LIT145)))) goto tmp5_end;
              tmpMeta12 = mmc_mk_cons(_eq, _outEql);
              tmpMeta3 = tmpMeta12;
              goto tmp5_done;
            }
            case 2: {
              modelica_metatype tmpMeta13;
              modelica_metatype tmpMeta14;
              modelica_boolean tmp15;
              modelica_metatype tmpMeta16;
              if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,4,5) == 0) goto tmp5_end;
              
              /* Pattern matching succeeded */
              tmpMeta13 = MMC_TAGPTR(mmc_alloc_words(7));
              memcpy(MMC_UNTAGPTR(tmpMeta13), MMC_UNTAGPTR(_eq), 7*sizeof(modelica_metatype));
              ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta13))[4] = omc_NFInst_filterInstanceAPIEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 4))));
              _eq = tmpMeta13;
              tmp15 = (modelica_boolean)listEmpty((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 4))));
              if(tmp15)
              {
                tmpMeta16 = _outEql;
              }
              else
              {
                tmpMeta14 = mmc_mk_cons(_eq, _outEql);
                tmpMeta16 = tmpMeta14;
              }
              tmpMeta3 = tmpMeta16;
              goto tmp5_done;
            }
            case 3: {
              modelica_metatype tmpMeta17;
              modelica_metatype tmpMeta18;
              modelica_metatype tmpMeta22;
              modelica_metatype tmpMeta23;
              modelica_boolean tmp24;
              modelica_metatype tmpMeta25;
              if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,0,5) == 0) goto tmp5_end;
              
              /* Pattern matching succeeded */
              {
                modelica_metatype __omcQ_24tmpVar9;
                modelica_metatype* tmp19;
                modelica_metatype tmpMeta20;
                modelica_metatype __omcQ_24tmpVar8;
                modelica_integer tmp21;
                modelica_metatype _eql_loopVar = 0;
                modelica_metatype _eql;
                _eql_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 3)));
                tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
                __omcQ_24tmpVar9 = tmpMeta20; /* defaultValue */
                tmp19 = &__omcQ_24tmpVar9;
                while(1) {
                  tmp21 = 1;
                  if (!listEmpty(_eql_loopVar)) {
                    _eql = MMC_CAR(_eql_loopVar);
                    _eql_loopVar = MMC_CDR(_eql_loopVar);
                    tmp21--;
                  }
                  if (tmp21 == 0) {
                    __omcQ_24tmpVar8 = omc_NFInst_filterInstanceAPIEquations(threadData, _eql);
                    *tmp19 = mmc_mk_cons(__omcQ_24tmpVar8,0);
                    tmp19 = &MMC_CDR(*tmp19);
                  } else if (tmp21 == 1) {
                    break;
                  } else {
                    goto goto_4;
                  }
                }
                *tmp19 = mmc_mk_nil();
                tmpMeta18 = __omcQ_24tmpVar9;
              }
              tmpMeta17 = MMC_TAGPTR(mmc_alloc_words(7));
              memcpy(MMC_UNTAGPTR(tmpMeta17), MMC_UNTAGPTR(_eq), 7*sizeof(modelica_metatype));
              ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta17))[3] = tmpMeta18;
              _eq = tmpMeta17;

              tmpMeta22 = MMC_TAGPTR(mmc_alloc_words(7));
              memcpy(MMC_UNTAGPTR(tmpMeta22), MMC_UNTAGPTR(_eq), 7*sizeof(modelica_metatype));
              ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta22))[4] = omc_NFInst_filterInstanceAPIEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 4))));
              _eq = tmpMeta22;
              tmp24 = (modelica_boolean)(omc_List_all(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 3))), boxvar_listEmpty) && listEmpty((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 4)))));
              if(tmp24)
              {
                tmpMeta25 = _outEql;
              }
              else
              {
                tmpMeta23 = mmc_mk_cons(_eq, _outEql);
                tmpMeta25 = tmpMeta23;
              }
              tmpMeta3 = tmpMeta25;
              goto tmp5_done;
            }
            case 4: {
              
              /* Pattern matching succeeded */
              tmpMeta3 = _outEql;
              goto tmp5_done;
            }
            }
            goto tmp5_end;
            tmp5_end: ;
          }
          goto goto_4;
          goto_4:;
          MMC_THROW_INTERNAL();
          goto tmp5_done;
          tmp5_done:;
        }
      }
      _outEql = tmpMeta3;
    }
  }

  _outEql = listReverseInPlace(_outEql);
  _return: OMC_LABEL_UNUSED
  return _outEql;
}

DLLDirection
modelica_metatype omc_NFInst_instEquations(threadData_t *threadData, modelica_metatype _scodeEql, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_integer _context)
{
  modelica_metatype _instEql = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _instEql = tmpMeta1;
  if(omc_NFInstContext_inInstanceAPI(threadData, _context))
  {
    {
      modelica_metatype _eq;
      for (tmpMeta2 = omc_NFInst_filterInstanceAPIEquations(threadData, _scodeEql); !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
      {
        _eq = MMC_CAR(tmpMeta2);
        { /* matchcontinue expression */
          {
            volatile mmc_switch_type tmp5;
            int tmp6;
            tmp5 = 0;
            MMC_TRY_INTERNAL(mmc_jumper)
            tmp4_top:
            threadData->mmc_jumper = &new_mmc_jumper;
            for (; tmp5 < 2; tmp5++) {
              switch (MMC_SWITCH_CAST(tmp5)) {
              case 0: {
                /* Pattern matching succeeded */
                _instEql = omc_NFInst_instEquation(threadData, _eq, _scope, _connectBreaks, _context, _instEql);
                goto tmp4_done;
              }
              case 1: {
                /* Pattern matching succeeded */
                goto tmp4_done;
              }
              }
              goto tmp4_end;
              tmp4_end: ;
            }
            goto goto_3;
            tmp4_done:
            (void)tmp5;
            MMC_RESTORE_INTERNAL(mmc_jumper);
            goto tmp4_done2;
            goto_3:;
            MMC_CATCH_INTERNAL(mmc_jumper);
            if (++tmp5 < 2) {
              goto tmp4_top;
            }
            MMC_THROW_INTERNAL();
            tmp4_done2:;
          }
        }
        ;
      }
    }
  }
  else
  {
    {
      modelica_metatype _eq;
      for (tmpMeta8 = _scodeEql; !listEmpty(tmpMeta8); tmpMeta8=MMC_CDR(tmpMeta8))
      {
        _eq = MMC_CAR(tmpMeta8);
        _instEql = omc_NFInst_instEquation(threadData, _eq, _scope, _connectBreaks, _context, _instEql);
      }
    }
  }

  _instEql = listReverseInPlace(_instEql);
  _return: OMC_LABEL_UNUSED
  return _instEql;
}
modelica_metatype boxptr_NFInst_instEquations(threadData_t *threadData, modelica_metatype _scodeEql, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _instEql = NULL;
  modelica_metatype tmpMeta2;
  tmp1 = mmc_unbox_integer(_context);
  _instEql = omc_NFInst_instEquations(threadData, _scodeEql, _scope, _connectBreaks, tmp1);
  /* skip box _instEql; list<NFEquation> */
  return _instEql;
}

DLLDirection
void omc_NFInst_checkExternalDeclLanguage(threadData_t *threadData, modelica_string _language, modelica_metatype _info)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_string tmp3_1;
    tmp3_1 = _language;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 5; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (1 != MMC_STRLEN(tmp3_1) || strcmp(MMC_STRINGDATA(_OMC_LIT149), MMC_STRINGDATA(tmp3_1)) != 0) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          if (10 != MMC_STRLEN(tmp3_1) || strcmp(MMC_STRINGDATA(_OMC_LIT150), MMC_STRINGDATA(tmp3_1)) != 0) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 2: {
          if (10 != MMC_STRLEN(tmp3_1) || strcmp(MMC_STRINGDATA(_OMC_LIT151), MMC_STRINGDATA(tmp3_1)) != 0) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 3: {
          if (7 != MMC_STRLEN(tmp3_1) || strcmp(MMC_STRINGDATA(_OMC_LIT152), MMC_STRINGDATA(tmp3_1)) != 0) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 4: {
          modelica_metatype tmpMeta5;
          
          /* Pattern matching succeeded */
          tmpMeta5 = mmc_mk_cons(_language, MMC_REFSTRUCTLIT(mmc_nil));
          omc_Error_addSourceMessage(threadData, _OMC_LIT148, tmpMeta5, _info);
          goto goto_1;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_instExternalDecl(threadData_t *threadData, modelica_metatype _extDecl, modelica_metatype _scope, modelica_integer _context)
{
  modelica_metatype _sections = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _sections has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _extDecl;
    {
      modelica_string _name = NULL;
      modelica_string _lang = NULL;
      modelica_metatype _args = NULL;
      modelica_metatype _ret_cref = NULL;
      modelica_metatype _info = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _name has no default value.
      // _lang has no default value.
      // _args has no default value.
      // _ret_cref has no default value.
      // _info has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta10;
          
          /* Pattern matching succeeded */
          _info = omc_NFInstNode_InstNode_info(threadData, _scope);

          _name = omc_Util_getOptionOrDefault(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 2))), omc_NFInstNode_InstNode_name(threadData, _scope));

          _lang = omc_Util_getOptionOrDefault(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 3))), _OMC_LIT149);

          omc_NFInst_checkExternalDeclLanguage(threadData, _lang, _info);

          {
            modelica_metatype __omcQ_24tmpVar11;
            modelica_metatype* tmp7;
            modelica_metatype tmpMeta8;
            modelica_metatype __omcQ_24tmpVar10;
            modelica_integer tmp9;
            modelica_metatype _arg_loopVar = 0;
            modelica_metatype _arg;
            _arg_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 5)));
            tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar11 = tmpMeta8; /* defaultValue */
            tmp7 = &__omcQ_24tmpVar11;
            while(1) {
              tmp9 = 1;
              if (!listEmpty(_arg_loopVar)) {
                _arg = MMC_CAR(_arg_loopVar);
                _arg_loopVar = MMC_CDR(_arg_loopVar);
                tmp9--;
              }
              if (tmp9 == 0) {
                __omcQ_24tmpVar10 = omc_NFInst_instExp(threadData, _arg, _scope, _context, _info);
                *tmp7 = mmc_mk_cons(__omcQ_24tmpVar10,0);
                tmp7 = &MMC_CDR(*tmp7);
              } else if (tmp9 == 1) {
                break;
              } else {
                goto goto_2;
              }
            }
            *tmp7 = mmc_mk_nil();
            tmpMeta6 = __omcQ_24tmpVar11;
          }
          _args = tmpMeta6;

          if(isSome((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 4)))))
          {
            _ret_cref = omc_NFLookup_lookupLocalComponent(threadData, omc_Util_getOption(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 4)))), _scope, _context, _info, NULL);
          }
          else
          {
            _ret_cref = _OMC_LIT153;
          }
          tmpMeta10 = mmc_mk_box8(4, &NFSections_EXTERNAL__desc, _name, _args, _ret_cref, _lang, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 6))), mmc_mk_boolean(isSome((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_extDecl), 2))))), _info);
          tmpMeta1 = tmpMeta10;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _sections = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _sections;
}
modelica_metatype boxptr_NFInst_instExternalDecl(threadData_t *threadData, modelica_metatype _extDecl, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _sections = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _sections = omc_NFInst_instExternalDecl(threadData, _extDecl, _scope, tmp1);
  /* skip box _sections; NFSections */
  return _sections;
}

DLLDirection
modelica_metatype omc_NFInst_instSections2(threadData_t *threadData, modelica_metatype _parts, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_integer _context, modelica_metatype __omcQ_24in_5Fsections)
{
  modelica_metatype _sections = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sections = __omcQ_24in_5Fsections;
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _parts;
    tmp4_2 = _sections;
    {
      modelica_metatype _eq = NULL;
      modelica_metatype _ieq = NULL;
      modelica_metatype _alg = NULL;
      modelica_metatype _ialg = NULL;
      modelica_metatype _ext_decl = NULL;
      modelica_integer _icontext;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _eq has no default value.
      // _ieq has no default value.
      // _alg has no default value.
      // _ialg has no default value.
      // _ext_decl has no default value.
      // _icontext has no default value.
      tmp4 = 0;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,7) == 0) goto tmp3_end;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,8) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
          if (optionNone(tmpMeta6)) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
          _ext_decl = tmpMeta7;
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!omc_Flags_isConfigFlagSet(threadData, _OMC_LIT78, _OMC_LIT19)) goto tmp3_end;
          tmpMeta1 = omc_NFInst_instExternalDecl(threadData, _ext_decl, _scope, _context);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,7) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!omc_SCodeUtil_classDefHasSections(threadData, _parts, 1 /* true */)) goto tmp3_end;
          tmpMeta8 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _scope), MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta9 = mmc_mk_cons((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sections), 8))), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _scope), MMC_REFSTRUCTLIT(mmc_nil)));
          omc_Error_addMultiSourceMessage(threadData, _OMC_LIT156, tmpMeta8, tmpMeta9);
          goto goto_2;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,8) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
          if (optionNone(tmpMeta10)) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
          
          _ext_decl = tmpMeta11;
          /* Pattern matching succeeded */
          if(omc_SCodeUtil_classDefHasSections(threadData, _parts, 0 /* false */))
          {
            tmpMeta12 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _scope), MMC_REFSTRUCTLIT(mmc_nil));
            omc_Error_addSourceMessage(threadData, _OMC_LIT156, tmpMeta12, omc_NFInstNode_InstNode_info(threadData, _scope));

            goto goto_2;
          }
          tmpMeta1 = omc_NFInst_instExternalDecl(threadData, _ext_decl, _scope, _context);
          goto tmp3_done;
        }
        case 3: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,8) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _icontext = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 256));

          _eq = omc_NFInst_instEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_parts), 3))), _scope, _connectBreaks, _context);

          _ieq = omc_NFInst_instEquations(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_parts), 4))), _scope, _connectBreaks, _icontext);

          _alg = omc_NFInst_instAlgorithmSections(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_parts), 5))), _scope, _context);

          _ialg = omc_NFInst_instAlgorithmSections(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_parts), 6))), _scope, _icontext);
          tmpMeta1 = omc_NFSections_join(threadData, omc_NFSections_new(threadData, _eq, _ieq, _alg, _ialg), _sections);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _sections = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _sections;
}
modelica_metatype boxptr_NFInst_instSections2(threadData_t *threadData, modelica_metatype _parts, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_metatype _context, modelica_metatype __omcQ_24in_5Fsections)
{
  modelica_integer tmp1;
  modelica_metatype _sections = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _sections = omc_NFInst_instSections2(threadData, _parts, _scope, _connectBreaks, tmp1, __omcQ_24in_5Fsections);
  /* skip box _sections; NFSections */
  return _sections;
}

DLLDirection
modelica_metatype omc_NFInst_instSections(threadData_t *threadData, modelica_metatype _node, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_integer _context, modelica_metatype __omcQ_24in_5Fsections)
{
  modelica_metatype _sections = NULL;
  modelica_metatype _el = NULL;
  modelica_metatype _def = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sections = __omcQ_24in_5Fsections;
  _el = omc_NFInstNode_InstNode_definition(threadData, _node);
  // _def has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _el;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,8) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFInst_instSections2(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_el), 7))), _scope, _connectBreaks, _context, _sections);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,2) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,8) == 0) goto tmp3_end;
          
          _def = tmpMeta8;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFInst_instSections2(threadData, _def, _scope, _connectBreaks, _context, _sections);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _sections;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _sections = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _sections;
}
modelica_metatype boxptr_NFInst_instSections(threadData_t *threadData, modelica_metatype _node, modelica_metatype _scope, modelica_metatype _connectBreaks, modelica_metatype _context, modelica_metatype __omcQ_24in_5Fsections)
{
  modelica_integer tmp1;
  modelica_metatype _sections = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _sections = omc_NFInst_instSections(threadData, _node, _scope, _connectBreaks, tmp1, __omcQ_24in_5Fsections);
  /* skip box _sections; NFSections */
  return _sections;
}

DLLDirection
modelica_metatype omc_NFInst_instPartEvalFunction(threadData_t *threadData, modelica_metatype _func, modelica_metatype _funcArgs, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _outExp = NULL;
  modelica_metatype _fn_ref = NULL;
  modelica_metatype _nargs = NULL;
  modelica_metatype _args = NULL;
  modelica_metatype _arg_names = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta11;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outExp has no default value.
  // _fn_ref has no default value.
  // _nargs has no default value.
  // _args has no default value.
  // _arg_names has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _funcArgs;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,2) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _nargs = tmpMeta2;

  _outExp = omc_NFInst_instCref(threadData, _func, _scope, _context, _info);

  if((!listEmpty(_nargs)))
  {
    _fn_ref = omc_NFExpression_toCref(threadData, _outExp);

    {
      modelica_metatype __omcQ_24tmpVar13;
      modelica_metatype* tmp4;
      modelica_metatype tmpMeta5;
      modelica_metatype __omcQ_24tmpVar12;
      modelica_integer tmp6;
      modelica_metatype _arg_loopVar = 0;
      modelica_metatype _arg;
      _arg_loopVar = _nargs;
      tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
      __omcQ_24tmpVar13 = tmpMeta5; /* defaultValue */
      tmp4 = &__omcQ_24tmpVar13;
      while(1) {
        tmp6 = 1;
        if (!listEmpty(_arg_loopVar)) {
          _arg = MMC_CAR(_arg_loopVar);
          _arg_loopVar = MMC_CDR(_arg_loopVar);
          tmp6--;
        }
        if (tmp6 == 0) {
          __omcQ_24tmpVar12 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_arg), 3))), _scope, _context, _info);
          *tmp4 = mmc_mk_cons(__omcQ_24tmpVar12,0);
          tmp4 = &MMC_CDR(*tmp4);
        } else if (tmp6 == 1) {
          break;
        } else {
          MMC_THROW_INTERNAL();
        }
      }
      *tmp4 = mmc_mk_nil();
      tmpMeta3 = __omcQ_24tmpVar13;
    }
    _args = tmpMeta3;

    {
      modelica_metatype __omcQ_24tmpVar15;
      modelica_metatype* tmp8;
      modelica_metatype tmpMeta9;
      modelica_string __omcQ_24tmpVar14;
      modelica_integer tmp10;
      modelica_metatype _arg_loopVar = 0;
      modelica_metatype _arg;
      _arg_loopVar = _nargs;
      tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
      __omcQ_24tmpVar15 = tmpMeta9; /* defaultValue */
      tmp8 = &__omcQ_24tmpVar15;
      while(1) {
        tmp10 = 1;
        if (!listEmpty(_arg_loopVar)) {
          _arg = MMC_CAR(_arg_loopVar);
          _arg_loopVar = MMC_CDR(_arg_loopVar);
          tmp10--;
        }
        if (tmp10 == 0) {
          __omcQ_24tmpVar14 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_arg), 2)));
          *tmp8 = mmc_mk_cons(__omcQ_24tmpVar14,0);
          tmp8 = &MMC_CDR(*tmp8);
        } else if (tmp10 == 1) {
          break;
        } else {
          MMC_THROW_INTERNAL();
        }
      }
      *tmp8 = mmc_mk_nil();
      tmpMeta7 = __omcQ_24tmpVar15;
    }
    _arg_names = tmpMeta7;

    tmpMeta11 = mmc_mk_box5(34, &NFExpression_PARTIAL__FUNCTION__APPLICATION__desc, _fn_ref, _args, _arg_names, _OMC_LIT97);
    _outExp = tmpMeta11;
  }
  _return: OMC_LABEL_UNUSED
  return _outExp;
}
modelica_metatype boxptr_NFInst_instPartEvalFunction(threadData_t *threadData, modelica_metatype _func, modelica_metatype _funcArgs, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _outExp = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _outExp = omc_NFInst_instPartEvalFunction(threadData, _func, _funcArgs, _scope, tmp1, _info);
  /* skip box _outExp; NFExpression */
  return _outExp;
}

DLLDirection
modelica_metatype omc_NFInst_instSubscript(threadData_t *threadData, modelica_metatype _subscript, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _outSubscript = NULL;
  modelica_metatype _exp = NULL;
  modelica_metatype _absynSub = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outSubscript has no default value.
  // _exp has no default value.
  // _absynSub has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _subscript;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,1) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _absynSub = tmpMeta2;

  { /* match expression */
    modelica_metatype tmp6_1;
    tmp6_1 = _absynSub;
    {
      volatile mmc_switch_type tmp6;
      int tmp7;
      tmp6 = 0;
      for (; tmp6 < 2; tmp6++) {
        switch (MMC_SWITCH_CAST(tmp6)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,0,0) == 0) goto tmp5_end;
          /* Pattern matching succeeded */
          tmpMeta3 = _OMC_LIT157;
          goto tmp5_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,1,1) == 0) goto tmp5_end;
          
          /* Pattern matching succeeded */
          _exp = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynSub), 2))), _scope, _context, _info);
          tmpMeta3 = omc_NFSubscript_fromExp(threadData, _exp);
          goto tmp5_done;
        }
        }
        goto tmp5_end;
        tmp5_end: ;
      }
      goto goto_4;
      goto_4:;
      MMC_THROW_INTERNAL();
      goto tmp5_done;
      tmp5_done:;
    }
  }
  _outSubscript = tmpMeta3;
  _return: OMC_LABEL_UNUSED
  return _outSubscript;
}
modelica_metatype boxptr_NFInst_instSubscript(threadData_t *threadData, modelica_metatype _subscript, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _outSubscript = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _outSubscript = omc_NFInst_instSubscript(threadData, _subscript, _scope, tmp1, _info);
  /* skip box _outSubscript; NFSubscript */
  return _outSubscript;
}

DLLDirection
modelica_metatype omc_NFInst_instCrefSubscripts(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fcref, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _cref = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _cref = __omcQ_24in_5Fcref;
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cref;
    {
      modelica_metatype _rest_cr = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _rest_cr has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,5) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          if((!listEmpty((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 3))))))
          {
            {
              modelica_metatype __omcQ_24tmpVar17;
              modelica_metatype* tmp7;
              modelica_metatype tmpMeta8;
              modelica_metatype __omcQ_24tmpVar16;
              modelica_integer tmp9;
              modelica_metatype _s_loopVar = 0;
              modelica_metatype _s;
              _s_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 3)));
              tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
              __omcQ_24tmpVar17 = tmpMeta8; /* defaultValue */
              tmp7 = &__omcQ_24tmpVar17;
              while(1) {
                tmp9 = 1;
                if (!listEmpty(_s_loopVar)) {
                  _s = MMC_CAR(_s_loopVar);
                  _s_loopVar = MMC_CDR(_s_loopVar);
                  tmp9--;
                }
                if (tmp9 == 0) {
                  __omcQ_24tmpVar16 = omc_NFInst_instSubscript(threadData, _s, _scope, _context, _info);
                  *tmp7 = mmc_mk_cons(__omcQ_24tmpVar16,0);
                  tmp7 = &MMC_CDR(*tmp7);
                } else if (tmp9 == 1) {
                  break;
                } else {
                  goto goto_1;
                }
              }
              *tmp7 = mmc_mk_nil();
              tmpMeta6 = __omcQ_24tmpVar17;
            }
            tmpMeta5 = MMC_TAGPTR(mmc_alloc_words(7));
            memcpy(MMC_UNTAGPTR(tmpMeta5), MMC_UNTAGPTR(_cref), 7*sizeof(modelica_metatype));
            ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta5))[3] = tmpMeta6;
            _cref = tmpMeta5;
          }

          _rest_cr = omc_NFInst_instCrefSubscripts(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 6))), _scope, _context, _info);

          if((!referenceEq(_rest_cr, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 6))))))
          {
            tmpMeta10 = MMC_TAGPTR(mmc_alloc_words(7));
            memcpy(MMC_UNTAGPTR(tmpMeta10), MMC_UNTAGPTR(_cref), 7*sizeof(modelica_metatype));
            ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta10))[6] = _rest_cr;
            _cref = tmpMeta10;
          }
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _cref;
}
modelica_metatype boxptr_NFInst_instCrefSubscripts(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fcref, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _cref = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _cref = omc_NFInst_instCrefSubscripts(threadData, __omcQ_24in_5Fcref, _scope, tmp1, _info);
  /* skip box _cref; NFComponentRef */
  return _cref;
}

DLLDirection
void omc_NFInst_checkUnsubscriptableCref(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _info)
{
  modelica_metatype tmpMeta1;
  modelica_string tmp2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if(omc_NFComponentRef_hasSubscripts(threadData, _cref))
  {
    tmp2 = modelica_integer_to_modelica_string(listLength(omc_NFComponentRef_getSubscripts(threadData, _cref)), ((modelica_integer) 0), 1 /* true */);
    tmpMeta1 = mmc_mk_cons(omc_NFComponentRef_toString(threadData, _cref), mmc_mk_cons(tmp2, mmc_mk_cons(_OMC_LIT161, MMC_REFSTRUCTLIT(mmc_nil))));
    omc_Error_addSourceMessage(threadData, _OMC_LIT160, tmpMeta1, _info);

    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_instCrefTypename(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _node, modelica_metatype _info)
{
  modelica_metatype _crefExp = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _crefExp has no default value.
  // _ty has no default value.
  omc_NFInst_checkUnsubscriptableCref(threadData, _cref, _info);

  _ty = omc_NFInstNode_InstNode_getType(threadData, _node);

  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _ty;
    {
      int tmp4;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 6: {
          modelica_metatype tmpMeta5;
          
          /* Pattern matching succeeded */
          tmpMeta5 = mmc_mk_box3(10, &NFType_ARRAY__desc, _ty, _OMC_LIT163);
          tmpMeta1 = tmpMeta5;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          tmpMeta7 = mmc_mk_box2(7, &NFDimension_ENUM__desc, _ty);
          tmpMeta6 = mmc_mk_cons(tmpMeta7, MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta8 = mmc_mk_box3(10, &NFType_ARRAY__desc, _ty, tmpMeta6);
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          modelica_metatype tmpMeta9;
          
          /* Pattern matching succeeded */
          tmpMeta9 = stringAppend(_OMC_LIT164,omc_NFInstNode_InstNode_name(threadData, _node));
          omc_Error_assertion(threadData, 0 /* false */, tmpMeta9, _OMC_LIT165);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _ty = tmpMeta1;

  tmpMeta10 = mmc_mk_box2(10, &NFExpression_TYPENAME__desc, _ty);
  _crefExp = tmpMeta10;
  _return: OMC_LABEL_UNUSED
  return _crefExp;
}

DLLDirection
modelica_metatype omc_NFInst_instCrefFunction(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _crefExp = NULL;
  modelica_metatype _fn_ref = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _crefExp has no default value.
  // _fn_ref has no default value.
  _fn_ref = omc_NFComponentRef_appendScope(threadData, _scope, _cref, 1 /* true */);

  _fn_ref = omc_NFFunction_Function_instFunctionRef(threadData, _fn_ref, _context, _info, NULL, NULL);

  tmpMeta1 = mmc_mk_box3(9, &NFExpression_CREF__desc, _OMC_LIT97, _fn_ref);
  _crefExp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _crefExp;
}
modelica_metatype boxptr_NFInst_instCrefFunction(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _crefExp = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _crefExp = omc_NFInst_instCrefFunction(threadData, _cref, _scope, tmp1, _info);
  /* skip box _crefExp; NFExpression */
  return _crefExp;
}

DLLDirection
modelica_metatype omc_NFInst_instCrefComponent(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _node, modelica_metatype _scope, modelica_metatype _info)
{
  modelica_metatype _crefExp = NULL;
  modelica_metatype _comp = NULL;
  modelica_metatype _prefixed_cref = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _crefExp has no default value.
  // _comp has no default value.
  // _prefixed_cref has no default value.
  _comp = omc_NFInstNode_InstNode_component(threadData, _node);

  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _comp;
    {
      int tmp4;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 5: {
          modelica_metatype tmpMeta5;
          
          /* Pattern matching succeeded */
          omc_NFInst_checkUnsubscriptableCref(threadData, _cref, _info);
          tmpMeta5 = mmc_mk_box3(9, &NFExpression_CREF__desc, _OMC_LIT97, omc_NFComponentRef_makeIterator(threadData, _node, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 2)))));
          tmpMeta1 = tmpMeta5;
          goto tmp3_done;
        }
        case 6: {
          
          /* Pattern matching succeeded */
          omc_NFInst_checkUnsubscriptableCref(threadData, _cref, _info);
          tmpMeta1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 2)));
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta6;
          
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, omc_NFInstNode_InstNode_parent(threadData, _node)), MMC_REFSTRUCTLIT(mmc_nil)));
          omc_Error_addSourceMessage(threadData, _OMC_LIT168, tmpMeta6, _info);
          goto goto_2;
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          modelica_metatype tmpMeta7;
          
          /* Pattern matching succeeded */
          tmpMeta7 = mmc_mk_box3(9, &NFExpression_CREF__desc, _OMC_LIT97, omc_NFComponentRef_appendScope(threadData, _scope, _cref, 0 /* false */));
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _crefExp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _crefExp;
}

DLLDirection
modelica_metatype omc_NFInst_instCref(threadData_t *threadData, modelica_metatype _absynCref, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _crefExp = NULL;
  modelica_metatype _cref = NULL;
  modelica_metatype _prefixed_cref = NULL;
  modelica_metatype _found_scope = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _comp = NULL;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _crefExp has no default value.
  // _cref has no default value.
  // _prefixed_cref has no default value.
  // _found_scope has no default value.
  // _ty has no default value.
  // _comp has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _absynCref;
    {
      int tmp4;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 6: {
          
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _OMC_LIT169;
          tmpMeta[0+1] = _scope;
          goto tmp3_done;
        }
        case 7: {
          
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _OMC_LIT169;
          tmpMeta[0+1] = _scope;
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          
          /* Pattern matching succeeded */
          tmpMeta[0+0] = omc_NFLookup_lookupComponent(threadData, _absynCref, _scope, _context, _info, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _cref = tmpMeta[0+0];
  _found_scope = tmpMeta[0+1];

  _cref = omc_NFInst_instCrefSubscripts(threadData, _cref, _scope, _context, _info);

  { /* match expression */
    modelica_metatype tmp8_1;
    tmp8_1 = _cref;
    {
      volatile mmc_switch_type tmp8;
      int tmp9;
      tmp8 = 0;
      for (; tmp8 < 2; tmp8++) {
        switch (MMC_SWITCH_CAST(tmp8)) {
        case 0: {
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,0,5) == 0) goto tmp7_end;
          
          /* Pattern matching succeeded */
          { /* match expression */
            modelica_metatype tmp13_1;
            tmp13_1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 2)));
            {
              int tmp13;
              {
                switch (MMC_SWITCH_CAST(valueConstructor(tmp13_1))) {
                case 4: {
                  
                  /* Pattern matching succeeded */
                  tmpMeta10 = omc_NFInst_instCrefComponent(threadData, _cref, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 2))), _found_scope, _info);
                  goto tmp12_done;
                }
                case 3: {
                  
                  /* Pattern matching succeeded */
                  tmpMeta10 = (omc_NFClass_isFunction(threadData, omc_NFInstNode_InstNode_getClass(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 2)))))?omc_NFInst_instCrefFunction(threadData, _cref, _found_scope, _context, _info):omc_NFInst_instCrefTypename(threadData, _cref, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cref), 2))), _info));
                  goto tmp12_done;
                }
                default:
                tmp12_default: OMC_LABEL_UNUSED; {
                  
                  /* Pattern matching succeeded */
                  omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT170, _OMC_LIT171);
                  goto goto_11;
                  goto tmp12_done;
                }
                }
                goto tmp12_end;
                tmp12_end: ;
              }
              goto goto_11;
              goto_11:;
              goto goto_6;
              goto tmp12_done;
              tmp12_done:;
            }
          }tmpMeta5 = tmpMeta10;
          goto tmp7_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          
          /* Pattern matching succeeded */
          tmpMeta14 = mmc_mk_box3(9, &NFExpression_CREF__desc, _OMC_LIT97, _cref);
          tmpMeta5 = tmpMeta14;
          goto tmp7_done;
        }
        }
        goto tmp7_end;
        tmp7_end: ;
      }
      goto goto_6;
      goto_6:;
      MMC_THROW_INTERNAL();
      goto tmp7_done;
      tmp7_done:;
    }
  }
  _crefExp = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _crefExp;
}
modelica_metatype boxptr_NFInst_instCref(threadData_t *threadData, modelica_metatype _absynCref, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _crefExp = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _crefExp = omc_NFInst_instCref(threadData, _absynCref, _scope, tmp1, _info);
  /* skip box _crefExp; NFExpression */
  return _crefExp;
}

static modelica_metatype closure2_NFInst_instExp(threadData_t *thData, modelica_metatype closure, modelica_metatype absynExp)
{
  modelica_metatype scope = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype info = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  return boxptr_NFInst_instExp(thData, absynExp, scope, context, info);
}
DLLDirection
modelica_metatype omc_NFInst_instExp(threadData_t *threadData, modelica_metatype _absynExp, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _exp = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _exp has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _absynExp;
    {
      modelica_metatype _e1 = NULL;
      modelica_metatype _e2 = NULL;
      modelica_metatype _e3 = NULL;
      modelica_metatype _oe = NULL;
      modelica_metatype _op = NULL;
      modelica_metatype _expl = NULL;
      modelica_metatype _expll = NULL;
      modelica_metatype _absynExp1 = NULL;
      modelica_metatype _arr = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _e1 has no default value.
      // _e2 has no default value.
      // _e3 has no default value.
      // _oe has no default value.
      // _op has no default value.
      // _expl has no default value.
      // _expll has no default value.
      // _absynExp1 has no default value.
      // _arr has no default value.
      tmp4 = 0;
      for (; tmp4 < 22; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_box2(3, &NFExpression_INTEGER__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))));
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta7 = mmc_mk_box2(4, &NFExpression_REAL__desc, mmc_mk_real(stringReal((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))))));
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_box2(5, &NFExpression_STRING__desc, omc_System_unescapedString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2)))));
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta9 = mmc_mk_box2(6, &NFExpression_BOOLEAN__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))));
          tmpMeta1 = tmpMeta9;
          goto tmp3_done;
        }
        case 4: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFInst_instCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta10 = mmc_mk_box3(0, _scope, mmc_mk_integer(_context), _info);
          _arr = omc_Array_mapList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), (modelica_fnptr) mmc_mk_box2(0,closure2_NFInst_instExp,tmpMeta10));
          tmpMeta1 = omc_NFExpression_makeArrayCheckLiteral(threadData, _OMC_LIT97, _arr);
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta19;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype __omcQ_24tmpVar21;
            modelica_metatype* tmp12;
            modelica_metatype tmpMeta13;
            modelica_metatype tmpMeta14;
            modelica_metatype __omcQ_24tmpVar20;
            modelica_integer tmp18;
            modelica_metatype _el_loopVar = 0;
            modelica_metatype _el;
            _el_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2)));
            tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar21 = tmpMeta13; /* defaultValue */
            tmp12 = &__omcQ_24tmpVar21;
            while(1) {
              tmp18 = 1;
              if (!listEmpty(_el_loopVar)) {
                _el = MMC_CAR(_el_loopVar);
                _el_loopVar = MMC_CDR(_el_loopVar);
                tmp18--;
              }
              if (tmp18 == 0) {
                {
                  modelica_metatype __omcQ_24tmpVar19;
                  modelica_metatype* tmp15;
                  modelica_metatype tmpMeta16;
                  modelica_metatype __omcQ_24tmpVar18;
                  modelica_integer tmp17;
                  modelica_metatype _e_loopVar = 0;
                  modelica_metatype _e;
                  _e_loopVar = _el;
                  tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
                  __omcQ_24tmpVar19 = tmpMeta16; /* defaultValue */
                  tmp15 = &__omcQ_24tmpVar19;
                  while(1) {
                    tmp17 = 1;
                    if (!listEmpty(_e_loopVar)) {
                      _e = MMC_CAR(_e_loopVar);
                      _e_loopVar = MMC_CDR(_e_loopVar);
                      tmp17--;
                    }
                    if (tmp17 == 0) {
                      __omcQ_24tmpVar18 = omc_NFInst_instExp(threadData, _e, _scope, _context, _info);
                      *tmp15 = mmc_mk_cons(__omcQ_24tmpVar18,0);
                      tmp15 = &MMC_CDR(*tmp15);
                    } else if (tmp17 == 1) {
                      break;
                    } else {
                      goto goto_2;
                    }
                  }
                  *tmp15 = mmc_mk_nil();
                  tmpMeta14 = __omcQ_24tmpVar19;
                }
                __omcQ_24tmpVar20 = tmpMeta14;
                *tmp12 = mmc_mk_cons(__omcQ_24tmpVar20,0);
                tmp12 = &MMC_CDR(*tmp12);
              } else if (tmp18 == 1) {
                break;
              } else {
                goto goto_2;
              }
            }
            *tmp12 = mmc_mk_nil();
            tmpMeta11 = __omcQ_24tmpVar21;
          }
          _expll = tmpMeta11;
          tmpMeta19 = mmc_mk_box2(12, &NFExpression_MATRIX__desc, _expll);
          tmpMeta1 = tmpMeta19;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta20;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info);

          _oe = omc_NFInst_instExpOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))), _scope, _context, _info);

          _e3 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 4))), _scope, _context, _info);
          tmpMeta20 = mmc_mk_box5(13, &NFExpression_RANGE__desc, _OMC_LIT97, _e1, _oe, _e3);
          tmpMeta1 = tmpMeta20;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta21)) goto tmp3_end;
          tmpMeta22 = MMC_CAR(tmpMeta21);
          tmpMeta23 = MMC_CDR(tmpMeta21);
          if (!listEmpty(tmpMeta23)) goto tmp3_end;
          _absynExp1 = tmpMeta22;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _absynExp = _absynExp1;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta28;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype __omcQ_24tmpVar23;
            modelica_metatype* tmp25;
            modelica_metatype tmpMeta26;
            modelica_metatype __omcQ_24tmpVar22;
            modelica_integer tmp27;
            modelica_metatype _e_loopVar = 0;
            modelica_metatype _e;
            _e_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2)));
            tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar23 = tmpMeta26; /* defaultValue */
            tmp25 = &__omcQ_24tmpVar23;
            while(1) {
              tmp27 = 1;
              if (!listEmpty(_e_loopVar)) {
                _e = MMC_CAR(_e_loopVar);
                _e_loopVar = MMC_CDR(_e_loopVar);
                tmp27--;
              }
              if (tmp27 == 0) {
                __omcQ_24tmpVar22 = omc_NFInst_instExp(threadData, _e, _scope, _context, _info);
                *tmp25 = mmc_mk_cons(__omcQ_24tmpVar22,0);
                tmp25 = &MMC_CDR(*tmp25);
              } else if (tmp27 == 1) {
                break;
              } else {
                goto goto_2;
              }
            }
            *tmp25 = mmc_mk_nil();
            tmpMeta24 = __omcQ_24tmpVar23;
          }
          _expl = tmpMeta24;
          tmpMeta28 = mmc_mk_box3(14, &NFExpression_TUPLE__desc, _OMC_LIT97, _expl);
          tmpMeta1 = tmpMeta28;
          goto tmp3_done;
        }
        case 10: {
          modelica_metatype tmpMeta29;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info);

          _e2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 4))), _scope, _context, _info);

          _op = omc_NFOperator_fromAbsyn(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))));
          tmpMeta29 = mmc_mk_box4(19, &NFExpression_BINARY__desc, _e1, _op, _e2);
          tmpMeta1 = tmpMeta29;
          goto tmp3_done;
        }
        case 11: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))), _scope, _context, _info);

          _op = omc_NFOperator_fromAbsyn(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))));
          tmpMeta1 = omc_NFExpression_makeUnary(threadData, _op, _e1);
          goto tmp3_done;
        }
        case 12: {
          modelica_metatype tmpMeta30;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info);

          _e2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 4))), _scope, _context, _info);

          _op = omc_NFOperator_fromAbsyn(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))));
          tmpMeta30 = mmc_mk_box4(21, &NFExpression_LBINARY__desc, _e1, _op, _e2);
          tmpMeta1 = tmpMeta30;
          goto tmp3_done;
        }
        case 13: {
          modelica_metatype tmpMeta31;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))), _scope, _context, _info);

          _op = omc_NFOperator_fromAbsyn(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))));
          tmpMeta31 = mmc_mk_box3(22, &NFExpression_LUNARY__desc, _op, _e1);
          tmpMeta1 = tmpMeta31;
          goto tmp3_done;
        }
        case 14: {
          modelica_metatype tmpMeta32;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info);

          _e2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 4))), _scope, _context, _info);

          _op = omc_NFOperator_fromAbsyn(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))));
          tmpMeta32 = mmc_mk_box5(23, &NFExpression_RELATION__desc, _e1, _op, _e2, mmc_mk_integer(((modelica_integer) -1)));
          tmpMeta1 = tmpMeta32;
          goto tmp3_done;
        }
        case 15: {
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_metatype tmpMeta36;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _e3 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 4))), _scope, _context, _info);

          {
            modelica_metatype _branch;
            for (tmpMeta33 = listReverse((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 5)))); !listEmpty(tmpMeta33); tmpMeta33=MMC_CDR(tmpMeta33))
            {
              _branch = MMC_CAR(tmpMeta33);
              _e1 = omc_NFInst_instExp(threadData, omc_Util_tuple21(threadData, _branch), _scope, _context, _info);

              _e2 = omc_NFInst_instExp(threadData, omc_Util_tuple22(threadData, _branch), _scope, _context, _info);

              tmpMeta34 = mmc_mk_box5(25, &NFExpression_IF__desc, _OMC_LIT97, _e1, _e2, _e3);
              _e3 = tmpMeta34;
            }
          }

          _e1 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info);

          _e2 = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))), _scope, _context, _info);
          tmpMeta36 = mmc_mk_box5(25, &NFExpression_IF__desc, _OMC_LIT97, _e1, _e2, _e3);
          tmpMeta1 = tmpMeta36;
          goto tmp3_done;
        }
        case 16: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFCall_instantiate(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))), _scope, _context, _info);
          goto tmp3_done;
        }
        case 17: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFInst_instPartEvalFunction(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3))), _scope, _context, _info);
          goto tmp3_done;
        }
        case 18: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,0) == 0) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT172;
          goto tmp3_done;
        }
        case 19: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _absynExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3)));
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 20: {
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta42;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype __omcQ_24tmpVar25;
            modelica_metatype* tmp38;
            modelica_metatype tmpMeta39;
            modelica_metatype tmpMeta40;
            modelica_metatype __omcQ_24tmpVar24;
            modelica_integer tmp41;
            modelica_metatype _s_loopVar = 0;
            modelica_metatype _s;
            _s_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 3)));
            tmpMeta39 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar25 = tmpMeta39; /* defaultValue */
            tmp38 = &__omcQ_24tmpVar25;
            while(1) {
              tmp41 = 1;
              if (!listEmpty(_s_loopVar)) {
                _s = MMC_CAR(_s_loopVar);
                _s_loopVar = MMC_CDR(_s_loopVar);
                tmp41--;
              }
              if (tmp41 == 0) {
                tmpMeta40 = mmc_mk_box2(3, &NFSubscript_RAW__SUBSCRIPT__desc, _s);
                __omcQ_24tmpVar24 = omc_NFInst_instSubscript(threadData, tmpMeta40, _scope, _context, _info);
                *tmp38 = mmc_mk_cons(__omcQ_24tmpVar24,0);
                tmp38 = &MMC_CDR(*tmp38);
              } else if (tmp41 == 1) {
                break;
              } else {
                goto goto_2;
              }
            }
            *tmp38 = mmc_mk_nil();
            tmpMeta37 = __omcQ_24tmpVar25;
          }
          tmpMeta42 = mmc_mk_box5(29, &NFExpression_SUBSCRIPTED__EXP__desc, omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_absynExp), 2))), _scope, _context, _info), tmpMeta37, _OMC_LIT97, mmc_mk_boolean(0 /* false */));
          tmpMeta1 = tmpMeta42;
          goto tmp3_done;
        }
        case 21: {
          modelica_metatype tmpMeta43;
          
          /* Pattern matching succeeded */
          tmpMeta43 = stringAppend(_OMC_LIT173,omc_Dump_printExpStr(threadData, _absynExp));
          omc_Error_assertion(threadData, 0 /* false */, tmpMeta43, _OMC_LIT174);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _exp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _exp;
}
modelica_metatype boxptr_NFInst_instExp(threadData_t *threadData, modelica_metatype _absynExp, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _exp = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _exp = omc_NFInst_instExp(threadData, _absynExp, _scope, tmp1, _info);
  /* skip box _exp; NFExpression */
  return _exp;
}

DLLDirection
modelica_metatype omc_NFInst_instExpOpt(threadData_t *threadData, modelica_metatype _absynExp, modelica_metatype _scope, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _exp = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _exp has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _absynExp;
    {
      modelica_metatype _aexp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _aexp has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (!optionNone(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = mmc_mk_none();
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta6;
          if (optionNone(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          _aexp = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = mmc_mk_some(omc_NFInst_instExp(threadData, _aexp, _scope, _context, _info));
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _exp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _exp;
}
modelica_metatype boxptr_NFInst_instExpOpt(threadData_t *threadData, modelica_metatype _absynExp, modelica_metatype _scope, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _exp = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _exp = omc_NFInst_instExpOpt(threadData, _absynExp, _scope, tmp1, _info);
  /* skip box _exp; Option<NFExpression> */
  return _exp;
}

DLLDirection
modelica_metatype omc_NFInst_instBinding(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fbinding, modelica_integer _context)
{
  modelica_metatype _binding = NULL;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _binding = __omcQ_24in_5Fbinding;
  if(omc_NFInstContext_inInstanceAPI(threadData, _context))
  {
    omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT176);

    { /* matchcontinue expression */
      {
        volatile mmc_switch_type tmp3;
        int tmp4;
        tmp3 = 0;
        MMC_TRY_INTERNAL(mmc_jumper)
        tmp2_top:
        threadData->mmc_jumper = &new_mmc_jumper;
        for (; tmp3 < 2; tmp3++) {
          switch (MMC_SWITCH_CAST(tmp3)) {
          case 0: {
            /* Pattern matching succeeded */
            _binding = omc_NFInst_instBinding(threadData, _binding, omc_NFInstContext_unset(threadData, _context, ((modelica_integer) 2)));
            goto tmp2_done;
          }
          case 1: {
            modelica_metatype tmpMeta5;
            /* Pattern matching succeeded */
            tmpMeta5 = mmc_mk_box3(9, &NFBinding_INVALID__BINDING__desc, _binding, omc_ErrorExt_getCheckpointMessages(threadData));
            _binding = tmpMeta5;
            goto tmp2_done;
          }
          }
          goto tmp2_end;
          tmp2_end: ;
        }
        goto goto_1;
        tmp2_done:
        (void)tmp3;
        MMC_RESTORE_INTERNAL(mmc_jumper);
        goto tmp2_done2;
        goto_1:;
        MMC_CATCH_INTERNAL(mmc_jumper);
        if (++tmp3 < 2) {
          goto tmp2_top;
        }
        MMC_THROW_INTERNAL();
        tmp2_done2:;
      }
    }
    ;

    omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT176);
  }
  else
  {
    { /* match expression */
      modelica_metatype tmp9_1;
      tmp9_1 = _binding;
      {
        modelica_metatype _bind_exp = NULL;
        volatile mmc_switch_type tmp9;
        int tmp10;
        // _bind_exp has no default value.
        tmp9 = 0;
        for (; tmp9 < 3; tmp9++) {
          switch (MMC_SWITCH_CAST(tmp9)) {
          case 0: {
            modelica_metatype tmpMeta11;
            if (mmc__uniontype__metarecord__typedef__equal(tmp9_1,1,6) == 0) goto tmp8_end;
            tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp9_1), 2));
            if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,26,0) == 0) goto tmp8_end;
            
            /* Pattern matching succeeded */
            tmpMeta6 = _OMC_LIT175;
            goto tmp8_done;
          }
          case 1: {
            modelica_metatype tmpMeta12;
            modelica_metatype tmpMeta13;
            if (mmc__uniontype__metarecord__typedef__equal(tmp9_1,1,6) == 0) goto tmp8_end;
            
            /* Pattern matching succeeded */
            _bind_exp = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 3))), _context, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 7))));

            if((!listEmpty((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 4))))))
            {
              tmpMeta12 = mmc_mk_box5(29, &NFExpression_SUBSCRIPTED__EXP__desc, _bind_exp, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 4))), _OMC_LIT97, mmc_mk_boolean(1 /* true */));
              _bind_exp = tmpMeta12;
            }
            tmpMeta13 = mmc_mk_box7(5, &NFBinding_UNTYPED__BINDING__desc, _bind_exp, mmc_mk_boolean(0 /* false */), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 5))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 6))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_binding), 7))));
            tmpMeta6 = tmpMeta13;
            goto tmp8_done;
          }
          case 2: {
            
            /* Pattern matching succeeded */
            tmpMeta6 = _binding;
            goto tmp8_done;
          }
          }
          goto tmp8_end;
          tmp8_end: ;
        }
        goto goto_7;
        goto_7:;
        MMC_THROW_INTERNAL();
        goto tmp8_done;
        tmp8_done:;
      }
    }
    _binding = tmpMeta6;
  }
  _return: OMC_LABEL_UNUSED
  return _binding;
}
modelica_metatype boxptr_NFInst_instBinding(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fbinding, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _binding = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _binding = omc_NFInst_instBinding(threadData, __omcQ_24in_5Fbinding, tmp1);
  /* skip box _binding; NFBinding */
  return _binding;
}

DLLDirection
void omc_NFInst_instComponentExpressions(threadData_t *threadData, modelica_metatype _component, modelica_integer _context, modelica_metatype _settings)
{
  modelica_metatype _node = NULL;
  modelica_metatype _c = NULL;
  modelica_metatype _dims = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _c has no default value.
  // _dims has no default value.
  if(omc_NFInstNode_InstNode_isEmpty(threadData, _component))
  {
    goto _return;
  }

  _node = omc_NFInstNode_InstNode_resolveInner(threadData, _component);

  _c = omc_NFInstNode_InstNode_component(threadData, _node);

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _c;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 6; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_integer tmp10;
          modelica_integer tmp11;
          modelica_integer tmp12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,8) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,17,2) == 0) goto tmp2_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 3));
          
          _dims = tmpMeta6;
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!(mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 8)))) == 1)) goto tmp2_end;
          tmpMeta7 = MMC_TAGPTR(mmc_alloc_words(10));
          memcpy(MMC_UNTAGPTR(tmpMeta7), MMC_UNTAGPTR(_c), 10*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta7))[8] = mmc_mk_integer(2);
          _c = tmpMeta7;

          omc_NFInstNode_InstNode_updateComponent(threadData, _c, _node);

          tmpMeta8 = MMC_TAGPTR(mmc_alloc_words(10));
          memcpy(MMC_UNTAGPTR(tmpMeta8), MMC_UNTAGPTR(_c), 10*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta8))[4] = omc_NFInst_instBinding(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 4))), _context);
          _c = tmpMeta8;

          tmpMeta9 = MMC_TAGPTR(mmc_alloc_words(10));
          memcpy(MMC_UNTAGPTR(tmpMeta9), MMC_UNTAGPTR(_c), 10*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta9))[5] = omc_NFInst_instBinding(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 5))), _context);
          _c = tmpMeta9;

          if((!omc_NFInstNode_InstNode_isEmpty(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2))))))
          {
            omc_NFInst_instExpressions(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2))), _node, _OMC_LIT177, omc_NFConnectBreakTree_new(threadData), _context, _settings);
          }

          tmp10 = ((modelica_integer) 1); tmp11 = 1; tmp12 = arrayLength(_dims);
          if(!(((tmp11 > 0) && (tmp10 > tmp12)) || ((tmp11 < 0) && (tmp10 < tmp12))))
          {
            modelica_integer _i;
            for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp10, tmp12); _i += tmp11)
            {
              arrayUpdate(_dims,_i,omc_NFInst_instDimension(threadData, arrayGet(_dims,_i) /* DAE.ASUB */, _context, _settings, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 9)))));
            }
          }

          omc_NFInstNode_InstNode_updateComponent(threadData, _c, _node);
          goto tmp2_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,8) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 2: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 3: {
          modelica_metatype tmpMeta13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,2) == 0) goto tmp2_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,2,0) == 0) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 4: {
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,2) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          tmpMeta14 = MMC_TAGPTR(mmc_alloc_words(4));
          memcpy(MMC_UNTAGPTR(tmpMeta14), MMC_UNTAGPTR(_c), 4*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta14))[3] = omc_NFInst_instBuiltinAttribute(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 3))), _component, _context);
          _c = tmpMeta14;

          omc_NFInstNode_InstNode_updateComponent(threadData, _c, _node);
          goto tmp2_done;
        }
        case 5: {
          
          /* Pattern matching succeeded */
          if((!omc_NFInstContext_inRelaxed(threadData, _context)))
          {
            omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT178, _OMC_LIT179);

            goto goto_1;
          }
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_instComponentExpressions(threadData_t *threadData, modelica_metatype _component, modelica_metatype _context, modelica_metatype _settings)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_instComponentExpressions(threadData, _component, tmp1, _settings);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_instBuiltinAttribute(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fattribute, modelica_metatype _node, modelica_integer _context)
{
  modelica_metatype _attribute = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _attribute = __omcQ_24in_5Fattribute;
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _attribute;
    {
      modelica_metatype _binding = NULL;
      int tmp3;
      // _binding has no default value.
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp3_1))) {
        case 3: {
          modelica_metatype tmpMeta4;
          modelica_metatype tmpMeta5;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,6) == 0) goto tmp2_end;
          tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 5));
          
          _binding = tmpMeta4;
          /* Pattern matching succeeded */
          tmpMeta5 = MMC_TAGPTR(mmc_alloc_words(8));
          memcpy(MMC_UNTAGPTR(tmpMeta5), MMC_UNTAGPTR(_attribute), 8*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta5))[5] = omc_NFInst_instBinding(threadData, _binding, _context);
          _attribute = tmpMeta5;
          goto tmp2_done;
        }
        case 4: {
          modelica_metatype tmpMeta6;
          
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_cons(omc_NFModifier_Modifier_name(threadData, _attribute), MMC_REFSTRUCTLIT(mmc_nil));
          omc_Error_addSourceMessage(threadData, _OMC_LIT182, tmpMeta6, omc_NFModifier_Modifier_info(threadData, _attribute));
          goto goto_1;
          goto tmp2_done;
        }
        default:
        tmp2_default: OMC_LABEL_UNUSED; {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _attribute;
}
modelica_metatype boxptr_NFInst_instBuiltinAttribute(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fattribute, modelica_metatype _node, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _attribute = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _attribute = omc_NFInst_instBuiltinAttribute(threadData, __omcQ_24in_5Fattribute, _node, tmp1);
  /* skip box _attribute; NFModifier.Modifier */
  return _attribute;
}

DLLDirection
void omc_NFInst_instRecordConstructor(threadData_t *threadData, modelica_metatype _node, modelica_integer _context)
{
  modelica_metatype _cache = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _cache has no default value.
  _cache = omc_NFInstNode_InstNode_getFuncCache(threadData, _node);

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cache;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,3) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          omc_NFInstNode_InstNode_cacheInitFunc(threadData, _node);

          if(omc_SCodeUtil_isOperatorRecord(threadData, omc_NFInstNode_InstNode_definition(threadData, _node)))
          {
            omc_NFOperatorOverloading_instConstructor(threadData, omc_NFInstNode_InstNode_fullPath(threadData, _node, 0 /* false */), _node, _context, omc_NFInstNode_InstNode_info(threadData, _node));
          }
          else
          {
            omc_NFRecord_instDefaultConstructor(threadData, omc_NFInstNode_InstNode_fullPath(threadData, _node, 0 /* false */), _node, _context, omc_NFInstNode_InstNode_info(threadData, _node));
          }
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_instRecordConstructor(threadData_t *threadData, modelica_metatype _node, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_instRecordConstructor(threadData, _node, tmp1);
  return;
}

DLLDirection
void omc_NFInst_instComplexType(threadData_t *threadData, modelica_metatype _ty, modelica_integer _context)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _ty;
    {
      modelica_metatype _node = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _node has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,11,2) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,4,3) == 0) goto tmp2_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
          
          _node = tmpMeta6;
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!(!omc_NFInstNode_InstNode_isModel(threadData, _node))) goto tmp2_end;
          omc_NFInst_instRecordConstructor(threadData, _node, _context);
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_instComplexType(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_instComplexType(threadData, _ty, tmp1);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_makeRecordComplexType(threadData_t *threadData, modelica_metatype _node, modelica_metatype _cls)
{
  modelica_metatype _ty = NULL;
  modelica_metatype _cls_node = NULL;
  modelica_metatype _indexMap = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ty has no default value.
  // _cls_node has no default value.
  _indexMap = omc_UnorderedMap_new(threadData, boxvar_stringHashDjb2, boxvar_stringEq, ((modelica_integer) 1));
  _cls_node = (omc_SCodeUtil_isOperatorRecord(threadData, omc_NFInstNode_InstNode_definition(threadData, _node))?omc_NFInstNode_InstNode_classScope(threadData, _node):omc_NFInstNode_InstNode_classScope(threadData, omc_NFInstNode_InstNode_getDerivedNode(threadData, _node, 1 /* true */)));

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta2 = mmc_mk_box4(7, &NFComplexType_RECORD__desc, _cls_node, listArray(tmpMeta1), _indexMap);
  _ty = tmpMeta2;
  _return: OMC_LABEL_UNUSED
  return _ty;
}

DLLDirection
modelica_metatype omc_NFInst_makeComplexType(threadData_t *threadData, modelica_metatype _restriction, modelica_metatype _node, modelica_metatype _cls)
{
  modelica_metatype _ty = NULL;
  modelica_metatype _cty = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ty has no default value.
  // _cty has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _restriction;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFInst_makeRecordComplexType(threadData, omc_NFInstNode_InstNode_classScope(threadData, omc_NFInstNode_InstNode_getDerivedNode(threadData, _node, 1 /* true */)), _cls);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT183;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _cty = tmpMeta1;

  tmpMeta6 = mmc_mk_box3(14, &NFType_COMPLEX__desc, _node, _cty);
  _ty = tmpMeta6;
  _return: OMC_LABEL_UNUSED
  return _ty;
}

static void closure3_NFInst_instComponentExpressions(threadData_t *thData, modelica_metatype closure, modelica_metatype component)
{
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype settings = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  boxptr_NFInst_instComponentExpressions(thData, component, context, settings);
}
DLLDirection
modelica_metatype omc_NFInst_instExpressions(threadData_t *threadData, modelica_metatype _node, modelica_metatype _scope, modelica_metatype __omcQ_24in_5Fsections, modelica_metatype _connectBreaks, modelica_integer _context, modelica_metatype _settings)
{
  modelica_metatype _sections = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _inst_cls = NULL;
  modelica_metatype _local_comps = NULL;
  modelica_metatype _exts = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_metatype _dims = NULL;
  modelica_metatype _info = NULL;
  modelica_metatype _ty = NULL;
  modelica_integer _next_context;
  modelica_metatype _connect_breaks = NULL;
  modelica_metatype _local_connect_breaks = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sections = __omcQ_24in_5Fsections;
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);
  // _inst_cls has no default value.
  // _local_comps has no default value.
  // _exts has no default value.
  // _cls_tree has no default value.
  // _dims has no default value.
  // _info has no default value.
  // _ty has no default value.
  // _next_context has no default value.
  // _connect_breaks has no default value.
  // _local_connect_breaks has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cls;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 7; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_integer tmp10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,12,0) == 0) goto tmp2_end;
          _cls_tree = tmpMeta5;
          /* Pattern matching succeeded */
          _exts = omc_NFClassTree_ClassTree_getExtends(threadData, _cls_tree);

          {
            modelica_metatype _ext;
            for (tmpMeta7 = _exts, tmp10 = arrayLength(tmpMeta7), tmp9 = 1; tmp9 <= tmp10; tmp9++)
            {
              _ext = arrayGet(tmpMeta7,tmp9);
              omc_NFInst_instExpressions(threadData, _ext, _ext, _sections, _connectBreaks, _context, _settings);
            }
          }

          if((arrayLength(_exts) == ((modelica_integer) 1)))
          {
            tmpMeta11 = mmc_mk_box2(4, &NFComplexType_EXTENDS__TYPE__desc, arrayGet(_exts,((modelica_integer) 1)) /* DAE.ASUB */);
            tmpMeta12 = mmc_mk_box3(14, &NFType_COMPLEX__desc, _node, tmpMeta11);
            _ty = tmpMeta12;
          }
          else
          {
            if(omc_SCodeUtil_hasBooleanNamedAnnotationInClass(threadData, omc_NFInstNode_InstNode_definition(threadData, _node), _OMC_LIT187))
            {
              tmpMeta13 = mmc_mk_box3(14, &NFType_COMPLEX__desc, _node, _OMC_LIT183);
              _ty = tmpMeta13;
            }
            else
            {
              tmpMeta14 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), MMC_REFSTRUCTLIT(mmc_nil));
              omc_Error_addSourceMessage(threadData, _OMC_LIT186, tmpMeta14, omc_NFInstNode_InstNode_info(threadData, _node));

              goto goto_1;
            }
          }

          _cls_tree = omc_NFClassTree_ClassTree_flatten(threadData, _cls_tree);

          tmpMeta15 = mmc_mk_box6(8, &NFClass_INSTANCED__CLASS__desc, _ty, _cls_tree, _OMC_LIT177, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 5))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 6))));
          _inst_cls = tmpMeta15;

          omc_NFInstNode_InstNode_updateClass(threadData, _inst_cls, _node);
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_integer tmp23;
          modelica_integer tmp24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          
          _cls_tree = tmpMeta16;
          /* Pattern matching succeeded */
          _connect_breaks = omc_NFConnectBreakTree_appendBreaksInNode(threadData, _node, _connectBreaks ,&_local_connect_breaks);

          if(mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_settings), 2)))))
          {
            {
              modelica_metatype _ext;
              for (tmpMeta17 = omc_NFClassTree_ClassTree_getExtends(threadData, _cls_tree), tmp20 = arrayLength(tmpMeta17), tmp19 = 1; tmp19 <= tmp20; tmp19++)
              {
                _ext = arrayGet(tmpMeta17,tmp19);
                _sections = omc_NFInst_instExpressions(threadData, _ext, _ext, _sections, _connect_breaks, _context, _settings);
              }
            }
          }
          else
          {
            {
              modelica_metatype _ext;
              for (tmpMeta21 = omc_NFClassTree_ClassTree_getExtends(threadData, _cls_tree), tmp24 = arrayLength(tmpMeta21), tmp23 = 1; tmp23 <= tmp24; tmp23++)
              {
                _ext = arrayGet(tmpMeta21,tmp23);
                omc_NFInst_instExpressions(threadData, _ext, _ext, _sections, _connect_breaks, _context, _settings);
              }
            }
          }

          tmpMeta25 = mmc_mk_box2(0, mmc_mk_integer(_context), _settings);
          omc_NFClassTree_ClassTree_applyLocalComponents(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure3_NFInst_instComponentExpressions,tmpMeta25));

          tmpMeta26 = MMC_TAGPTR(mmc_alloc_words(7));
          memcpy(MMC_UNTAGPTR(tmpMeta26), MMC_UNTAGPTR(_cls), 7*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta26))[2] = omc_NFClassTree_ClassTree_flatten(threadData, _cls_tree);
          _cls = tmpMeta26;

          omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);

          _next_context = (omc_NFRestriction_isFunction(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 6))))?((modelica_integer) 16):((modelica_integer) 8));

          _next_context = omc_NFInstContext_set(threadData, _context, _next_context);

          _sections = omc_NFInst_instSections(threadData, _node, _scope, _connect_breaks, _next_context, _sections);

          omc_NFConnectBreakTree_checkUnmatchedBreaks(threadData, _local_connect_breaks);

          _ty = omc_NFInst_makeComplexType(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 6))), _node, _cls);

          tmpMeta27 = mmc_mk_box6(8, &NFClass_INSTANCED__CLASS__desc, _ty, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), _sections, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 5))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 6))));
          _inst_cls = tmpMeta27;

          omc_NFInstNode_InstNode_updateClass(threadData, _inst_cls, _node);

          omc_NFInst_instComplexType(threadData, _ty, _context);
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta28;
          modelica_integer tmp29;
          modelica_integer tmp30;
          modelica_integer tmp31;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,7) == 0) goto tmp2_end;
          tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 5));
          
          _dims = tmpMeta28;
          /* Pattern matching succeeded */
          _sections = omc_NFInst_instExpressions(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), _scope, _sections, _connectBreaks, _context, _settings);

          _info = omc_NFInstNode_InstNode_info(threadData, _node);

          tmp29 = ((modelica_integer) 1); tmp30 = 1; tmp31 = arrayLength(_dims);
          if(!(((tmp30 > 0) && (tmp29 > tmp31)) || ((tmp30 < 0) && (tmp29 < tmp31))))
          {
            modelica_integer _i;
            for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp29, tmp31); _i += tmp30)
            {
              arrayUpdate(_dims,_i,omc_NFInst_instDimension(threadData, arrayGet(_dims,_i) /* DAE.ASUB */, _context, _settings, _info));
            }
          }

          if(omc_NFRestriction_isRecord(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 8)))))
          {
            omc_NFInst_instRecordConstructor(threadData, _node, _context);
          }
          goto tmp2_done;
        }
        case 3: {
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_integer tmp36;
          modelica_integer tmp37;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,3) == 0) goto tmp2_end;
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,3,5) == 0) goto tmp2_end;
          tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 4));
          
          _local_comps = tmpMeta33;
          /* Pattern matching succeeded */
          {
            modelica_metatype _comp;
            for (tmpMeta34 = _local_comps, tmp37 = arrayLength(tmpMeta34), tmp36 = 1; tmp36 <= tmp37; tmp36++)
            {
              _comp = arrayGet(tmpMeta34,tmp36);
              omc_NFInst_instComponentExpressions(threadData, _comp, _context, _settings);
            }
          }
          goto tmp2_done;
        }
        case 4: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,3) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 5: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,5) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 6: {
          
          /* Pattern matching succeeded */
          omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT188, _OMC_LIT189);
          goto goto_1;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _sections;
}
modelica_metatype boxptr_NFInst_instExpressions(threadData_t *threadData, modelica_metatype _node, modelica_metatype _scope, modelica_metatype __omcQ_24in_5Fsections, modelica_metatype _connectBreaks, modelica_metatype _context, modelica_metatype _settings)
{
  modelica_integer tmp1;
  modelica_metatype _sections = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _sections = omc_NFInst_instExpressions(threadData, _node, _scope, __omcQ_24in_5Fsections, _connectBreaks, tmp1, _settings);
  /* skip box _sections; NFSections */
  return _sections;
}

DLLDirection
modelica_metatype omc_NFInst_instResizable(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp)
{
  modelica_metatype _exp = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _exp = __omcQ_24in_5Fexp;
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _exp;
    {
      modelica_metatype _node = NULL;
      modelica_metatype _comp = NULL;
      modelica_metatype _attr = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _node has no default value.
      // _comp has no default value.
      // _attr has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,2) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,0,5) == 0) goto tmp2_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,6) == 0) goto tmp2_end;
          
          _node = tmpMeta6;
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!(omc_NFComponent_variability(threadData, omc_Pointer_access(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_node), 5))))) == 3)) goto tmp2_end;
          _comp = omc_Pointer_access(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_node), 5))));

          { /* match expression */
            modelica_metatype tmp9_1;
            tmp9_1 = _comp;
            {
              volatile mmc_switch_type tmp9;
              int tmp10;
              tmp9 = 0;
              for (; tmp9 < 2; tmp9++) {
                switch (MMC_SWITCH_CAST(tmp9)) {
                case 0: {
                  modelica_metatype tmpMeta11;
                  modelica_metatype tmpMeta12;
                  modelica_metatype tmpMeta13;
                  modelica_metatype tmpMeta14;
                  if (mmc__uniontype__metarecord__typedef__equal(tmp9_1,1,8) == 0) goto tmp8_end;
                  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp9_1), 6));
                  
                  _attr = tmpMeta11;
                  /* Pattern matching succeeded */
                  tmpMeta12 = MMC_TAGPTR(mmc_alloc_words(11));
                  memcpy(MMC_UNTAGPTR(tmpMeta12), MMC_UNTAGPTR(_attr), 11*sizeof(modelica_metatype));
                  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta12))[4] = mmc_mk_integer(4);
                  _attr = tmpMeta12;

                  tmpMeta13 = MMC_TAGPTR(mmc_alloc_words(11));
                  memcpy(MMC_UNTAGPTR(tmpMeta13), MMC_UNTAGPTR(_attr), 11*sizeof(modelica_metatype));
                  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta13))[10] = mmc_mk_boolean(1 /* true */);
                  _attr = tmpMeta13;

                  tmpMeta14 = MMC_TAGPTR(mmc_alloc_words(10));
                  memcpy(MMC_UNTAGPTR(tmpMeta14), MMC_UNTAGPTR(_comp), 10*sizeof(modelica_metatype));
                  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta14))[6] = _attr;
                  _comp = tmpMeta14;

                  omc_Pointer_update(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_node), 5))), _comp);
                  goto tmp8_done;
                }
                case 1: {
                  
                  /* Pattern matching succeeded */
                  goto tmp8_done;
                }
                }
                goto tmp8_end;
                tmp8_end: ;
              }
              goto goto_7;
              goto_7:;
              goto goto_1;
              goto tmp8_done;
              tmp8_done:;
            }
          }
          ;
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _exp;
}

DLLDirection
modelica_metatype omc_NFInst_instDimension(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fdimension, modelica_integer _context, modelica_metatype _settings, modelica_metatype _info)
{
  modelica_metatype _dimension = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _dimension = __omcQ_24in_5Fdimension;
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _dimension;
    {
      modelica_metatype _dim = NULL;
      modelica_metatype _exp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _dim has no default value.
      // _exp has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _dim = tmpMeta6;
          /* Pattern matching succeeded */
          { /* matchcontinue expression */
            volatile modelica_metatype tmp10_1;
            tmp10_1 = _dim;
            {
              volatile mmc_switch_type tmp10;
              int tmp11;
              tmp10 = 0;
              MMC_TRY_INTERNAL(mmc_jumper)
              tmp9_top:
              threadData->mmc_jumper = &new_mmc_jumper;
              for (; tmp10 < 3; tmp10++) {
                switch (MMC_SWITCH_CAST(tmp10)) {
                case 0: {
                  if (mmc__uniontype__metarecord__typedef__equal(tmp10_1,0,0) == 0) goto tmp9_end;
                  tmp10 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
                  tmpMeta7 = _OMC_LIT190;
                  goto tmp9_done;
                }
                case 1: {
                  modelica_metatype tmpMeta12;
                  if (mmc__uniontype__metarecord__typedef__equal(tmp10_1,1,1) == 0) goto tmp9_end;
                  
                  /* Pattern matching succeeded */
                  _exp = omc_NFInst_instExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_dim), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_dimension), 3))), _context, _info);

                  if(mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_settings), 3)))))
                  {
                    _exp = omc_NFExpression_map(threadData, _exp, boxvar_NFInst_instResizable);
                  }
                  tmpMeta12 = mmc_mk_box3(4, &NFDimension_UNTYPED__desc, _exp, mmc_mk_boolean(0 /* false */));
                  tmpMeta7 = tmpMeta12;
                  goto tmp9_done;
                }
                case 2: {
                  
                  /* Pattern matching succeeded */
                  /* Check guard condition after assignments */
                  if (!omc_NFInstContext_inRelaxed(threadData, _context)) goto tmp9_end;
                  tmpMeta7 = _OMC_LIT190;
                  goto tmp9_done;
                }
                }
                goto tmp9_end;
                tmp9_end: ;
              }
              goto goto_8;
              tmp9_done:
              (void)tmp10;
              MMC_RESTORE_INTERNAL(mmc_jumper);
              goto tmp9_done2;
              goto_8:;
              MMC_CATCH_INTERNAL(mmc_jumper);
              if (++tmp10 < 3) {
                goto tmp9_top;
              }
              goto goto_2;
              tmp9_done2:;
            }
          }tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _dimension;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _dimension = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _dimension;
}
modelica_metatype boxptr_NFInst_instDimension(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fdimension, modelica_metatype _context, modelica_metatype _settings, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _dimension = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _dimension = omc_NFInst_instDimension(threadData, __omcQ_24in_5Fdimension, tmp1, _settings, _info);
  /* skip box _dimension; NFDimension */
  return _dimension;
}

DLLDirection
void omc_NFInst_updateParameterBinding(threadData_t *threadData, modelica_metatype _node, modelica_integer _context)
{
  modelica_metatype _comp = NULL;
  modelica_metatype _binding = NULL;
  modelica_metatype _exp = NULL;
  modelica_metatype _aexp = NULL;
  modelica_metatype _args = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _comp has no default value.
  // _binding has no default value.
  // _exp has no default value.
  // _aexp has no default value.
  // _args has no default value.
  if(omc_NFInstContext_inRedeclared(threadData, _context))
  {
    goto _return;
  }

  _comp = omc_NFInstNode_InstNode_component(threadData, _node);

  if(((!omc_NFComponent_isFixed(threadData, _comp)) || omc_NFInstNode_InstNode_hasBinding(threadData, _node)))
  {
    goto _return;
  }

  _binding = omc_NFComponent_getTypeAttributeBinding(threadData, _comp, _OMC_LIT191);

  if((omc_NFBinding_isBound(threadData, _binding) && (!omc_NFBinding_hasTypeOrigin(threadData, _binding))))
  {
    if((!omc_NFInstContext_inRelaxed(threadData, _context)))
    {
      tmpMeta1 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, omc_NFInstNode_InstNode_scopePath(threadData, _node, 1, 0 /* false */), _OMC_LIT5, 1 /* true */, 0 /* false */), mmc_mk_cons(omc_NFBinding_toString(threadData, _binding, _OMC_LIT131), MMC_REFSTRUCTLIT(mmc_nil)));
      omc_Error_addSourceMessage(threadData, _OMC_LIT194, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _node));
    }

    _binding = omc_NFBinding_unpropagate(threadData, _binding, _node);

    if(omc_NFBinding_isEach(threadData, _binding))
    {
      _binding = omc_NFBinding_expandEach(threadData, _binding, _node);
    }

    _comp = omc_NFComponent_setBinding(threadData, _binding, _comp);

    omc_NFInstNode_InstNode_updateComponent(threadData, _comp, _node);
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_updateParameterBinding(threadData_t *threadData, modelica_metatype _node, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_updateParameterBinding(threadData, _node, tmp1);
  return;
}

DLLDirection
void omc_NFInst_checkRecursiveDefinition(threadData_t *threadData, modelica_metatype _componentType, modelica_metatype _component, modelica_boolean _limitReached)
{
  modelica_metatype _parent = NULL;
  modelica_metatype _parent_type = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _parent = omc_NFInstNode_InstNode_parent(threadData, _component);
  // _parent_type has no default value.
  if((!omc_NFClass_isFunction(threadData, omc_NFInstNode_InstNode_getClass(threadData, _parent))))
  {
    while(1)
    {
      if(!(!omc_NFInstNode_InstNode_isEmpty(threadData, _parent))) break;
      _parent_type = omc_NFInstNode_InstNode_classScope(threadData, _parent);

      if(referenceEq(omc_NFInstNode_InstNode_definition(threadData, _componentType), omc_NFInstNode_InstNode_definition(threadData, _parent_type)))
      {
        tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _component), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, omc_NFInstNode_InstNode_classScope(threadData, omc_NFInstNode_InstNode_parent(threadData, _component))), MMC_REFSTRUCTLIT(mmc_nil)));
        omc_Error_addSourceMessage(threadData, _OMC_LIT197, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _component));

        omc_NFInstNode_InstNode_componentApply(threadData, _component, boxvar_NFComponent_setClassInstance, _OMC_LIT198);

        MMC_THROW_INTERNAL();
      }

      _parent = omc_NFInstNode_InstNode_parent(threadData, _parent);
    }
  }

  if(_limitReached)
  {
    tmpMeta2 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, omc_NFInstNode_InstNode_scopePath(threadData, _component, 1, 0 /* false */), _OMC_LIT5, 1 /* true */, 0 /* false */), MMC_REFSTRUCTLIT(mmc_nil));
    omc_Error_addSourceMessage(threadData, _OMC_LIT201, tmpMeta2, omc_NFInstNode_InstNode_info(threadData, _component));

    omc_NFInstNode_InstNode_componentApply(threadData, _component, boxvar_NFComponent_setClassInstance, _OMC_LIT198);

    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_checkRecursiveDefinition(threadData_t *threadData, modelica_metatype _componentType, modelica_metatype _component, modelica_metatype _limitReached)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_limitReached);
  omc_NFInst_checkRecursiveDefinition(threadData, _componentType, _component, tmp1);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_instTypeSpec(threadData_t *threadData, modelica_metatype _typeSpec, modelica_metatype _modifier, modelica_metatype _attributes, modelica_boolean _useBinding, modelica_metatype _scope, modelica_metatype _parent, modelica_metatype _info, modelica_integer _instLevel, modelica_integer _context, modelica_metatype *out_outAttributes)
{
  modelica_metatype _node = NULL;
  modelica_metatype _outAttributes = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _outAttributes has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _typeSpec;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _node = omc_NFLookup_lookupClassName(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_typeSpec), 2))), _scope, _context, _info, 1 /* true */);

          if((_instLevel >= ((modelica_integer) 100)))
          {
            omc_NFInst_checkRecursiveDefinition(threadData, _node, _parent, 1 /* true */);
          }

          _node = omc_NFInst_expand(threadData, _node, _context);

          _node = omc_NFInst_instClass(threadData, _node, _modifier, _attributes, _useBinding, _instLevel, _parent, _context ,&_outAttributes);
          tmpMeta1 = _node;
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          /* Check guard condition after assignments */
          if (!omc_NFInstContext_inInstanceAPI(threadData, _context)) goto tmp3_end;
          _outAttributes = _attributes;
          tmpMeta1 = _OMC_LIT198;
          goto tmp3_done;
        }
        case 2: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT202),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _node = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  if (out_outAttributes) { *out_outAttributes = _outAttributes; }
  return _node;
}
modelica_metatype boxptr_NFInst_instTypeSpec(threadData_t *threadData, modelica_metatype _typeSpec, modelica_metatype _modifier, modelica_metatype _attributes, modelica_metatype _useBinding, modelica_metatype _scope, modelica_metatype _parent, modelica_metatype _info, modelica_metatype _instLevel, modelica_metatype _context, modelica_metatype *out_outAttributes)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_useBinding);
  tmp2 = mmc_unbox_integer(_instLevel);
  tmp3 = mmc_unbox_integer(_context);
  _node = omc_NFInst_instTypeSpec(threadData, _typeSpec, _modifier, _attributes, tmp1, _scope, _parent, _info, tmp2, tmp3, out_outAttributes);
  /* skip box _node; NFInstNode.InstNode */
  /* skip box _outAttributes; NFAttributes */
  return _node;
}

DLLDirection
void omc_NFInst_checkOuterComponentMod(threadData_t *threadData, modelica_metatype _node, modelica_integer _context)
{
  modelica_metatype _outer_node = NULL;
  modelica_metatype _elem = NULL;
  modelica_metatype _smod = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outer_node has no default value.
  // _elem has no default value.
  // _smod has no default value.
  _outer_node = omc_NFInstNode_InstNode_resolveOuter(threadData, _node);

  _elem = omc_NFInstNode_InstNode_definition(threadData, _outer_node);

  if(omc_AbsynUtil_isOnlyOuter(threadData, omc_SCodeUtil_prefixesInnerOuter(threadData, omc_SCodeUtil_elementPrefixes(threadData, _elem))))
  {
    _smod = omc_SCodeUtil_componentMod(threadData, _elem);

    if((!omc_SCodeUtil_isEmptyMod(threadData, _smod)))
    {
      tmpMeta1 = mmc_mk_cons(omc_SCodeDump_printModStr(threadData, _smod, _OMC_LIT206), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _outer_node), MMC_REFSTRUCTLIT(mmc_nil)));
      omc_Error_addSourceMessage(threadData, _OMC_LIT205, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _outer_node));

      if((!omc_NFInstContext_inInstanceAPI(threadData, _context)))
      {
        MMC_THROW_INTERNAL();
      }
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_checkOuterComponentMod(threadData_t *threadData, modelica_metatype _node, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_checkOuterComponentMod(threadData, _node, tmp1);
  return;
}

DLLDirection
void omc_NFInst_redeclareComponent(threadData_t *threadData, modelica_metatype _redeclareNode, modelica_metatype _originalNode, modelica_metatype _outerMod, modelica_metatype _constrainingMod, modelica_metatype _propagatedSubs, modelica_metatype _outerAttr, modelica_metatype _redeclaredNode, modelica_integer _instLevel, modelica_integer _context)
{
  modelica_metatype _orig_comp = NULL;
  modelica_metatype _rdcl_comp = NULL;
  modelica_metatype _new_comp = NULL;
  modelica_metatype _binding = NULL;
  modelica_metatype _condition = NULL;
  modelica_metatype _attr = NULL;
  modelica_metatype _orig_ty = NULL;
  modelica_metatype _rdcl_ty = NULL;
  modelica_metatype _cmt = NULL;
  modelica_metatype _orig_node = NULL;
  modelica_metatype _rdcl_node = NULL;
  modelica_metatype _rdcl_type = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _orig_comp has no default value.
  // _rdcl_comp has no default value.
  // _new_comp has no default value.
  // _binding has no default value.
  // _condition has no default value.
  // _attr has no default value.
  // _orig_ty has no default value.
  // _rdcl_ty has no default value.
  // _cmt has no default value.
  // _orig_node has no default value.
  // _rdcl_node has no default value.
  // _rdcl_type has no default value.
  if((!omc_NFInstNode_InstNode_isComponent(threadData, _redeclareNode)))
  {
    tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_typeName(threadData, _originalNode), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _originalNode), mmc_mk_cons(omc_NFInstNode_InstNode_typeName(threadData, _redeclareNode), MMC_REFSTRUCTLIT(mmc_nil))));
    tmpMeta2 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _redeclareNode), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _originalNode), MMC_REFSTRUCTLIT(mmc_nil)));
    omc_Error_addMultiSourceMessage(threadData, _OMC_LIT209, tmpMeta1, tmpMeta2);

    MMC_THROW_INTERNAL();
  }

  _orig_node = omc_NFInstNode_InstNode_resolveInner(threadData, _originalNode);

  _orig_comp = omc_NFInstNode_InstNode_component(threadData, _orig_node);

  tmpMeta3 = mmc_mk_box2(10, &NFInstNode_InstNodeType_REDECLARED__COMP__desc, omc_NFInstNode_InstNode_parent(threadData, _orig_node));
  _rdcl_type = tmpMeta3;

  _rdcl_node = omc_NFInstNode_InstNode_setNodeType(threadData, _rdcl_type, _redeclareNode);

  _rdcl_node = omc_NFInstNode_InstNode_copyInstancePtr(threadData, _orig_node, _rdcl_node);

  _rdcl_node = omc_NFInstNode_InstNode_updateComponent(threadData, omc_NFInstNode_InstNode_component(threadData, _redeclareNode), _rdcl_node);

  omc_NFInst_instComponent(threadData, _rdcl_node, _outerAttr, _constrainingMod, 1 /* true */, _instLevel, _context, mmc_mk_some(omc_NFComponent_getAttributes(threadData, _orig_comp)), _propagatedSubs);

  _rdcl_comp = omc_NFInstNode_InstNode_component(threadData, _rdcl_node);

  { /* match expression */
    modelica_metatype tmp7_1;modelica_metatype tmp7_2;
    tmp7_1 = _orig_comp;
    tmp7_2 = _rdcl_comp;
    {
      volatile mmc_switch_type tmp7;
      int tmp8;
      tmp7 = 0;
      for (; tmp7 < 2; tmp7++) {
        switch (MMC_SWITCH_CAST(tmp7)) {
        case 0: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp7_1,1,8) == 0) goto tmp6_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp7_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,17,2) == 0) goto tmp6_end;
          if (mmc__uniontype__metarecord__typedef__equal(tmp7_2,1,8) == 0) goto tmp6_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp7_2), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,17,2) == 0) goto tmp6_end;
          
          _orig_ty = tmpMeta9;
          _rdcl_ty = tmpMeta10;
          /* Pattern matching succeeded */
          if((((!omc_NFInstNode_InstNode_isReplaceable(threadData, _orig_node)) && (!omc_NFInstContext_inInstanceAPI(threadData, _context))) && (!omc_NFType_isEqual(threadData, omc_NFType_arrayElementType(threadData, _orig_ty), omc_NFType_arrayElementType(threadData, _rdcl_ty)))))
          {
            tmpMeta11 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _orig_node), MMC_REFSTRUCTLIT(mmc_nil));
            tmpMeta12 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _orig_node), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _rdcl_node), MMC_REFSTRUCTLIT(mmc_nil)));
            omc_Error_addMultiSourceMessage(threadData, _OMC_LIT212, tmpMeta11, tmpMeta12);

            goto goto_5;
          }

          _binding = omc_NFModifier_Modifier_binding(threadData, _outerMod);

          if(omc_NFBinding_isUnbound(threadData, _binding))
          {
            _binding = (omc_NFBinding_isBound(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_comp), 4))))?(MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_comp), 4))):(MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_orig_comp), 4))));
          }

          if(omc_NFBinding_isBound(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_comp), 5)))))
          {
            tmpMeta13 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _redeclareNode), MMC_REFSTRUCTLIT(mmc_nil));
            omc_Error_addSourceMessage(threadData, _OMC_LIT215, tmpMeta13, omc_NFInstNode_InstNode_info(threadData, _redeclareNode));

            goto goto_5;
          }

          _condition = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_orig_comp), 5)));

          _attr = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_comp), 6)));

          if((omc_NFType_dimensionCount(threadData, _rdcl_ty) == ((modelica_integer) 0)))
          {
            tmpMeta14 = mmc_mk_box3(20, &NFType_UNTYPED__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_ty), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_orig_ty), 3))));
            _rdcl_ty = tmpMeta14;
          }

          _cmt = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_orig_comp), 7)));
          tmpMeta15 = mmc_mk_box9(4, &NFComponent_COMPONENT__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_comp), 2))), _rdcl_ty, _binding, _condition, _attr, _cmt, mmc_mk_integer(1), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_comp), 9))));
          tmpMeta4 = tmpMeta15;
          goto tmp6_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT216, _OMC_LIT217);
          goto goto_5;
          goto tmp6_done;
        }
        }
        goto tmp6_end;
        tmp6_end: ;
      }
      goto goto_5;
      goto_5:;
      MMC_THROW_INTERNAL();
      goto tmp6_done;
      tmp6_done:;
    }
  }
  _new_comp = tmpMeta4;

  omc_NFInstNode_InstNode_updateComponent(threadData, _new_comp, omc_NFInstNode_InstNode_resolveInner(threadData, _redeclaredNode));
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_redeclareComponent(threadData_t *threadData, modelica_metatype _redeclareNode, modelica_metatype _originalNode, modelica_metatype _outerMod, modelica_metatype _constrainingMod, modelica_metatype _propagatedSubs, modelica_metatype _outerAttr, modelica_metatype _redeclaredNode, modelica_metatype _instLevel, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  tmp1 = mmc_unbox_integer(_instLevel);
  tmp2 = mmc_unbox_integer(_context);
  omc_NFInst_redeclareComponent(threadData, _redeclareNode, _originalNode, _outerMod, _constrainingMod, _propagatedSubs, _outerAttr, _redeclaredNode, tmp1, tmp2);
  return;
}

DLLDirection
void omc_NFInst_checkBindingRestriction(threadData_t *threadData, modelica_metatype _restriction, modelica_metatype _binding, modelica_metatype _component, modelica_metatype _info)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if(omc_NFBinding_isBound(threadData, _binding))
  {
    { /* match expression */
      modelica_metatype tmp3_1;
      tmp3_1 = _restriction;
      {
        int tmp3;
        {
          switch (MMC_SWITCH_CAST(valueConstructor(tmp3_1))) {
          case 5: {
            
            /* Pattern matching succeeded */
            goto tmp2_done;
          }
          case 6: {
            
            /* Pattern matching succeeded */
            goto tmp2_done;
          }
          case 7: {
            
            /* Pattern matching succeeded */
            goto tmp2_done;
          }
          case 8: {
            
            /* Pattern matching succeeded */
            goto tmp2_done;
          }
          case 13: {
            
            /* Pattern matching succeeded */
            goto tmp2_done;
          }
          case 15: {
            
            /* Pattern matching succeeded */
            goto tmp2_done;
          }
          default:
          tmp2_default: OMC_LABEL_UNUSED; {
            modelica_metatype tmpMeta4;
            
            /* Pattern matching succeeded */
            tmpMeta4 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _component), mmc_mk_cons(omc_NFRestriction_toString(threadData, _restriction), MMC_REFSTRUCTLIT(mmc_nil)));
            omc_Error_addSourceMessage(threadData, _OMC_LIT220, tmpMeta4, _info);
            goto goto_1;
            goto tmp2_done;
          }
          }
          goto tmp2_end;
          tmp2_end: ;
        }
        goto goto_1;
        goto_1:;
        MMC_THROW_INTERNAL();
        goto tmp2_done;
        tmp2_done:;
      }
    }
    ;
  }
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_NFInst_checkPartialComponent(threadData_t *threadData, modelica_metatype _compNode, modelica_metatype _compAttr, modelica_metatype _clsNode, modelica_boolean _isPartial, modelica_metatype _res, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if(omc_NFRestriction_isFunction(threadData, _res))
  {
    if(((!_isPartial) && (!omc_NFInstContext_inRelaxed(threadData, _context))))
    {
      tmpMeta1 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, omc_NFInstNode_InstNode_scopePath(threadData, _clsNode, 1, 0 /* false */), _OMC_LIT5, 1 /* true */, 0 /* false */), MMC_REFSTRUCTLIT(mmc_nil));
      omc_Error_addSourceMessage(threadData, _OMC_LIT226, tmpMeta1, _info);

      MMC_THROW_INTERNAL();
    }
  }
  else
  {
    if(((_isPartial && (mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_compAttr), 6)))) != 3)) && (!omc_NFInstContext_inRelaxed(threadData, _context))))
    {
      tmpMeta2 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, omc_NFInstNode_InstNode_scopePath(threadData, _compNode, 1, 0 /* false */), _OMC_LIT5, 1 /* true */, 0 /* false */), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _clsNode), MMC_REFSTRUCTLIT(mmc_nil)));
      tmpMeta3 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _clsNode), mmc_mk_cons(_info, MMC_REFSTRUCTLIT(mmc_nil)));
      omc_Error_addMultiSourceMessage(threadData, _OMC_LIT223, tmpMeta2, tmpMeta3);

      MMC_THROW_INTERNAL();
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_checkPartialComponent(threadData_t *threadData, modelica_metatype _compNode, modelica_metatype _compAttr, modelica_metatype _clsNode, modelica_metatype _isPartial, modelica_metatype _res, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  tmp1 = mmc_unbox_integer(_isPartial);
  tmp2 = mmc_unbox_integer(_context);
  omc_NFInst_checkPartialComponent(threadData, _compNode, _compAttr, _clsNode, tmp1, _res, tmp2, _info);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_propagateRedeclaredMod(threadData_t *threadData, modelica_metatype _mod, modelica_metatype _component)
{
  modelica_metatype _outMod = NULL;
  modelica_metatype _parent = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outMod has no default value.
  // _parent has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _component;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,6) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,7,1) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          _parent = tmpMeta7;
          /* Pattern matching succeeded */
          _parent = omc_NFInstNode_InstNode_getDerivedNode(threadData, _parent, 1 /* true */);

          _outMod = omc_NFInst_propagateRedeclaredMod(threadData, _mod, _parent);
          tmpMeta1 = omc_NFModifier_Modifier_propagateBinding(threadData, _outMod, _parent, _parent);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _mod;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outMod = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outMod;
}

DLLDirection
modelica_metatype omc_NFInst_getConstrainingMod(threadData_t *threadData, modelica_metatype _element, modelica_metatype _parent, modelica_metatype _outerMod)
{
  modelica_metatype _ccMod = NULL;
  modelica_string _name = NULL;
  modelica_metatype _cc_smod = NULL;
  modelica_metatype _mod_scope = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ccMod has no default value.
  // _name has no default value.
  // _cc_smod has no default value.
  // _mod_scope has no default value.
  _cc_smod = omc_SCodeUtil_getConstrainingMod(threadData, _element);

  if((!omc_SCodeUtil_isEmptyMod(threadData, _cc_smod)))
  {
    _name = omc_SCodeUtil_elementName(threadData, _element);

    _ccMod = omc_NFModifier_Modifier_create(threadData, _cc_smod, _name, omc_NFModifier_ModifierScope_fromElement(threadData, _element), _parent);

    _ccMod = omc_NFModifier_Modifier_merge(threadData, _outerMod, _ccMod, _OMC_LIT131);
  }
  else
  {
    _ccMod = _outerMod;
  }
  _return: OMC_LABEL_UNUSED
  return _ccMod;
}

DLLDirection
modelica_metatype omc_NFInst_instConstrainingMod(threadData_t *threadData, modelica_metatype _element, modelica_metatype _parent)
{
  modelica_metatype _ccMod = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ccMod has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _element;
    {
      modelica_metatype _smod = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _smod has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
          if (optionNone(tmpMeta8)) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
          
          _smod = tmpMeta10;
          /* Pattern matching succeeded */
          tmpMeta11 = mmc_mk_box2(4, &NFModifier_ModifierScope_CLASS__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_element), 2))));
          tmpMeta1 = omc_NFModifier_Modifier_create(threadData, _smod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_element), 2))), tmpMeta11, _parent);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 6));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,1) == 0) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
          if (optionNone(tmpMeta14)) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 1));
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
          
          _smod = tmpMeta16;
          /* Pattern matching succeeded */
          tmpMeta17 = mmc_mk_box2(3, &NFModifier_ModifierScope_COMPONENT__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_element), 2))));
          tmpMeta1 = omc_NFModifier_Modifier_create(threadData, _smod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_element), 2))), tmpMeta17, _parent);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT88;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _ccMod = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _ccMod;
}

DLLDirection
modelica_metatype omc_NFInst_instElementModifier(threadData_t *threadData, modelica_metatype _element, modelica_metatype _component, modelica_metatype _parent)
{
  modelica_metatype _mod = NULL;
  modelica_metatype _cc_mod = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _mod has no default value.
  // _cc_mod has no default value.
  _mod = omc_NFModifier_Modifier_fromElement(threadData, _element, _parent);

  if(omc_NFInstNode_InstNode_isRedeclared(threadData, _component))
  {
    _mod = omc_NFInst_propagateRedeclaredMod(threadData, _mod, _component);
  }
  else
  {
    _cc_mod = omc_NFInst_instConstrainingMod(threadData, _element, _parent);

    _mod = omc_NFModifier_Modifier_merge(threadData, _mod, _cc_mod, _OMC_LIT131);
  }
  _return: OMC_LABEL_UNUSED
  return _mod;
}

DLLDirection
void omc_NFInst_instComponentDef(threadData_t *threadData, modelica_metatype _component, modelica_metatype _outerMod, modelica_metatype _innerMod, modelica_metatype _attributes, modelica_boolean _useBinding, modelica_metatype _node, modelica_metatype _parent, modelica_integer _instLevel, modelica_metatype _originalAttr, modelica_metatype _propagatedSubs, modelica_integer _context)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _component;
    {
      modelica_metatype _info = NULL;
      modelica_metatype _mod = NULL;
      modelica_metatype _dims = NULL;
      modelica_metatype _binding = NULL;
      modelica_metatype _condition = NULL;
      modelica_metatype _attr = NULL;
      modelica_metatype _ty_attr = NULL;
      modelica_metatype _inst_comp = NULL;
      modelica_metatype _ty_node = NULL;
      modelica_metatype _ty = NULL;
      modelica_metatype _elementDefinition = NULL;
      modelica_metatype _parent_res = NULL;
      modelica_metatype _res = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _info has no default value.
      // _mod has no default value.
      // _dims has no default value.
      // _binding has no default value.
      // _condition has no default value.
      // _attr has no default value.
      // _ty_attr has no default value.
      // _inst_comp has no default value.
      // _ty_node has no default value.
      // _ty has no default value.
      // _elementDefinition has no default value.
      // _parent_res has no default value.
      // _res has no default value.
      tmp3 = 0;
      for (; tmp3 < 1; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,8) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 9));
          _info = tmpMeta5;
          /* Pattern matching succeeded */
          _mod = omc_NFInst_instElementModifier(threadData, _component, _node, _parent);

          if((!listEmpty(_propagatedSubs)))
          {
            _mod = omc_NFModifier_Modifier_propagateSubs(threadData, _mod, _propagatedSubs);
          }

          _mod = omc_NFModifier_Modifier_merge(threadData, _mod, _innerMod, _OMC_LIT131);

          _mod = omc_NFModifier_Modifier_merge(threadData, _outerMod, _mod, _OMC_LIT131);

          {
            modelica_metatype __omcQ_24tmpVar27;
            modelica_metatype* tmp7;
            modelica_metatype tmpMeta8;
            modelica_metatype tmpMeta9;
            modelica_metatype __omcQ_24tmpVar26;
            modelica_integer tmp10;
            modelica_metatype _d_loopVar = 0;
            modelica_metatype _d;
            _d_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_component), 4)))), 2)));
            tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar27 = tmpMeta8; /* defaultValue */
            tmp7 = &__omcQ_24tmpVar27;
            while(1) {
              tmp10 = 1;
              if (!listEmpty(_d_loopVar)) {
                _d = MMC_CAR(_d_loopVar);
                _d_loopVar = MMC_CDR(_d_loopVar);
                tmp10--;
              }
              if (tmp10 == 0) {
                tmpMeta9 = mmc_mk_box3(3, &NFDimension_RAW__DIM__desc, _d, _parent);
                __omcQ_24tmpVar26 = tmpMeta9;
                *tmp7 = mmc_mk_cons(__omcQ_24tmpVar26,0);
                tmp7 = &MMC_CDR(*tmp7);
              } else if (tmp10 == 1) {
                break;
              } else {
                goto goto_1;
              }
            }
            *tmp7 = mmc_mk_nil();
            tmpMeta6 = __omcQ_24tmpVar27;
          }
          _dims = tmpMeta6;

          _binding = (_useBinding?omc_NFModifier_Modifier_binding(threadData, _mod):_OMC_LIT175);

          _condition = omc_NFBinding_fromAbsyn(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_component), 8))), 0 /* false */, 0 /* false */, _parent, _info);

          _parent_res = omc_NFClass_restriction(threadData, omc_NFInstNode_InstNode_getClass(threadData, _parent));

          _attr = omc_NFAttributes_fromSCode(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_component), 4))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_component), 3))));

          _attr = omc_NFAttributes_checkDeclaredComponentAttributes(threadData, _attr, _parent_res, _node);

          _attr = omc_NFAttributes_mergeComponentAttributes(threadData, _attributes, _attr, _node, _parent_res);

          if(isSome(_originalAttr))
          {
            _attr = omc_NFAttributes_mergeRedeclaredComponentAttributes(threadData, omc_Util_getOption(threadData, _originalAttr), _attr, _node);
          }

          if(((!mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_attr), 7))))) && omc_NFModifier_Modifier_isFinal(threadData, _mod)))
          {
            tmpMeta11 = MMC_TAGPTR(mmc_alloc_words(11));
            memcpy(MMC_UNTAGPTR(tmpMeta11), MMC_UNTAGPTR(_attr), 11*sizeof(modelica_metatype));
            ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta11))[7] = mmc_mk_boolean(1 /* true */);
            _attr = tmpMeta11;
          }

          tmpMeta12 = mmc_mk_box9(4, &NFComponent_COMPONENT__desc, _OMC_LIT198, _OMC_LIT97, _binding, _condition, _attr, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_component), 7))), mmc_mk_integer(1), _info);
          _inst_comp = tmpMeta12;

          omc_NFInstNode_InstNode_updateComponent(threadData, _inst_comp, _node);

          _mod = omc_NFModifier_Modifier_propagate(threadData, _mod, _node, _node);

          _ty_node = omc_NFInst_instTypeSpec(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_component), 5))), _mod, _attr, (_useBinding && (!omc_NFBinding_isBound(threadData, _binding))), _parent, _node, _info, _instLevel, _context ,&_ty_attr);

          tmpMeta13 = mmc_mk_box3(20, &NFType_UNTYPED__desc, _ty_node, listArray(_dims));
          omc_NFInstNode_InstNode_componentApply(threadData, _node, boxvar_NFComponent_setType, tmpMeta13);

          if((!omc_NFInstNode_InstNode_isEmpty(threadData, _ty_node)))
          {
            _ty = omc_NFInstNode_InstNode_getClass(threadData, _ty_node);

            _res = omc_NFClass_restriction(threadData, _ty);

            _elementDefinition = omc_NFInstNode_InstNode_definition(threadData, _ty_node);

            if((omc_NFRestriction_isType(threadData, _res) && omc_SCodeUtil_optCommentHasBooleanNamedAnnotationFalse(threadData, omc_SCodeUtil_getElementComment(threadData, _elementDefinition), _OMC_LIT227)))
            {
              omc_NFInstNode_InstNode_componentApply(threadData, _node, boxvar_NFComponent_setComment, omc_Util_getOption(threadData, omc_SCodeUtil_getElementComment(threadData, _elementDefinition)));
            }

            if((!omc_NFInstContext_inRedeclared(threadData, _context)))
            {
              omc_NFInst_checkPartialComponent(threadData, _node, _attr, _ty_node, omc_NFClass_isPartial(threadData, _ty), _res, _context, _info);
            }

            omc_NFInst_checkBindingRestriction(threadData, _res, _binding, _node, _info);

            _ty_attr = omc_NFAttributes_updateVariability(threadData, _ty_attr, _ty, _ty_node, _node, _context);

            _ty_attr = omc_NFAttributes_updateComponentConnectorType(threadData, _ty_attr, _res, _context, _node);

            if((!referenceEq(_attr, _ty_attr)))
            {
              omc_NFInstNode_InstNode_componentApply(threadData, _node, boxvar_NFComponent_setAttributes, _ty_attr);
            }

            if(((((_useBinding && omc_NFBinding_isUnbound(threadData, _binding)) && (!omc_NFInstContext_inFunction(threadData, _context))) && (mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_ty_attr), 4)))) <= 3)) && omc_NFRestriction_isType(threadData, _res)))
            {
              omc_NFInst_updateParameterBinding(threadData, _node, _context);
            }
          }
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_instComponentDef(threadData_t *threadData, modelica_metatype _component, modelica_metatype _outerMod, modelica_metatype _innerMod, modelica_metatype _attributes, modelica_metatype _useBinding, modelica_metatype _node, modelica_metatype _parent, modelica_metatype _instLevel, modelica_metatype _originalAttr, modelica_metatype _propagatedSubs, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  tmp1 = mmc_unbox_integer(_useBinding);
  tmp2 = mmc_unbox_integer(_instLevel);
  tmp3 = mmc_unbox_integer(_context);
  omc_NFInst_instComponentDef(threadData, _component, _outerMod, _innerMod, _attributes, tmp1, _node, _parent, tmp2, _originalAttr, _propagatedSubs, tmp3);
  return;
}

DLLDirection
void omc_NFInst_instComponent(threadData_t *threadData, modelica_metatype _node, modelica_metatype _attributes, modelica_metatype _innerMod, modelica_boolean _useBinding, modelica_integer _instLevel, modelica_integer _context, modelica_metatype _originalAttr, modelica_metatype _propagatedSubs)
{
  modelica_metatype _comp = NULL;
  modelica_metatype _def = NULL;
  modelica_metatype _comp_node = NULL;
  modelica_metatype _rdcl_node = NULL;
  modelica_metatype _outer_mod = NULL;
  modelica_metatype _inner_mod = NULL;
  modelica_metatype _cc_mod = NULL;
  modelica_metatype _cc_def_mod = NULL;
  modelica_metatype _cc_smod = NULL;
  modelica_string _name = NULL;
  modelica_metatype _parent = NULL;
  modelica_integer _next_context;
  modelica_metatype _propagated_subs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _comp has no default value.
  // _def has no default value.
  // _comp_node has no default value.
  // _rdcl_node has no default value.
  // _outer_mod has no default value.
  // _inner_mod has no default value.
  _cc_mod = _innerMod;
  // _cc_def_mod has no default value.
  // _cc_smod has no default value.
  // _name has no default value.
  // _parent has no default value.
  // _next_context has no default value.
  // _propagated_subs has no default value.
  if(omc_NFInstNode_InstNode_isEmpty(threadData, _node))
  {
    goto _return;
  }

  omc_NFInst_checkOuterComponentMod(threadData, _node, _context);

  _comp_node = omc_NFInstNode_InstNode_resolveInner(threadData, _node);

  _comp = omc_NFInstNode_InstNode_component(threadData, _comp_node);

  _parent = omc_NFInstNode_InstNode_parent(threadData, _comp_node);

  if((!omc_NFComponent_isDefinition(threadData, _comp)))
  {
    omc_NFInst_checkRecursiveDefinition(threadData, omc_NFComponent_classInstance(threadData, _comp), _comp_node, 0 /* false */);

    goto _return;
  }

  /* Pattern-matching assignment */
  tmpMeta1 = _comp;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,2) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _def = tmpMeta2;
  _outer_mod = tmpMeta3;

  if(omc_NFModifier_Modifier_isRedeclare(threadData, _outer_mod))
  {
    /* Pattern-matching assignment */
    tmpMeta4 = _outer_mod;
    if (mmc__uniontype__metarecord__typedef__equal(tmpMeta4,1,7) == 0) MMC_THROW_INTERNAL();
    tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 4));
    tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 5));
    tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 6));
    tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 7));
    tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 8));
    _rdcl_node = tmpMeta5;
    _inner_mod = tmpMeta6;
    _outer_mod = tmpMeta7;
    _cc_mod = tmpMeta8;
    _propagated_subs = tmpMeta9;

    _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 32));

    tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
    omc_NFInst_instComponentDef(threadData, _def, _OMC_LIT88, _inner_mod, _OMC_LIT87, _useBinding, _comp_node, _parent, _instLevel, _originalAttr, tmpMeta10, _next_context);

    _cc_mod = omc_NFInst_getConstrainingMod(threadData, _def, _parent, _cc_mod);

    _cc_mod = omc_NFModifier_Modifier_merge(threadData, _cc_mod, _innerMod, _OMC_LIT131);

    _outer_mod = omc_NFModifier_Modifier_merge(threadData, omc_NFInstNode_InstNode_getModifier(threadData, _rdcl_node), _outer_mod, _OMC_LIT131);

    omc_NFInstNode_InstNode_setModifier(threadData, _outer_mod, _rdcl_node);

    omc_NFInst_redeclareComponent(threadData, _rdcl_node, _node, _OMC_LIT88, _cc_mod, _propagated_subs, _attributes, _node, _instLevel, _context);
  }
  else
  {
    omc_NFInst_instComponentDef(threadData, _def, _outer_mod, _innerMod, _attributes, _useBinding, _comp_node, _parent, _instLevel, _originalAttr, _propagatedSubs, _context);
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_instComponent(threadData_t *threadData, modelica_metatype _node, modelica_metatype _attributes, modelica_metatype _innerMod, modelica_metatype _useBinding, modelica_metatype _instLevel, modelica_metatype _context, modelica_metatype _originalAttr, modelica_metatype _propagatedSubs)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  tmp1 = mmc_unbox_integer(_useBinding);
  tmp2 = mmc_unbox_integer(_instLevel);
  tmp3 = mmc_unbox_integer(_context);
  omc_NFInst_instComponent(threadData, _node, _attributes, _innerMod, tmp1, tmp2, tmp3, _originalAttr, _propagatedSubs);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_redeclareEnum(threadData_t *threadData, modelica_metatype _redeclareClass, modelica_metatype _originalClass, modelica_metatype _prefixes, modelica_metatype _outerMod, modelica_metatype _redeclareNode, modelica_metatype _originalNode, modelica_integer _context)
{
  modelica_metatype _redeclaredClass = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _redeclaredClass = _redeclareClass;
  omc_NFInst_expand(threadData, _redeclareNode, _context);

  _redeclaredClass = omc_NFInstNode_InstNode_getClass(threadData, _redeclareNode);

  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _redeclaredClass;
    tmp4_2 = _originalClass;
    {
      modelica_metatype _lits1 = NULL;
      modelica_metatype _lits2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _lits1 has no default value.
      // _lits2 has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,5) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,2) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          if (!listEmpty(tmpMeta7)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!omc_NFInstNode_InstNode_isEnumerationType(threadData, _redeclareNode)) goto tmp3_end;
          _redeclaredClass = omc_NFClass_setPrefixes(threadData, _prefixes, _redeclaredClass);
          tmpMeta1 = omc_NFClass_mergeModifier(threadData, _outerMod, _redeclaredClass);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,5,2) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,5) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,5,2) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
          
          _lits1 = tmpMeta9;
          _lits2 = tmpMeta11;
          /* Pattern matching succeeded */
          if((!(listEmpty(_lits2) || omc_List_isEqualOnTrue(threadData, _lits1, _lits2, boxvar_stringEq))))
          {
            tmpMeta12 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _originalNode), MMC_REFSTRUCTLIT(mmc_nil));
            tmpMeta13 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _redeclareNode), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _originalNode), MMC_REFSTRUCTLIT(mmc_nil)));
            omc_Error_addMultiSourceMessage(threadData, _OMC_LIT230, tmpMeta12, tmpMeta13);

            goto goto_2;
          }

          tmpMeta14 = MMC_TAGPTR(mmc_alloc_words(7));
          memcpy(MMC_UNTAGPTR(tmpMeta14), MMC_UNTAGPTR(_redeclaredClass), 7*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta14))[5] = _prefixes;
          _redeclaredClass = tmpMeta14;

          tmpMeta15 = MMC_TAGPTR(mmc_alloc_words(7));
          memcpy(MMC_UNTAGPTR(tmpMeta15), MMC_UNTAGPTR(_redeclaredClass), 7*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta15))[4] = omc_NFModifier_Modifier_merge(threadData, _outerMod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_redeclaredClass), 4))), _OMC_LIT131);
          _redeclaredClass = tmpMeta15;
          tmpMeta1 = _redeclaredClass;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          
          /* Pattern matching succeeded */
          tmpMeta16 = mmc_mk_cons(omc_NFRestriction_toString(threadData, omc_NFClass_restriction(threadData, _originalClass)), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _originalNode), MMC_REFSTRUCTLIT(mmc_nil)));
          tmpMeta17 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _redeclareNode), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _originalNode), MMC_REFSTRUCTLIT(mmc_nil)));
          omc_Error_addMultiSourceMessage(threadData, _OMC_LIT233, tmpMeta16, tmpMeta17);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _redeclaredClass = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _redeclaredClass;
}
modelica_metatype boxptr_NFInst_redeclareEnum(threadData_t *threadData, modelica_metatype _redeclareClass, modelica_metatype _originalClass, modelica_metatype _prefixes, modelica_metatype _outerMod, modelica_metatype _redeclareNode, modelica_metatype _originalNode, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _redeclaredClass = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _redeclaredClass = omc_NFInst_redeclareEnum(threadData, _redeclareClass, _originalClass, _prefixes, _outerMod, _redeclareNode, _originalNode, tmp1);
  /* skip box _redeclaredClass; NFClass */
  return _redeclaredClass;
}

DLLDirection
modelica_metatype omc_NFInst_redeclareClass(threadData_t *threadData, modelica_metatype _redeclareNode, modelica_metatype _originalNode, modelica_metatype _outerMod, modelica_metatype _constrainingMod, modelica_integer _context)
{
  modelica_metatype _redeclaredNode = NULL;
  modelica_metatype _orig_node = NULL;
  modelica_metatype _orig_cls = NULL;
  modelica_metatype _rdcl_cls = NULL;
  modelica_metatype _new_cls = NULL;
  modelica_metatype _prefs = NULL;
  modelica_metatype _node_ty = NULL;
  modelica_metatype _mod = NULL;
  modelica_metatype _orig_opt = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta17;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _redeclaredNode has no default value.
  // _orig_node has no default value.
  // _orig_cls has no default value.
  // _rdcl_cls has no default value.
  // _new_cls has no default value.
  // _prefs has no default value.
  // _node_ty has no default value.
  // _mod has no default value.
  // _orig_opt has no default value.
  // _cls_tree has no default value.
  if((!omc_NFInstNode_InstNode_isClass(threadData, _redeclareNode)))
  {
    tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_typeName(threadData, _originalNode), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _originalNode), mmc_mk_cons(omc_NFInstNode_InstNode_typeName(threadData, _redeclareNode), MMC_REFSTRUCTLIT(mmc_nil))));
    tmpMeta2 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _redeclareNode), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _originalNode), MMC_REFSTRUCTLIT(mmc_nil)));
    omc_Error_addMultiSourceMessage(threadData, _OMC_LIT209, tmpMeta1, tmpMeta2);

    MMC_THROW_INTERNAL();
  }

  omc_NFInst_partialInstClass(threadData, _originalNode);

  _orig_cls = omc_NFInstNode_InstNode_getClass(threadData, _originalNode);

  omc_NFInst_partialInstClass(threadData, _redeclareNode);

  _rdcl_cls = omc_NFInstNode_InstNode_getClass(threadData, _redeclareNode);

  _mod = omc_NFClass_getModifier(threadData, _rdcl_cls);

  _mod = omc_NFModifier_Modifier_merge(threadData, _outerMod, _mod, _OMC_LIT131);

  _prefs = omc_NFAttributes_mergeRedeclaredClassPrefixes(threadData, omc_NFClass_getPrefixes(threadData, _orig_cls), omc_NFClass_getPrefixes(threadData, _rdcl_cls), _redeclareNode);

  if(omc_SCodeUtil_isClassExtends(threadData, omc_NFInstNode_InstNode_definition(threadData, _redeclareNode)))
  {
    _orig_node = omc_NFInst_expand(threadData, _originalNode, _context);

    _orig_cls = omc_NFInstNode_InstNode_getClass(threadData, _orig_node);

    { /* match expression */
      modelica_metatype tmp6_1;
      tmp6_1 = _rdcl_cls;
      {
        volatile mmc_switch_type tmp6;
        int tmp7;
        tmp6 = 0;
        for (; tmp6 < 3; tmp6++) {
          switch (MMC_SWITCH_CAST(tmp6)) {
          case 0: {
            modelica_metatype tmpMeta8;
            if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,1,4) == 0) goto tmp5_end;
            
            /* Pattern matching succeeded */
            /* Check guard condition after assignments */
            if (!omc_NFClass_isBuiltin(threadData, _orig_cls)) goto tmp5_end;
            if((!omc_SCodeUtil_isEmptyClassDef(threadData, omc_SCodeUtil_getClassDef(threadData, omc_NFInstNode_InstNode_definition(threadData, _redeclareNode)))))
            {
              tmpMeta8 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _redeclareNode), MMC_REFSTRUCTLIT(mmc_nil));
              omc_Error_addSourceMessage(threadData, _OMC_LIT238, tmpMeta8, omc_NFInstNode_InstNode_info(threadData, _redeclareNode));

              goto goto_4;
            }
            tmpMeta3 = omc_NFClass_setPrefixes(threadData, _prefs, _orig_cls);
            goto tmp5_done;
          }
          case 1: {
            modelica_metatype tmpMeta9;
            modelica_metatype tmpMeta10;
            if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,1,4) == 0) goto tmp5_end;
            
            /* Pattern matching succeeded */
            tmpMeta9 = mmc_mk_box4(4, &NFInstNode_InstNodeType_BASE__CLASS__desc, omc_NFInstNode_InstNode_parent(threadData, _orig_node), omc_NFInstNode_InstNode_definition(threadData, _orig_node), omc_NFInstNode_InstNode_nodeType(threadData, _orig_node));
            _node_ty = tmpMeta9;

            _orig_node = omc_NFInstNode_InstNode_setNodeType(threadData, _node_ty, _orig_node);

            _cls_tree = omc_NFClassTree_ClassTree_setClassExtends(threadData, _orig_node, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_cls), 2))));
            tmpMeta10 = mmc_mk_box5(4, &NFClass_PARTIAL__CLASS__desc, _cls_tree, _mod, _constrainingMod, _prefs);
            tmpMeta3 = tmpMeta10;
            goto tmp5_done;
          }
          case 2: {
            
            /* Pattern matching succeeded */
            omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT234, _OMC_LIT239);
            goto goto_4;
            goto tmp5_done;
          }
          }
          goto tmp5_end;
          tmp5_end: ;
        }
        goto goto_4;
        goto_4:;
        MMC_THROW_INTERNAL();
        goto tmp5_done;
        tmp5_done:;
      }
    }
    _new_cls = tmpMeta3;
  }
  else
  {
    { /* match expression */
      modelica_metatype tmp14_1;modelica_metatype tmp14_2;
      tmp14_1 = _orig_cls;
      tmp14_2 = _rdcl_cls;
      {
        volatile mmc_switch_type tmp14;
        int tmp15;
        tmp14 = 0;
        for (; tmp14 < 3; tmp14++) {
          switch (MMC_SWITCH_CAST(tmp14)) {
          case 0: {
            if (mmc__uniontype__metarecord__typedef__equal(tmp14_1,2,5) == 0) goto tmp13_end;
            
            /* Pattern matching succeeded */
            tmpMeta11 = omc_NFInst_redeclareEnum(threadData, _rdcl_cls, _orig_cls, _prefs, _mod, _redeclareNode, _originalNode, _context);
            goto tmp13_done;
          }
          case 1: {
            modelica_metatype tmpMeta16;
            if (mmc__uniontype__metarecord__typedef__equal(tmp14_2,1,4) == 0) goto tmp13_end;
            
            /* Pattern matching succeeded */
            tmpMeta16 = mmc_mk_box5(4, &NFClass_PARTIAL__CLASS__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_rdcl_cls), 2))), _mod, _constrainingMod, _prefs);
            tmpMeta11 = tmpMeta16;
            goto tmp13_done;
          }
          case 2: {
            
            /* Pattern matching succeeded */
            omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT234, _OMC_LIT235);
            goto goto_12;
            goto tmp13_done;
          }
          }
          goto tmp13_end;
          tmp13_end: ;
        }
        goto goto_12;
        goto_12:;
        MMC_THROW_INTERNAL();
        goto tmp13_done;
        tmp13_done:;
      }
    }
    _new_cls = tmpMeta11;
  }

  _orig_opt = (omc_NFInstContext_inInstanceAPI(threadData, _context)?mmc_mk_some(_originalNode):mmc_mk_none());

  _redeclaredNode = omc_NFInstNode_InstNode_replaceClass(threadData, _new_cls, _redeclareNode);

  tmpMeta17 = mmc_mk_box4(11, &NFInstNode_InstNodeType_REDECLARED__CLASS__desc, omc_NFInstNode_InstNode_parent(threadData, _originalNode), omc_NFInstNode_InstNode_nodeType(threadData, _originalNode), _orig_opt);
  _node_ty = tmpMeta17;

  _redeclaredNode = omc_NFInstNode_InstNode_setNodeType(threadData, _node_ty, _redeclaredNode);
  _return: OMC_LABEL_UNUSED
  return _redeclaredNode;
}
modelica_metatype boxptr_NFInst_redeclareClass(threadData_t *threadData, modelica_metatype _redeclareNode, modelica_metatype _originalNode, modelica_metatype _outerMod, modelica_metatype _constrainingMod, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _redeclaredNode = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _redeclaredNode = omc_NFInst_redeclareClass(threadData, _redeclareNode, _originalNode, _outerMod, _constrainingMod, tmp1);
  /* skip box _redeclaredNode; NFInstNode.InstNode */
  return _redeclaredNode;
}

DLLDirection
modelica_metatype omc_NFInst_redeclareComponentElement(threadData_t *threadData, modelica_metatype _redeclareComp, modelica_metatype _replaceableComp, modelica_integer _instLevel, modelica_integer _context)
{
  modelica_metatype _outComp = NULL;
  modelica_metatype _rdcl_node = NULL;
  modelica_metatype _repl_node = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outComp has no default value.
  // _rdcl_node has no default value.
  // _repl_node has no default value.
  _rdcl_node = omc_Mutable_access(threadData, _redeclareComp);

  _repl_node = omc_Mutable_access(threadData, _replaceableComp);

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  omc_NFInst_instComponent(threadData, _repl_node, _OMC_LIT87, _OMC_LIT88, 1 /* true */, _instLevel, _context, mmc_mk_none(), tmpMeta1);

  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  omc_NFInst_redeclareComponent(threadData, _rdcl_node, _repl_node, _OMC_LIT88, _OMC_LIT88, tmpMeta2, _OMC_LIT87, _rdcl_node, _instLevel, _context);

  _outComp = omc_Mutable_create(threadData, _rdcl_node);
  _return: OMC_LABEL_UNUSED
  return _outComp;
}
modelica_metatype boxptr_NFInst_redeclareComponentElement(threadData_t *threadData, modelica_metatype _redeclareComp, modelica_metatype _replaceableComp, modelica_metatype _instLevel, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _outComp = NULL;
  tmp1 = mmc_unbox_integer(_instLevel);
  tmp2 = mmc_unbox_integer(_context);
  _outComp = omc_NFInst_redeclareComponentElement(threadData, _redeclareComp, _replaceableComp, tmp1, tmp2);
  /* skip box _outComp; Mutable<NFInstNode.InstNode> */
  return _outComp;
}

DLLDirection
modelica_metatype omc_NFInst_redeclareClassElement(threadData_t *threadData, modelica_metatype _redeclareCls, modelica_metatype _replaceableCls, modelica_integer _context)
{
  modelica_metatype _outCls = NULL;
  modelica_metatype _rdcl_node = NULL;
  modelica_metatype _repl_node = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outCls has no default value.
  // _rdcl_node has no default value.
  // _repl_node has no default value.
  _rdcl_node = omc_Mutable_access(threadData, _redeclareCls);

  _repl_node = omc_Mutable_access(threadData, _replaceableCls);

  _rdcl_node = omc_NFInst_redeclareClass(threadData, _rdcl_node, _repl_node, _OMC_LIT88, _OMC_LIT88, _context);

  _outCls = omc_Mutable_create(threadData, _rdcl_node);
  _return: OMC_LABEL_UNUSED
  return _outCls;
}
modelica_metatype boxptr_NFInst_redeclareClassElement(threadData_t *threadData, modelica_metatype _redeclareCls, modelica_metatype _replaceableCls, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _outCls = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _outCls = omc_NFInst_redeclareClassElement(threadData, _redeclareCls, _replaceableCls, tmp1);
  /* skip box _outCls; Mutable<NFInstNode.InstNode> */
  return _outCls;
}

DLLDirection
void omc_NFInst_redeclareElements(threadData_t *threadData, modelica_metatype _chain, modelica_integer _instLevel, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  modelica_metatype _node_ptr = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _node_ptr has no default value.
  _node = omc_Mutable_access(threadData, listHead(_chain));

  _node_ptr = listHead(_chain);

  if(omc_NFInstNode_InstNode_isClass(threadData, _node))
  {
    {
      modelica_metatype _cls_ptr;
      for (tmpMeta1 = listRest(_chain); !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
      {
        _cls_ptr = MMC_CAR(tmpMeta1);
        _node_ptr = omc_NFInst_redeclareClassElement(threadData, _cls_ptr, _node_ptr, _context);
      }
    }

    _node = omc_Mutable_access(threadData, _node_ptr);
  }
  else
  {
    {
      modelica_metatype _comp_ptr;
      for (tmpMeta3 = listRest(_chain); !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
      {
        _comp_ptr = MMC_CAR(tmpMeta3);
        _node_ptr = omc_NFInst_redeclareComponentElement(threadData, _comp_ptr, _node_ptr, _instLevel, _context);
      }
    }

    _node = omc_Mutable_access(threadData, _node_ptr);
  }

  {
    modelica_metatype _cls_ptr;
    for (tmpMeta5 = _chain; !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
    {
      _cls_ptr = MMC_CAR(tmpMeta5);
      omc_Mutable_update(threadData, _cls_ptr, _node);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_redeclareElements(threadData_t *threadData, modelica_metatype _chain, modelica_metatype _instLevel, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  tmp1 = mmc_unbox_integer(_instLevel);
  tmp2 = mmc_unbox_integer(_context);
  omc_NFInst_redeclareElements(threadData, _chain, tmp1, tmp2);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_redeclareClasses(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftree, modelica_metatype _parent, modelica_integer _context)
{
  modelica_metatype _tree = NULL;
  modelica_metatype _cls_node = NULL;
  modelica_metatype _redecl_node = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _mod = NULL;
  modelica_metatype _cc_mod = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _tree = __omcQ_24in_5Ftree;
  // _cls_node has no default value.
  // _redecl_node has no default value.
  // _cls has no default value.
  // _mod has no default value.
  // _cc_mod has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _tree;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_integer tmp12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,7) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _cls_ptr;
            for (tmpMeta5 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_tree), 3))), tmp12 = arrayLength(tmpMeta5), tmp11 = 1; tmp11 <= tmp12; tmp11++)
            {
              _cls_ptr = arrayGet(tmpMeta5,tmp11);
              _cls_node = omc_Mutable_access(threadData, _cls_ptr);

              _cls = omc_NFInstNode_InstNode_getClass(threadData, omc_NFInstNode_InstNode_resolveOuter(threadData, _cls_node));

              _mod = omc_NFClass_getModifier(threadData, _cls);

              if(omc_NFModifier_Modifier_isRedeclare(threadData, _mod))
              {
                /* Pattern-matching assignment */
                tmpMeta6 = _mod;
                if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,7) == 0) goto goto_1;
                tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
                tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
                tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 7));
                _redecl_node = tmpMeta7;
                _mod = tmpMeta8;
                _cc_mod = tmpMeta9;

                _cc_mod = omc_NFInst_getConstrainingMod(threadData, omc_NFInstNode_InstNode_definition(threadData, _cls_node), _parent, _cc_mod);

                _cls_node = omc_NFInst_redeclareClass(threadData, _redecl_node, _cls_node, _mod, _cc_mod, _context);

                omc_Mutable_update(threadData, _cls_ptr, _cls_node);
              }
            }
          }
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _tree;
}
modelica_metatype boxptr_NFInst_redeclareClasses(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftree, modelica_metatype _parent, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _tree = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _tree = omc_NFInst_redeclareClasses(threadData, __omcQ_24in_5Ftree, _parent, tmp1);
  /* skip box _tree; NFClassTree.ClassTree */
  return _tree;
}

DLLDirection
modelica_metatype omc_NFInst_applyModifier(threadData_t *threadData, modelica_metatype _modifier, modelica_metatype __omcQ_24in_5Fcls, modelica_metatype _parent, modelica_integer _context)
{
  modelica_metatype _cls = NULL;
  modelica_metatype _mods = NULL;
  modelica_metatype _node_ptrs = NULL;
  modelica_metatype _node = NULL;
  modelica_metatype _comp = NULL;
  modelica_boolean _found;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _cls = __omcQ_24in_5Fcls;
  // _mods has no default value.
  // _node_ptrs has no default value.
  // _node has no default value.
  // _comp has no default value.
  // _found has no default value.
  _mods = omc_NFModifier_Modifier_toList(threadData, _modifier);

  if(listEmpty(_mods))
  {
    goto _return;
  }

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cls;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _mod;
            for (tmpMeta5 = _mods; !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
            {
              _mod = MMC_CAR(tmpMeta5);
              { /* matchcontinue expression */
                {
                  volatile mmc_switch_type tmp8;
                  int tmp9;
                  tmp8 = 0;
                  MMC_TRY_INTERNAL(mmc_jumper)
                  tmp7_top:
                  threadData->mmc_jumper = &new_mmc_jumper;
                  for (; tmp8 < 2; tmp8++) {
                    switch (MMC_SWITCH_CAST(tmp8)) {
                    case 0: {
                      /* Pattern matching succeeded */
                      _node = omc_NFClassTree_ClassTree_lookupElement(threadData, omc_NFModifier_Modifier_name(threadData, _mod), _cls, NULL);

                      omc_NFInstNode_InstNode_componentApply(threadData, _node, boxvar_NFComponent_mergeModifier, _mod);
                      goto tmp7_done;
                    }
                    case 1: {
                      modelica_metatype tmpMeta10;
                      /* Pattern matching succeeded */
                      tmpMeta10 = mmc_mk_cons(omc_NFModifier_Modifier_name(threadData, _mod), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _parent), MMC_REFSTRUCTLIT(mmc_nil)));
                      omc_Error_addSourceMessage(threadData, _OMC_LIT242, tmpMeta10, omc_NFModifier_Modifier_info(threadData, _mod));

                      if((!omc_NFInstContext_inInstanceAPI(threadData, _context)))
                      {
                        goto goto_6;
                      }
                      goto tmp7_done;
                    }
                    }
                    goto tmp7_end;
                    tmp7_end: ;
                  }
                  goto goto_6;
                  tmp7_done:
                  (void)tmp8;
                  MMC_RESTORE_INTERNAL(mmc_jumper);
                  goto tmp7_done2;
                  goto_6:;
                  MMC_CATCH_INTERNAL(mmc_jumper);
                  if (++tmp8 < 2) {
                    goto tmp7_top;
                  }
                  goto goto_1;
                  tmp7_done2:;
                }
              }
              ;
            }
          }
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _mod;
            for (tmpMeta12 = _mods; !listEmpty(tmpMeta12); tmpMeta12=MMC_CDR(tmpMeta12))
            {
              _mod = MMC_CAR(tmpMeta12);
              { /* matchcontinue expression */
                {
                  volatile mmc_switch_type tmp15;
                  int tmp16;
                  tmp15 = 0;
                  MMC_TRY_INTERNAL(mmc_jumper)
                  tmp14_top:
                  threadData->mmc_jumper = &new_mmc_jumper;
                  for (; tmp15 < 2; tmp15++) {
                    switch (MMC_SWITCH_CAST(tmp15)) {
                    case 0: {
                      /* Pattern matching succeeded */
                      _node_ptrs = omc_NFClassTree_ClassTree_lookupElementsPtr(threadData, omc_NFModifier_Modifier_name(threadData, _mod), _cls);
                      goto tmp14_done;
                    }
                    case 1: {
                      modelica_metatype tmpMeta17;
                      /* Pattern matching succeeded */
                      tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
                      _node_ptrs = tmpMeta17;
                      goto tmp14_done;
                    }
                    }
                    goto tmp14_end;
                    tmp14_end: ;
                  }
                  goto goto_13;
                  tmp14_done:
                  (void)tmp15;
                  MMC_RESTORE_INTERNAL(mmc_jumper);
                  goto tmp14_done2;
                  goto_13:;
                  MMC_CATCH_INTERNAL(mmc_jumper);
                  if (++tmp15 < 2) {
                    goto tmp14_top;
                  }
                  goto goto_1;
                  tmp14_done2:;
                }
              }
              ;

              _found = 0 /* false */;

              {
                modelica_metatype _node_ptr;
                for (tmpMeta18 = _node_ptrs; !listEmpty(tmpMeta18); tmpMeta18=MMC_CDR(tmpMeta18))
                {
                  _node_ptr = MMC_CAR(tmpMeta18);
                  _node = omc_Mutable_access(threadData, _node_ptr);

                  if(omc_NFInstNode_InstNode_isEmpty(threadData, _node))
                  {
                    continue;
                  }

                  _found = 1 /* true */;

                  _node = omc_NFInstNode_InstNode_resolveOuter(threadData, _node);

                  if((omc_NFInstNode_InstNode_isProtected(threadData, _node) && (!(omc_NFInstNode_InstNode_isExtends(threadData, _parent) || omc_NFInstNode_InstNode_isBaseClass(threadData, _parent)))))
                  {
                    tmpMeta19 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(omc_NFModifier_Modifier_toString(threadData, _mod, 1 /* true */), MMC_REFSTRUCTLIT(mmc_nil)));
                    tmpMeta20 = mmc_mk_cons(omc_NFModifier_Modifier_info(threadData, _mod), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _node), MMC_REFSTRUCTLIT(mmc_nil)));
                    omc_Error_addMultiSourceMessage(threadData, _OMC_LIT245, tmpMeta19, tmpMeta20);

                    if(omc_NFInstContext_inInstanceAPI(threadData, _context))
                    {
                      continue;
                    }
                    else
                    {
                      goto goto_1;
                    }
                  }

                  if(omc_NFInstNode_InstNode_isOnlyOuter(threadData, _node))
                  {
                    tmpMeta21 = mmc_mk_cons(omc_NFModifier_Modifier_toString(threadData, _mod, 0 /* false */), mmc_mk_cons(omc_NFModifier_Modifier_name(threadData, _mod), MMC_REFSTRUCTLIT(mmc_nil)));
                    omc_Error_addSourceMessage(threadData, _OMC_LIT205, tmpMeta21, omc_NFModifier_Modifier_info(threadData, _mod));

                    if(omc_NFInstContext_inInstanceAPI(threadData, _context))
                    {
                      continue;
                    }
                    else
                    {
                      goto goto_1;
                    }
                  }

                  if(omc_NFInstNode_InstNode_isComponent(threadData, _node))
                  {
                    omc_NFInstNode_InstNode_componentApply(threadData, _node, boxvar_NFComponent_mergeModifier, _mod);
                  }
                  else
                  {
                    omc_NFInst_partialInstClass(threadData, _node);

                    _node = omc_NFInstNode_InstNode_replaceClass(threadData, omc_NFClass_mergeModifier(threadData, _mod, omc_NFInstNode_InstNode_getClass(threadData, _node)), _node);

                    _node = omc_NFInstNode_InstNode_clearPackageCache(threadData, _node);

                    omc_Mutable_update(threadData, _node_ptr, _node);
                  }
                }
              }

              if(((!_found) && (!omc_NFInstContext_inInstanceAPI(threadData, _context))))
              {
                tmpMeta23 = mmc_mk_cons(omc_NFModifier_Modifier_name(threadData, _mod), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _parent), MMC_REFSTRUCTLIT(mmc_nil)));
                omc_Error_addSourceMessage(threadData, _OMC_LIT242, tmpMeta23, omc_NFModifier_Modifier_info(threadData, _mod));

                goto goto_1;
              }
            }
          }
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _cls;
}
modelica_metatype boxptr_NFInst_applyModifier(threadData_t *threadData, modelica_metatype _modifier, modelica_metatype __omcQ_24in_5Fcls, modelica_metatype _parent, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _cls = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _cls = omc_NFInst_applyModifier(threadData, _modifier, __omcQ_24in_5Fcls, _parent, tmp1);
  /* skip box _cls; NFClassTree.ClassTree */
  return _cls;
}

static modelica_metatype closure4_NFInst_instExtends(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_node)
{
  modelica_metatype attributes = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype useBinding = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype instLevel = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_NFInst_instExtends(thData, $in_node, attributes, useBinding, instLevel, context);
}static void closure5_NFInst_instComponent(threadData_t *thData, modelica_metatype closure, modelica_metatype node)
{
  modelica_metatype attributes = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype innerMod = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype useBinding = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype instLevel = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),5));
  modelica_metatype originalAttr = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),6));
  modelica_metatype propagatedSubs = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),7));
  boxptr_NFInst_instComponent(thData, node, attributes, innerMod, useBinding, instLevel, context, originalAttr, propagatedSubs);
}
DLLDirection
modelica_metatype omc_NFInst_instExtends(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _attributes, modelica_boolean _useBinding, modelica_integer _instLevel, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _inst_cls = NULL;
  modelica_metatype _cls_tree = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _cls has no default value.
  // _inst_cls has no default value.
  // _cls_tree has no default value.
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cls;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 4; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,2,7) == 0) goto tmp2_end;
          
          _cls_tree = tmpMeta5;
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_box4(0, _attributes, mmc_mk_boolean(_useBinding), mmc_mk_integer(_instLevel), mmc_mk_integer(_context));
          omc_NFClassTree_ClassTree_mapExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure4_NFInst_instExtends,tmpMeta6));

          tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta7 = mmc_mk_box7(0, _attributes, _OMC_LIT88, mmc_mk_boolean(_useBinding), mmc_mk_integer(_instLevel), mmc_mk_integer(_context), mmc_mk_none(), tmpMeta8);
          omc_NFClassTree_ClassTree_applyLocalComponents(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure5_NFInst_instComponent,tmpMeta7));
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,7) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          tmpMeta9 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta9), MMC_UNTAGPTR(_cls), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta9))[2] = omc_NFInst_instExtends(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), _attributes, _useBinding, _instLevel, _context);
          _cls = tmpMeta9;

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,5) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          tmpMeta10 = mmc_mk_box4(9, &NFClass_INSTANCED__BUILTIN__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 6))));
          _inst_cls = tmpMeta10;

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _inst_cls, _node);
          goto tmp2_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_instExtends(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _attributes, modelica_metatype _useBinding, modelica_metatype _instLevel, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_useBinding);
  tmp2 = mmc_unbox_integer(_instLevel);
  tmp3 = mmc_unbox_integer(_context);
  _node = omc_NFInst_instExtends(threadData, __omcQ_24in_5Fnode, _attributes, tmp1, tmp2, tmp3);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

static modelica_metatype closure6_NFInst_applyExtendsVisibility(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_node)
{
  modelica_metatype visibility = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFInst_applyExtendsVisibility(thData, $in_node, visibility);
}
DLLDirection
modelica_metatype omc_NFInst_applyExtendsVisibility(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _visibility)
{
  modelica_metatype _node = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_integer _vis;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _cls has no default value.
  // _cls_tree has no default value.
  _vis = (modelica_integer)_visibility;
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cls;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 3; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,2,7) == 0) goto tmp2_end;
          
          _cls_tree = tmpMeta5;
          /* Pattern matching succeeded */
          if(((((modelica_integer)_vis == 1) && omc_NFInstNode_InstNode_isProtectedBaseClass(threadData, _node)) || ((modelica_integer)_vis == 2)))
          {
            _vis = 3;
          }

          if((((modelica_integer)_vis == 3) && ((modelica_integer)_visibility != 3)))
          {
            {
              modelica_metatype _c;
              for (tmpMeta6 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls_tree), 3))), tmp9 = arrayLength(tmpMeta6), tmp8 = 1; tmp8 <= tmp9; tmp8++)
              {
                _c = arrayGet(tmpMeta6,tmp8);
                omc_Mutable_update(threadData, _c, omc_NFInstNode_InstNode_protectClass(threadData, omc_Mutable_access(threadData, _c)));
              }
            }

            {
              modelica_metatype _c;
              for (tmpMeta10 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls_tree), 4))), tmp13 = arrayLength(tmpMeta10), tmp12 = 1; tmp12 <= tmp13; tmp12++)
              {
                _c = arrayGet(tmpMeta10,tmp12);
                omc_Mutable_update(threadData, _c, omc_NFInstNode_InstNode_protectComponent(threadData, omc_Mutable_access(threadData, _c)));
              }
            }
          }

          tmpMeta14 = mmc_mk_box1(0, mmc_mk_integer((modelica_integer)_vis));
          omc_NFClassTree_ClassTree_mapExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure6_NFInst_applyExtendsVisibility,tmpMeta14));
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,7) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          if((((modelica_integer)_vis == 1) && omc_NFInstNode_InstNode_isProtectedBaseClass(threadData, _node)))
          {
            _vis = 2;
          }

          tmpMeta15 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta15), MMC_UNTAGPTR(_cls), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta15))[2] = omc_NFInst_applyExtendsVisibility(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), (modelica_integer)_vis);
          _cls = tmpMeta15;

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);
          goto tmp2_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_applyExtendsVisibility(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _visibility)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_visibility);
  _node = omc_NFInst_applyExtendsVisibility(threadData, __omcQ_24in_5Fnode, tmp1);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

static modelica_metatype closure7_NFInst_modifyExtends(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_extendsNode)
{
  modelica_metatype scope = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_NFInst_modifyExtends(thData, $in_extendsNode, scope, context);
}
DLLDirection
modelica_metatype omc_NFInst_modifyExtends(threadData_t *threadData, modelica_metatype __omcQ_24in_5FextendsNode, modelica_metatype _scope, modelica_integer _context)
{
  modelica_metatype _extendsNode = NULL;
  modelica_metatype _elem = NULL;
  modelica_metatype _ext_mod = NULL;
  modelica_metatype _ext_node = NULL;
  modelica_metatype _info = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _extendsNode = __omcQ_24in_5FextendsNode;
  // _elem has no default value.
  // _ext_mod has no default value.
  // _ext_node has no default value.
  // _info has no default value.
  // _cls has no default value.
  // _cls_tree has no default value.
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _extendsNode);

  _cls_tree = omc_NFClass_classTree(threadData, _cls);

  /* Pattern-matching assignment */
  tmpMeta1 = omc_NFInstNode_InstNode_nodeType(threadData, _extendsNode);
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,1,3) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _elem = tmpMeta2;

  _ext_mod = omc_NFModifier_Modifier_fromElement(threadData, _elem, _scope);

  _ext_mod = omc_NFModifier_Modifier_merge(threadData, omc_NFInstNode_InstNode_getModifier(threadData, _extendsNode), _ext_mod, _OMC_LIT131);

  if((!omc_NFClass_isBuiltin(threadData, _cls)))
  {
    tmpMeta3 = mmc_mk_box2(0, _extendsNode, mmc_mk_integer(_context));
    omc_NFClassTree_ClassTree_mapExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure7_NFInst_modifyExtends,tmpMeta3));

    { /* match expression */
      modelica_metatype tmp6_1;
      tmp6_1 = _elem;
      {
        volatile mmc_switch_type tmp6;
        int tmp7;
        tmp6 = 0;
        for (; tmp6 < 2; tmp6++) {
          switch (MMC_SWITCH_CAST(tmp6)) {
          case 0: {
            modelica_metatype tmpMeta8;
            modelica_metatype tmpMeta9;
            modelica_metatype tmpMeta10;
            modelica_metatype tmpMeta11;
            modelica_metatype tmpMeta12;
            if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,1,5) == 0) goto tmp5_end;
            
            /* Pattern matching succeeded */
            /* Pattern-matching assignment */
            tmpMeta8 = omc_NFLookup_lookupBaseClassName(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_elem), 2))), _scope, _context, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_elem), 6))));
            if (listEmpty(tmpMeta8)) goto goto_4;
            tmpMeta9 = MMC_CAR(tmpMeta8);
            tmpMeta10 = MMC_CDR(tmpMeta8);
            _ext_node = tmpMeta9;

            if(((!referenceEq(omc_NFInstNode_InstNode_definition(threadData, _extendsNode), omc_NFInstNode_InstNode_definition(threadData, _ext_node))) && (!omc_Flags_isSet(threadData, _OMC_LIT252))))
            {
              tmpMeta11 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_elem), 2))), _OMC_LIT5, 1 /* true */, 0 /* false */), MMC_REFSTRUCTLIT(mmc_nil));
              tmpMeta12 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _extendsNode), mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _ext_node), MMC_REFSTRUCTLIT(mmc_nil)));
              omc_Error_addMultiSourceMessage(threadData, _OMC_LIT248, tmpMeta11, tmpMeta12);

              goto goto_4;
            }
            goto tmp5_done;
          }
          case 1: {
            if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,2,8) == 0) goto tmp5_end;
            
            /* Pattern matching succeeded */
            goto tmp5_done;
          }
          }
          goto tmp5_end;
          tmp5_end: ;
        }
        goto goto_4;
        goto_4:;
        MMC_THROW_INTERNAL();
        goto tmp5_done;
        tmp5_done:;
      }
    }
    ;
  }

  omc_NFInst_applyModifier(threadData, _ext_mod, _cls_tree, _extendsNode, _context);
  _return: OMC_LABEL_UNUSED
  return _extendsNode;
}
modelica_metatype boxptr_NFInst_modifyExtends(threadData_t *threadData, modelica_metatype __omcQ_24in_5FextendsNode, modelica_metatype _scope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _extendsNode = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _extendsNode = omc_NFInst_modifyExtends(threadData, __omcQ_24in_5FextendsNode, _scope, tmp1);
  /* skip box _extendsNode; NFInstNode.InstNode */
  return _extendsNode;
}

DLLDirection
modelica_metatype omc_NFInst_instPackage(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  modelica_metatype _cache = NULL;
  modelica_metatype _inst = NULL;
  modelica_integer _state;
  modelica_integer tmp1_c1 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _cache has no default value.
  // _inst has no default value.
  // _state has no default value.
  _cache = omc_NFInstNode_InstNode_getPackageCache(threadData, _node);

  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _cache;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cache), 2)));
          tmp1_c1 = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cache), 3))));
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _node;
          tmp1_c1 = 1;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _inst = tmpMeta[0+0];
  _state = tmp1_c1;

  if(((modelica_integer)_state == 5))
  {
    _node = _inst;

    goto _return;
  }

  if(((modelica_integer)_state == 2))
  {
    _node = _inst;

    goto _return;
  }

  if(omc_NFInstContext_inFastLookup(threadData, _context))
  {
    if(((modelica_integer)_state < 3))
    {
      omc_NFInstNode_InstNode_setPackageCache(threadData, _node, _node, 2);

      _inst = omc_NFInst_expand(threadData, _node, _context);

      omc_NFInstNode_InstNode_setPackageCache(threadData, _node, _inst, 3);
    }

    goto _return;
  }

  if(((modelica_integer)_state < 4))
  {
    omc_NFInstNode_InstNode_setPackageCache(threadData, _node, _node, 2);

    _inst = omc_NFInst_instantiate(threadData, _node, _OMC_LIT88, _OMC_LIT198, _context, 0 /* false */);

    omc_NFInstNode_InstNode_setPackageCache(threadData, _node, _inst, 4);
  }

  if((((modelica_integer)_state < 5) && ((!omc_NFInstNode_InstNode_isPartial(threadData, _inst)) || omc_NFInstContext_inRelaxed(threadData, _context))))
  {
    omc_NFInstNode_InstNode_setPackageCache(threadData, _node, _inst, 5);

    omc_NFInst_instExpressions(threadData, _inst, _inst, _OMC_LIT177, omc_NFConnectBreakTree_new(threadData), _context, _OMC_LIT253);
  }

  _node = _inst;
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_instPackage(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _node = omc_NFInst_instPackage(threadData, __omcQ_24in_5Fnode, tmp1);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

DLLDirection
void omc_NFInst_instExternalObjectStructors(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _parent, modelica_integer _context)
{
  modelica_metatype _constructor = NULL;
  modelica_metatype _destructor = NULL;
  modelica_metatype _par = NULL;
  modelica_metatype _info = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _constructor has no default value.
  // _destructor has no default value.
  // _par has no default value.
  // _info has no default value.
  _par = omc_NFInstNode_InstNode_parent(threadData, omc_NFInstNode_InstNode_parent(threadData, _parent));

  if((!(omc_NFInstNode_InstNode_isClass(threadData, _par) && omc_NFClass_isExternalObject(threadData, omc_NFInstNode_InstNode_getClass(threadData, _par)))))
  {
    /* Pattern-matching assignment */
    tmpMeta1 = _ty;
    if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,11,2) == 0) MMC_THROW_INTERNAL();
    tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
    if (mmc__uniontype__metarecord__typedef__equal(tmpMeta2,5,2) == 0) MMC_THROW_INTERNAL();
    tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
    tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 3));
    _constructor = tmpMeta3;
    _destructor = tmpMeta4;

    _info = omc_NFInstNode_InstNode_info(threadData, _parent);

    omc_NFFunction_Function_instFunctionNode(threadData, _constructor, _context, _info);

    omc_NFFunction_Function_instFunctionNode(threadData, _destructor, _context, _info);
  }
  _return: OMC_LABEL_UNUSED
  return;
}
void boxptr_NFInst_instExternalObjectStructors(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _parent, modelica_metatype _context)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_context);
  omc_NFInst_instExternalObjectStructors(threadData, _ty, _parent, tmp1);
  return;
}

DLLDirection
modelica_metatype omc_NFInst_updateComponentType(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fcomponent, modelica_metatype _cls)
{
  modelica_metatype _component = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _component = __omcQ_24in_5Fcomponent;
  if(omc_NFInstNode_InstNode_isComponent(threadData, _component))
  {
    _component = omc_NFInstNode_InstNode_componentApply(threadData, _component, boxvar_NFComponent_setClassInstance, _cls);
  }
  _return: OMC_LABEL_UNUSED
  return _component;
}

static modelica_metatype closure8_NFInst_modifyExtends(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_extendsNode)
{
  modelica_metatype scope = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_NFInst_modifyExtends(thData, $in_extendsNode, scope, context);
}static modelica_metatype closure9_NFInst_applyExtendsVisibility(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_node)
{
  modelica_metatype visibility = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFInst_applyExtendsVisibility(thData, $in_node, visibility);
}static void closure10_NFInst_redeclareElements(threadData_t *thData, modelica_metatype closure, modelica_metatype chain)
{
  modelica_metatype instLevel = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  boxptr_NFInst_redeclareElements(thData, chain, instLevel, context);
}static modelica_metatype closure11_NFInst_instExtends(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_node)
{
  modelica_metatype attributes = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype useBinding = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype instLevel = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_NFInst_instExtends(thData, $in_node, attributes, useBinding, instLevel, context);
}static void closure12_NFInst_instComponent(threadData_t *thData, modelica_metatype closure, modelica_metatype node)
{
  modelica_metatype attributes = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype innerMod = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype useBinding = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype instLevel = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),5));
  modelica_metatype originalAttr = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),6));
  modelica_metatype propagatedSubs = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),7));
  boxptr_NFInst_instComponent(thData, node, attributes, innerMod, useBinding, instLevel, context, originalAttr, propagatedSubs);
}
DLLDirection
modelica_metatype omc_NFInst_instClassDef(threadData_t *threadData, modelica_metatype _cls, modelica_metatype _outerMod, modelica_metatype __omcQ_24in_5Fattributes, modelica_boolean _useBinding, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _parent, modelica_integer _instLevel, modelica_integer _context, modelica_metatype *out_node)
{
  modelica_metatype _attributes = NULL;
  modelica_metatype _node = NULL;
  modelica_metatype _par = NULL;
  modelica_metatype _base_node = NULL;
  modelica_metatype _inst_cls = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_metatype _mod = NULL;
  modelica_metatype _outer_mod = NULL;
  modelica_metatype _res = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _attrs = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _attributes = __omcQ_24in_5Fattributes;
  _node = __omcQ_24in_5Fnode;
  // _par has no default value.
  // _base_node has no default value.
  // _inst_cls has no default value.
  // _cls_tree has no default value.
  // _mod has no default value.
  // _outer_mod has no default value.
  // _res has no default value.
  // _ty has no default value.
  // _attrs has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _cls;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 6; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
          _res = tmpMeta5;
          /* Pattern matching succeeded */
          if(omc_NFInstNode_InstNode_isBaseClass(threadData, _node))
          {
            _par = _parent;
          }
          else
          {
            _node = omc_NFClassTree_ClassTree_instantiate(threadData, _node, _parent, _OMC_LIT198 ,&_par, NULL, NULL);
          }

          omc_NFInst_updateComponentType(threadData, _parent, _node);

          _attributes = omc_NFAttributes_updateClassConnectorType(threadData, _res, _attributes);

          /* Pattern-matching assignment */
          tmpMeta6 = omc_NFInstNode_InstNode_getClass(threadData, _node);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,5) == 0) goto goto_1;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          _inst_cls = tmpMeta6;
          _cls_tree = tmpMeta7;

          _mod = omc_NFInst_instElementModifier(threadData, omc_NFInstNode_InstNode_definition(threadData, _node), _node, _par);

          _mod = omc_NFModifier_Modifier_propagate(threadData, _mod, _node, _par);

          _mod = omc_NFModifier_Modifier_merge(threadData, _mod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 4))), _OMC_LIT131);

          _outer_mod = omc_NFModifier_Modifier_propagate(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 3))), _node, _par);

          _outer_mod = omc_NFModifier_Modifier_merge(threadData, _outerMod, _outer_mod, _OMC_LIT131);

          _mod = omc_NFModifier_Modifier_merge(threadData, _outer_mod, _mod, _OMC_LIT131);

          tmpMeta8 = mmc_mk_box2(0, _par, mmc_mk_integer(_context));
          omc_NFClassTree_ClassTree_mapExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure8_NFInst_modifyExtends,tmpMeta8));

          tmpMeta9 = mmc_mk_box1(0, mmc_mk_integer(1));
          omc_NFClassTree_ClassTree_mapExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure9_NFInst_applyExtendsVisibility,tmpMeta9));

          omc_NFInst_applyModifier(threadData, _mod, _cls_tree, _node, _context);

          tmpMeta10 = mmc_mk_box2(0, mmc_mk_integer(_instLevel), mmc_mk_integer(_context));
          omc_NFClassTree_ClassTree_mapRedeclareChains(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure10_NFInst_redeclareElements,tmpMeta10));

          omc_NFInst_redeclareClasses(threadData, _cls_tree, _par, _context);

          tmpMeta11 = mmc_mk_box4(0, _attributes, mmc_mk_boolean(_useBinding), mmc_mk_integer(((modelica_integer) 1) + _instLevel), mmc_mk_integer(_context));
          omc_NFClassTree_ClassTree_mapExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure11_NFInst_instExtends,tmpMeta11));

          tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta12 = mmc_mk_box7(0, _attributes, _OMC_LIT88, mmc_mk_boolean(_useBinding), mmc_mk_integer(((modelica_integer) 1) + _instLevel), mmc_mk_integer(_context), mmc_mk_none(), tmpMeta13);
          omc_NFClassTree_ClassTree_applyLocalComponents(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure12_NFInst_instComponent,tmpMeta12));

          _cls_tree = omc_NFClassTree_ClassTree_replaceDuplicates(threadData, _cls_tree);

          omc_NFClassTree_ClassTree_checkDuplicates(threadData, _cls_tree);

          omc_NFInstNode_InstNode_updateClass(threadData, omc_NFClass_setClassTree(threadData, _cls_tree, _inst_cls), _node);

          omc_NFRestriction_checkClass(threadData, _node, _res, _context);
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,7) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          _node = omc_NFClassTree_ClassTree_instantiate(threadData, _node, _parent, _OMC_LIT198 ,&_par, NULL, NULL);

          tmpMeta14 = mmc_mk_box2(5, &NFInstNode_InstNodeType_DERIVED__CLASS__desc, omc_NFInstNode_InstNode_nodeType(threadData, _node));
          _node = omc_NFInstNode_InstNode_setNodeType(threadData, tmpMeta14, _node);

          /* Pattern-matching assignment */
          tmpMeta15 = omc_NFInstNode_InstNode_getClass(threadData, _node);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,4,7) == 0) goto goto_1;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
          _base_node = tmpMeta16;

          _mod = omc_NFInst_instElementModifier(threadData, omc_NFInstNode_InstNode_definition(threadData, _node), _node, omc_NFInstNode_InstNode_rootParent(threadData, _node));

          _mod = omc_NFModifier_Modifier_propagate(threadData, _mod, _node, _par);

          _mod = omc_NFModifier_Modifier_merge(threadData, _mod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 4))), _OMC_LIT131);

          _outer_mod = omc_NFModifier_Modifier_propagate(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 3))), _node, _par);

          _outer_mod = omc_NFModifier_Modifier_merge(threadData, _outerMod, _outer_mod, _OMC_LIT131);

          _mod = omc_NFModifier_Modifier_merge(threadData, _outer_mod, _mod, _OMC_LIT131);

          _attrs = omc_NFAttributes_updateClassConnectorType(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 8))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 7))));

          _attributes = omc_NFAttributes_mergeDerivedAttributes(threadData, _attrs, _attributes, _parent);

          _base_node = omc_NFInst_instClass(threadData, _base_node, _mod, _attributes, _useBinding, _instLevel, _par, _context ,&_attributes);

          tmpMeta17 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta17), MMC_UNTAGPTR(_cls), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta17))[2] = _base_node;
          _cls = tmpMeta17;

          tmpMeta18 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta18), MMC_UNTAGPTR(_cls), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta18))[7] = _attributes;
          _cls = tmpMeta18;

          tmpMeta19 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta19), MMC_UNTAGPTR(_cls), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta19))[5] = arrayCopy((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 5))));
          _cls = tmpMeta19;

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);

          omc_NFInst_updateComponentType(threadData, _parent, _node);
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,5) == 0) goto tmp2_end;
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,5,0) == 0) goto tmp2_end;
          /* Pattern matching succeeded */
          tmpMeta21 = mmc_mk_box4(9, &NFClass_INSTANCED__BUILTIN__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 6))));
          _inst_cls = tmpMeta21;

          omc_NFInst_applyModifier(threadData, _outerMod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 3))), _node, _context);

          _node = omc_NFInstNode_InstNode_replaceClass(threadData, _inst_cls, _node);

          omc_NFInst_updateComponentType(threadData, _parent, _node);

          omc_NFInst_instExternalObjectStructors(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 2))), _parent, _context);
          goto tmp2_done;
        }
        case 3: {
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,5) == 0) goto tmp2_end;
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
          _ty = tmpMeta22;
          _res = tmpMeta23;
          /* Pattern matching succeeded */
          _node = omc_NFClassTree_ClassTree_instantiate(threadData, _node, _parent, _OMC_LIT198 ,&_par, NULL, NULL);

          omc_NFInst_updateComponentType(threadData, _parent, _node);

          _cls_tree = omc_NFClass_classTree(threadData, omc_NFInstNode_InstNode_getClass(threadData, _node));

          _mod = omc_NFInst_instElementModifier(threadData, omc_NFInstNode_InstNode_definition(threadData, _node), _node, omc_NFInstNode_InstNode_parent(threadData, _node));

          _outer_mod = omc_NFModifier_Modifier_merge(threadData, _outerMod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 4))), _OMC_LIT131);

          _mod = omc_NFModifier_Modifier_merge(threadData, _outer_mod, _mod, _OMC_LIT131);

          omc_NFInst_applyModifier(threadData, _mod, _cls_tree, _node, _context);

          tmpMeta24 = mmc_mk_box4(9, &NFClass_INSTANCED__BUILTIN__desc, _ty, _cls_tree, _res);
          _inst_cls = tmpMeta24;

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _inst_cls, _node);
          goto tmp2_done;
        }
        case 4: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,5) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          _node = omc_NFInstNode_InstNode_replaceClass(threadData, _OMC_LIT254, _node);

          _node = omc_NFInstNode_InstNode_setNodeType(threadData, _OMC_LIT255, _node);

          _node = omc_NFInst_expand(threadData, _node, _context);

          _node = omc_NFInst_instClass(threadData, _node, _outerMod, _attributes, _useBinding, _instLevel, _parent, _context, NULL);

          omc_NFInst_updateComponentType(threadData, _parent, _node);
          goto tmp2_done;
        }
        case 5: {
          
          /* Pattern matching succeeded */
          omc_Error_assertion(threadData, 0 /* false */, _OMC_LIT256, _OMC_LIT257);
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  if (out_node) { *out_node = _node; }
  return _attributes;
}
modelica_metatype boxptr_NFInst_instClassDef(threadData_t *threadData, modelica_metatype _cls, modelica_metatype _outerMod, modelica_metatype __omcQ_24in_5Fattributes, modelica_metatype _useBinding, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _parent, modelica_metatype _instLevel, modelica_metatype _context, modelica_metatype *out_node)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype _attributes = NULL;
  tmp1 = mmc_unbox_integer(_useBinding);
  tmp2 = mmc_unbox_integer(_instLevel);
  tmp3 = mmc_unbox_integer(_context);
  _attributes = omc_NFInst_instClassDef(threadData, _cls, _outerMod, __omcQ_24in_5Fattributes, tmp1, __omcQ_24in_5Fnode, _parent, tmp2, tmp3, out_node);
  /* skip box _attributes; NFAttributes */
  /* skip box _node; NFInstNode.InstNode */
  return _attributes;
}

DLLDirection
modelica_metatype omc_NFInst_instClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _modifier, modelica_metatype __omcQ_24in_5Fattributes, modelica_boolean _useBinding, modelica_integer _instLevel, modelica_metatype _parent, modelica_integer _context, modelica_metatype *out_attributes)
{
  modelica_metatype _node = NULL;
  modelica_metatype _attributes = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _outer_mod = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  _attributes = __omcQ_24in_5Fattributes;
  // _cls has no default value.
  // _outer_mod has no default value.
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);

  _outer_mod = omc_NFClass_getModifier(threadData, _cls);

  if(omc_NFModifier_Modifier_hasBinding(threadData, _outer_mod))
  {
    tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), MMC_REFSTRUCTLIT(mmc_nil));
    omc_Error_addSourceMessage(threadData, _OMC_LIT260, tmpMeta1, omc_NFBinding_getInfo(threadData, omc_NFModifier_Modifier_binding(threadData, _outer_mod)));

    MMC_THROW_INTERNAL();
  }

  _attributes = omc_NFInst_instClassDef(threadData, _cls, _modifier, _attributes, _useBinding, _node, _parent, _instLevel, _context ,&_node);
  _return: OMC_LABEL_UNUSED
  if (out_attributes) { *out_attributes = _attributes; }
  return _node;
}
modelica_metatype boxptr_NFInst_instClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _modifier, modelica_metatype __omcQ_24in_5Fattributes, modelica_metatype _useBinding, modelica_metatype _instLevel, modelica_metatype _parent, modelica_metatype _context, modelica_metatype *out_attributes)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_useBinding);
  tmp2 = mmc_unbox_integer(_instLevel);
  tmp3 = mmc_unbox_integer(_context);
  _node = omc_NFInst_instClass(threadData, __omcQ_24in_5Fnode, _modifier, __omcQ_24in_5Fattributes, tmp1, tmp2, _parent, tmp3, out_attributes);
  /* skip box _node; NFInstNode.InstNode */
  /* skip box _attributes; NFAttributes */
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_expandClassDerivedComplex(threadData_t *threadData, modelica_metatype _element, modelica_metatype _definition, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _info)
{
  modelica_metatype _node = NULL;
  modelica_metatype _ty_path = NULL;
  modelica_metatype _prefs = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _res = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _ty_path has no default value.
  // _prefs has no default value.
  // _ty has no default value.
  // _res has no default value.
  // _cls has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _definition;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,2,3) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta2,1,3) == 0) MMC_THROW_INTERNAL();
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
  _ty_path = tmpMeta3;

  { /* match expression */
    modelica_metatype tmp7_1;
    tmp7_1 = _ty_path;
    {
      volatile mmc_switch_type tmp7;
      int tmp8;
      tmp7 = 0;
      for (; tmp7 < 2; tmp7++) {
        switch (MMC_SWITCH_CAST(tmp7)) {
        case 0: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp7_1,1,1) == 0) goto tmp6_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp7_1), 2));
          if (11 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT264), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp6_end;
          /* Pattern matching succeeded */
          tmpMeta10 = mmc_mk_box2(17, &NFType_POLYMORPHIC__desc, omc_NFInstNode_InstNode_name(threadData, _node));
          tmpMeta4 = tmpMeta10;
          goto tmp6_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          
          /* Pattern matching succeeded */
          tmpMeta11 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _ty_path, _OMC_LIT5, 1 /* true */, 0 /* false */), mmc_mk_cons(omc_NFInstNode_InstNode_scopeName(threadData, _node), MMC_REFSTRUCTLIT(mmc_nil)));
          omc_Error_addSourceMessage(threadData, _OMC_LIT263, tmpMeta11, _info);
          goto goto_5;
          goto tmp6_done;
        }
        }
        goto tmp6_end;
        tmp6_end: ;
      }
      goto goto_5;
      goto_5:;
      MMC_THROW_INTERNAL();
      goto tmp6_done;
      tmp6_done:;
    }
  }
  _ty = tmpMeta4;

  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);

  _prefs = omc_NFClass_getPrefixes(threadData, _cls);

  _res = omc_NFRestriction_fromSCode(threadData, omc_SCodeUtil_getClassRestriction(threadData, _element));

  tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta16 = mmc_mk_box7(3, &NFClassTree_ClassTree_PARTIAL__TREE__desc, _OMC_LIT265, listArray(tmpMeta12), listArray(tmpMeta13), listArray(tmpMeta14), listArray(tmpMeta15), _OMC_LIT266);
  tmpMeta17 = mmc_mk_box6(5, &NFClass_PARTIAL__BUILTIN__desc, _ty, tmpMeta16, _OMC_LIT88, _prefs, _res);
  _cls = tmpMeta17;

  _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);
  _return: OMC_LABEL_UNUSED
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_expandClassDerived(threadData_t *threadData, modelica_metatype _element, modelica_metatype _definition, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _context, modelica_metatype _info)
{
  modelica_metatype _node = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _ext_node = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _prefs = NULL;
  modelica_metatype _sattrs = NULL;
  modelica_metatype _attrs = NULL;
  modelica_metatype _dims = NULL;
  modelica_metatype _mod = NULL;
  modelica_metatype _cc_mod = NULL;
  modelica_metatype _res = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta14;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _ty has no default value.
  // _ext_node has no default value.
  // _cls has no default value.
  // _prefs has no default value.
  // _sattrs has no default value.
  // _attrs has no default value.
  // _dims has no default value.
  // _mod has no default value.
  // _cc_mod has no default value.
  // _res has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _definition;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,2,3) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  _ty = tmpMeta2;
  _sattrs = tmpMeta3;

  /* Pattern-matching assignment */
  tmpMeta4 = omc_NFLookup_lookupBaseClassName(threadData, omc_AbsynUtil_typeSpecPath(threadData, _ty), omc_NFInstNode_InstNode_parent(threadData, _node), _context, _info);
  if (listEmpty(tmpMeta4)) MMC_THROW_INTERNAL();
  tmpMeta5 = MMC_CAR(tmpMeta4);
  tmpMeta6 = MMC_CDR(tmpMeta4);
  _ext_node = tmpMeta5;

  if(referenceEq(_ext_node, _node))
  {
    tmpMeta7 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(omc_Dump_unparseTypeSpec(threadData, _ty), MMC_REFSTRUCTLIT(mmc_nil)));
    omc_Error_addSourceMessage(threadData, _OMC_LIT269, tmpMeta7, _info);

    MMC_THROW_INTERNAL();
  }

  _ext_node = omc_NFInst_expand(threadData, _ext_node, _context);

  _ext_node = omc_NFInstNode_InstNode_clone(threadData, _ext_node);

  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);

  _prefs = omc_NFClass_getPrefixes(threadData, _cls);

  if(((!omc_NFClass_Prefixes_isPartial(threadData, _prefs)) && omc_NFInstNode_InstNode_isPartial(threadData, _ext_node)))
  {
    tmpMeta8 = MMC_TAGPTR(mmc_alloc_words(7));
    memcpy(MMC_UNTAGPTR(tmpMeta8), MMC_UNTAGPTR(_prefs), 7*sizeof(modelica_metatype));
    ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta8))[3] = _OMC_LIT270;
    _prefs = tmpMeta8;
  }

  _attrs = omc_NFAttributes_fromDerivedSCode(threadData, _sattrs);

  {
    modelica_metatype __omcQ_24tmpVar29;
    modelica_metatype* tmp10;
    modelica_metatype tmpMeta11;
    modelica_metatype tmpMeta12;
    modelica_metatype __omcQ_24tmpVar28;
    modelica_integer tmp13;
    modelica_metatype _d_loopVar = 0;
    modelica_metatype _d;
    _d_loopVar = omc_AbsynUtil_typeSpecDimensions(threadData, _ty);
    tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar29 = tmpMeta11; /* defaultValue */
    tmp10 = &__omcQ_24tmpVar29;
    while(1) {
      tmp13 = 1;
      if (!listEmpty(_d_loopVar)) {
        _d = MMC_CAR(_d_loopVar);
        _d_loopVar = MMC_CDR(_d_loopVar);
        tmp13--;
      }
      if (tmp13 == 0) {
        tmpMeta12 = mmc_mk_box3(3, &NFDimension_RAW__DIM__desc, _d, omc_NFInstNode_InstNode_parent(threadData, _node));
        __omcQ_24tmpVar28 = tmpMeta12;
        *tmp10 = mmc_mk_cons(__omcQ_24tmpVar28,0);
        tmp10 = &MMC_CDR(*tmp10);
      } else if (tmp13 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp10 = mmc_mk_nil();
    tmpMeta9 = __omcQ_24tmpVar29;
  }
  _dims = tmpMeta9;

  _mod = omc_NFClass_getModifier(threadData, _cls);

  _cc_mod = omc_NFClass_getCCModifier(threadData, _cls);

  _res = omc_NFRestriction_fromSCode(threadData, omc_SCodeUtil_getClassRestriction(threadData, _element));

  tmpMeta14 = mmc_mk_box8(7, &NFClass_EXPANDED__DERIVED__desc, _ext_node, _mod, _cc_mod, listArray(_dims), _prefs, _attrs, _res);
  _cls = tmpMeta14;

  _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_expandClassDerived(threadData_t *threadData, modelica_metatype _element, modelica_metatype _definition, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _context, modelica_metatype _info)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _node = omc_NFInst_expandClassDerived(threadData, _element, _definition, __omcQ_24in_5Fnode, tmp1, _info);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

DLLDirection
void omc_NFInst_checkElementNotReplaceable(threadData_t *threadData, modelica_metatype _node)
{
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if(omc_SCodeUtil_isElementReplaceable(threadData, omc_NFInstNode_InstNode_definition(threadData, _node)))
  {
    tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), MMC_REFSTRUCTLIT(mmc_nil));
    omc_Error_addSourceMessage(threadData, _OMC_LIT273, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _node));

    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_makeExternalObjectType(threadData_t *threadData, modelica_metatype _tree, modelica_metatype _node)
{
  modelica_metatype _ty = NULL;
  modelica_metatype _base_path = NULL;
  modelica_metatype _constructor = NULL;
  modelica_metatype _destructor = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ty has no default value.
  // _base_path has no default value.
  _constructor = _OMC_LIT198;
  _destructor = _OMC_LIT198;
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _tree;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_integer tmp10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta27;
          modelica_integer tmp28;
          modelica_integer tmp29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,6) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _comp;
            for (tmpMeta6 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_tree), 4))), tmp10 = arrayLength(tmpMeta6), tmp9 = 1; tmp9 <= tmp10; tmp9++)
            {
              _comp = arrayGet(tmpMeta6,tmp9);
              if(omc_NFInstNode_InstNode_isComponent(threadData, _comp))
              {
                tmpMeta7 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _comp), MMC_REFSTRUCTLIT(mmc_nil)));
                omc_Error_addSourceMessage(threadData, _OMC_LIT276, tmpMeta7, omc_NFInstNode_InstNode_info(threadData, _comp));

                goto goto_2;
              }
            }
          }

          if((arrayLength((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_tree), 5)))) > ((modelica_integer) 1)))
          {
            {
              modelica_metatype _ext;
              for (tmpMeta11 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_tree), 5))), tmp20 = arrayLength(tmpMeta11), tmp19 = 1; tmp19 <= tmp20; tmp19++)
              {
                _ext = arrayGet(tmpMeta11,tmp19);
                if(((!stringEqual(omc_NFInstNode_InstNode_name(threadData, _ext), _OMC_LIT278)) && (omc_NFClassTree_ClassTree_recursiveElementCount(threadData, omc_NFClass_classTree(threadData, omc_NFInstNode_InstNode_getClass(threadData, _ext))) != ((modelica_integer) 0))))
                {
                  /* Pattern-matching assignment */
                  tmpMeta12 = _ext;
                  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,7) == 0) goto goto_2;
                  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 8));
                  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,3) == 0) goto goto_2;
                  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
                  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,5) == 0) goto goto_2;
                  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
                  _base_path = tmpMeta15;

                  tmpMeta17 = stringAppend(_OMC_LIT277,omc_AbsynUtil_pathString(threadData, _base_path, _OMC_LIT5, 1 /* true */, 0 /* false */));
                  tmpMeta16 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(tmpMeta17, MMC_REFSTRUCTLIT(mmc_nil)));
                  omc_Error_addSourceMessage(threadData, _OMC_LIT276, tmpMeta16, omc_NFInstNode_InstNode_info(threadData, _ext));

                  goto goto_2;
                }
              }
            }
          }

          {
            modelica_metatype _cls;
            for (tmpMeta21 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_tree), 3))), tmp29 = arrayLength(tmpMeta21), tmp28 = 1; tmp28 <= tmp29; tmp28++)
            {
              _cls = arrayGet(tmpMeta21,tmp28);
              { /* match expression */
                modelica_string tmp24_1;
                tmp24_1 = omc_NFInstNode_InstNode_name(threadData, _cls);
                {
                  volatile mmc_switch_type tmp24;
                  int tmp25;
                  tmp24 = 0;
                  for (; tmp24 < 3; tmp24++) {
                    switch (MMC_SWITCH_CAST(tmp24)) {
                    case 0: {
                      if (11 != MMC_STRLEN(tmp24_1) || strcmp(MMC_STRINGDATA(_OMC_LIT279), MMC_STRINGDATA(tmp24_1)) != 0) goto tmp23_end;
                      /* Pattern matching succeeded */
                      /* Check guard condition after assignments */
                      if (!omc_SCodeUtil_isFunction(threadData, omc_NFInstNode_InstNode_definition(threadData, _cls))) goto tmp23_end;
                      omc_NFInst_checkElementNotReplaceable(threadData, _cls);

                      _constructor = _cls;
                      goto tmp23_done;
                    }
                    case 1: {
                      if (10 != MMC_STRLEN(tmp24_1) || strcmp(MMC_STRINGDATA(_OMC_LIT280), MMC_STRINGDATA(tmp24_1)) != 0) goto tmp23_end;
                      /* Pattern matching succeeded */
                      /* Check guard condition after assignments */
                      if (!omc_SCodeUtil_isFunction(threadData, omc_NFInstNode_InstNode_definition(threadData, _cls))) goto tmp23_end;
                      omc_NFInst_checkElementNotReplaceable(threadData, _cls);

                      _destructor = _cls;
                      goto tmp23_done;
                    }
                    case 2: {
                      modelica_metatype tmpMeta26;
                      
                      /* Pattern matching succeeded */
                      tmpMeta26 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _cls), MMC_REFSTRUCTLIT(mmc_nil)));
                      omc_Error_addSourceMessage(threadData, _OMC_LIT276, tmpMeta26, omc_NFInstNode_InstNode_info(threadData, _cls));
                      goto goto_22;
                      goto tmp23_done;
                    }
                    }
                    goto tmp23_end;
                    tmp23_end: ;
                  }
                  goto goto_22;
                  goto_22:;
                  goto goto_2;
                  goto tmp23_done;
                  tmp23_done:;
                }
              }
              ;
            }
          }

          if(omc_NFInstNode_InstNode_isEmpty(threadData, _constructor))
          {
            tmpMeta30 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(_OMC_LIT279, MMC_REFSTRUCTLIT(mmc_nil)));
            omc_Error_addSourceMessage(threadData, _OMC_LIT283, tmpMeta30, omc_NFInstNode_InstNode_info(threadData, _node));

            goto goto_2;
          }

          if(omc_NFInstNode_InstNode_isEmpty(threadData, _destructor))
          {
            tmpMeta31 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _node), mmc_mk_cons(_OMC_LIT280, MMC_REFSTRUCTLIT(mmc_nil)));
            omc_Error_addSourceMessage(threadData, _OMC_LIT283, tmpMeta31, omc_NFInstNode_InstNode_info(threadData, _node));

            goto goto_2;
          }
          tmpMeta32 = mmc_mk_box3(8, &NFComplexType_EXTERNAL__OBJECT__desc, _constructor, _destructor);
          tmpMeta1 = tmpMeta32;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _ty = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _ty;
}

DLLDirection
void omc_NFInst_checkBuiltinTypeExtends(threadData_t *threadData, modelica_metatype _builtinExtends, modelica_metatype _tree, modelica_metatype _node)
{
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if(((omc_NFClassTree_ClassTree_componentCount(threadData, _tree) > ((modelica_integer) 0)) || (omc_NFClassTree_ClassTree_extendsCount(threadData, _tree) > ((modelica_integer) 1))))
  {
    tmpMeta1 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _builtinExtends), MMC_REFSTRUCTLIT(mmc_nil));
    omc_Error_addSourceMessage(threadData, _OMC_LIT238, tmpMeta1, omc_NFInstNode_InstNode_info(threadData, _node));

    MMC_THROW_INTERNAL();
  }
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_expandExternalObject(threadData_t *threadData, modelica_metatype _clsTree, modelica_metatype __omcQ_24in_5Fnode)
{
  modelica_metatype _node = NULL;
  modelica_metatype _eo_ty = NULL;
  modelica_metatype _c = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _eo_ty has no default value.
  // _c has no default value.
  _eo_ty = omc_NFInst_makeExternalObjectType(threadData, _clsTree, _node);

  tmpMeta1 = mmc_mk_box3(14, &NFType_COMPLEX__desc, _node, _eo_ty);
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta5 = mmc_mk_box6(6, &NFClassTree_ClassTree_FLAT__TREE__desc, _OMC_LIT265, listArray(tmpMeta2), listArray(tmpMeta3), listArray(tmpMeta4), _OMC_LIT266);
  tmpMeta6 = mmc_mk_box6(5, &NFClass_PARTIAL__BUILTIN__desc, tmpMeta1, tmpMeta5, _OMC_LIT88, _OMC_LIT289, _OMC_LIT290);
  _c = tmpMeta6;

  _node = omc_NFInstNode_InstNode_updateClass(threadData, _c, _node);
  _return: OMC_LABEL_UNUSED
  return _node;
}

DLLDirection
void omc_NFInst_checkReplaceableBaseClass(threadData_t *threadData, modelica_metatype _baseClasses, modelica_metatype _basePath, modelica_metatype _info)
{
  modelica_integer _i;
  modelica_integer _pos;
  modelica_string _name = NULL;
  modelica_metatype _rest = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_integer tmp4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _i = ((modelica_integer) 0);
  // _pos has no default value.
  // _name has no default value.
  // _rest has no default value.
  {
    modelica_metatype _base;
    for (tmpMeta1 = _baseClasses; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _base = MMC_CAR(tmpMeta1);
      _i = ((modelica_integer) 1) + _i;

      if(omc_SCodeUtil_isElementReplaceable(threadData, omc_NFInstNode_InstNode_definition(threadData, _base)))
      {
        if((listLength(_baseClasses) > ((modelica_integer) 1)))
        {
          _rest = _baseClasses;

          _name = _OMC_LIT131;

          tmp4 = ((modelica_integer) 1); tmp5 = 1; tmp6 = ((modelica_integer) -1) + _i;
          if(!(((tmp5 > 0) && (tmp4 > tmp6)) || ((tmp5 < 0) && (tmp4 < tmp6))))
          {
            modelica_integer _j;
            for(_j = ((modelica_integer) 1); in_range_integer(_j, tmp4, tmp6); _j += tmp5)
            {
              tmpMeta2 = stringAppend(_OMC_LIT5,omc_NFInstNode_InstNode_name(threadData, listHead(_rest)));
              tmpMeta3 = stringAppend(tmpMeta2,_name);
              _name = tmpMeta3;

              _rest = listRest(_rest);
            }
          }

          tmpMeta7 = stringAppend(_OMC_LIT291,omc_NFInstNode_InstNode_name(threadData, listHead(_rest)));
          tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT292);
          tmpMeta9 = stringAppend(tmpMeta8,_name);
          _name = tmpMeta9;

          _rest = listRest(_rest);

          {
            modelica_metatype _n;
            for (tmpMeta10 = _rest; !listEmpty(tmpMeta10); tmpMeta10=MMC_CDR(tmpMeta10))
            {
              _n = MMC_CAR(tmpMeta10);
              tmpMeta11 = stringAppend(omc_NFInstNode_InstNode_name(threadData, _n),_OMC_LIT5);
              tmpMeta12 = stringAppend(tmpMeta11,_name);
              _name = tmpMeta12;
            }
          }
        }
        else
        {
          _name = omc_AbsynUtil_pathString(threadData, _basePath, _OMC_LIT5, 1 /* true */, 0 /* false */);
        }

        tmpMeta14 = mmc_mk_cons(omc_NFInstNode_InstNode_name(threadData, _base), mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil)));
        tmpMeta15 = mmc_mk_cons(omc_NFInstNode_InstNode_info(threadData, _base), mmc_mk_cons(_info, MMC_REFSTRUCTLIT(mmc_nil)));
        omc_Error_addMultiSourceMessage(threadData, _OMC_LIT295, tmpMeta14, tmpMeta15);

        MMC_THROW_INTERNAL();
      }
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_NFInst_checkExtendsLoop(threadData_t *threadData, modelica_metatype _node, modelica_metatype _scope, modelica_metatype _path, modelica_metatype _info)
{
  modelica_metatype _parent = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _parent has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = omc_NFInstNode_InstNode_getClass(threadData, _node);
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,0,6) == 0) goto tmp2_end;
          
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT5, 1 /* true */, 0 /* false */), MMC_REFSTRUCTLIT(mmc_nil));
          omc_Error_addSourceMessage(threadData, _OMC_LIT298, tmpMeta6, _info);
          goto goto_1;
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          
          /* Pattern matching succeeded */
          _parent = _scope;

          while(1)
          {
            if(!(!omc_NFInstNode_InstNode_isTopScope(threadData, _parent))) break;
            if(omc_NFInstNode_InstNode_refEqual(threadData, _parent, _node))
            {
              tmpMeta7 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT5, 1 /* true */, 0 /* false */), MMC_REFSTRUCTLIT(mmc_nil));
              omc_Error_addSourceMessage(threadData, _OMC_LIT298, tmpMeta7, _info);

              goto goto_1;
            }

            _parent = omc_NFInstNode_InstNode_parentScope(threadData, _parent, 0 /* false */);
          }
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_expandExtends(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fext, modelica_metatype __omcQ_24in_5FbuiltinExt, modelica_integer _context, modelica_metatype _nameMap, modelica_metatype *out_builtinExt)
{
  modelica_metatype _ext = NULL;
  modelica_metatype _builtinExt = NULL;
  modelica_metatype _def = NULL;
  modelica_metatype _base_path = NULL;
  modelica_metatype _base_nodes = NULL;
  modelica_metatype _scope = NULL;
  modelica_metatype _base_node = NULL;
  modelica_metatype _vis = NULL;
  modelica_metatype _smod = NULL;
  modelica_metatype _ann = NULL;
  modelica_metatype _info = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _ext = __omcQ_24in_5Fext;
  _builtinExt = __omcQ_24in_5FbuiltinExt;
  // _def has no default value.
  // _base_path has no default value.
  // _base_nodes has no default value.
  // _scope has no default value.
  // _base_node has no default value.
  // _vis has no default value.
  // _smod has no default value.
  // _ann has no default value.
  // _info has no default value.
  if(omc_NFInstNode_InstNode_isEmpty(threadData, _ext))
  {
    goto _return;
  }

  _def = omc_NFInstNode_InstNode_definition(threadData, _ext);

  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _def;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,5) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 4));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 5));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
          _base_path = tmpMeta5;
          _vis = tmpMeta6;
          _smod = tmpMeta7;
          _ann = tmpMeta8;
          _info = tmpMeta9;
          /* Pattern matching succeeded */
          _scope = omc_NFInstNode_InstNode_parent(threadData, _ext);

          /* Pattern-matching assignment */
          tmpMeta10 = omc_NFLookup_lookupBaseClassName(threadData, _base_path, _scope, _context, _info);
          if (listEmpty(tmpMeta10)) goto goto_1;
          tmpMeta11 = MMC_CAR(tmpMeta10);
          tmpMeta12 = MMC_CDR(tmpMeta10);
          _base_nodes = tmpMeta10;
          _base_node = tmpMeta11;

          omc_NFInst_checkExtendsLoop(threadData, _base_node, _scope, _base_path, _info);

          omc_NFInst_checkReplaceableBaseClass(threadData, _base_nodes, _base_path, _info);

          if((omc_NFInstNode_InstNode_isRootClass(threadData, _scope) && omc_SCodeUtil_isEmptyMod(threadData, _smod)))
          {
            _base_node = omc_NFInstUtil_mergeScalars(threadData, _base_node, _base_path, 0 /* false */, _nameMap);
          }

          _base_node = omc_NFInst_expand(threadData, _base_node, _context);

          tmpMeta13 = mmc_mk_box4(4, &NFInstNode_InstNodeType_BASE__CLASS__desc, _scope, _def, omc_NFInstNode_InstNode_nodeType(threadData, _base_node));
          _ext = omc_NFInstNode_InstNode_setNodeType(threadData, tmpMeta13, _base_node);

          if((omc_NFInstNode_InstNode_isBuiltin(threadData, _base_node) || omc_NFClass_isBuiltin(threadData, omc_NFInstNode_InstNode_getClass(threadData, _base_node))))
          {
            _builtinExt = _ext;
          }
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  if (out_builtinExt) { *out_builtinExt = _builtinExt; }
  return _ext;
}
modelica_metatype boxptr_NFInst_expandExtends(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fext, modelica_metatype __omcQ_24in_5FbuiltinExt, modelica_metatype _context, modelica_metatype _nameMap, modelica_metatype *out_builtinExt)
{
  modelica_integer tmp1;
  modelica_metatype _ext = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _ext = omc_NFInst_expandExtends(threadData, __omcQ_24in_5Fext, __omcQ_24in_5FbuiltinExt, tmp1, _nameMap, out_builtinExt);
  /* skip box _ext; NFInstNode.InstNode */
  /* skip box _builtinExt; NFInstNode.InstNode */
  return _ext;
}

static modelica_metatype closure13_NFInst_expandExtends(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_ext, modelica_metatype $in_builtinExt, modelica_metatype tmp6)
{
  modelica_metatype context = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype nameMap = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_NFInst_expandExtends(thData, $in_ext, $in_builtinExt, context, nameMap, tmp6);
}
DLLDirection
modelica_metatype omc_NFInst_expandClassParts(threadData_t *threadData, modelica_metatype _def, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _context, modelica_metatype _info, modelica_metatype *out_nameMap)
{
  modelica_metatype _node = NULL;
  modelica_metatype _nameMap = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _cls_tree = NULL;
  modelica_metatype _mod = NULL;
  modelica_metatype _cc_mod = NULL;
  modelica_metatype _builtin_ext = NULL;
  modelica_metatype _prefs = NULL;
  modelica_metatype _res = NULL;
  modelica_metatype _name_map = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _nameMap has no default value.
  // _cls has no default value.
  // _cls_tree has no default value.
  // _mod has no default value.
  // _cc_mod has no default value.
  // _builtin_ext has no default value.
  // _prefs has no default value.
  // _res has no default value.
  // _name_map has no default value.
  _cls = omc_NFInstNode_InstNode_getClass(threadData, _node);

  _cls = omc_NFClass_initExpandedClass(threadData, _cls);

  _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);

  /* Pattern-matching assignment */
  tmpMeta1 = _cls;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,3,5) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  _cls_tree = tmpMeta2;
  _mod = tmpMeta3;
  _cc_mod = tmpMeta4;
  _prefs = tmpMeta5;

  if((omc_NFClassTree_ClassTree_extendsCount(threadData, _cls_tree) > ((modelica_integer) 0)))
  {
    _name_map = omc_NFInstUtil_makeMergeNameMap(threadData);

    tmpMeta7 = mmc_mk_box2(0, mmc_mk_integer(_context), _name_map);
    _builtin_ext = omc_NFClassTree_ClassTree_mapFoldExtends(threadData, _cls_tree, (modelica_fnptr) mmc_mk_box2(0,closure13_NFInst_expandExtends,tmpMeta7), _OMC_LIT198);

    _nameMap = (omc_UnorderedMap_isEmpty(threadData, _name_map)?mmc_mk_none():mmc_mk_some(_name_map));
  }
  else
  {
    _builtin_ext = _OMC_LIT198;

    _nameMap = mmc_mk_none();
  }

  if((stringEqual(omc_NFInstNode_InstNode_name(threadData, _builtin_ext), _OMC_LIT278)))
  {
    _node = omc_NFInst_expandExternalObject(threadData, _cls_tree, _node);
  }
  else
  {
    if((!omc_NFInstNode_InstNode_isEmpty(threadData, _builtin_ext)))
    {
      omc_NFInst_checkBuiltinTypeExtends(threadData, _builtin_ext, _cls_tree, _node);
    }

    _cls_tree = omc_NFClassTree_ClassTree_expand(threadData, _cls_tree);

    _res = omc_NFRestriction_fromSCode(threadData, omc_SCodeUtil_getClassRestriction(threadData, _def));

    tmpMeta8 = mmc_mk_box6(6, &NFClass_EXPANDED__CLASS__desc, _cls_tree, _mod, _cc_mod, _prefs, _res);
    _cls = tmpMeta8;

    _node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _node);
  }
  _return: OMC_LABEL_UNUSED
  if (out_nameMap) { *out_nameMap = _nameMap; }
  return _node;
}
modelica_metatype boxptr_NFInst_expandClassParts(threadData_t *threadData, modelica_metatype _def, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _context, modelica_metatype _info, modelica_metatype *out_nameMap)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _node = omc_NFInst_expandClassParts(threadData, _def, __omcQ_24in_5Fnode, tmp1, _info, out_nameMap);
  /* skip box _node; NFInstNode.InstNode */
  /* skip box _nameMap; Option<UnorderedMap<String,Absyn.ComponentRef>> */
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_expandClass2(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  modelica_metatype _def = NULL;
  modelica_metatype _cdef = NULL;
  modelica_metatype _info = NULL;
  modelica_metatype _name_map = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  _def = omc_NFInstNode_InstNode_definition(threadData, _node);
  // _cdef has no default value.
  // _info has no default value.
  _name_map = mmc_mk_none();
  /* Pattern-matching assignment */
  tmpMeta1 = _def;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,2,8) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  _cdef = tmpMeta2;
  _info = tmpMeta3;

  { /* match expression */
    modelica_metatype tmp7_1;
    tmp7_1 = _cdef;
    {
      int tmp7;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp7_1))) {
        case 3: {
          
          /* Pattern matching succeeded */
          _node = omc_NFInst_expandClassParts(threadData, _def, _node, _context, _info ,&_name_map);

          if(isSome(_name_map))
          {
            omc_NFInstUtil_mergeScalarsComponentBindings(threadData, _node, omc_Util_getOption(threadData, _name_map));
          }
          tmpMeta4 = _node;
          goto tmp6_done;
        }
        case 4: {
          
          /* Pattern matching succeeded */
          _node = omc_NFInst_expandClassParts(threadData, _def, _node, _context, _info ,&_name_map);

          if(isSome(_name_map))
          {
            omc_NFInstUtil_mergeScalarsComponentBindings(threadData, _node, omc_Util_getOption(threadData, _name_map));
          }
          tmpMeta4 = _node;
          goto tmp6_done;
        }
        case 5: {
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          { /* match expression */
            modelica_metatype tmp11_1;
            tmp11_1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cdef), 2)));
            {
              volatile mmc_switch_type tmp11;
              int tmp12;
              tmp11 = 0;
              for (; tmp11 < 2; tmp11++) {
                switch (MMC_SWITCH_CAST(tmp11)) {
                case 0: {
                  if (mmc__uniontype__metarecord__typedef__equal(tmp11_1,1,3) == 0) goto tmp10_end;
                  
                  /* Pattern matching succeeded */
                  tmpMeta8 = omc_NFInst_expandClassDerivedComplex(threadData, _def, _cdef, _node, _info);
                  goto tmp10_done;
                }
                case 1: {
                  
                  /* Pattern matching succeeded */
                  tmpMeta8 = omc_NFInst_expandClassDerived(threadData, _def, _cdef, _node, _context, _info);
                  goto tmp10_done;
                }
                }
                goto tmp10_end;
                tmp10_end: ;
              }
              goto goto_9;
              goto_9:;
              goto goto_5;
              goto tmp10_done;
              tmp10_done:;
            }
          }tmpMeta4 = tmpMeta8;
          goto tmp6_done;
        }
        case 7: {
          
          /* Pattern matching succeeded */
          tmpMeta4 = _node;
          goto tmp6_done;
        }
        case 8: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          
          /* Pattern matching succeeded */
          tmpMeta13 = mmc_mk_box3(3, &Absyn_TypeSpec_TPATH__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cdef), 2))), mmc_mk_none());
          tmpMeta14 = mmc_mk_box4(5, &SCode_ClassDef_DERIVED__desc, tmpMeta13, _OMC_LIT299, _OMC_LIT305);
          tmpMeta4 = omc_NFInst_expandClassDerived(threadData, _def, tmpMeta14, _node, _context, _info);
          goto tmp6_done;
        }
        default:
        tmp6_default: OMC_LABEL_UNUSED; {
          modelica_metatype tmpMeta15;
          
          /* Pattern matching succeeded */
          tmpMeta15 = stringAppend(_OMC_LIT306,omc_SCodeDump_unparseElementStr(threadData, _def, _OMC_LIT206));
          omc_Error_assertion(threadData, 0 /* false */, tmpMeta15, _OMC_LIT307);
          goto goto_5;
          goto tmp6_done;
        }
        }
        goto tmp6_end;
        tmp6_end: ;
      }
      goto goto_5;
      goto_5:;
      MMC_THROW_INTERNAL();
      goto tmp6_done;
      tmp6_done:;
    }
  }
  _node = tmpMeta4;
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_expandClass2(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _node = omc_NFInst_expandClass2(threadData, __omcQ_24in_5Fnode, tmp1);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_expandClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = omc_NFInstNode_InstNode_getClass(threadData, _node);
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFInst_expandClass2(threadData, _node, _context);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _node;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _node = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_expandClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _node = omc_NFInst_expandClass(threadData, __omcQ_24in_5Fnode, tmp1);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_makeEnumerationType(threadData_t *threadData, modelica_metatype _literals, modelica_metatype _scope)
{
  modelica_metatype _ty = NULL;
  modelica_metatype _lits = NULL;
  modelica_metatype _path = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ty has no default value.
  // _lits has no default value.
  // _path has no default value.
  _path = omc_NFInstNode_InstNode_scopePath(threadData, _scope, 1, 0 /* false */);

  {
    modelica_metatype __omcQ_24tmpVar31;
    modelica_metatype* tmp2;
    modelica_metatype tmpMeta3;
    modelica_string __omcQ_24tmpVar30;
    modelica_integer tmp4;
    modelica_metatype _e_loopVar = 0;
    modelica_metatype _e;
    _e_loopVar = _literals;
    tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar31 = tmpMeta3; /* defaultValue */
    tmp2 = &__omcQ_24tmpVar31;
    while(1) {
      tmp4 = 1;
      if (!listEmpty(_e_loopVar)) {
        _e = MMC_CAR(_e_loopVar);
        _e_loopVar = MMC_CDR(_e_loopVar);
        tmp4--;
      }
      if (tmp4 == 0) {
        __omcQ_24tmpVar30 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 2)));
        *tmp2 = mmc_mk_cons(__omcQ_24tmpVar30,0);
        tmp2 = &MMC_CDR(*tmp2);
      } else if (tmp4 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp2 = mmc_mk_nil();
    tmpMeta1 = __omcQ_24tmpVar31;
  }
  _lits = tmpMeta1;

  tmpMeta5 = mmc_mk_box3(8, &NFType_ENUMERATION__desc, _path, _lits);
  _ty = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _ty;
}

DLLDirection
modelica_metatype omc_NFInst_instClassPrefixes(threadData_t *threadData, modelica_metatype _cls)
{
  modelica_metatype _prefixes = NULL;
  modelica_metatype _prefs = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _prefixes has no default value.
  // _prefs has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _cls;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,0) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,0) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,0) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,0) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,0) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT289;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _prefs = tmpMeta12;
          /* Pattern matching succeeded */
          tmpMeta13 = mmc_mk_box6(3, &NFClass_Prefixes_PREFIXES__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 4))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cls), 5))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_prefs), 4))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_prefs), 5))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_prefs), 6))));
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _prefixes = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _prefixes;
}

DLLDirection
modelica_metatype omc_NFInst_partialInstClass2(threadData_t *threadData, modelica_metatype _definition, modelica_metatype _scope)
{
  modelica_metatype _cls = NULL;
  modelica_metatype _cdef = NULL;
  modelica_metatype _ce_cdef = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _prefs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _cls has no default value.
  // _cdef has no default value.
  // _ce_cdef has no default value.
  // _ty has no default value.
  // _prefs has no default value.
  omc_Error_assertion(threadData, omc_SCodeUtil_elementIsClass(threadData, _definition), _OMC_LIT308, _OMC_LIT309);

  /* Pattern-matching assignment */
  tmpMeta1 = _definition;
  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,2,8) == 0) MMC_THROW_INTERNAL();
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  _cdef = tmpMeta2;

  _prefs = omc_NFInst_instClassPrefixes(threadData, _definition);

  { /* match expression */
    modelica_metatype tmp6_1;
    tmp6_1 = _cdef;
    {
      volatile mmc_switch_type tmp6;
      int tmp7;
      tmp6 = 0;
      for (; tmp6 < 4; tmp6++) {
        switch (MMC_SWITCH_CAST(tmp6)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,0,8) == 0) goto tmp5_end;
          
          /* Pattern matching succeeded */
          tmpMeta3 = omc_NFClass_fromSCode(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cdef), 2))), 0 /* false */, _scope, _prefs);
          goto tmp5_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,1,2) == 0) goto tmp5_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,8) == 0) goto tmp5_end;
          
          _ce_cdef = tmpMeta8;
          /* Pattern matching succeeded */
          if((!omc_SCodeUtil_isElementRedeclare(threadData, _definition)))
          {
            tmpMeta9 = mmc_mk_cons(omc_SCodeUtil_elementName(threadData, _definition), MMC_REFSTRUCTLIT(mmc_nil));
            omc_Error_addSourceMessage(threadData, _OMC_LIT312, tmpMeta9, omc_SCodeUtil_elementInfo(threadData, _definition));
          }
          tmpMeta3 = omc_NFClass_fromSCode(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_ce_cdef), 2))), 1 /* true */, _scope, _prefs);
          goto tmp5_done;
        }
        case 2: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,3,1) == 0) goto tmp5_end;
          
          /* Pattern matching succeeded */
          _ty = omc_NFInst_makeEnumerationType(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cdef), 2))), _scope);
          tmpMeta3 = omc_NFClass_fromEnumeration(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_cdef), 2))), _ty, _prefs, _scope);
          goto tmp5_done;
        }
        case 3: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          
          /* Pattern matching succeeded */
          tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta14 = mmc_mk_box7(3, &NFClassTree_ClassTree_PARTIAL__TREE__desc, _OMC_LIT265, listArray(tmpMeta10), listArray(tmpMeta11), listArray(tmpMeta12), listArray(tmpMeta13), _OMC_LIT266);
          tmpMeta15 = mmc_mk_box5(4, &NFClass_PARTIAL__CLASS__desc, tmpMeta14, _OMC_LIT88, _OMC_LIT88, _prefs);
          tmpMeta3 = tmpMeta15;
          goto tmp5_done;
        }
        }
        goto tmp5_end;
        tmp5_end: ;
      }
      goto goto_4;
      goto_4:;
      MMC_THROW_INTERNAL();
      goto tmp5_done;
      tmp5_done:;
    }
  }
  _cls = tmpMeta3;
  _return: OMC_LABEL_UNUSED
  return _cls;
}

DLLDirection
modelica_metatype omc_NFInst_partialInstClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode)
{
  modelica_metatype _node = NULL;
  modelica_metatype _c = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  // _c has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = omc_NFInstNode_InstNode_getClass(threadData, _node);
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,0) == 0) goto tmp2_end;
          /* Pattern matching succeeded */
          _c = omc_NFInst_partialInstClass2(threadData, omc_NFInstNode_InstNode_definition(threadData, _node), _node);

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _c, _node);

          _c = omc_NFClass_initImports(threadData, _c, _node);

          _node = omc_NFInstNode_InstNode_updateClass(threadData, _c, _node);
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_markBuiltinTypeNodesByAnnotation(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode)
{
  modelica_metatype _node = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  if(omc_SCodeUtil_hasBooleanNamedAnnotationInClass(threadData, omc_NFInstNode_InstNode_definition(threadData, _node), _OMC_LIT314))
  {
    _node = omc_NFInstNode_InstNode_setNodeType(threadData, _OMC_LIT313, _node);
  }
  _return: OMC_LABEL_UNUSED
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_markBuiltinTypeNodes(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode)
{
  modelica_metatype _node = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  _node = omc_NFInstNode_InstNode_setNodeType(threadData, _OMC_LIT313, _node);
  _return: OMC_LABEL_UNUSED
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_makeTopNode(threadData_t *threadData, modelica_metatype _topClasses, modelica_metatype _annotationClasses)
{
  modelica_metatype _topNode = NULL;
  modelica_metatype _top_classes = NULL;
  modelica_metatype _cls_elem = NULL;
  modelica_metatype _ann_package = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _ann_cls = NULL;
  modelica_metatype _elems = NULL;
  modelica_metatype _node_ty = NULL;
  modelica_metatype _ann_node = NULL;
  modelica_metatype _generated_inners = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  modelica_metatype tmpMeta21;
  modelica_metatype tmpMeta22;
  modelica_metatype tmpMeta23;
  modelica_metatype tmpMeta24;
  modelica_metatype tmpMeta25;
  modelica_metatype tmpMeta26;
  modelica_metatype tmpMeta27;
  modelica_metatype tmpMeta28;
  modelica_metatype tmpMeta29;
  modelica_metatype tmpMeta30;
  modelica_metatype tmpMeta31;
  modelica_metatype tmpMeta32;
  modelica_metatype tmpMeta33;
  modelica_metatype tmpMeta34;
  modelica_metatype tmpMeta35;
  modelica_metatype tmpMeta36;
  modelica_metatype tmpMeta37;
  modelica_metatype tmpMeta38;
  modelica_metatype tmpMeta39;
  modelica_metatype tmpMeta40;
  modelica_metatype tmpMeta41;
  modelica_metatype tmpMeta42;
  modelica_metatype tmpMeta43;
  modelica_metatype tmpMeta44;
  modelica_metatype tmpMeta45;
  modelica_metatype tmpMeta46;
  modelica_metatype tmpMeta47;
  modelica_metatype tmpMeta48;
  modelica_metatype tmpMeta49;
  modelica_metatype tmpMeta50;
  modelica_metatype tmpMeta51;
  modelica_metatype tmpMeta52;
  modelica_metatype tmpMeta53;
  modelica_metatype tmpMeta54;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _topNode has no default value.
  // _top_classes has no default value.
  // _cls_elem has no default value.
  // _ann_package has no default value.
  // _cls has no default value.
  // _ann_cls has no default value.
  // _elems has no default value.
  // _node_ty has no default value.
  // _ann_node has no default value.
  // _generated_inners has no default value.
  _top_classes = _topClasses;

  if(omc_Flags_getConfigBool(threadData, _OMC_LIT364))
  {
    tmpMeta1 = mmc_mk_cons(_OMC_LIT357, _top_classes);
    _top_classes = tmpMeta1;
  }

  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta8 = mmc_mk_box9(3, &SCode_ClassDef_PARTS__desc, _top_classes, tmpMeta2, tmpMeta3, tmpMeta4, tmpMeta5, tmpMeta6, tmpMeta7, mmc_mk_none());
  tmpMeta9 = mmc_mk_box9(5, &SCode_Element_CLASS__desc, _OMC_LIT365, _OMC_LIT318, _OMC_LIT284, _OMC_LIT285, _OMC_LIT366, tmpMeta8, _OMC_LIT329, _OMC_LIT133);
  _cls_elem = tmpMeta9;

  _generated_inners = omc_UnorderedMap_new(threadData, boxvar_stringHashDjb2, boxvar_stringEq, ((modelica_integer) 1));

  tmpMeta10 = mmc_mk_box3(7, &NFInstNode_InstNodeType_TOP__SCOPE__desc, _OMC_LIT198, _generated_inners);
  _node_ty = tmpMeta10;

  _topNode = omc_NFInstNode_InstNode_newClass(threadData, _cls_elem, _OMC_LIT198, _node_ty);

  tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta17 = mmc_mk_box9(3, &SCode_ClassDef_PARTS__desc, _annotationClasses, tmpMeta11, tmpMeta12, tmpMeta13, tmpMeta14, tmpMeta15, tmpMeta16, mmc_mk_none());
  tmpMeta18 = mmc_mk_box9(5, &SCode_Element_CLASS__desc, _OMC_LIT367, _OMC_LIT318, _OMC_LIT319, _OMC_LIT285, _OMC_LIT366, tmpMeta17, _OMC_LIT329, _OMC_LIT133);
  _ann_package = tmpMeta18;

  _ann_node = omc_NFInstNode_InstNode_newClass(threadData, _ann_package, _topNode, _OMC_LIT368);

  omc_NFInst_expand(threadData, _ann_node, ((modelica_integer) 0));

  _cls = omc_NFInstNode_InstNode_getClass(threadData, _ann_node);

  _elems = omc_NFClass_classTree(threadData, _cls);

  omc_NFClassTree_ClassTree_mapClasses(threadData, _elems, boxvar_NFInst_markBuiltinTypeNodes);

  _cls = omc_NFClass_setClassTree(threadData, _elems, _cls);

  _ann_node = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _ann_node);

  tmpMeta19 = mmc_mk_box3(7, &NFInstNode_InstNodeType_TOP__SCOPE__desc, _ann_node, _generated_inners);
  _node_ty = tmpMeta19;

  _topNode = omc_NFInstNode_InstNode_setNodeType(threadData, _node_ty, _topNode);

  _cls = omc_NFClass_fromSCode(threadData, _top_classes, 0 /* false */, _topNode, _OMC_LIT289);

  _elems = omc_NFClass_classTree(threadData, _cls);

  omc_NFClassTree_ClassTree_mapClasses(threadData, _elems, boxvar_NFInst_markBuiltinTypeNodesByAnnotation);

  tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta22 = mmc_mk_box6(6, &NFClassTree_ClassTree_FLAT__TREE__desc, _OMC_LIT380, listArray(tmpMeta20), _OMC_LIT393, listArray(tmpMeta21), _OMC_LIT266);
  tmpMeta23 = mmc_mk_box6(5, &NFClass_PARTIAL__BUILTIN__desc, _OMC_LIT373, tmpMeta22, _OMC_LIT88, _OMC_LIT289, _OMC_LIT394);
  tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta29 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta30 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta31 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta32 = mmc_mk_box14(3, &NFFunction_Function_FUNCTION__desc, _OMC_LIT395, _OMC_LIT404, tmpMeta26, _OMC_LIT409, tmpMeta27, tmpMeta28, _OMC_LIT373, _OMC_LIT413, tmpMeta29, tmpMeta30, listArray(tmpMeta31), _OMC_LIT414, _OMC_LIT415);
  tmpMeta33 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta34 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta35 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta36 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta37 = mmc_mk_box14(3, &NFFunction_Function_FUNCTION__desc, _OMC_LIT395, _OMC_LIT404, _OMC_LIT422, _OMC_LIT409, tmpMeta33, _OMC_LIT432, _OMC_LIT373, _OMC_LIT413, tmpMeta34, tmpMeta35, listArray(tmpMeta36), _OMC_LIT414, _OMC_LIT415);
  tmpMeta38 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta39 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta40 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta41 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta42 = mmc_mk_box14(3, &NFFunction_Function_FUNCTION__desc, _OMC_LIT395, _OMC_LIT404, _OMC_LIT438, _OMC_LIT409, tmpMeta38, _OMC_LIT442, _OMC_LIT373, _OMC_LIT413, tmpMeta39, tmpMeta40, listArray(tmpMeta41), _OMC_LIT414, _OMC_LIT415);
  tmpMeta43 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta44 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta45 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta46 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta47 = mmc_mk_box14(3, &NFFunction_Function_FUNCTION__desc, _OMC_LIT395, _OMC_LIT404, _OMC_LIT448, _OMC_LIT409, tmpMeta43, _OMC_LIT458, _OMC_LIT373, _OMC_LIT413, tmpMeta44, tmpMeta45, listArray(tmpMeta46), _OMC_LIT414, _OMC_LIT415);
  tmpMeta48 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta49 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta50 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta51 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta52 = mmc_mk_box14(3, &NFFunction_Function_FUNCTION__desc, _OMC_LIT395, _OMC_LIT404, _OMC_LIT463, _OMC_LIT409, tmpMeta48, _OMC_LIT471, _OMC_LIT373, _OMC_LIT413, tmpMeta49, tmpMeta50, listArray(tmpMeta51), _OMC_LIT414, _OMC_LIT415);
  tmpMeta25 = mmc_mk_cons(tmpMeta32, mmc_mk_cons(tmpMeta37, mmc_mk_cons(tmpMeta42, mmc_mk_cons(tmpMeta47, mmc_mk_cons(tmpMeta52, MMC_REFSTRUCTLIT(mmc_nil))))));
  tmpMeta53 = mmc_mk_box4(5, &NFInstNode_CachedData_FUNCTION__desc, tmpMeta25, mmc_mk_boolean(1 /* true */), mmc_mk_boolean(1 /* true */));
  tmpMeta24 = mmc_mk_cons(tmpMeta53, mmc_mk_cons(_OMC_LIT399, mmc_mk_cons(_OMC_LIT399, MMC_REFSTRUCTLIT(mmc_nil))));
  tmpMeta54 = mmc_mk_box8(3, &NFInstNode_InstNode_CLASS__NODE__desc, _OMC_LIT369, _OMC_LIT372, mmc_mk_integer(1), mmc_mk_some(tmpMeta23), listArrayLiteral(tmpMeta24), _OMC_LIT198, _OMC_LIT313);
  omc_NFClassTree_ClassTree_replaceClass(threadData, tmpMeta54, _elems);

  _cls = omc_NFClass_setClassTree(threadData, _elems, _cls);

  _topNode = omc_NFInstNode_InstNode_updateClass(threadData, _cls, _topNode);
  _return: OMC_LABEL_UNUSED
  return _topNode;
}

DLLDirection
modelica_metatype omc_NFInst_expand(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_integer _context)
{
  modelica_metatype _node = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  _node = omc_NFInst_partialInstClass(threadData, _node);

  _node = omc_NFInst_expandClass(threadData, _node, _context);
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_expand(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _node = omc_NFInst_expand(threadData, __omcQ_24in_5Fnode, tmp1);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_instantiate(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _mod, modelica_metatype _parent, modelica_integer _context, modelica_boolean _instPartial)
{
  modelica_metatype _node = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _node = __omcQ_24in_5Fnode;
  _node = omc_NFInst_expand(threadData, _node, _context);

  if((((_instPartial || (!omc_NFInstNode_InstNode_isPartial(threadData, _node))) || omc_NFInstContext_inRelaxed(threadData, _context)) || omc_NFInstContext_inRedeclared(threadData, _context)))
  {
    _node = omc_NFInst_instClass(threadData, _node, _mod, _OMC_LIT87, 1 /* true */, ((modelica_integer) 0), _parent, _context, NULL);
  }
  _return: OMC_LABEL_UNUSED
  return _node;
}
modelica_metatype boxptr_NFInst_instantiate(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fnode, modelica_metatype _mod, modelica_metatype _parent, modelica_metatype _context, modelica_metatype _instPartial)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _node = NULL;
  tmp1 = mmc_unbox_integer(_context);
  tmp2 = mmc_unbox_integer(_instPartial);
  _node = omc_NFInst_instantiate(threadData, __omcQ_24in_5Fnode, _mod, _parent, tmp1, tmp2);
  /* skip box _node; NFInstNode.InstNode */
  return _node;
}

DLLDirection
modelica_metatype omc_NFInst_instantiateRootFunction(threadData_t *threadData, modelica_metatype _funcNode, modelica_integer _context, modelica_metatype *out_functions, modelica_string *out_flatString)
{
  modelica_metatype _flatModel = NULL;
  modelica_metatype _functions = NULL;
  modelica_string _flatString = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _flatModel has no default value.
  // _functions has no default value.
  _flatString = _OMC_LIT131;
  omc_NFFunction_Function_instFunctionNode(threadData, _funcNode, _context, omc_NFInstNode_InstNode_info(threadData, _funcNode));

  _functions = omc_NFFlatten_FunctionTreeImpl_new(threadData);

  {
    modelica_metatype _fn;
    for (tmpMeta1 = omc_NFFunction_Function_typeNodeCache(threadData, _funcNode, _context); !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _fn = MMC_CAR(tmpMeta1);
      _functions = omc_NFFlatten_flattenFunction(threadData, _fn, _functions);
    }
  }

  tmpMeta3 = mmc_mk_box2(4, &Absyn_Path_IDENT__desc, omc_NFInstNode_InstNode_name(threadData, _funcNode));
  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta9 = mmc_mk_box8(3, &NFFlatModel_FLAT__MODEL__desc, tmpMeta3, tmpMeta4, tmpMeta5, tmpMeta6, tmpMeta7, tmpMeta8, omc_ElementSource_createElementSource(threadData, omc_NFInstNode_InstNode_info(threadData, _funcNode), mmc_mk_none(), _OMC_LIT472, _OMC_LIT475));
  _flatModel = tmpMeta9;
  _return: OMC_LABEL_UNUSED
  if (out_functions) { *out_functions = _functions; }
  if (out_flatString) { *out_flatString = _flatString; }
  return _flatModel;
}
modelica_metatype boxptr_NFInst_instantiateRootFunction(threadData_t *threadData, modelica_metatype _funcNode, modelica_metatype _context, modelica_metatype *out_functions, modelica_metatype *out_flatString)
{
  modelica_integer tmp1;
  modelica_metatype _flatModel = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _flatModel = omc_NFInst_instantiateRootFunction(threadData, _funcNode, tmp1, out_functions, out_flatString);
  /* skip box _flatModel; NFFlatModel */
  /* skip box _functions; NFFlatten.FunctionTreeImpl.Tree */
  /* skip box _flatString; String */
  return _flatModel;
}

DLLDirection
modelica_metatype omc_NFInst_instantiateRootClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5FclsNode, modelica_integer _context, modelica_metatype _mod)
{
  modelica_metatype _clsNode = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _clsNode = __omcQ_24in_5FclsNode;
  _clsNode = omc_NFInst_instantiate(threadData, _clsNode, _mod, _OMC_LIT198, _context, 0 /* false */);

  omc_NFInst_checkPartialClass(threadData, _clsNode, _context);

  omc_NFInst_insertGeneratedInners(threadData, _clsNode, omc_NFInstNode_InstNode_topScope(threadData, _clsNode), _context);
  _return: OMC_LABEL_UNUSED
  return _clsNode;
}
modelica_metatype boxptr_NFInst_instantiateRootClass(threadData_t *threadData, modelica_metatype __omcQ_24in_5FclsNode, modelica_metatype _context, modelica_metatype _mod)
{
  modelica_integer tmp1;
  modelica_metatype _clsNode = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _clsNode = omc_NFInst_instantiateRootClass(threadData, __omcQ_24in_5FclsNode, tmp1, _mod);
  /* skip box _clsNode; NFInstNode.InstNode */
  return _clsNode;
}

DLLDirection
modelica_metatype omc_NFInst_lookupRootClass(threadData_t *threadData, modelica_metatype _path, modelica_metatype _topScope, modelica_integer _context)
{
  modelica_metatype _clsNode = NULL;
  modelica_integer _next_context;
  modelica_string _last = NULL;
  modelica_metatype _cty = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _clsNode has no default value.
  // _next_context has no default value.
  // _last has no default value.
  // _cty has no default value.
  _next_context = omc_NFInstContext_set(threadData, _context, ((modelica_integer) 1));

  omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT476);

  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          /* Pattern matching succeeded */
          _clsNode = omc_NFLookup_lookupClassName(threadData, _path, _topScope, _next_context, _OMC_LIT133, 0 /* false */);

          omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT476);
          goto tmp2_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          { /* matchcontinue expression */
            {
              volatile mmc_switch_type tmp7;
              int tmp8;
              tmp7 = 0;
              MMC_TRY_INTERNAL(mmc_jumper)
              tmp6_top:
              threadData->mmc_jumper = &new_mmc_jumper;
              for (; tmp7 < 2; tmp7++) {
                switch (MMC_SWITCH_CAST(tmp7)) {
                case 0: {
                  modelica_boolean tmp9;
                  modelica_metatype tmpMeta10;
                  modelica_metatype tmpMeta11;
                  modelica_metatype tmpMeta12;
                  modelica_metatype tmpMeta13;
                  modelica_metatype tmpMeta14;
                  modelica_metatype tmpMeta15;
                  /* Pattern matching succeeded */
                  _last = omc_AbsynUtil_pathLastIdent(threadData, _path);

                  /* Pattern-matching assignment */
                  tmp9 = ((stringEqual(_last, _OMC_LIT279)) || (stringEqual(_last, _OMC_LIT280)));
                  if (1 /* true */ != tmp9) goto goto_5;

                  _clsNode = omc_NFLookup_lookupName(threadData, omc_AbsynUtil_stripLast(threadData, _path), _topScope, _next_context, 0 /* false */, NULL);

                  /* Pattern-matching assignment */
                  tmpMeta10 = omc_NFInstNode_InstNode_getType(threadData, _clsNode);
                  if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,11,2) == 0) goto goto_5;
                  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
                  _cty = tmpMeta11;

                  if((stringEqual(_last, _OMC_LIT279)))
                  {
                    /* Pattern-matching assignment */
                    tmpMeta12 = _cty;
                    if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,5,2) == 0) goto goto_5;
                    tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
                    _clsNode = tmpMeta13;
                  }
                  else
                  {
                    /* Pattern-matching assignment */
                    tmpMeta14 = _cty;
                    if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,5,2) == 0) goto goto_5;
                    tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 3));
                    _clsNode = tmpMeta15;
                  }

                  omc_ErrorExt_rollBack(threadData, _OMC_LIT476);
                  goto tmp6_done;
                }
                case 1: {
                  /* Pattern matching succeeded */
                  omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT476);

                  goto goto_5;
                  goto tmp6_done;
                }
                }
                goto tmp6_end;
                tmp6_end: ;
              }
              goto goto_5;
              tmp6_done:
              (void)tmp7;
              MMC_RESTORE_INTERNAL(mmc_jumper);
              goto tmp6_done2;
              goto_5:;
              MMC_CATCH_INTERNAL(mmc_jumper);
              if (++tmp7 < 2) {
                goto tmp6_top;
              }
              goto goto_1;
              tmp6_done2:;
            }
          }
          ;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 2) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;

  _clsNode = omc_NFInstUtil_mergeScalars(threadData, _clsNode, _path, 1 /* true */, omc_NFInstUtil_makeMergeNameMap(threadData));

  omc_NFInst_checkInstanceRestriction(threadData, _clsNode, _path, _context);

  _clsNode = omc_NFInstNode_InstNode_makeRootClass(threadData, _clsNode, _OMC_LIT198, mmc_mk_none());
  _return: OMC_LABEL_UNUSED
  return _clsNode;
}
modelica_metatype boxptr_NFInst_lookupRootClass(threadData_t *threadData, modelica_metatype _path, modelica_metatype _topScope, modelica_metatype _context)
{
  modelica_integer tmp1;
  modelica_metatype _clsNode = NULL;
  tmp1 = mmc_unbox_integer(_context);
  _clsNode = omc_NFInst_lookupRootClass(threadData, _path, _topScope, tmp1);
  /* skip box _clsNode; NFInstNode.InstNode */
  return _clsNode;
}

DLLDirection
void omc_NFInst_clearCaches(threadData_t *threadData)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  omc_NFEvalFunction_clearLibraryCache(threadData);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_NFInst_resetGlobalFlags(threadData_t *threadData)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  if(omc_Flags_getConfigBool(threadData, _OMC_LIT492))
  {
    if((!omc_Flags_isSet(threadData, _OMC_LIT484)))
    {
      omc_FlagsUtil_set(threadData, _OMC_LIT480, 0 /* false */);
    }

    omc_FlagsUtil_set(threadData, _OMC_LIT488, 1 /* true */);
  }

  if((!omc_Flags_isSet(threadData, _OMC_LIT480)))
  {
    omc_FlagsUtil_set(threadData, _OMC_LIT496, 0 /* false */);

    omc_FlagsUtil_set(threadData, _OMC_LIT500, 0 /* false */);
  }

  omc_System_setUsesCardinality(threadData, 0 /* false */);

  omc_System_setHasOverconstrainedConnectors(threadData, 0 /* false */);

  omc_System_setHasStreamConnectors(threadData, 0 /* false */);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_NFInst_instClassForConnection(threadData_t *threadData, modelica_metatype _classPath, modelica_metatype _program, modelica_metatype _annotationProgram)
{
  modelica_metatype _connList = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _conns = NULL;
  modelica_metatype _top = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _inst_cls = NULL;
  modelica_integer _context;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _connList = tmpMeta1;
  // _conns has no default value.
  // _top has no default value.
  // _cls has no default value.
  // _inst_cls has no default value.
  // _context has no default value.
  omc_NFInst_resetGlobalFlags(threadData);

  _context = ((omc_Flags_getConfigBool(threadData, _OMC_LIT505) || omc_Flags_isSet(threadData, _OMC_LIT509))?((modelica_integer) 1):((modelica_integer) 0));

  _top = omc_NFInst_makeTopNode(threadData, _program, _annotationProgram);

  _cls = omc_NFInst_lookupRootClass(threadData, _classPath, _top, _context);

  _inst_cls = omc_NFInst_instantiateRootClass(threadData, _cls, _context, _OMC_LIT88);

  omc_NFInst_instExpressions(threadData, _inst_cls, _inst_cls, _OMC_LIT177, omc_NFConnectBreakTree_new(threadData), _context, _OMC_LIT253);

  omc_NFTyping_typeClass(threadData, _inst_cls, _context);

  _conns = omc_NFFlatten_flattenConnection(threadData, _inst_cls, _classPath);

  _connList = omc_NFConnections_toStringList(threadData, _conns);

  omc_NFInst_clearCaches(threadData);
  _return: OMC_LABEL_UNUSED
  return _connList;
}

static modelica_metatype closure15_NFCall_toArrayConstructor(threadData_t *thData, modelica_metatype closure, modelica_metatype iCall)
{
  modelica_metatype index_ptr = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFCall_toArrayConstructor(thData, iCall, index_ptr);
}static modelica_metatype closure14_NFExpression_wrapCall(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_exp)
{
  modelica_fnptr fun = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFExpression_wrapCall(thData, $in_exp, fun);
}static modelica_metatype closure17_NFCall_toArrayConstructor(threadData_t *thData, modelica_metatype closure, modelica_metatype iCall)
{
  modelica_metatype index_ptr = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFCall_toArrayConstructor(thData, iCall, index_ptr);
}static modelica_metatype closure16_NFExpression_wrapCall(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_exp)
{
  modelica_fnptr fun = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFExpression_wrapCall(thData, $in_exp, fun);
}
DLLDirection
modelica_metatype omc_NFInst_instClassInProgram(threadData_t *threadData, modelica_metatype _classPath, modelica_metatype _program, modelica_metatype _annotationProgram, modelica_boolean _relaxedFrontend, modelica_boolean _dumpFlat, modelica_metatype *out_functions, modelica_string *out_flatString)
{
  modelica_metatype _flatModel = NULL;
  modelica_metatype _functions = NULL;
  modelica_string _flatString = NULL;
  modelica_metatype _top = NULL;
  modelica_metatype _cls = NULL;
  modelica_metatype _inst_cls = NULL;
  modelica_integer _context;
  modelica_integer _var_count;
  modelica_integer _eq_count;
  modelica_integer _expose_local_ios;
  modelica_metatype _prog = NULL;
  modelica_metatype _settings = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _flatModel has no default value.
  // _functions has no default value.
  // _flatString has no default value.
  // _top has no default value.
  // _cls has no default value.
  // _inst_cls has no default value.
  // _context has no default value.
  // _var_count has no default value.
  // _eq_count has no default value.
  // _expose_local_ios has no default value.
  _prog = _program;
  // _settings has no default value.
  omc_NFInst_resetGlobalFlags(threadData);

  _context = (((_relaxedFrontend || omc_Flags_getConfigBool(threadData, _OMC_LIT505)) || omc_Flags_isSet(threadData, _OMC_LIT509))?((modelica_integer) 1):((modelica_integer) 0));

  _top = omc_NFInst_makeTopNode(threadData, _prog, _annotationProgram);

  _cls = omc_NFInst_lookupRootClass(threadData, _classPath, _top, _context);

  if(omc_SCodeUtil_isFunction(threadData, omc_NFInstNode_InstNode_definition(threadData, _cls)))
  {
    _flatModel = omc_NFInst_instantiateRootFunction(threadData, _cls, _context ,&_functions ,&_flatString);

    goto _return;
  }

  _inst_cls = omc_NFInst_instantiateRootClass(threadData, _cls, _context, _OMC_LIT88);

  tmpMeta1 = stringAppend(_OMC_LIT510,omc_AbsynUtil_pathString(threadData, _classPath, _OMC_LIT5, 1 /* true */, 0 /* false */));
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT511);
  omc_ExecStat_execStat(threadData, tmpMeta2);

  _settings = omc_NFInst_InstSettings_create(threadData);

  omc_NFInst_instExpressions(threadData, _inst_cls, _inst_cls, _OMC_LIT177, omc_NFConnectBreakTree_new(threadData), _context, _settings);

  omc_ExecStat_execStat(threadData, _OMC_LIT512);

  omc_NFInst_updateImplicitVariability(threadData, _inst_cls, omc_Flags_isSet(threadData, _OMC_LIT516), _context);

  omc_ExecStat_execStat(threadData, _OMC_LIT517);

  omc_NFTyping_typeClass(threadData, _inst_cls, _context);

  _flatModel = omc_NFFlatten_flatten(threadData, _inst_cls, _classPath, 1 /* true */);

  _flatModel = omc_NFEvalConstants_evaluate(threadData, _flatModel, _context);

  omc_NFInstUtil_dumpFlatModelDebug(threadData, _OMC_LIT518, _flatModel, omc_NFFlatten_FunctionTreeImpl_new(threadData));

  _flatModel = omc_NFUnitCheck_checkUnits(threadData, _flatModel);

  if((!omc_Flags_getConfigBool(threadData, _OMC_LIT522)))
  {
    _flatModel = omc_NFSimplifyModel_simplify(threadData, _flatModel);
  }

  _flatModel = omc_NFPackage_collectConstants(threadData, _flatModel);

  _functions = omc_NFFlatten_collectFunctions(threadData, _flatModel);

  if((!omc_Flags_isConfigFlagSet(threadData, _OMC_LIT538, _OMC_LIT528)))
  {
    _flatString = (_dumpFlat?omc_NFInstUtil_dumpFlatModel(threadData, _flatModel, _functions):_OMC_LIT131);
  }

  omc_NFInstUtil_dumpFlatModelDebug(threadData, _OMC_LIT539, _flatModel, _functions);

  omc_NFInstUtil_printStructuralParameters(threadData, _flatModel);

  if(omc_Flags_isSet(threadData, _OMC_LIT480))
  {
    _flatModel = omc_NFScalarize_scalarize(threadData, _flatModel);
  }
  else
  {
    tmpMeta3 = MMC_TAGPTR(mmc_alloc_words(9));
    memcpy(MMC_UNTAGPTR(tmpMeta3), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
    ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta3))[3] = omc_List_filterOnFalse(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 3))), boxvar_NFVariable_isEmptyArray);
    _flatModel = tmpMeta3;

    {
      modelica_metatype __omcQ_24tmpVar33;
      modelica_metatype* tmp6;
      modelica_metatype tmpMeta7;
      modelica_metatype __omcQ_24tmpVar32;
      modelica_integer tmp8;
      modelica_metatype _v_loopVar = 0;
      modelica_metatype _v;
      _v_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 3)));
      tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
      __omcQ_24tmpVar33 = tmpMeta7; /* defaultValue */
      tmp6 = &__omcQ_24tmpVar33;
      while(1) {
        tmp8 = 1;
        if (!listEmpty(_v_loopVar)) {
          _v = MMC_CAR(_v_loopVar);
          _v_loopVar = MMC_CDR(_v_loopVar);
          tmp8--;
        }
        if (tmp8 == 0) {
          __omcQ_24tmpVar32 = omc_NFFlatten_fillVectorizedVariableBinding(threadData, _v);
          *tmp6 = mmc_mk_cons(__omcQ_24tmpVar32,0);
          tmp6 = &MMC_CDR(*tmp6);
        } else if (tmp8 == 1) {
          break;
        } else {
          MMC_THROW_INTERNAL();
        }
      }
      *tmp6 = mmc_mk_nil();
      tmpMeta5 = __omcQ_24tmpVar33;
    }
    tmpMeta4 = MMC_TAGPTR(mmc_alloc_words(9));
    memcpy(MMC_UNTAGPTR(tmpMeta4), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
    ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta4))[3] = tmpMeta5;
    _flatModel = tmpMeta4;
  }

  _flatModel = omc_NFInstUtil_replaceEmptyArrays(threadData, _flatModel);

  omc_NFInstUtil_dumpFlatModelDebug(threadData, _OMC_LIT528, _flatModel, _functions);

  if(omc_Flags_isConfigFlagSet(threadData, _OMC_LIT538, _OMC_LIT528))
  {
    _flatString = (_dumpFlat?omc_NFInstUtil_dumpFlatModel(threadData, _flatModel, _functions):_OMC_LIT131);
  }

  if(omc_Flags_getConfigBool(threadData, _OMC_LIT492))
  {
    _flatModel = omc_NFSimplifyModel_combineBinaries(threadData, _flatModel);

    omc_ExecStat_execStat(threadData, _OMC_LIT540);

    tmpMeta11 = mmc_mk_box1(0, omc_Pointer_create(threadData, mmc_mk_integer(((modelica_integer) 1))));
    tmpMeta10 = mmc_mk_box1(0, (modelica_fnptr) mmc_mk_box2(0,closure15_NFCall_toArrayConstructor,tmpMeta11));
    tmpMeta9 = MMC_TAGPTR(mmc_alloc_words(9));
    memcpy(MMC_UNTAGPTR(tmpMeta9), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
    ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta9))[4] = omc_NFEquation_mapExpList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 4))), (modelica_fnptr) mmc_mk_box2(0,closure14_NFExpression_wrapCall,tmpMeta10));
    _flatModel = tmpMeta9;

    {
      modelica_metatype __omcQ_24tmpVar35;
      modelica_metatype* tmp14;
      modelica_metatype tmpMeta15;
      modelica_metatype tmpMeta16;
      modelica_metatype tmpMeta17;
      modelica_metatype __omcQ_24tmpVar34;
      modelica_integer tmp18;
      modelica_metatype _var_loopVar = 0;
      modelica_metatype _var;
      _var_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 3)));
      tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
      __omcQ_24tmpVar35 = tmpMeta15; /* defaultValue */
      tmp14 = &__omcQ_24tmpVar35;
      while(1) {
        tmp18 = 1;
        if (!listEmpty(_var_loopVar)) {
          _var = MMC_CAR(_var_loopVar);
          _var_loopVar = MMC_CDR(_var_loopVar);
          tmp18--;
        }
        if (tmp18 == 0) {
          tmpMeta17 = mmc_mk_box1(0, omc_Pointer_create(threadData, mmc_mk_integer(((modelica_integer) 1))));
          tmpMeta16 = mmc_mk_box1(0, (modelica_fnptr) mmc_mk_box2(0,closure17_NFCall_toArrayConstructor,tmpMeta17));
          __omcQ_24tmpVar34 = omc_NFVariable_mapExp(threadData, _var, (modelica_fnptr) mmc_mk_box2(0,closure16_NFExpression_wrapCall,tmpMeta16));
          *tmp14 = mmc_mk_cons(__omcQ_24tmpVar34,0);
          tmp14 = &MMC_CDR(*tmp14);
        } else if (tmp18 == 1) {
          break;
        } else {
          MMC_THROW_INTERNAL();
        }
      }
      *tmp14 = mmc_mk_nil();
      tmpMeta13 = __omcQ_24tmpVar35;
    }
    tmpMeta12 = MMC_TAGPTR(mmc_alloc_words(9));
    memcpy(MMC_UNTAGPTR(tmpMeta12), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
    ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta12))[3] = tmpMeta13;
    _flatModel = tmpMeta12;

    omc_ExecStat_execStat(threadData, _OMC_LIT541);
  }

  omc_NFVerifyModel_verify(threadData, _flatModel, omc_NFInstNode_InstNode_isPartial(threadData, _inst_cls));

  _flatModel = omc_NFInstUtil_expandSlicedCrefs(threadData, _flatModel, _functions ,&_functions);

  _flatModel = omc_NFInstUtil_combineSubscripts(threadData, _flatModel);

  {
    modelica_metatype __omcQ_24tmpVar37;
    modelica_metatype* tmp21;
    modelica_metatype tmpMeta22;
    modelica_metatype __omcQ_24tmpVar36;
    modelica_integer tmp23;
    modelica_metatype _var_loopVar = 0;
    modelica_metatype _var;
    _var_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 3)));
    tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar37 = tmpMeta22; /* defaultValue */
    tmp21 = &__omcQ_24tmpVar37;
    while(1) {
      tmp23 = 1;
      if (!listEmpty(_var_loopVar)) {
        _var = MMC_CAR(_var_loopVar);
        _var_loopVar = MMC_CDR(_var_loopVar);
        tmp23--;
      }
      if (tmp23 == 0) {
        __omcQ_24tmpVar36 = omc_NFVariable_propagateAnnotation(threadData, _OMC_LIT542, 0 /* false */, 1 /* true */, _var);
        *tmp21 = mmc_mk_cons(__omcQ_24tmpVar36,0);
        tmp21 = &MMC_CDR(*tmp21);
      } else if (tmp23 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp21 = mmc_mk_nil();
    tmpMeta20 = __omcQ_24tmpVar37;
  }
  tmpMeta19 = MMC_TAGPTR(mmc_alloc_words(9));
  memcpy(MMC_UNTAGPTR(tmpMeta19), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta19))[3] = tmpMeta20;
  _flatModel = tmpMeta19;

  _flatModel = omc_NFFlatModel_removeNonTopLevelDirections(threadData, _flatModel);

  if(((stringEqual(omc_Flags_getConfigString(threadData, _OMC_LIT569), _OMC_LIT553)) || (stringEqual(omc_Flags_getConfigString(threadData, _OMC_LIT569), _OMC_LIT549))))
  {
    _flatModel = omc_NFFlatModel_obfuscate(threadData, _flatModel);
  }

  omc_NFInst_clearCaches(threadData);
  _return: OMC_LABEL_UNUSED
  if (out_functions) { *out_functions = _functions; }
  if (out_flatString) { *out_flatString = _flatString; }
  return _flatModel;
}
modelica_metatype boxptr_NFInst_instClassInProgram(threadData_t *threadData, modelica_metatype _classPath, modelica_metatype _program, modelica_metatype _annotationProgram, modelica_metatype _relaxedFrontend, modelica_metatype _dumpFlat, modelica_metatype *out_functions, modelica_metatype *out_flatString)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _flatModel = NULL;
  tmp1 = mmc_unbox_integer(_relaxedFrontend);
  tmp2 = mmc_unbox_integer(_dumpFlat);
  _flatModel = omc_NFInst_instClassInProgram(threadData, _classPath, _program, _annotationProgram, tmp1, tmp2, out_functions, out_flatString);
  /* skip box _flatModel; NFFlatModel */
  /* skip box _functions; NFFlatten.FunctionTreeImpl.Tree */
  /* skip box _flatString; String */
  return _flatModel;
}

modelica_metatype omc_NFInst_Inst__makeTopNode(threadData_t *threadData, modelica_metatype _program, modelica_metatype _annotationProgram)
{
  modelica_metatype _program_ext;
  modelica_metatype _annotationProgram_ext;
  modelica_metatype _topNode_ext;
  modelica_metatype _topNode = NULL;
  // _topNode has no default value.
  _program_ext = (modelica_metatype) _program;
  _annotationProgram_ext = (modelica_metatype) _annotationProgram;
  _topNode_ext = Inst_makeTopNode(_program_ext, _annotationProgram_ext);
  _topNode = (modelica_metatype)_topNode_ext;
  return _topNode;
}

DLLDirection
modelica_metatype omc_NFInst_InstSettings_create(threadData_t *threadData)
{
  modelica_metatype _settings = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = mmc_mk_box3(3, &NFInst_InstSettings_SETTINGS__desc, mmc_mk_boolean(1 /* true */), mmc_mk_boolean(omc_Flags_getConfigBool(threadData, _OMC_LIT573)));
  _settings = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _settings;
}

