#ifdef OMC_BASE_FILE
#define OMC_FILE OMC_BASE_FILE
#else
#define OMC_FILE "InstUtil.c"
#endif
#include "omc_simulation_settings.h"
#include "InstUtil.h"
#define _OMC_LIT0_data "x"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,1,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data "$ghostL"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,7,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
#define _OMC_LIT2_data "$ghostR"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,7,_OMC_LIT2_data);
#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT3,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT3 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT3)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT4,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT4 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT4)
#define _OMC_LIT5_data "%s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,2,_OMC_LIT5_data);
#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT6,2,4) {&Gettext_TranslatableContent_notrans__desc,_OMC_LIT5}};
#define _OMC_LIT6 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT7,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5999)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT6}};
#define _OMC_LIT7 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT7)
#define _OMC_LIT8_data "Field variable '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT8,16,_OMC_LIT8_data);
#define _OMC_LIT8 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "' has different domain than the equation or is not a field."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,59,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT10,1,4) {&Absyn_Operator_SUB__desc,}};
#define _OMC_LIT10 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT10)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT11,1,6) {&Absyn_Operator_DIV__desc,}};
#define _OMC_LIT11 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT11)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT12,2,3) {&Absyn_Exp_INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT12 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT12)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT13,1,5) {&Absyn_Operator_MUL__desc,}};
#define _OMC_LIT13 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT13)
#define _OMC_LIT14_data "dx"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT14,2,_OMC_LIT14_data);
#define _OMC_LIT14 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT14)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT15,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT14,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT15 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT15)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT16,1,3) {&Absyn_Operator_ADD__desc,}};
#define _OMC_LIT16 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT16)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT17,1,7) {&Absyn_Operator_POW__desc,}};
#define _OMC_LIT17 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT17)
#define _OMC_LIT18_data "You are differentiating with respect to variable that is not a coordinate."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT18,74,_OMC_LIT18_data);
#define _OMC_LIT18 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT18)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT19,2,1) {_OMC_LIT18,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT19 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT19)
#define _OMC_LIT20_data "Unsupported partial derivative."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT20,31,_OMC_LIT20_data);
#define _OMC_LIT20 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT20)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT21,2,1) {_OMC_LIT20,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT21 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT21)
#define _OMC_LIT22_data "pder"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT22,4,_OMC_LIT22_data);
#define _OMC_LIT22 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT22)
#define _OMC_LIT23_data "There are no fields defined within the domain of this equation."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT23,63,_OMC_LIT23_data);
#define _OMC_LIT23 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT23)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24,2,1) {_OMC_LIT23,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT24 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24)
#define _OMC_LIT25_data "extrapolateField"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT25,16,_OMC_LIT25_data);
#define _OMC_LIT25 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT25)
#define _OMC_LIT26_data "Unhandled type of EQ_PDE in discretizePDE\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT26,42,_OMC_LIT26_data);
#define _OMC_LIT26 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT26)
#define _OMC_LIT27_data "interior"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT27,8,_OMC_LIT27_data);
#define _OMC_LIT27 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT27)
#define _OMC_LIT28_data "left"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT28,4,_OMC_LIT28_data);
#define _OMC_LIT28 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data "right"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,5,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT30,1,3) {&SCode_Each_EACH__desc,}};
#define _OMC_LIT30 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT30)
#define _OMC_LIT31_data "N"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT31,1,_OMC_LIT31_data);
#define _OMC_LIT31 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT31)
#define _OMC_LIT32_data "PDEModelica: %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT32,15,_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,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(7013)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT33}};
#define _OMC_LIT34 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "The domain type is wrong.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,26,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT36,2,1) {_OMC_LIT35,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT36 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT36)
#define _OMC_LIT37_data "domain"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT37,6,_OMC_LIT37_data);
#define _OMC_LIT37 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT37)
#define _OMC_LIT38_data "DomainLineSegment1D"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT38,19,_OMC_LIT38_data);
#define _OMC_LIT38 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT38)
#define _OMC_LIT39_data "Domain of the field variable '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT39,30,_OMC_LIT39_data);
#define _OMC_LIT39 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data "' not found."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,12,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
#define _OMC_LIT41_data "' has no domain modifier."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT41,25,_OMC_LIT41_data);
#define _OMC_LIT41 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT41)
#define _OMC_LIT42_data "start"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT42,5,_OMC_LIT42_data);
#define _OMC_LIT42 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT42)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT43,1,3) {&Absyn_IsField_NONFIELD__desc,}};
#define _OMC_LIT43 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT43)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT44,1,5) {&DAE_Mod_NOMOD__desc,}};
#define _OMC_LIT44 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT44)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT45,1,5) {&SCode_Mod_NOMOD__desc,}};
#define _OMC_LIT45 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT45)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT46,1,5) {&FCore_ScopeType_PARALLEL__SCOPE__desc,}};
#define _OMC_LIT46 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT46)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT47,1,1) {_OMC_LIT46}};
#define _OMC_LIT47 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT47)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT48,1,3) {&SCode_Parallelism_PARGLOBAL__desc,}};
#define _OMC_LIT48 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT48)
#define _OMC_LIT49_data "\n- local parglobal component '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT49,30,_OMC_LIT49_data);
#define _OMC_LIT49 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT49)
#define _OMC_LIT50_data "' is declared in parallel/parkernel function '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT50,46,_OMC_LIT50_data);
#define _OMC_LIT50 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT50)
#define _OMC_LIT51_data "'. \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT51,4,_OMC_LIT51_data);
#define _OMC_LIT51 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data "- parglobal variables can be declared only in normal functions. \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,65,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
#define _OMC_LIT53_data "ParModelica: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT53,16,_OMC_LIT53_data);
#define _OMC_LIT53 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT53)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT54,2,4) {&Gettext_TranslatableContent_notrans__desc,_OMC_LIT53}};
#define _OMC_LIT54 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT54)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT55,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(7005)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT54}};
#define _OMC_LIT55 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT55)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT56,1,5) {&ErrorTypes_Severity_WARNING__desc,}};
#define _OMC_LIT56 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT56)
#define _OMC_LIT57_data "%s was used before it was defined (given a value). Additional such uses may exist for the variable, but some messages were suppressed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,134,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT58,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT57}};
#define _OMC_LIT58 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT58)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT59,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(245)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT58}};
#define _OMC_LIT59 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data "_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,1,_OMC_LIT60_data);
#define _OMC_LIT60 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT60)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT61,2,1) {_OMC_LIT60,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT61 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT61)
#define _OMC_LIT62_data "isPresent"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT62,9,_OMC_LIT62_data);
#define _OMC_LIT62 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data "."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,1,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
#define _OMC_LIT64_data "Internal error %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT64,17,_OMC_LIT64_data);
#define _OMC_LIT64 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT64)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT65,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT64}};
#define _OMC_LIT65 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT65)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT66,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(63)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT65}};
#define _OMC_LIT66 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT66)
#define _OMC_LIT67_data "InstUtil.checkFunctionDefUseStmt failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT67,39,_OMC_LIT67_data);
#define _OMC_LIT67 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT67)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT68,2,1) {_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT68 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT68)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT69,3,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT69 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT69)
#define _OMC_LIT70_data "InstUtil.checkFunctionDefUseStmt failed: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT70,41,_OMC_LIT70_data);
#define _OMC_LIT70 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT70)
#define _OMC_LIT71_data "fail"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT71,4,_OMC_LIT71_data);
#define _OMC_LIT71 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT71)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT72,1,4) {&DAE_VarDirection_OUTPUT__desc,}};
#define _OMC_LIT72 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT72)
#define _OMC_LIT73_data "InstUtil.checkFunctionDefUse failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT73,35,_OMC_LIT73_data);
#define _OMC_LIT73 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT73)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT74,2,1) {_OMC_LIT73,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT74 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT74)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT75,2,22) {&DAE_Exp_TUPLE__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT75 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT75)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT76,1,1) {_OMC_LIT75}};
#define _OMC_LIT76 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "Tail recursion of: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,19,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
#define _OMC_LIT78_data " with input vars: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT78,18,_OMC_LIT78_data);
#define _OMC_LIT78 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT78)
#define _OMC_LIT79_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT79,1,_OMC_LIT79_data);
#define _OMC_LIT79 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT79)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT80,1,6) {&ErrorTypes_Severity_NOTIFICATION__desc,}};
#define _OMC_LIT80 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT80)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT81,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(6001)),_OMC_LIT3,_OMC_LIT80,_OMC_LIT6}};
#define _OMC_LIT81 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT81)
#define _OMC_LIT82_data "tail"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT82,4,_OMC_LIT82_data);
#define _OMC_LIT82 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT82)
#define _OMC_LIT83_data "Prints out a notification if tail recursion optimization has been applied."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT83,74,_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) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(19)),_OMC_LIT82,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT84}};
#define _OMC_LIT85 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT85)
#define _OMC_LIT86_data "The behavior of multiple algorithm sections in function %s is not standard Modelica. OpenModelica will execute the sections in the order in which they were declared or inherited (same ordering as inherited input/output arguments, which also are not standardized)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT86,263,_OMC_LIT86_data);
#define _OMC_LIT86 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT86)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT87,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT86}};
#define _OMC_LIT87 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT87)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT88,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(189)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT87}};
#define _OMC_LIT88 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data "Real"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,4,_OMC_LIT89_data);
#define _OMC_LIT89 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT89)
#define _OMC_LIT90_data "Integer"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT90,7,_OMC_LIT90_data);
#define _OMC_LIT90 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT90)
#define _OMC_LIT91_data "Boolean"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT91,7,_OMC_LIT91_data);
#define _OMC_LIT91 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data "String"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,6,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
#define _OMC_LIT93_data "Clock"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT93,5,_OMC_LIT93_data);
#define _OMC_LIT93 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT93)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT94,2,1) {_OMC_LIT93,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT94 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT94)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT95,2,1) {_OMC_LIT92,_OMC_LIT94}};
#define _OMC_LIT95 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT95)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT96,2,1) {_OMC_LIT91,_OMC_LIT95}};
#define _OMC_LIT96 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT96)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT97,2,1) {_OMC_LIT90,_OMC_LIT96}};
#define _OMC_LIT97 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT97)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT98,2,1) {_OMC_LIT89,_OMC_LIT97}};
#define _OMC_LIT98 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT98)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT99,2,1) {_OMC_LIT92,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT99 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT99)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT100,2,1) {_OMC_LIT91,_OMC_LIT99}};
#define _OMC_LIT100 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT100)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT101,2,1) {_OMC_LIT90,_OMC_LIT100}};
#define _OMC_LIT101 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT101)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT102,2,1) {_OMC_LIT89,_OMC_LIT101}};
#define _OMC_LIT102 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,0,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT104,10,3) {&SCodeDump_SCodeDumpOptions_OPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT104 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT104)
#define _OMC_LIT105_data "Element:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT105,9,_OMC_LIT105_data);
#define _OMC_LIT105 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT105)
#define _OMC_LIT106_data "\nModifier: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT106,11,_OMC_LIT106_data);
#define _OMC_LIT106 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT106)
#define _OMC_LIT107_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT107,1,_OMC_LIT107_data);
#define _OMC_LIT107 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT107)
#define _OMC_LIT108_data "Element is not allowed in function context: %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT108,46,_OMC_LIT108_data);
#define _OMC_LIT108 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT108)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT109,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT108}};
#define _OMC_LIT109 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT109)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT110,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(155)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT109}};
#define _OMC_LIT110 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT110)
#define _OMC_LIT111_data "__OpenModelica_Impure"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT111,21,_OMC_LIT111_data);
#define _OMC_LIT111 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT111)
#define _OMC_LIT112_data "__ModelicaAssociation_Impure"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT112,28,_OMC_LIT112_data);
#define _OMC_LIT112 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data "__OpenModelica_UnboxArguments"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,29,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT114,1,3) {&DAE_FunctionParallelism_FP__NON__PARALLEL__desc,}};
#define _OMC_LIT114 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT114)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT115,1,4) {&DAE_FunctionParallelism_FP__PARALLEL__FUNCTION__desc,}};
#define _OMC_LIT115 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT115)
#define _OMC_LIT116_data "__OpenModelica_BuiltinPtr"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT116,25,_OMC_LIT116_data);
#define _OMC_LIT116 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT116)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT117,1,5) {&DAE_FunctionBuiltin_FUNCTION__BUILTIN__PTR__desc,}};
#define _OMC_LIT117 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,1,3) {&DAE_FunctionBuiltin_FUNCTION__NOT__BUILTIN__desc,}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT119,1,7) {&DAE_InlineType_NO__INLINE__desc,}};
#define _OMC_LIT119 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,1,5) {&DAE_FunctionParallelism_FP__KERNEL__FUNCTION__desc,}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,7,3) {&DAE_FunctionAttributes_FUNCTION__ATTRIBUTES__desc,_OMC_LIT119,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT118,_OMC_LIT120}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT122,1,4) {&SCode_Final_NOT__FINAL__desc,}};
#define _OMC_LIT122 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,1,4) {&SCode_Each_NOT__EACH__desc,}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,3,3) {&SCode_Comment_COMMENT__desc,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT125,1,3) {&SCode_Partial_PARTIAL__desc,}};
#define _OMC_LIT125 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,1,4) {&SCode_Partial_NOT__PARTIAL__desc,}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
#define _OMC_LIT127_data "constructor"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT127,11,_OMC_LIT127_data);
#define _OMC_LIT127 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT127)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT128,2,6) {&DAE_Exp_BCONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT128 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT128)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT129,1,1) {_OMC_LIT128}};
#define _OMC_LIT129 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT129)
#define _OMC_LIT130_data "Moving binding to initial equation section and setting fixed attribute of %s to false."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT130,86,_OMC_LIT130_data);
#define _OMC_LIT130 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT130)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT131,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT130}};
#define _OMC_LIT131 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT131)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT132,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(583)),_OMC_LIT3,_OMC_LIT80,_OMC_LIT131}};
#define _OMC_LIT132 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT132)
#define _OMC_LIT133_data " failure in propagateAbSCDirection2, Absyn.DIRECTION mismatch"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT133,61,_OMC_LIT133_data);
#define _OMC_LIT133 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT133)
#define _OMC_LIT134_data "Component declared as %s when having the variable %s declared as %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT134,68,_OMC_LIT134_data);
#define _OMC_LIT134 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT134}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT136,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(42)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT135}};
#define _OMC_LIT136 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT136)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT137,2,1) {_OMC_LIT103,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT137 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT137)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT138,2,1) {_OMC_LIT103,_OMC_LIT137}};
#define _OMC_LIT138 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT138)
#define _OMC_LIT139_data "Type error in conditional '%s'. Expected Boolean, got %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT139,57,_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(10)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT140}};
#define _OMC_LIT141 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT141)
#define _OMC_LIT142_data "Component condition must be parameter or constant expression (in %s)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT142,69,_OMC_LIT142_data);
#define _OMC_LIT142 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT142)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT143,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT142}};
#define _OMC_LIT143 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT143)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT144,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(100)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT143}};
#define _OMC_LIT144 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "The conditional expression %s could not be evaluated."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,53,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT146,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT145}};
#define _OMC_LIT146 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT146)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT147,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(137)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT146}};
#define _OMC_LIT147 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT147)
#define _OMC_LIT148_data "InstUtil.instConditionalDeclaration got unexpected value "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT148,57,_OMC_LIT148_data);
#define _OMC_LIT148 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT148)
#define _OMC_LIT149_data "InstUtil.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT149,11,_OMC_LIT149_data);
#define _OMC_LIT149 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT149)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT150_6,0.0);
#define _OMC_LIT150_6 MMC_REFREALLIT(_OMC_LIT_STRUCT150_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT150,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT149,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6802)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6802)),MMC_IMMEDIATE(MMC_TAGFIXNUM(134)),_OMC_LIT150_6}};
#define _OMC_LIT150 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT150)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT151,1,1) {MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT151 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "array"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,5,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT152,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT154,1,3) {&Absyn_ReductionIterType_COMBINE__desc,}};
#define _OMC_LIT154 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT154)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT155,2,3) {&Absyn_Exp_INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT155 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT155)
#define _OMC_LIT156_data "i"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT156,1,_OMC_LIT156_data);
#define _OMC_LIT156 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT156)
#define _OMC_LIT157_data " we failed with traverseModAddFinal3\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT157,37,_OMC_LIT157_data);
#define _OMC_LIT157 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT157)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT158,1,3) {&SCode_Final_FINAL__desc,}};
#define _OMC_LIT158 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT158)
#define _OMC_LIT159_data "InstUtil.traverseModAddFinal"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT159,28,_OMC_LIT159_data);
#define _OMC_LIT159 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT159)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT160_6,0.0);
#define _OMC_LIT160_6 MMC_REFREALLIT(_OMC_LIT_STRUCT160_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT160,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT149,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6392)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6392)),MMC_IMMEDIATE(MMC_TAGFIXNUM(64)),_OMC_LIT160_6}};
#define _OMC_LIT160 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT160)
#define _OMC_LIT161_data "ModelicaServices"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT161,16,_OMC_LIT161_data);
#define _OMC_LIT161 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT161)
#define _OMC_LIT162_data "Modelica"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT162,8,_OMC_LIT162_data);
#define _OMC_LIT162 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT162)
#define _OMC_LIT163_data "expandableConnectorsOrder"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT163,25,_OMC_LIT163_data);
#define _OMC_LIT163 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT163)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT164,1,3) {&DAE_StateSelect_NEVER__desc,}};
#define _OMC_LIT164 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,1,1) {_OMC_LIT164}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT166,1,4) {&DAE_StateSelect_AVOID__desc,}};
#define _OMC_LIT166 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT166)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT167,1,1) {_OMC_LIT166}};
#define _OMC_LIT167 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT167)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT168,1,5) {&DAE_StateSelect_DEFAULT__desc,}};
#define _OMC_LIT168 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT168)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT169,1,1) {_OMC_LIT168}};
#define _OMC_LIT169 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT169)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT170,1,6) {&DAE_StateSelect_PREFER__desc,}};
#define _OMC_LIT170 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT170)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT171,1,1) {_OMC_LIT170}};
#define _OMC_LIT171 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,1,7) {&DAE_StateSelect_ALWAYS__desc,}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT173,1,1) {_OMC_LIT172}};
#define _OMC_LIT173 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT173)
#define _OMC_LIT174_data "StateSelect"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT174,11,_OMC_LIT174_data);
#define _OMC_LIT174 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT174)
#define _OMC_LIT175_data "never"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT175,5,_OMC_LIT175_data);
#define _OMC_LIT175 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT175)
#define _OMC_LIT176_data "avoid"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT176,5,_OMC_LIT176_data);
#define _OMC_LIT176 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT176)
#define _OMC_LIT177_data "default"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT177,7,_OMC_LIT177_data);
#define _OMC_LIT177 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT177)
#define _OMC_LIT178_data "prefer"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT178,6,_OMC_LIT178_data);
#define _OMC_LIT178 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT178)
#define _OMC_LIT179_data "always"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT179,6,_OMC_LIT179_data);
#define _OMC_LIT179 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT179)
#define _OMC_LIT180_data "Modification or redeclaration of protected elements is not allowed.\n  Element: %s, modification: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT180,100,_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(54)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT181}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
#define _OMC_LIT183_data "InstUtil.mktypeWithArrays failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT183,33,_OMC_LIT183_data);
#define _OMC_LIT183 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT183)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT184,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT103}};
#define _OMC_LIT184 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT184)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT185,2,14) {&ClassInf_State_TYPE__INTEGER__desc,_OMC_LIT184}};
#define _OMC_LIT185 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,2,15) {&ClassInf_State_TYPE__REAL__desc,_OMC_LIT184}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT187,2,16) {&ClassInf_State_TYPE__STRING__desc,_OMC_LIT184}};
#define _OMC_LIT187 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT187)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT188,2,17) {&ClassInf_State_TYPE__BOOL__desc,_OMC_LIT184}};
#define _OMC_LIT188 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT188)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT189,2,18) {&ClassInf_State_TYPE__CLOCK__desc,_OMC_LIT184}};
#define _OMC_LIT189 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT189)
#define _OMC_LIT190_data "Uniontype %s was not generated correctly. One possible cause is modifications, which are not allowed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT190,101,_OMC_LIT190_data);
#define _OMC_LIT190 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT190)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT191,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT190}};
#define _OMC_LIT191 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT191)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT192,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5005)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT191}};
#define _OMC_LIT192 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT192)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT193,1,3) {&DAE_VarDirection_INPUT__desc,}};
#define _OMC_LIT193 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT193)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT194,1,5) {&DAE_VarDirection_BIDIR__desc,}};
#define _OMC_LIT194 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT194)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT195,1,3) {&DAE_VarKind_VARIABLE__desc,}};
#define _OMC_LIT195 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT195)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT196,1,5) {&DAE_VarKind_PARAM__desc,}};
#define _OMC_LIT196 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT196)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT197,1,6) {&DAE_VarKind_CONST__desc,}};
#define _OMC_LIT197 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT197)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT198,1,4) {&DAE_VarKind_DISCRETE__desc,}};
#define _OMC_LIT198 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT198)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT199,1,4) {&DAE_VarVisibility_PROTECTED__desc,}};
#define _OMC_LIT199 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,1,3) {&DAE_VarVisibility_PUBLIC__desc,}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
#define _OMC_LIT201_data "The lhs (result) of the external function declaration has array type (%s), but this is not allowed in the specification. You need to pass it as an input to the function (preferably also with a size()-expression to avoid out-of-bounds errors in the external call)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT201,263,_OMC_LIT201_data);
#define _OMC_LIT201 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT201)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT202,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT201}};
#define _OMC_LIT202 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT202)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT203,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(177)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT202}};
#define _OMC_LIT203 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT203)
#define _OMC_LIT204_data "The lhs (result) of the external function declaration is not a component reference: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT204,87,_OMC_LIT204_data);
#define _OMC_LIT204 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT204)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT205,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT204}};
#define _OMC_LIT205 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT205)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT206,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(175)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT205}};
#define _OMC_LIT206 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT206)
#define _OMC_LIT207_data "The lhs (result) of the external function declaration is not a variable."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT207,72,_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(176)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT208}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209)
#define _OMC_LIT210_data "builtin"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT210,7,_OMC_LIT210_data);
#define _OMC_LIT210 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT210)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT211,1,6) {&DAE_ExtArg_NOEXTARG__desc,}};
#define _OMC_LIT211 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT211)
#define _OMC_LIT212_data "failtrace"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT212,9,_OMC_LIT212_data);
#define _OMC_LIT212 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT212)
#define _OMC_LIT213_data "Sets whether to print a failtrace or not."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT213,41,_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) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT212,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT214}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
#define _OMC_LIT216_data "- InstUtil.instExtRettype failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT216,32,_OMC_LIT216_data);
#define _OMC_LIT216 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT216)
#define _OMC_LIT217_data "Variable %s not found in scope %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT217,34,_OMC_LIT217_data);
#define _OMC_LIT217 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT217)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT218,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT217}};
#define _OMC_LIT218 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT218)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT219,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT218}};
#define _OMC_LIT219 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT219)
#define _OMC_LIT220_data "Expression %s cannot be an external argument. Only identifiers, scalar constants, and size-expressions are allowed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT220,115,_OMC_LIT220_data);
#define _OMC_LIT220 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT220)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT221,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT220}};
#define _OMC_LIT221 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT221)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT222,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(251)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT221}};
#define _OMC_LIT222 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT222)
#define _OMC_LIT223_data "- InstUtil.instExtGetFargs failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT223,33,_OMC_LIT223_data);
#define _OMC_LIT223 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT223)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT224,2,3) {&DAE_Type_T__INTEGER__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT224 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT224)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT225,1,5) {&DAE_Const_C__VAR__desc,}};
#define _OMC_LIT225 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT225)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT226,3,3) {&DAE_Properties_PROP__desc,_OMC_LIT224,_OMC_LIT225}};
#define _OMC_LIT226 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT226)
#define _OMC_LIT227_data "-Inst.elabExpExt failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT227,23,_OMC_LIT227_data);
#define _OMC_LIT227 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT227)
#define _OMC_LIT228_data "size"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT228,4,_OMC_LIT228_data);
#define _OMC_LIT228 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT228)
#define _OMC_LIT229_data "C"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT229,1,_OMC_LIT229_data);
#define _OMC_LIT229 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT229)
#define _OMC_LIT230_data "%s is an unbound output in external function %s. Either add it to the external declaration or add a default binding."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT230,116,_OMC_LIT230_data);
#define _OMC_LIT230 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT230)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT231,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT230}};
#define _OMC_LIT231 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(191)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT231}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT233,1,6) {&ErrorTypes_MessageType_SYMBOLIC__desc,}};
#define _OMC_LIT233 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT233)
#define _OMC_LIT234_data "Unused input variable %s in function %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT234,40,_OMC_LIT234_data);
#define _OMC_LIT234 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT234)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT235,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT234}};
#define _OMC_LIT235 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT235)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT236,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(192)),_OMC_LIT233,_OMC_LIT56,_OMC_LIT235}};
#define _OMC_LIT236 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT236)
#define _OMC_LIT237_data "__OpenModelica_UnusedVariable"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT237,29,_OMC_LIT237_data);
#define _OMC_LIT237 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT237)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT238,1,6) {&DAE_InlineType_DEFAULT__INLINE__desc,}};
#define _OMC_LIT238 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT238)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT239,1,3) {&DAE_InlineType_NORM__INLINE__desc,}};
#define _OMC_LIT239 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT239)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT240,1,8) {&DAE_InlineType_AFTER__INDEX__RED__INLINE__desc,}};
#define _OMC_LIT240 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT240)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT241,1,5) {&DAE_InlineType_EARLY__INLINE__desc,}};
#define _OMC_LIT241 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT241)
#define _OMC_LIT242_data "Inline"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT242,6,_OMC_LIT242_data);
#define _OMC_LIT242 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT242)
#define _OMC_LIT243_data "LateInline"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT243,10,_OMC_LIT243_data);
#define _OMC_LIT243 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT243)
#define _OMC_LIT244_data "__MathCore_InlineAfterIndexReduction"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT244,36,_OMC_LIT244_data);
#define _OMC_LIT244 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT244)
#define _OMC_LIT245_data "__Dymola_InlineAfterIndexReduction"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT245,34,_OMC_LIT245_data);
#define _OMC_LIT245 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT245)
#define _OMC_LIT246_data "InlineAfterIndexReduction"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT246,25,_OMC_LIT246_data);
#define _OMC_LIT246 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT246)
#define _OMC_LIT247_data "__OpenModelica_EarlyInline"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT247,26,_OMC_LIT247_data);
#define _OMC_LIT247 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT247)
#define _OMC_LIT248_data "order"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT248,5,_OMC_LIT248_data);
#define _OMC_LIT248 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT248)
#define _OMC_LIT249_data "derivative"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT249,10,_OMC_LIT249_data);
#define _OMC_LIT249 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT249)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT250,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT250 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT250)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT251,2,4) {&DAE_derivativeCond_NO__DERIVATIVE__desc,_OMC_LIT250}};
#define _OMC_LIT251 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT251)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT252,1,3) {&DAE_derivativeCond_ZERO__DERIVATIVE__desc,}};
#define _OMC_LIT252 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT252)
#define _OMC_LIT253_data " failure in setFunctionInputIndex, didn't find any index for: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT253,62,_OMC_LIT253_data);
#define _OMC_LIT253 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT253)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT254,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(99))}};
#define _OMC_LIT254 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT254)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT255,2,4) {&DAE_derivativeCond_NO__DERIVATIVE__desc,_OMC_LIT254}};
#define _OMC_LIT255 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT255)
#define _OMC_LIT256_data "noDerivative"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT256,12,_OMC_LIT256_data);
#define _OMC_LIT256 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT256)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT257,2,3) {&Mod_ModScope_COMPONENT__desc,_OMC_LIT256}};
#define _OMC_LIT257 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT257)
#define _OMC_LIT258_data "zeroDerivative"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT258,14,_OMC_LIT258_data);
#define _OMC_LIT258 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT258)
#define _OMC_LIT259_data "getDeriveAnnotation3"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT259,20,_OMC_LIT259_data);
#define _OMC_LIT259 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT259)
#define _OMC_LIT260_data "Undefined! The type detected: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT260,30,_OMC_LIT260_data);
#define _OMC_LIT260 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT260)
#define _OMC_LIT261_data "Type mismatch in modifier of component %s, declared type %s, got modifier %s of type %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT261,88,_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(97)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT262}};
#define _OMC_LIT263 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT263)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264,1,7) {&DAE_Dimension_DIM__UNKNOWN__desc,}};
#define _OMC_LIT264 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264)
#define _OMC_LIT265_data "- InstUtil.compatibleArraydim failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT265,37,_OMC_LIT265_data);
#define _OMC_LIT265 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT265)
#define _OMC_LIT266_data "checkModel"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT266,10,_OMC_LIT266_data);
#define _OMC_LIT266 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT266)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT267,1,3) {&Flags_FlagVisibility_INTERNAL__desc,}};
#define _OMC_LIT267 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT267)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT268,2,4) {&Flags_FlagData_BOOL__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT268 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT268)
#define _OMC_LIT269_data "Set when checkModel is used to turn on specific features for checking."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT269,70,_OMC_LIT269_data);
#define _OMC_LIT269 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT269)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT270,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT269}};
#define _OMC_LIT270 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT270)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT271,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(31)),_OMC_LIT266,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT267,_OMC_LIT268,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT270}};
#define _OMC_LIT271 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT271)
#define _OMC_LIT272_data "Array dimension mismatch, expression %s has type %s, expected array dimensions [%s]."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT272,84,_OMC_LIT272_data);
#define _OMC_LIT272 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT272)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT273,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT272}};
#define _OMC_LIT273 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT273)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT274,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(43)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT273}};
#define _OMC_LIT274 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT274)
#define _OMC_LIT275_data "- InstUtil.elabArraydim failed on: \n	cref:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT275,42,_OMC_LIT275_data);
#define _OMC_LIT275 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT275)
#define _OMC_LIT276_data " "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT276,1,_OMC_LIT276_data);
#define _OMC_LIT276 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT276)
#define _OMC_LIT277_data " = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT277,3,_OMC_LIT277_data);
#define _OMC_LIT277 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT277)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT278,1,3) {&DAE_Prefix_NOPRE__desc,}};
#define _OMC_LIT278 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT278)
#define _OMC_LIT279_data "- InstUtil.elabComponentArraydimFromEnv failed: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT279,48,_OMC_LIT279_data);
#define _OMC_LIT279 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT279)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT280,1,4) {&DAE_ConnectorType_FLOW__desc,}};
#define _OMC_LIT280 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT280)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT281,2,5) {&DAE_ConnectorType_STREAM__desc,MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT281 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT281)
#define _OMC_LIT282_data "Invalid type prefix '%s' on %s %s, due to existing type prefix '%s'."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT282,68,_OMC_LIT282_data);
#define _OMC_LIT282 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT282)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT283,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT282}};
#define _OMC_LIT283 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT283)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT284,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(179)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT283}};
#define _OMC_LIT284 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT284)
#define _OMC_LIT285_data "variable"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT285,8,_OMC_LIT285_data);
#define _OMC_LIT285 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT285)
#define _OMC_LIT286_data "\n- Component declared as '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT286,26,_OMC_LIT286_data);
#define _OMC_LIT286 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT286)
#define _OMC_LIT287_data "' when having the variable '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT287,28,_OMC_LIT287_data);
#define _OMC_LIT287 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT287)
#define _OMC_LIT288_data "' declared as '"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT288,15,_OMC_LIT288_data);
#define _OMC_LIT288 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT288)
#define _OMC_LIT289_data "' : Subcomponent parallelism modified to."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT289,41,_OMC_LIT289_data);
#define _OMC_LIT289 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT289)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT290,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(7004)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT54}};
#define _OMC_LIT290 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT290)
#define _OMC_LIT291_data "Failed to deduce dimensions of %s due to unknown dimensions of modifier %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT291,75,_OMC_LIT291_data);
#define _OMC_LIT291 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT291)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT292,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT291}};
#define _OMC_LIT292 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT292)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT293,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(171)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT292}};
#define _OMC_LIT293 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT293)
#define _OMC_LIT294_data "- InstUtil.instWholeDimFromMod failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT294,38,_OMC_LIT294_data);
#define _OMC_LIT294 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT294)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT295,1,3) {&DAE_Subscript_WHOLEDIM__desc,}};
#define _OMC_LIT295 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT295)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT296,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT296 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT296)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT297,2,6) {&DAE_Subscript_WHOLE__NONEXP__desc,_OMC_LIT296}};
#define _OMC_LIT297 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT297)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT298,2,3) {&DAE_Dimension_DIM__INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT298 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT298)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT299,1,6) {&DAE_ConnectorType_NON__CONNECTOR__desc,}};
#define _OMC_LIT299 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT299)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT300,1,5) {&SCode_Parallelism_NON__PARALLEL__desc,}};
#define _OMC_LIT300 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT300)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT301,1,3) {&SCode_Variability_VAR__desc,}};
#define _OMC_LIT301 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT301)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT302,1,5) {&Absyn_Direction_BIDIR__desc,}};
#define _OMC_LIT302 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT302)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT303,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc,}};
#define _OMC_LIT303 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT303)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT304,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT304 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT304)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT305,7,3) {&DAE_Attributes_ATTR__desc,_OMC_LIT299,_OMC_LIT300,_OMC_LIT301,_OMC_LIT302,_OMC_LIT303,_OMC_LIT304}};
#define _OMC_LIT305 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT305)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT306,1,11) {&DAE_Type_T__UNKNOWN__desc,}};
#define _OMC_LIT306 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT306)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT307,1,3) {&DAE_Binding_UNBOUND__desc,}};
#define _OMC_LIT307 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT307)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT308,1,3) {&FCore_Status_VAR__UNTYPED__desc,}};
#define _OMC_LIT308 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT308)
#define _OMC_LIT309_data "InstUtil.addEnumerationLiteralToEnv: Unknown enumeration type!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT309,63,_OMC_LIT309_data);
#define _OMC_LIT309 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT309)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT310,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT90}};
#define _OMC_LIT310 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT310)
#define _OMC_LIT311_data "%s is used as a function reference, but doesn't specify the partial prefix."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT311,75,_OMC_LIT311_data);
#define _OMC_LIT311 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT311)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT312,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT311}};
#define _OMC_LIT312 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT312)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT313,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5003)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT312}};
#define _OMC_LIT313 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT313)
#define _OMC_LIT314_data "InstUtil.getUsertypeDimensions failed: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT314,39,_OMC_LIT314_data);
#define _OMC_LIT314 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT314)
#define _OMC_LIT315_data "- InstUtil.makeArrayType failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT315,32,_OMC_LIT315_data);
#define _OMC_LIT315 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT315)
#define _OMC_LIT316_data "Component %s of variability %s has binding %s of higher variability %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT316,71,_OMC_LIT316_data);
#define _OMC_LIT316 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT316)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT317,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT316}};
#define _OMC_LIT317 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT317)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT318,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(130)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT317}};
#define _OMC_LIT318 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT318)
#define _OMC_LIT319_data "Invalid type %s for function component %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT319,42,_OMC_LIT319_data);
#define _OMC_LIT319 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT319)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT320,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT319}};
#define _OMC_LIT320 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT320)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT321,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(198)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT320}};
#define _OMC_LIT321 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT321)
#define _OMC_LIT322_data "Invalid public variable %s, function variables that are not input/output must be protected."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT322,91,_OMC_LIT322_data);
#define _OMC_LIT322 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT322)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT323,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT322}};
#define _OMC_LIT323 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT323)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT324,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(201)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT323}};
#define _OMC_LIT324 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT324)
#define _OMC_LIT325_data "Invalid protected variable %s, function variables that are input/output must be public."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT325,87,_OMC_LIT325_data);
#define _OMC_LIT325 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT325)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT326,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT325}};
#define _OMC_LIT326 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT326)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT327,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(202)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT326}};
#define _OMC_LIT327 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT327)
#define _OMC_LIT328_data "- InstUtil.moveBindings failed on "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT328,34,_OMC_LIT328_data);
#define _OMC_LIT328 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT328)
#define _OMC_LIT329_data "- InstUtil.moveBindings: Mismatched number of equations and variables."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT329,70,_OMC_LIT329_data);
#define _OMC_LIT329 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT329)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT330,0.0);
#define _OMC_LIT330 MMC_REFREALLIT(_OMC_LIT_STRUCT330)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT331,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT103,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT330}};
#define _OMC_LIT331 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT331)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT332,2,3) {&ClassInf_State_UNKNOWN__desc,_OMC_LIT184}};
#define _OMC_LIT332 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT332)
#define _OMC_LIT333_data "Duplicate class definitions (due to inheritance) not equivalent, first definition is: %s, second definition is: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT333,115,_OMC_LIT333_data);
#define _OMC_LIT333 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT333)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT334,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT333}};
#define _OMC_LIT334 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT334)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT335,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(129)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT334}};
#define _OMC_LIT335 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT335)
#define _OMC_LIT336_data "m_flow"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT336,6,_OMC_LIT336_data);
#define _OMC_LIT336 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT336)
#define _OMC_LIT337_data "Inherited elements are not identical: bug: https://trac.modelica.org/Modelica/ticket/627\n	first:  "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT337,98,_OMC_LIT337_data);
#define _OMC_LIT337 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT337)
#define _OMC_LIT338_data "\n	second: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT338,10,_OMC_LIT338_data);
#define _OMC_LIT338 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT338)
#define _OMC_LIT339_data "\nContinue ...."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT339,14,_OMC_LIT339_data);
#define _OMC_LIT339 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT339)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT340,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(6000)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT6}};
#define _OMC_LIT340 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT340)
#define _OMC_LIT341_data "Duplicate elements (due to inherited elements) not identical:\n  first element is:  %s\n  second element is: %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT341,109,_OMC_LIT341_data);
#define _OMC_LIT341 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT341)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT342,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT341}};
#define _OMC_LIT342 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT342)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT343,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(90)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT342}};
#define _OMC_LIT343 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT343)
#define _OMC_LIT344_data "checkMultiplyDeclared"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT344,21,_OMC_LIT344_data);
#define _OMC_LIT344 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT344)
#define _OMC_LIT345_data "$parent."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT345,8,_OMC_LIT345_data);
#define _OMC_LIT345 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT345)
#define _OMC_LIT346_data "-Inst.checkMultiplyDeclared failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT346,35,_OMC_LIT346_data);
#define _OMC_LIT346 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT346)
#define _OMC_LIT347_data "Depreciated record constructor used: Inst.addRecordConstructorsToTheCache"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT347,73,_OMC_LIT347_data);
#define _OMC_LIT347 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT347)
#define _OMC_LIT348_data " in env: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT348,9,_OMC_LIT348_data);
#define _OMC_LIT348 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT348)
#define _OMC_LIT349_data "Component %s has the same name as its type %s.\n	This is forbidden by Modelica specification and may lead to lookup errors."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT349,122,_OMC_LIT349_data);
#define _OMC_LIT349 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT349)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT350,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT349}};
#define _OMC_LIT350 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT350)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT351,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(136)),_OMC_LIT3,_OMC_LIT56,_OMC_LIT350}};
#define _OMC_LIT351 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT351)
#define _OMC_LIT352_data "- InstUtil.addClassdefToEnv2 failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT352,36,_OMC_LIT352_data);
#define _OMC_LIT352 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT352)
#define _OMC_LIT353_data "}, {"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT353,4,_OMC_LIT353_data);
#define _OMC_LIT353 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT353)
#define _OMC_LIT354_data "{"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT354,1,_OMC_LIT354_data);
#define _OMC_LIT354 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT354)
#define _OMC_LIT355_data "}"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT355,1,_OMC_LIT355_data);
#define _OMC_LIT355 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT355)
#define _OMC_LIT356_data "Cyclically dependent constants or parameters found in scope %s: %s (ignore with -d=ignoreCycles)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT356,97,_OMC_LIT356_data);
#define _OMC_LIT356 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT356)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT357,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT356}};
#define _OMC_LIT357 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT357)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT358,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(170)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT357}};
#define _OMC_LIT358 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT358)
#define _OMC_LIT359_data "ignoreCycles"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT359,12,_OMC_LIT359_data);
#define _OMC_LIT359 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT359)
#define _OMC_LIT360_data "Ignores cycles between constant/parameter components."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT360,53,_OMC_LIT360_data);
#define _OMC_LIT360 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT360)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT361,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT360}};
#define _OMC_LIT361 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT361)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT362,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(162)),_OMC_LIT359,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT361}};
#define _OMC_LIT362 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT362)
#define _OMC_LIT363_data "- InstUtil.getCrefFromDim failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT363,33,_OMC_LIT363_data);
#define _OMC_LIT363 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT363)
#define _OMC_LIT364_data "InstUtil.getCrefFromMod: could not retrieve crefs from SCode.Mod: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT364,66,_OMC_LIT364_data);
#define _OMC_LIT364 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT364)
#define _OMC_LIT365_data "Graph for env: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT365,15,_OMC_LIT365_data);
#define _OMC_LIT365 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT365)
#define _OMC_LIT366_data "Element order:\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT366,16,_OMC_LIT366_data);
#define _OMC_LIT366 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT366)
#define _OMC_LIT367_data "\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT367,2,_OMC_LIT367_data);
#define _OMC_LIT367 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT367)
#define _OMC_LIT368_data "Cycles:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT368,8,_OMC_LIT368_data);
#define _OMC_LIT368 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT368)
#define _OMC_LIT369_data ", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT369,2,_OMC_LIT369_data);
#define _OMC_LIT369 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT369)
#define _OMC_LIT370_data " failure in get_Constant_PlusDeps \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT370,35,_OMC_LIT370_data);
#define _OMC_LIT370 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT370)
#define _OMC_LIT371_data "- InstUtil.extractConstantPlusDeps failure to find "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT371,51,_OMC_LIT371_data);
#define _OMC_LIT371 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT371)
#define _OMC_LIT372_data ", returning \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT372,13,_OMC_LIT372_data);
#define _OMC_LIT372 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT372)
#define _OMC_LIT373_data "- InstUtil.extractConstantPlusDeps elements to instantiate:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT373,59,_OMC_LIT373_data);
#define _OMC_LIT373 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT373)
#define _OMC_LIT374_data " not found in <"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT374,15,_OMC_LIT374_data);
#define _OMC_LIT374 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT374)
#define _OMC_LIT375_data ">"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT375,1,_OMC_LIT375_data);
#define _OMC_LIT375 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT375)
#define _OMC_LIT376_data "In modifier %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT376,15,_OMC_LIT376_data);
#define _OMC_LIT376 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT376)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT377,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT376}};
#define _OMC_LIT377 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT377)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT378,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(515)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT377}};
#define _OMC_LIT378 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT378)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT379,2,1) {_OMC_LIT91,_OMC_LIT94}};
#define _OMC_LIT379 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT379)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT380,2,1) {_OMC_LIT92,_OMC_LIT379}};
#define _OMC_LIT380 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT380)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT381,2,1) {_OMC_LIT90,_OMC_LIT380}};
#define _OMC_LIT381 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT381)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT382,2,1) {_OMC_LIT89,_OMC_LIT381}};
#define _OMC_LIT382 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT382)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT383,2,1) {_OMC_LIT91,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT383 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT383)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT384,2,1) {_OMC_LIT92,_OMC_LIT383}};
#define _OMC_LIT384 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT384)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT385,2,1) {_OMC_LIT90,_OMC_LIT384}};
#define _OMC_LIT385 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT385)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT386,2,1) {_OMC_LIT89,_OMC_LIT385}};
#define _OMC_LIT386 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT386)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT387,1,10) {&SCode_Restriction_R__TYPE__desc,}};
#define _OMC_LIT387 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT387)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT388,1,14) {&SCode_Restriction_R__PREDEFINED__INTEGER__desc,}};
#define _OMC_LIT388 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT388)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT389,1,15) {&SCode_Restriction_R__PREDEFINED__REAL__desc,}};
#define _OMC_LIT389 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT389)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT390,1,16) {&SCode_Restriction_R__PREDEFINED__STRING__desc,}};
#define _OMC_LIT390 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT390)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT391,1,17) {&SCode_Restriction_R__PREDEFINED__BOOLEAN__desc,}};
#define _OMC_LIT391 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT391)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT392,1,19) {&SCode_Restriction_R__PREDEFINED__CLOCK__desc,}};
#define _OMC_LIT392 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT392)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT393,2,1) {_OMC_LIT392,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT393 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT393)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT394,2,1) {_OMC_LIT391,_OMC_LIT393}};
#define _OMC_LIT394 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT394)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT395,2,1) {_OMC_LIT390,_OMC_LIT394}};
#define _OMC_LIT395 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT395)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT396,2,1) {_OMC_LIT389,_OMC_LIT395}};
#define _OMC_LIT396 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT396)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT397,2,1) {_OMC_LIT388,_OMC_LIT396}};
#define _OMC_LIT397 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT397)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT398,2,1) {_OMC_LIT387,_OMC_LIT397}};
#define _OMC_LIT398 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT398)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT399,2,1) {_OMC_LIT391,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT399 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT399)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT400,2,1) {_OMC_LIT390,_OMC_LIT399}};
#define _OMC_LIT400 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT400)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT401,2,1) {_OMC_LIT389,_OMC_LIT400}};
#define _OMC_LIT401 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT401)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT402,2,1) {_OMC_LIT388,_OMC_LIT401}};
#define _OMC_LIT402 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT402)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT403,2,1) {_OMC_LIT387,_OMC_LIT402}};
#define _OMC_LIT403 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT403)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT404,2,8) {&SCode_Restriction_R__CONNECTOR__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT404 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT404)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT405,2,8) {&SCode_Restriction_R__CONNECTOR__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT405 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT405)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT406,2,1) {_OMC_LIT405,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT406 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT406)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT407,2,1) {_OMC_LIT404,_OMC_LIT406}};
#define _OMC_LIT407 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT407)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT408,2,1) {_OMC_LIT387,_OMC_LIT407}};
#define _OMC_LIT408 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT408)
#define _OMC_LIT409_data "Error!: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT409,8,_OMC_LIT409_data);
#define _OMC_LIT409 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT409)
#define _OMC_LIT410_data " cannot be extended by "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT410,23,_OMC_LIT410_data);
#define _OMC_LIT410 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT410)
#define _OMC_LIT411_data " due to derived/base class restrictions.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT411,41,_OMC_LIT411_data);
#define _OMC_LIT411 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT411)
#define _OMC_LIT412_data "equalityConstraint"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT412,18,_OMC_LIT412_data);
#define _OMC_LIT412 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT412)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT413,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT412}};
#define _OMC_LIT413 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT413)
#define _OMC_LIT414_data " ***** FAILURE with "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT414,20,_OMC_LIT414_data);
#define _OMC_LIT414 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT414)
#define _OMC_LIT415_data " _and_ "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT415,7,_OMC_LIT415_data);
#define _OMC_LIT415 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT415)
#define _OMC_LIT416_data "The system of units is consistent."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT416,34,_OMC_LIT416_data);
#define _OMC_LIT416 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT416)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT417,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT416}};
#define _OMC_LIT417 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT417)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT418,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(518)),_OMC_LIT3,_OMC_LIT80,_OMC_LIT417}};
#define _OMC_LIT418 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT418)
#define _OMC_LIT419_data "The system of units is incomplete. Please provide unit information to the model by e.g. using types from the SIunits package."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT419,125,_OMC_LIT419_data);
#define _OMC_LIT419 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT419)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT420,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT419}};
#define _OMC_LIT420 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT420)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT421,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(519)),_OMC_LIT3,_OMC_LIT80,_OMC_LIT420}};
#define _OMC_LIT421 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT421)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT422,1,5) {&FCore_Status_VAR__DAE__desc,}};
#define _OMC_LIT422 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT422)
#define _OMC_LIT423_data "Expression"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT423,10,_OMC_LIT423_data);
#define _OMC_LIT423 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT423)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT424,1,3) {&DAE_CodeType_C__EXPRESSION__desc,}};
#define _OMC_LIT424 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT424)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT425,2,18) {&DAE_Type_T__CODE__desc,_OMC_LIT424}};
#define _OMC_LIT425 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT425)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT426,2,0) {_OMC_LIT423,_OMC_LIT425}};
#define _OMC_LIT426 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT426)
#define _OMC_LIT427_data "ExpressionOrModification"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT427,24,_OMC_LIT427_data);
#define _OMC_LIT427 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT427)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT428,1,4) {&DAE_CodeType_C__EXPRESSION__OR__MODIFICATION__desc,}};
#define _OMC_LIT428 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT428)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT429,2,18) {&DAE_Type_T__CODE__desc,_OMC_LIT428}};
#define _OMC_LIT429 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT429)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT430,2,0) {_OMC_LIT427,_OMC_LIT429}};
#define _OMC_LIT430 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT430)
#define _OMC_LIT431_data "TypeName"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT431,8,_OMC_LIT431_data);
#define _OMC_LIT431 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT431)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT432,1,6) {&DAE_CodeType_C__TYPENAME__desc,}};
#define _OMC_LIT432 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT432)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT433,2,18) {&DAE_Type_T__CODE__desc,_OMC_LIT432}};
#define _OMC_LIT433 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT433)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT434,2,0) {_OMC_LIT431,_OMC_LIT433}};
#define _OMC_LIT434 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT434)
#define _OMC_LIT435_data "VariableName"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT435,12,_OMC_LIT435_data);
#define _OMC_LIT435 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT435)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT436,1,7) {&DAE_CodeType_C__VARIABLENAME__desc,}};
#define _OMC_LIT436 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT436)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT437,2,18) {&DAE_Type_T__CODE__desc,_OMC_LIT436}};
#define _OMC_LIT437 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT437)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT438,2,0) {_OMC_LIT435,_OMC_LIT437}};
#define _OMC_LIT438 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT438)
#define _OMC_LIT439_data "VariableNames"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT439,13,_OMC_LIT439_data);
#define _OMC_LIT439 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT439)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT440,1,8) {&DAE_CodeType_C__VARIABLENAMES__desc,}};
#define _OMC_LIT440 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT440)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT441,2,18) {&DAE_Type_T__CODE__desc,_OMC_LIT440}};
#define _OMC_LIT441 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT441)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT442,2,0) {_OMC_LIT439,_OMC_LIT441}};
#define _OMC_LIT442 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT442)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT443,2,1) {_OMC_LIT442,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT443 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT443)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT444,2,1) {_OMC_LIT438,_OMC_LIT443}};
#define _OMC_LIT444 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT444)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT445,2,1) {_OMC_LIT434,_OMC_LIT444}};
#define _OMC_LIT445 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT445)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT446,2,1) {_OMC_LIT430,_OMC_LIT445}};
#define _OMC_LIT446 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT446)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT447,2,1) {_OMC_LIT426,_OMC_LIT446}};
#define _OMC_LIT447 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT447)
#define _OMC_LIT448_data "Class %s not found."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT448,19,_OMC_LIT448_data);
#define _OMC_LIT448 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT448)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT449,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT448}};
#define _OMC_LIT449 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT449)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT450,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(20)),_OMC_LIT3,_OMC_LIT4,_OMC_LIT449}};
#define _OMC_LIT450 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT450)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT451,1,4) {&Absyn_Msg_NO__MSG__desc,}};
#define _OMC_LIT451 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT451)
#define _OMC_LIT452_data "scodeFlattenProgram"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT452,19,_OMC_LIT452_data);
#define _OMC_LIT452 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT452)
#define _OMC_LIT453_data "scodeDep"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT453,8,_OMC_LIT453_data);
#define _OMC_LIT453 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT453)
#define _OMC_LIT454_data "Does scode dependency analysis prior to instantiation. Defaults to true."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT454,72,_OMC_LIT454_data);
#define _OMC_LIT454 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT454)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT455,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT454}};
#define _OMC_LIT455 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT455)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT456,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(106)),_OMC_LIT453,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT455}};
#define _OMC_LIT456 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT456)
#define _OMC_LIT457_data "__TMP__"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT457,7,_OMC_LIT457_data);
#define _OMC_LIT457 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT457)
#include "util/modelica.h"
#include "InstUtil_includes.h"
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_findDomF(threadData_t *threadData, modelica_metatype _inTup, modelica_string _name);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findDomF(threadData_t *threadData, modelica_metatype _inTup, modelica_metatype _name);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_findDomF,2,0) {(void*) boxptr_InstUtil_findDomF,0}};
#define boxvar_InstUtil_findDomF MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_findDomF)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_discretizeTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTup, modelica_metatype *out_outTup);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_discretizeTraverseFun,2,0) {(void*) boxptr_InstUtil_discretizeTraverseFun,0}};
#define boxvar_InstUtil_discretizeTraverseFun MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_discretizeTraverseFun)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_newEQFun(threadData_t *threadData, modelica_integer _i, modelica_metatype _inLhs_exp, modelica_metatype _inRhs_exp, modelica_metatype _domainCr, modelica_integer _N, modelica_boolean _isBC, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_newEQFun(threadData_t *threadData, modelica_metatype _i, modelica_metatype _inLhs_exp, modelica_metatype _inRhs_exp, modelica_metatype _domainCr, modelica_metatype _N, modelica_metatype _isBC, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_newEQFun,2,0) {(void*) boxptr_InstUtil_newEQFun,0}};
#define boxvar_InstUtil_newEQFun MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_newEQFun)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_hasPderTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inHasPder, modelica_boolean *out_outHasPder);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_hasPderTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHasPder, modelica_metatype *out_outHasPder);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_hasPderTraverseFun,2,0) {(void*) boxptr_InstUtil_hasPderTraverseFun,0}};
#define boxvar_InstUtil_hasPderTraverseFun MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_hasPderTraverseFun)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_creatFieldEqs(threadData_t *threadData, modelica_metatype _lhs_exp, modelica_metatype _rhs_exp, modelica_metatype _domainCr, modelica_integer _N, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_creatFieldEqs(threadData_t *threadData, modelica_metatype _lhs_exp, modelica_metatype _rhs_exp, modelica_metatype _domainCr, modelica_metatype _N, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_creatFieldEqs,2,0) {(void*) boxptr_InstUtil_creatFieldEqs,0}};
#define boxvar_InstUtil_creatFieldEqs MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_creatFieldEqs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extrapolateFieldEq(threadData_t *threadData, modelica_boolean _isRight, modelica_metatype _fieldCr, modelica_metatype _domainCr, modelica_integer _N, modelica_metatype _comment, modelica_metatype _info, modelica_metatype _fieldLst);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_extrapolateFieldEq(threadData_t *threadData, modelica_metatype _isRight, modelica_metatype _fieldCr, modelica_metatype _domainCr, modelica_metatype _N, modelica_metatype _comment, modelica_metatype _info, modelica_metatype _fieldLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extrapolateFieldEq,2,0) {(void*) boxptr_InstUtil_extrapolateFieldEq,0}};
#define boxvar_InstUtil_extrapolateFieldEq MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extrapolateFieldEq)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_absynDAECrefEqualName(threadData_t *threadData, modelica_metatype _domainCr1, modelica_metatype _domainCr2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_absynDAECrefEqualName(threadData_t *threadData, modelica_metatype _domainCr1, modelica_metatype _domainCr2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_absynDAECrefEqualName,2,0) {(void*) boxptr_InstUtil_absynDAECrefEqualName,0}};
#define boxvar_InstUtil_absynDAECrefEqualName MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_absynDAECrefEqualName)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_domNFieldsFindFun(threadData_t *threadData, modelica_metatype _inDomFields, modelica_metatype _inDomainCr);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_domNFieldsFindFun,2,0) {(void*) boxptr_InstUtil_domNFieldsFindFun,0}};
#define boxvar_InstUtil_domNFieldsFindFun MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_domNFieldsFindFun)
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_getDomNFields(threadData_t *threadData, modelica_metatype _inDomFieldLst, modelica_metatype _inDomainCr, modelica_metatype _info, modelica_metatype *out_outFieldLst);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getDomNFields(threadData_t *threadData, modelica_metatype _inDomFieldLst, modelica_metatype _inDomainCr, modelica_metatype _info, modelica_metatype *out_outFieldLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDomNFields,2,0) {(void*) boxptr_InstUtil_getDomNFields,0}};
#define boxvar_InstUtil_getDomNFields MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDomNFields)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extrapFieldTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_integer _inN, modelica_integer *out_outN);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_extrapFieldTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inN, modelica_metatype *out_outN);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extrapFieldTraverseFun,2,0) {(void*) boxptr_InstUtil_extrapFieldTraverseFun,0}};
#define boxvar_InstUtil_extrapFieldTraverseFun MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extrapFieldTraverseFun)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optAppendFieldMapFun(threadData_t *threadData, modelica_metatype _inDomainFields, modelica_metatype _domainCrToAdd, modelica_metatype _fieldCrToAdd, modelica_boolean _inFound, modelica_boolean *out_outFound);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_optAppendFieldMapFun(threadData_t *threadData, modelica_metatype _inDomainFields, modelica_metatype _domainCrToAdd, modelica_metatype _fieldCrToAdd, modelica_metatype _inFound, modelica_metatype *out_outFound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optAppendFieldMapFun,2,0) {(void*) boxptr_InstUtil_optAppendFieldMapFun,0}};
#define boxvar_InstUtil_optAppendFieldMapFun MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optAppendFieldMapFun)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addEach(threadData_t *threadData, modelica_metatype _inSubMod);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addEach,2,0) {(void*) boxptr_InstUtil_addEach,0}};
#define boxvar_InstUtil_addEach MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addEach)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findN(threadData_t *threadData, modelica_metatype _inVar);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_findN,2,0) {(void*) boxptr_InstUtil_findN,0}};
#define boxvar_InstUtil_findN MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_findN)
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_getNDcr(threadData_t *threadData, modelica_metatype _dcr, modelica_metatype *out_outCrOpt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getNDcr(threadData_t *threadData, modelica_metatype _dcr, modelica_metatype *out_outCrOpt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getNDcr,2,0) {(void*) boxptr_InstUtil_getNDcr,0}};
#define boxvar_InstUtil_getNDcr MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getNDcr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getQualDcr(threadData_t *threadData, modelica_metatype _domainSubMod, modelica_metatype _inInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getQualDcr,2,0) {(void*) boxptr_InstUtil_getQualDcr,0}};
#define boxvar_InstUtil_getQualDcr MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getQualDcr)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_findDomainSubMod(threadData_t *threadData, modelica_metatype _subMod);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findDomainSubMod(threadData_t *threadData, modelica_metatype _subMod);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_findDomainSubMod,2,0) {(void*) boxptr_InstUtil_findDomainSubMod,0}};
#define boxvar_InstUtil_findDomainSubMod MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_findDomainSubMod)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findUnboundVariableUseInCase(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _inUnbound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_findUnboundVariableUseInCase,2,0) {(void*) boxptr_InstUtil_findUnboundVariableUseInCase,0}};
#define boxvar_InstUtil_findUnboundVariableUseInCase MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_findUnboundVariableUseInCase)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findUnboundVariableUse(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findUnboundVariableUse(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_findUnboundVariableUse,2,0) {(void*) boxptr_InstUtil_findUnboundVariableUse,0}};
#define boxvar_InstUtil_findUnboundVariableUse MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_findUnboundVariableUse)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseCrefSubs(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _info, modelica_metatype _inUnbound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_traverseCrefSubs,2,0) {(void*) boxptr_InstUtil_traverseCrefSubs,0}};
#define boxvar_InstUtil_traverseCrefSubs MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_traverseCrefSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_patternFiltering(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inLst, modelica_metatype *out_unbound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_patternFiltering,2,0) {(void*) boxptr_InstUtil_patternFiltering,0}};
#define boxvar_InstUtil_patternFiltering MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_patternFiltering)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_crefFiltering(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inUnbound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_crefFiltering,2,0) {(void*) boxptr_InstUtil_crefFiltering,0}};
#define boxvar_InstUtil_crefFiltering MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_crefFiltering)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkFunctionDefUseElse(threadData_t *threadData, modelica_metatype _inElse, modelica_metatype _inUnbound, modelica_boolean _inLoop, modelica_metatype _info);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkFunctionDefUseElse(threadData_t *threadData, modelica_metatype _inElse, modelica_metatype _inUnbound, modelica_metatype _inLoop, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkFunctionDefUseElse,2,0) {(void*) boxptr_InstUtil_checkFunctionDefUseElse,0}};
#define boxvar_InstUtil_checkFunctionDefUseElse MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkFunctionDefUseElse)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkFunctionDefUseStmt(threadData_t *threadData, modelica_metatype _inStmt, modelica_boolean _inLoop, modelica_metatype _inUnbound);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkFunctionDefUseStmt(threadData_t *threadData, modelica_metatype _inStmt, modelica_metatype _inLoop, modelica_metatype _inUnbound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkFunctionDefUseStmt,2,0) {(void*) boxptr_InstUtil_checkFunctionDefUseStmt,0}};
#define boxvar_InstUtil_checkFunctionDefUseStmt MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkFunctionDefUseStmt)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkOutputDefUse(threadData_t *threadData, modelica_string _name, modelica_metatype _info, modelica_metatype _inUnbound);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkOutputDefUse,2,0) {(void*) boxptr_InstUtil_checkOutputDefUse,0}};
#define boxvar_InstUtil_checkOutputDefUse MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkOutputDefUse)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkFunctionDefUse2(threadData_t *threadData, modelica_metatype _elts, modelica_metatype _alg, modelica_metatype _inUnbound, modelica_metatype _inOutputs, modelica_metatype _inInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkFunctionDefUse2,2,0) {(void*) boxptr_InstUtil_checkFunctionDefUse2,0}};
#define boxvar_InstUtil_checkFunctionDefUse2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkFunctionDefUse2)
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_numStructuralParameterScopes(threadData_t *threadData, modelica_metatype _cache);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_numStructuralParameterScopes(threadData_t *threadData, modelica_metatype _cache);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_numStructuralParameterScopes,2,0) {(void*) boxptr_InstUtil_numStructuralParameterScopes,0}};
#define boxvar_InstUtil_numStructuralParameterScopes MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_numStructuralParameterScopes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_prefixAndAddCrefsToHt(threadData_t *threadData, modelica_metatype _cache, modelica_metatype __omcQ_24in_5Fset, modelica_metatype _pre, modelica_metatype _icrs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_prefixAndAddCrefsToHt,2,0) {(void*) boxptr_InstUtil_prefixAndAddCrefsToHt,0}};
#define boxvar_InstUtil_prefixAndAddCrefsToHt MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_prefixAndAddCrefsToHt)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTailMatchCases(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inCases, modelica_boolean _changed, modelica_metatype _inAcc, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_optimizeStatementTailMatchCases(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inCases, modelica_metatype _changed, modelica_metatype _inAcc, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTailMatchCases,2,0) {(void*) boxptr_InstUtil_optimizeStatementTailMatchCases,0}};
#define boxvar_InstUtil_optimizeStatementTailMatchCases MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTailMatchCases)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTail3(threadData_t *threadData, modelica_metatype _path, modelica_metatype _rhs, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source, modelica_boolean *out_isTailRecursive);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_optimizeStatementTail3(threadData_t *threadData, modelica_metatype _path, modelica_metatype _rhs, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source, modelica_metatype *out_isTailRecursive);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTail3,2,0) {(void*) boxptr_InstUtil_optimizeStatementTail3,0}};
#define boxvar_InstUtil_optimizeStatementTail3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTail3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTail2(threadData_t *threadData, modelica_metatype _path, modelica_metatype _rhs, modelica_metatype _lhsVars, modelica_metatype _invars, modelica_metatype _outvars, modelica_metatype _source);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTail2,2,0) {(void*) boxptr_InstUtil_optimizeStatementTail2,0}};
#define boxvar_InstUtil_optimizeStatementTail2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTail2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeElseTail(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inElse, modelica_metatype _invars, modelica_metatype _outvars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optimizeElseTail,2,0) {(void*) boxptr_InstUtil_optimizeElseTail,0}};
#define boxvar_InstUtil_optimizeElseTail MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optimizeElseTail)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTail(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inStmt, modelica_metatype _invars, modelica_metatype _outvars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTail,2,0) {(void*) boxptr_InstUtil_optimizeStatementTail,0}};
#define boxvar_InstUtil_optimizeStatementTail MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optimizeStatementTail)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeLastStatementTail(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inStmts, modelica_metatype _invars, modelica_metatype _outvars, modelica_metatype _acc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_optimizeLastStatementTail,2,0) {(void*) boxptr_InstUtil_optimizeLastStatementTail,0}};
#define boxvar_InstUtil_optimizeLastStatementTail MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_optimizeLastStatementTail)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_splitClassDefsAndComponents(threadData_t *threadData, modelica_metatype _inLstElAndMod, modelica_metatype *out_outComponentDefs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_splitClassDefsAndComponents,2,0) {(void*) boxptr_InstUtil_splitClassDefsAndComponents,0}};
#define boxvar_InstUtil_splitClassDefsAndComponents MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_splitClassDefsAndComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getFunctionAttributes(threadData_t *threadData, modelica_metatype _cl, modelica_metatype _vl, modelica_metatype _inheritedComment);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getFunctionAttributes,2,0) {(void*) boxptr_InstUtil_getFunctionAttributes,0}};
#define boxvar_InstUtil_getFunctionAttributes MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getFunctionAttributes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_mergeClassComments(threadData_t *threadData, modelica_metatype _comment1, modelica_metatype _comment2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_mergeClassComments,2,0) {(void*) boxptr_InstUtil_mergeClassComments,0}};
#define boxvar_InstUtil_mergeClassComments MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_mergeClassComments)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findCorrespondingBinding(threadData_t *threadData, modelica_metatype _inCref, modelica_metatype _inEquations, modelica_integer __omcQ_24in_5Fi, modelica_integer *out_i);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findCorrespondingBinding(threadData_t *threadData, modelica_metatype _inCref, modelica_metatype _inEquations, modelica_metatype __omcQ_24in_5Fi, modelica_metatype *out_i);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_findCorrespondingBinding,2,0) {(void*) boxptr_InstUtil_findCorrespondingBinding,0}};
#define boxvar_InstUtil_findCorrespondingBinding MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_findCorrespondingBinding)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkVariabilityOfUpdatedComponent(threadData_t *threadData, modelica_metatype _variability, modelica_metatype _cref);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkVariabilityOfUpdatedComponent,2,0) {(void*) boxptr_InstUtil_checkVariabilityOfUpdatedComponent,0}};
#define boxvar_InstUtil_checkVariabilityOfUpdatedComponent MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkVariabilityOfUpdatedComponent)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_makeCrefBaseType2(threadData_t *threadData, modelica_metatype _inBaseType, modelica_metatype _inDimensions);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_makeCrefBaseType2,2,0) {(void*) boxptr_InstUtil_makeCrefBaseType2,0}};
#define boxvar_InstUtil_makeCrefBaseType2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_makeCrefBaseType2)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_instConditionalDeclaration(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inCondition, modelica_metatype _inPrefix, modelica_metatype _inInfo, modelica_metatype *out_outCache);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_instConditionalDeclaration(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inCondition, modelica_metatype _inPrefix, modelica_metatype _inInfo, modelica_metatype *out_outCache);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_instConditionalDeclaration,2,0) {(void*) boxptr_InstUtil_instConditionalDeclaration,0}};
#define boxvar_InstUtil_instConditionalDeclaration MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_instConditionalDeclaration)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_wrapIntoForLst(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inNames, modelica_metatype _inRanges);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_wrapIntoForLst,2,0) {(void*) boxptr_InstUtil_wrapIntoForLst,0}};
#define boxvar_InstUtil_wrapIntoForLst MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_wrapIntoForLst)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_wrapIntoFor(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inNames, modelica_metatype _inRanges);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_wrapIntoFor,2,0) {(void*) boxptr_InstUtil_wrapIntoFor,0}};
#define boxvar_InstUtil_wrapIntoFor MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_wrapIntoFor)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_stringSub(threadData_t *threadData, modelica_string _inName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_stringSub,2,0) {(void*) boxptr_InstUtil_stringSub,0}};
#define boxvar_InstUtil_stringSub MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_stringSub)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_stringsSubs(threadData_t *threadData, modelica_metatype _inNames);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_stringsSubs,2,0) {(void*) boxptr_InstUtil_stringsSubs,0}};
#define boxvar_InstUtil_stringsSubs MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_stringsSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNamesLstCall(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNamesLstCall,2,0) {(void*) boxptr_InstUtil_generateUnusedNamesLstCall,0}};
#define boxvar_InstUtil_generateUnusedNamesLstCall MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNamesLstCall)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNamesLst(threadData_t *threadData, modelica_metatype _inList, modelica_integer _inInt, modelica_integer *out_outInt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_generateUnusedNamesLst(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _inInt, modelica_metatype *out_outInt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNamesLst,2,0) {(void*) boxptr_InstUtil_generateUnusedNamesLst,0}};
#define boxvar_InstUtil_generateUnusedNamesLst MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNamesLst)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNames2(threadData_t *threadData, modelica_metatype _inList, modelica_integer _inInt, modelica_integer *out_outInt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_generateUnusedNames2(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _inInt, modelica_metatype *out_outInt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNames2,2,0) {(void*) boxptr_InstUtil_generateUnusedNames2,0}};
#define boxvar_InstUtil_generateUnusedNames2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNames2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNames(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNames,2,0) {(void*) boxptr_InstUtil_generateUnusedNames,0}};
#define boxvar_InstUtil_generateUnusedNames MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_generateUnusedNames)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_insertSubsInBinding(threadData_t *threadData, modelica_metatype _inOpt, modelica_metatype _inExps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_insertSubsInBinding,2,0) {(void*) boxptr_InstUtil_insertSubsInBinding,0}};
#define boxvar_InstUtil_insertSubsInBinding MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_insertSubsInBinding)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddDims5(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMods, modelica_metatype _inExps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddDims5,2,0) {(void*) boxptr_InstUtil_traverseModAddDims5,0}};
#define boxvar_InstUtil_traverseModAddDims5 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddDims5)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddDims4(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _inExps, modelica_boolean _inIsTop);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_traverseModAddDims4(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _inExps, modelica_metatype _inIsTop);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddDims4,2,0) {(void*) boxptr_InstUtil_traverseModAddDims4,0}};
#define boxvar_InstUtil_traverseModAddDims4 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddDims4)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddFinal4(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fsub);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddFinal4,2,0) {(void*) boxptr_InstUtil_traverseModAddFinal4,0}};
#define boxvar_InstUtil_traverseModAddFinal4 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddFinal4)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddFinal3(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddFinal3,2,0) {(void*) boxptr_InstUtil_traverseModAddFinal3,0}};
#define boxvar_InstUtil_traverseModAddFinal3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_traverseModAddFinal3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractCorrectClassMod2(threadData_t *threadData, modelica_metatype _smod, modelica_string _name, modelica_metatype _premod, modelica_metatype *out_restmods);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extractCorrectClassMod2,2,0) {(void*) boxptr_InstUtil_extractCorrectClassMod2,0}};
#define boxvar_InstUtil_extractCorrectClassMod2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extractCorrectClassMod2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addClassdefsToEnv3(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _sele, modelica_metatype *out_oenv, modelica_metatype *out_outIH, modelica_metatype *out_osele);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addClassdefsToEnv3,2,0) {(void*) boxptr_InstUtil_addClassdefsToEnv3,0}};
#define boxvar_InstUtil_addClassdefsToEnv3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addClassdefsToEnv3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_splitClassExtendsElts(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_outElts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_splitClassExtendsElts,2,0) {(void*) boxptr_InstUtil_splitClassExtendsElts,0}};
#define boxvar_InstUtil_splitClassExtendsElts MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_splitClassExtendsElts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_orderComponents(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _inCompElts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_orderComponents,2,0) {(void*) boxptr_InstUtil_orderComponents,0}};
#define boxvar_InstUtil_orderComponents MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_orderComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_splitInners(threadData_t *threadData, modelica_metatype _inTplLstElementMod, modelica_metatype _inAcc1, modelica_metatype _inAcc2, modelica_metatype _inAcc3, modelica_metatype *out_outModelica, modelica_metatype *out_outOthers);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_splitInners,2,0) {(void*) boxptr_InstUtil_splitInners,0}};
#define boxvar_InstUtil_splitInners MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_splitInners)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkProt(threadData_t *threadData, modelica_metatype _inVisibility, modelica_metatype _inMod, modelica_metatype _inComponentRef, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkProt,2,0) {(void*) boxptr_InstUtil_checkProt,0}};
#define boxvar_InstUtil_checkProt MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkProt)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getOptPath(threadData_t *threadData, modelica_metatype _inPath);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getOptPath,2,0) {(void*) boxptr_InstUtil_getOptPath,0}};
#define boxvar_InstUtil_getOptPath MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getOptPath)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_arrayTTypeToClassInfState(threadData_t *threadData, modelica_metatype _arrayType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_arrayTTypeToClassInfState,2,0) {(void*) boxptr_InstUtil_arrayTTypeToClassInfState,0}};
#define boxvar_InstUtil_arrayTTypeToClassInfState MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_arrayTTypeToClassInfState)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_assertExtArgOutputIsCrefVariable(threadData_t *threadData, modelica_metatype _lang, modelica_metatype _arg, modelica_metatype _ty, modelica_metatype _c, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_assertExtArgOutputIsCrefVariable,2,0) {(void*) boxptr_InstUtil_assertExtArgOutputIsCrefVariable,0}};
#define boxvar_InstUtil_assertExtArgOutputIsCrefVariable MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_assertExtArgOutputIsCrefVariable)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_instExtGetFargsSingle(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _absynExp, modelica_metatype _inExp, modelica_metatype _inProperties, modelica_metatype _lang, modelica_metatype _info, modelica_metatype *out_outExtArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_instExtGetFargsSingle,2,0) {(void*) boxptr_InstUtil_instExtGetFargsSingle,0}};
#define boxvar_InstUtil_instExtGetFargsSingle MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_instExtGetFargsSingle)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_instExtGetFargs2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _absynExps, modelica_metatype _inExpExpLst, modelica_metatype _inTypesPropertiesLst, modelica_metatype _lang, modelica_metatype _info, modelica_metatype *out_outDAEExtArgLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_instExtGetFargs2,2,0) {(void*) boxptr_InstUtil_instExtGetFargs2,0}};
#define boxvar_InstUtil_instExtGetFargs2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_instExtGetFargs2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabExpExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExp, modelica_boolean _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outProperties);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_elabExpExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExp, modelica_metatype _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outProperties);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elabExpExt,2,0) {(void*) boxptr_InstUtil_elabExpExt,0}};
#define boxvar_InstUtil_elabExpExt MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elabExpExt)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabExpListExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inAbsynExpLst, modelica_boolean _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExpExpLst, modelica_metatype *out_outTypesPropertiesLst);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_elabExpListExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inAbsynExpLst, modelica_metatype _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExpExpLst, modelica_metatype *out_outTypesPropertiesLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elabExpListExt,2,0) {(void*) boxptr_InstUtil_elabExpListExt,0}};
#define boxvar_InstUtil_elabExpListExt MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elabExpListExt)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isInputVar(threadData_t *threadData, modelica_metatype _inElement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isInputVar(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isInputVar,2,0) {(void*) boxptr_InstUtil_isInputVar,0}};
#define boxvar_InstUtil_isInputVar MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isInputVar)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isOutputVar(threadData_t *threadData, modelica_metatype _inElement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isOutputVar(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isOutputVar,2,0) {(void*) boxptr_InstUtil_isOutputVar,0}};
#define boxvar_InstUtil_isOutputVar MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isOutputVar)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isInoutVar(threadData_t *threadData, modelica_metatype _inElement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isInoutVar(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isInoutVar,2,0) {(void*) boxptr_InstUtil_isInoutVar,0}};
#define boxvar_InstUtil_isInoutVar MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isInoutVar)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_extArgCrefEq(threadData_t *threadData, modelica_metatype _v, modelica_metatype _arg);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_extArgCrefEq(threadData_t *threadData, modelica_metatype _v, modelica_metatype _arg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extArgCrefEq,2,0) {(void*) boxptr_InstUtil_extArgCrefEq,0}};
#define boxvar_InstUtil_extArgCrefEq MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extArgCrefEq)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkExternalFunctionOutputAssigned(threadData_t *threadData, modelica_metatype _v, modelica_metatype _decl, modelica_string _name);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExternalFunctionOutputAssigned,2,0) {(void*) boxptr_InstUtil_checkExternalFunctionOutputAssigned,0}};
#define boxvar_InstUtil_checkExternalFunctionOutputAssigned MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExternalFunctionOutputAssigned)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkExternalDeclArgs(threadData_t *threadData, modelica_metatype _v, modelica_metatype _args);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkExternalDeclArgs(threadData_t *threadData, modelica_metatype _v, modelica_metatype _args);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExternalDeclArgs,2,0) {(void*) boxptr_InstUtil_checkExternalDeclArgs,0}};
#define boxvar_InstUtil_checkExternalDeclArgs MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExternalDeclArgs)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkVarBindingInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _el);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkVarBindingInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _el);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkVarBindingInputUsed,2,0) {(void*) boxptr_InstUtil_checkVarBindingInputUsed,0}};
#define boxvar_InstUtil_checkVarBindingInputUsed MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkVarBindingInputUsed)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkVarBindingsInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _els);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkVarBindingsInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _els);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkVarBindingsInputUsed,2,0) {(void*) boxptr_InstUtil_checkVarBindingsInputUsed,0}};
#define boxvar_InstUtil_checkVarBindingsInputUsed MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkVarBindingsInputUsed)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkExpInputUsed3(threadData_t *threadData, modelica_metatype _el, modelica_metatype _cr2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkExpInputUsed3(threadData_t *threadData, modelica_metatype _el, modelica_metatype _cr2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExpInputUsed3,2,0) {(void*) boxptr_InstUtil_checkExpInputUsed3,0}};
#define boxvar_InstUtil_checkExpInputUsed3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExpInputUsed3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkExpInputUsed(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inEls, modelica_metatype *out_els);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExpInputUsed,2,0) {(void*) boxptr_InstUtil_checkExpInputUsed,0}};
#define boxvar_InstUtil_checkExpInputUsed MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExpInputUsed)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkExternalDeclInputUsed(threadData_t *threadData, modelica_metatype _inames, modelica_metatype _decl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExternalDeclInputUsed,2,0) {(void*) boxptr_InstUtil_checkExternalDeclInputUsed,0}};
#define boxvar_InstUtil_checkExternalDeclInputUsed MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExternalDeclInputUsed)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_warnUnusedFunctionVar(threadData_t *threadData, modelica_metatype _v, modelica_string _name);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_warnUnusedFunctionVar,2,0) {(void*) boxptr_InstUtil_warnUnusedFunctionVar,0}};
#define boxvar_InstUtil_warnUnusedFunctionVar MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_warnUnusedFunctionVar)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_isInlineFunc2(threadData_t *threadData, modelica_metatype _inSubModList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isInlineFunc2,2,0) {(void*) boxptr_InstUtil_isInlineFunc2,0}};
#define boxvar_InstUtil_isInlineFunc2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isInlineFunc2)
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_getDerivativeOrder(threadData_t *threadData, modelica_metatype _inSubs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getDerivativeOrder(threadData_t *threadData, modelica_metatype _inSubs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDerivativeOrder,2,0) {(void*) boxptr_InstUtil_getDerivativeOrder,0}};
#define boxvar_InstUtil_getDerivativeOrder MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDerivativeOrder)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDerivativeSubModsOptDefault(threadData_t *threadData, modelica_metatype _inSubs, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDerivativeSubModsOptDefault,2,0) {(void*) boxptr_InstUtil_getDerivativeSubModsOptDefault,0}};
#define boxvar_InstUtil_getDerivativeSubModsOptDefault MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDerivativeSubModsOptDefault)
PROTECTED_FUNCTION_STATIC modelica_string omc_InstUtil_extractNameAndExp(threadData_t *threadData, modelica_metatype _m, modelica_metatype *out_cond);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extractNameAndExp,2,0) {(void*) boxptr_InstUtil_extractNameAndExp,0}};
#define boxvar_InstUtil_extractNameAndExp MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extractNameAndExp)
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_setFunctionInputIndex(threadData_t *threadData, modelica_metatype _inElemDecl, modelica_string _str, modelica_integer _currPos);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_setFunctionInputIndex(threadData_t *threadData, modelica_metatype _inElemDecl, modelica_metatype _str, modelica_metatype _currPos);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_setFunctionInputIndex,2,0) {(void*) boxptr_InstUtil_setFunctionInputIndex,0}};
#define boxvar_InstUtil_setFunctionInputIndex MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_setFunctionInputIndex)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDeriveCondition(threadData_t *threadData, modelica_metatype _inSubs, modelica_metatype _elemDecl, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDeriveCondition,2,0) {(void*) boxptr_InstUtil_getDeriveCondition,0}};
#define boxvar_InstUtil_getDeriveCondition MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDeriveCondition)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDeriveAnnotation3(threadData_t *threadData, modelica_metatype _inSubs, modelica_metatype _elemDecl, modelica_metatype _baseFunc, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDeriveAnnotation3,2,0) {(void*) boxptr_InstUtil_getDeriveAnnotation3,0}};
#define boxvar_InstUtil_getDeriveAnnotation3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDeriveAnnotation3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDeriveAnnotation2(threadData_t *threadData, modelica_metatype _ann, modelica_metatype _elemDecl, modelica_metatype _baseFunc, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDeriveAnnotation2,2,0) {(void*) boxptr_InstUtil_getDeriveAnnotation2,0}};
#define boxvar_InstUtil_getDeriveAnnotation2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDeriveAnnotation2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addNameToDerivativeMappingFunctionDefs(threadData_t *threadData, modelica_metatype _inFuncs, modelica_metatype _path);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addNameToDerivativeMappingFunctionDefs,2,0) {(void*) boxptr_InstUtil_addNameToDerivativeMappingFunctionDefs,0}};
#define boxvar_InstUtil_addNameToDerivativeMappingFunctionDefs MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addNameToDerivativeMappingFunctionDefs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabArraydimType2(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inArrayDim, modelica_metatype _inDims);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elabArraydimType2,2,0) {(void*) boxptr_InstUtil_elabArraydimType2,0}};
#define boxvar_InstUtil_elabArraydimType2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elabArraydimType2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabArraydimType(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inArrayDim, modelica_metatype _inExp, modelica_metatype _inPath, modelica_metatype _inPrefix, modelica_metatype _inCref, modelica_metatype _inInfo, modelica_metatype _inInstDims);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elabArraydimType,2,0) {(void*) boxptr_InstUtil_elabArraydimType,0}};
#define boxvar_InstUtil_elabArraydimType MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elabArraydimType)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_compatibleArraydim(threadData_t *threadData, modelica_metatype _inDimension1, modelica_metatype _inDimension2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_compatibleArraydim,2,0) {(void*) boxptr_InstUtil_compatibleArraydim,0}};
#define boxvar_InstUtil_compatibleArraydim MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_compatibleArraydim)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabComponentArraydimFromEnv2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEqMod, modelica_metatype _inEnv, modelica_metatype *out_outDimensionLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elabComponentArraydimFromEnv2,2,0) {(void*) boxptr_InstUtil_elabComponentArraydimFromEnv2,0}};
#define boxvar_InstUtil_elabComponentArraydimFromEnv2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elabComponentArraydimFromEnv2)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_attrIsParam(threadData_t *threadData, modelica_metatype _inAttributes);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_attrIsParam(threadData_t *threadData, modelica_metatype _inAttributes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_attrIsParam,2,0) {(void*) boxptr_InstUtil_attrIsParam,0}};
#define boxvar_InstUtil_attrIsParam MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_attrIsParam)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_absynDirToDaeDir(threadData_t *threadData, modelica_metatype _inDirection);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_absynDirToDaeDir,2,0) {(void*) boxptr_InstUtil_absynDirToDaeDir,0}};
#define boxvar_InstUtil_absynDirToDaeDir MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_absynDirToDaeDir)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateConnectorType(threadData_t *threadData, modelica_metatype _inVarConnectorType, modelica_metatype _inConnectorType, modelica_metatype _inCref, modelica_metatype _inInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateConnectorType,2,0) {(void*) boxptr_InstUtil_propagateConnectorType,0}};
#define boxvar_InstUtil_propagateConnectorType MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateConnectorType)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateInnerOuter(threadData_t *threadData, modelica_metatype _inVarInnerOuter, modelica_metatype _inInnerOuter);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateInnerOuter,2,0) {(void*) boxptr_InstUtil_propagateInnerOuter,0}};
#define boxvar_InstUtil_propagateInnerOuter MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateInnerOuter)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateFinal(threadData_t *threadData, modelica_metatype _inVarAttributes, modelica_metatype _inFinal);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateFinal,2,0) {(void*) boxptr_InstUtil_propagateFinal,0}};
#define boxvar_InstUtil_propagateFinal MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateFinal)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateVariability(threadData_t *threadData, modelica_metatype _inVarKind, modelica_metatype _inVariability);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateVariability,2,0) {(void*) boxptr_InstUtil_propagateVariability,0}};
#define boxvar_InstUtil_propagateVariability MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateVariability)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateVisibility(threadData_t *threadData, modelica_metatype _inVarVisibility, modelica_metatype _inVisibility);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateVisibility,2,0) {(void*) boxptr_InstUtil_propagateVisibility,0}};
#define boxvar_InstUtil_propagateVisibility MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateVisibility)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateParallelism(threadData_t *threadData, modelica_metatype _inVarParallelism, modelica_metatype _inParallelism, modelica_metatype _inCref, modelica_metatype _inInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateParallelism,2,0) {(void*) boxptr_InstUtil_propagateParallelism,0}};
#define boxvar_InstUtil_propagateParallelism MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateParallelism)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateDirection(threadData_t *threadData, modelica_metatype _inVarDirection, modelica_metatype _inDirection, modelica_metatype _inCref, modelica_metatype _inInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateDirection,2,0) {(void*) boxptr_InstUtil_propagateDirection,0}};
#define boxvar_InstUtil_propagateDirection MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateDirection)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateAllAttributes(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _inAttributes, modelica_metatype _inPrefixes, modelica_metatype _inInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_propagateAllAttributes,2,0) {(void*) boxptr_InstUtil_propagateAllAttributes,0}};
#define boxvar_InstUtil_propagateAllAttributes MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_propagateAllAttributes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addEnumerationLiteralToEnv(threadData_t *threadData, modelica_metatype _inEnum, modelica_metatype _inEnv);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addEnumerationLiteralToEnv,2,0) {(void*) boxptr_InstUtil_addEnumerationLiteralToEnv,0}};
#define boxvar_InstUtil_addEnumerationLiteralToEnv MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addEnumerationLiteralToEnv)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addEnumerationLiteralsToEnv(threadData_t *threadData, modelica_metatype _inEnv, modelica_metatype _inClass);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addEnumerationLiteralsToEnv,2,0) {(void*) boxptr_InstUtil_addEnumerationLiteralsToEnv,0}};
#define boxvar_InstUtil_addEnumerationLiteralsToEnv MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addEnumerationLiteralsToEnv)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_moveBindings3(threadData_t *threadData, modelica_metatype _inEquation);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_moveBindings3,2,0) {(void*) boxptr_InstUtil_moveBindings3,0}};
#define boxvar_InstUtil_moveBindings3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_moveBindings3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_moveBindings2(threadData_t *threadData, modelica_metatype _inEquation, modelica_metatype _inVariable);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_moveBindings2,2,0) {(void*) boxptr_InstUtil_moveBindings2,0}};
#define boxvar_InstUtil_moveBindings2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_moveBindings2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_keepConstrainingTypeModifersOnly2(threadData_t *threadData, modelica_metatype _isubs, modelica_metatype _elems);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_keepConstrainingTypeModifersOnly2,2,0) {(void*) boxptr_InstUtil_keepConstrainingTypeModifersOnly2,0}};
#define boxvar_InstUtil_keepConstrainingTypeModifersOnly2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_keepConstrainingTypeModifersOnly2)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkMultipleClassesEquivalent(threadData_t *threadData, modelica_metatype _oldClass, modelica_metatype _newClass);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkMultipleClassesEquivalent,2,0) {(void*) boxptr_InstUtil_checkMultipleClassesEquivalent,0}};
#define boxvar_InstUtil_checkMultipleClassesEquivalent MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkMultipleClassesEquivalent)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkMultipleElementsIdentical(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _oldComponent, modelica_metatype _newComponent);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkMultipleElementsIdentical,2,0) {(void*) boxptr_InstUtil_checkMultipleElementsIdentical,0}};
#define boxvar_InstUtil_checkMultipleElementsIdentical MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkMultipleElementsIdentical)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_instStatusToBool(threadData_t *threadData, modelica_metatype _instStatus);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_instStatusToBool(threadData_t *threadData, modelica_metatype _instStatus);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_instStatusToBool,2,0) {(void*) boxptr_InstUtil_instStatusToBool,0}};
#define boxvar_InstUtil_instStatusToBool MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_instStatusToBool)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addRecordConstructorsToTheCache(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inMod, modelica_metatype _inPrefix, modelica_metatype _inState, modelica_metatype _inDirection, modelica_metatype _inClass, modelica_metatype _inInstDims, modelica_metatype *out_outEnv, modelica_metatype *out_outIH);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addRecordConstructorsToTheCache,2,0) {(void*) boxptr_InstUtil_addRecordConstructorsToTheCache,0}};
#define boxvar_InstUtil_addRecordConstructorsToTheCache MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addRecordConstructorsToTheCache)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_memberCrefs(threadData_t *threadData, modelica_metatype _inComponentRef, modelica_metatype _inComponentRefs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_memberCrefs(threadData_t *threadData, modelica_metatype _inComponentRef, modelica_metatype _inComponentRefs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_memberCrefs,2,0) {(void*) boxptr_InstUtil_memberCrefs,0}};
#define boxvar_InstUtil_memberCrefs MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_memberCrefs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getCrefsFromCompdims(threadData_t *threadData, modelica_metatype _inComponents);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getCrefsFromCompdims,2,0) {(void*) boxptr_InstUtil_getCrefsFromCompdims,0}};
#define boxvar_InstUtil_getCrefsFromCompdims MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getCrefsFromCompdims)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkCompEnvPathVsCompTypePath(threadData_t *threadData, modelica_metatype _inCompEnvPath, modelica_metatype _inCompTypePath);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkCompEnvPathVsCompTypePath,2,0) {(void*) boxptr_InstUtil_checkCompEnvPathVsCompTypePath,0}};
#define boxvar_InstUtil_checkCompEnvPathVsCompTypePath MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkCompEnvPathVsCompTypePath)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addClassdefToEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inSCodeElement, modelica_boolean _inBoolean, modelica_metatype _redeclareMod, modelica_boolean _checkDuplicates, modelica_metatype *out_outEnv, modelica_metatype *out_outIH);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_addClassdefToEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inSCodeElement, modelica_metatype _inBoolean, modelica_metatype _redeclareMod, modelica_metatype _checkDuplicates, modelica_metatype *out_outEnv, modelica_metatype *out_outIH);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_addClassdefToEnv,2,0) {(void*) boxptr_InstUtil_addClassdefToEnv,0}};
#define boxvar_InstUtil_addClassdefToEnv MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_addClassdefToEnv)
PROTECTED_FUNCTION_STATIC modelica_string omc_InstUtil_elementName(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elementName,2,0) {(void*) boxptr_InstUtil_elementName,0}};
#define boxvar_InstUtil_elementName MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elementName)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isElementParamOrConst(threadData_t *threadData, modelica_metatype _inElement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isElementParamOrConst(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isElementParamOrConst,2,0) {(void*) boxptr_InstUtil_isElementParamOrConst,0}};
#define boxvar_InstUtil_isElementParamOrConst MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isElementParamOrConst)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkCyclicalComponents(threadData_t *threadData, modelica_metatype _inCycles, modelica_metatype _inEnv);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkCyclicalComponents,2,0) {(void*) boxptr_InstUtil_checkCyclicalComponents,0}};
#define boxvar_InstUtil_checkCyclicalComponents MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkCyclicalComponents)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isElementEqual(threadData_t *threadData, modelica_metatype _inElement1, modelica_metatype _inElement2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isElementEqual(threadData_t *threadData, modelica_metatype _inElement1, modelica_metatype _inElement2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isElementEqual,2,0) {(void*) boxptr_InstUtil_isElementEqual,0}};
#define boxvar_InstUtil_isElementEqual MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isElementEqual)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isElementNamed(threadData_t *threadData, modelica_metatype _inElement, modelica_string _inName);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isElementNamed(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _inName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isElementNamed,2,0) {(void*) boxptr_InstUtil_isElementNamed,0}};
#define boxvar_InstUtil_isElementNamed MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isElementNamed)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getElementDependenciesTraverserExit(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTuple, modelica_metatype *out_outTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getElementDependenciesTraverserExit,2,0) {(void*) boxptr_InstUtil_getElementDependenciesTraverserExit,0}};
#define boxvar_InstUtil_getElementDependenciesTraverserExit MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getElementDependenciesTraverserExit)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getElementDependenciesTraverserEnter(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTuple, modelica_metatype *out_outTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getElementDependenciesTraverserEnter,2,0) {(void*) boxptr_InstUtil_getElementDependenciesTraverserEnter,0}};
#define boxvar_InstUtil_getElementDependenciesTraverserEnter MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getElementDependenciesTraverserEnter)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getExpsFromDefaults(threadData_t *threadData, modelica_metatype _inEls, modelica_metatype _inAcc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getExpsFromDefaults,2,0) {(void*) boxptr_InstUtil_getExpsFromDefaults,0}};
#define boxvar_InstUtil_getExpsFromDefaults MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getExpsFromDefaults)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getExpsFromExternalDecl(threadData_t *threadData, modelica_metatype _inExternalDecl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getExpsFromExternalDecl,2,0) {(void*) boxptr_InstUtil_getExpsFromExternalDecl,0}};
#define boxvar_InstUtil_getExpsFromExternalDecl MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getExpsFromExternalDecl)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getExpsFromSubMods(threadData_t *threadData, modelica_metatype _inSubMods);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getExpsFromSubMods,2,0) {(void*) boxptr_InstUtil_getExpsFromSubMods,0}};
#define boxvar_InstUtil_getExpsFromSubMods MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getExpsFromSubMods)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_removeCurrentElementFromArrayDimDeps(threadData_t *threadData, modelica_string _name, modelica_metatype _inDependencies);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_removeCurrentElementFromArrayDimDeps,2,0) {(void*) boxptr_InstUtil_removeCurrentElementFromArrayDimDeps,0}};
#define boxvar_InstUtil_removeCurrentElementFromArrayDimDeps MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_removeCurrentElementFromArrayDimDeps)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDepsFromExps(threadData_t *threadData, modelica_metatype _inExps, modelica_metatype _inAllElements, modelica_metatype _inDependencies, modelica_boolean _isFunction);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getDepsFromExps(threadData_t *threadData, modelica_metatype _inExps, modelica_metatype _inAllElements, modelica_metatype _inDependencies, modelica_metatype _isFunction);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getDepsFromExps,2,0) {(void*) boxptr_InstUtil_getDepsFromExps,0}};
#define boxvar_InstUtil_getDepsFromExps MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getDepsFromExps)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_printGraph(threadData_t *threadData, modelica_metatype _env, modelica_metatype _g, modelica_metatype _order, modelica_metatype _cycles);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_printGraph,2,0) {(void*) boxptr_InstUtil_printGraph,0}};
#define boxvar_InstUtil_printGraph MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_printGraph)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getOptionArraydim(threadData_t *threadData, modelica_metatype _inAbsynArrayDimOption);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_getOptionArraydim,2,0) {(void*) boxptr_InstUtil_getOptionArraydim,0}};
#define boxvar_InstUtil_getOptionArraydim MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_getOptionArraydim)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_removeExtBindings(threadData_t *threadData, modelica_metatype _elements);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_removeExtBindings,2,0) {(void*) boxptr_InstUtil_removeExtBindings,0}};
#define boxvar_InstUtil_removeExtBindings MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_removeExtBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_removeBindings(threadData_t *threadData, modelica_metatype _elements);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_removeBindings,2,0) {(void*) boxptr_InstUtil_removeBindings,0}};
#define boxvar_InstUtil_removeBindings MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_removeBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractConstantPlusDeps3(threadData_t *threadData, modelica_metatype _inAcrefs, modelica_metatype _remainingComps, modelica_string _className, modelica_metatype _inExisting);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extractConstantPlusDeps3,2,0) {(void*) boxptr_InstUtil_extractConstantPlusDeps3,0}};
#define boxvar_InstUtil_extractConstantPlusDeps3 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extractConstantPlusDeps3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractConstantPlusDeps2(threadData_t *threadData, modelica_metatype _inComps, modelica_metatype _ocr, modelica_metatype _inAllComps, modelica_string _className, modelica_metatype _inExisting);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extractConstantPlusDeps2,2,0) {(void*) boxptr_InstUtil_extractConstantPlusDeps2,0}};
#define boxvar_InstUtil_extractConstantPlusDeps2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extractConstantPlusDeps2)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_elementNameMember(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _els);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_elementNameMember(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _els);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_elementNameMember,2,0) {(void*) boxptr_InstUtil_elementNameMember,0}};
#define boxvar_InstUtil_elementNameMember MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_elementNameMember)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkExtendsForTypeRestiction(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inRestriction, modelica_metatype _inSCodeElementLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExtendsForTypeRestiction,2,0) {(void*) boxptr_InstUtil_checkExtendsForTypeRestiction,0}};
#define boxvar_InstUtil_checkExtendsForTypeRestiction MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExtendsForTypeRestiction)
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkExtendsRestrictionMatch(threadData_t *threadData, modelica_metatype _r1, modelica_metatype _r2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkExtendsRestrictionMatch,2,0) {(void*) boxptr_InstUtil_checkExtendsRestrictionMatch,0}};
#define boxvar_InstUtil_checkExtendsRestrictionMatch MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkExtendsRestrictionMatch)
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_equalityConstraintOutputDimension(threadData_t *threadData, modelica_metatype _inElements);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_equalityConstraintOutputDimension(threadData_t *threadData, modelica_metatype _inElements);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_equalityConstraintOutputDimension,2,0) {(void*) boxptr_InstUtil_equalityConstraintOutputDimension,0}};
#define boxvar_InstUtil_equalityConstraintOutputDimension MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_equalityConstraintOutputDimension)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkClassEqual(threadData_t *threadData, modelica_metatype _c1, modelica_metatype _c2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkClassEqual(threadData_t *threadData, modelica_metatype _c1, modelica_metatype _c2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_checkClassEqual,2,0) {(void*) boxptr_InstUtil_checkClassEqual,0}};
#define boxvar_InstUtil_checkClassEqual MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_checkClassEqual)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_updateCrefTypesWithConnectorPrefix(threadData_t *threadData, modelica_metatype _cr1, modelica_metatype _cr2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_updateCrefTypesWithConnectorPrefix,2,0) {(void*) boxptr_InstUtil_updateCrefTypesWithConnectorPrefix,0}};
#define boxvar_InstUtil_updateCrefTypesWithConnectorPrefix MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_updateCrefTypesWithConnectorPrefix)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractConnectorPrefix(threadData_t *threadData, modelica_metatype _connectorRef);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_extractConnectorPrefix,2,0) {(void*) boxptr_InstUtil_extractConnectorPrefix,0}};
#define boxvar_InstUtil_extractConnectorPrefix MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_extractConnectorPrefix)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_updateDeducedUnits2(threadData_t *threadData, modelica_metatype _elt, modelica_metatype _vec, modelica_metatype _ht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_updateDeducedUnits2,2,0) {(void*) boxptr_InstUtil_updateDeducedUnits2,0}};
#define boxvar_InstUtil_updateDeducedUnits2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_updateDeducedUnits2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_updateEnumerationEnvironment1(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_string _inName, modelica_metatype _inNames, modelica_metatype _inVars, modelica_metatype _inPath, modelica_metatype *out_outEnv);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_updateEnumerationEnvironment1,2,0) {(void*) boxptr_InstUtil_updateEnumerationEnvironment1,0}};
#define boxvar_InstUtil_updateEnumerationEnvironment1 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_updateEnumerationEnvironment1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_makeDAEElementInitial(threadData_t *threadData, modelica_metatype _inElems);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_makeDAEElementInitial,2,0) {(void*) boxptr_InstUtil_makeDAEElementInitial,0}};
#define boxvar_InstUtil_makeDAEElementInitial MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_makeDAEElementInitial)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_reEvaluateInitialIfEqns2(threadData_t *threadData, modelica_metatype _acc, modelica_metatype _elem, modelica_metatype _inCache, modelica_metatype _env);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_reEvaluateInitialIfEqns2,2,0) {(void*) boxptr_InstUtil_reEvaluateInitialIfEqns2,0}};
#define boxvar_InstUtil_reEvaluateInitialIfEqns2 MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_reEvaluateInitialIfEqns2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_scodeFlattenProgram(threadData_t *threadData, modelica_metatype _inProgram);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_scodeFlattenProgram,2,0) {(void*) boxptr_InstUtil_scodeFlattenProgram,0}};
#define boxvar_InstUtil_scodeFlattenProgram MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_scodeFlattenProgram)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isNotFunction(threadData_t *threadData, modelica_metatype _cls);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isNotFunction(threadData_t *threadData, modelica_metatype _cls);
static const MMC_DEFSTRUCTLIT(boxvar_lit_InstUtil_isNotFunction,2,0) {(void*) boxptr_InstUtil_isNotFunction,0}};
#define boxvar_InstUtil_isNotFunction MMC_REFSTRUCTLIT(boxvar_lit_InstUtil_isNotFunction)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_findDomF(threadData_t *threadData, modelica_metatype _inTup, modelica_string _name)
{
modelica_boolean _found;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTup;
{
modelica_string _nameLoc = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_nameLoc = tmpMeta6;
if (!(stringEqual(_nameLoc, _name))) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_found = tmp1;
_return: OMC_LABEL_UNUSED
return _found;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findDomF(threadData_t *threadData, modelica_metatype _inTup, modelica_metatype _name)
{
modelica_boolean _found;
modelica_metatype out_found;
_found = omc_InstUtil_findDomF(threadData, _inTup, _name);
out_found = mmc_mk_icon(_found);
return out_found;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_discretizeTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTup, modelica_metatype *out_outTup)
{
jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
modelica_metatype _outExp = NULL;
modelica_metatype _outTup = NULL;
modelica_integer _i;
modelica_integer _N;
modelica_metatype _fieldLst = NULL;
modelica_metatype _info = NULL;
modelica_boolean _skip;
modelica_boolean _failVar;
modelica_boolean _isBC;
modelica_metatype _domainCr = NULL;
modelica_string _domName = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta169;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_failVar = 0;
tmpMeta1 = _inTup;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
tmp3 = mmc_unbox_integer(tmpMeta2);
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
tmp8 = mmc_unbox_integer(tmpMeta7);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
tmp10 = mmc_unbox_integer(tmpMeta9);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
tmp12 = mmc_unbox_integer(tmpMeta11);
_i = tmp3;
_fieldLst = tmpMeta4;
_domainCr = tmpMeta5;
_info = tmpMeta6;
_skip = tmp8;
_N = tmp10;
_isBC = tmp12;
tmpMeta13 = _domainCr;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,2,2) == 0) MMC_THROW_INTERNAL();
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
_domName = tmpMeta14;
if(_skip)
{
_outExp = _inExp;
_outTup = _inTup;
goto _return;
}
{
volatile modelica_metatype tmp18_1;
tmp18_1 = _inExp;
{
modelica_string _name = NULL;
modelica_metatype _subscripts = NULL;
modelica_metatype _fieldCr = NULL;
modelica_metatype _leftVar = NULL;
modelica_metatype _actualVar = NULL;
modelica_metatype _rightVar = NULL;
volatile mmc_switch_type tmp18;
int tmp19;
tmp18 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp17_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp18 < 7; tmp18++) {
switch (MMC_SWITCH_CAST(tmp18)) {
case 0: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp18_1,2,1) == 0) goto tmp17_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,1,3) == 0) goto tmp17_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 3));
if (!listEmpty(tmpMeta22)) goto tmp17_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,2,2) == 0) goto tmp17_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
if (1 != MMC_STRLEN(tmpMeta24) || strcmp(MMC_STRINGDATA(_OMC_LIT0), MMC_STRINGDATA(tmpMeta24)) != 0) goto tmp17_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 3));
if (!listEmpty(tmpMeta25)) goto tmp17_end;
_domName = tmpMeta21;
tmp18 += 5;
tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta28 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i));
tmpMeta29 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta28);
tmpMeta27 = mmc_mk_cons(tmpMeta29, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta30 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _OMC_LIT0, tmpMeta27);
tmpMeta31 = mmc_mk_box4(4, &Absyn_ComponentRef_CREF__QUAL__desc, _domName, tmpMeta26, tmpMeta30);
tmpMeta32 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta31);
tmpMeta15 = tmpMeta32;
goto tmp17_done;
}
case 1: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_boolean tmp36;
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_boolean tmp48;
modelica_metatype tmpMeta49;
modelica_boolean tmp50;
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp18_1,2,1) == 0) goto tmp17_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,2,2) == 0) goto tmp17_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 3));
_fieldCr = tmpMeta33;
_name = tmpMeta34;
_subscripts = tmpMeta35;
tmp18 += 4;
tmp36 = omc_List_isMemberOnTrue(threadData, _fieldCr, _fieldLst, boxvar_AbsynUtil_crefEqual);
if (1 != tmp36) goto goto_16;
tmp50 = (modelica_boolean)(_isBC && (_i == ((modelica_integer) 1)));
if(tmp50)
{
tmpMeta37 = stringAppend(_name,_OMC_LIT1);
tmpMeta38 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, tmpMeta37, _subscripts);
tmpMeta39 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta38);
tmpMeta51 = tmpMeta39;
}
else
{
tmp48 = (modelica_boolean)(_isBC && (_i == _N));
if(tmp48)
{
tmpMeta40 = stringAppend(_name,_OMC_LIT2);
tmpMeta41 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, tmpMeta40, _subscripts);
tmpMeta42 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta41);
tmpMeta49 = tmpMeta42;
}
else
{
tmpMeta44 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i));
tmpMeta45 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta44);
tmpMeta43 = mmc_mk_cons(tmpMeta45, _subscripts);
tmpMeta46 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta43);
tmpMeta47 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta46);
tmpMeta49 = tmpMeta47;
}
tmpMeta51 = tmpMeta49;
}
tmpMeta15 = tmpMeta51;
goto tmp17_done;
}
case 2: {
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_boolean tmp78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
modelica_metatype tmpMeta81;
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_metatype tmpMeta87;
modelica_boolean tmp88;
modelica_metatype tmpMeta89;
modelica_metatype tmpMeta90;
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
if (mmc__uniontype__metarecord__typedef__equal(tmp18_1,11,3) == 0) goto tmp17_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta52,2,2) == 0) goto tmp17_end;
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 2));
if (4 != MMC_STRLEN(tmpMeta53) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta53)) != 0) goto tmp17_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 3));
if (!listEmpty(tmpMeta54)) goto tmp17_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta55,0,2) == 0) goto tmp17_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta55), 2));
if (listEmpty(tmpMeta56)) goto tmp17_end;
tmpMeta57 = MMC_CAR(tmpMeta56);
tmpMeta58 = MMC_CDR(tmpMeta56);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta57,2,1) == 0) goto tmp17_end;
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta57), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta59,2,2) == 0) goto tmp17_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta59), 2));
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta59), 3));
if (listEmpty(tmpMeta58)) goto tmp17_end;
tmpMeta62 = MMC_CAR(tmpMeta58);
tmpMeta63 = MMC_CDR(tmpMeta58);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta62,2,1) == 0) goto tmp17_end;
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta62), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta64,2,2) == 0) goto tmp17_end;
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta64), 2));
if (1 != MMC_STRLEN(tmpMeta65) || strcmp(MMC_STRINGDATA(_OMC_LIT0), MMC_STRINGDATA(tmpMeta65)) != 0) goto tmp17_end;
if (!listEmpty(tmpMeta63)) goto tmp17_end;
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 4));
if (!listEmpty(tmpMeta66)) goto tmp17_end;
_fieldCr = tmpMeta59;
_name = tmpMeta60;
_subscripts = tmpMeta61;
tmp18 += 1;
if((!omc_List_isMemberOnTrue(threadData, _fieldCr, _fieldLst, boxvar_AbsynUtil_crefEqual)))
{
_failVar = 1;
tmpMeta68 = stringAppend(_OMC_LIT8,_name);
tmpMeta69 = stringAppend(tmpMeta68,_OMC_LIT9);
tmpMeta67 = mmc_mk_cons(tmpMeta69, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT7, tmpMeta67, _info);
}
tmp78 = (modelica_boolean)(_i == ((modelica_integer) 1));
if(tmp78)
{
tmpMeta70 = stringAppend(_name,_OMC_LIT1);
tmpMeta71 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, tmpMeta70, _subscripts);
tmpMeta72 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta71);
tmpMeta79 = tmpMeta72;
}
else
{
tmpMeta74 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(((modelica_integer) -1) + _i));
tmpMeta75 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta74);
tmpMeta73 = mmc_mk_cons(tmpMeta75, _subscripts);
tmpMeta76 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta73);
tmpMeta77 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta76);
tmpMeta79 = tmpMeta77;
}
_leftVar = tmpMeta79;
tmp88 = (modelica_boolean)(_i == _N);
if(tmp88)
{
tmpMeta80 = stringAppend(_name,_OMC_LIT2);
tmpMeta81 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, tmpMeta80, _subscripts);
tmpMeta82 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta81);
tmpMeta89 = tmpMeta82;
}
else
{
tmpMeta84 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(((modelica_integer) 1) + _i));
tmpMeta85 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta84);
tmpMeta83 = mmc_mk_cons(tmpMeta85, _subscripts);
tmpMeta86 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta83);
tmpMeta87 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta86);
tmpMeta89 = tmpMeta87;
}
_rightVar = tmpMeta89;
tmpMeta90 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _rightVar, _OMC_LIT10, _leftVar);
tmpMeta91 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta92 = mmc_mk_box4(4, &Absyn_ComponentRef_CREF__QUAL__desc, _domName, tmpMeta91, _OMC_LIT15);
tmpMeta93 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta92);
tmpMeta94 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _OMC_LIT12, _OMC_LIT13, tmpMeta93);
tmpMeta95 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, tmpMeta90, _OMC_LIT11, tmpMeta94);
tmpMeta15 = tmpMeta95;
goto tmp17_done;
}
case 3: {
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_metatype tmpMeta100;
modelica_metatype tmpMeta101;
modelica_metatype tmpMeta102;
modelica_metatype tmpMeta103;
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
modelica_metatype tmpMeta106;
modelica_metatype tmpMeta107;
modelica_metatype tmpMeta108;
modelica_metatype tmpMeta109;
modelica_metatype tmpMeta110;
modelica_metatype tmpMeta111;
modelica_metatype tmpMeta112;
modelica_metatype tmpMeta113;
modelica_metatype tmpMeta114;
modelica_metatype tmpMeta115;
modelica_metatype tmpMeta116;
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
modelica_metatype tmpMeta119;
modelica_metatype tmpMeta120;
modelica_metatype tmpMeta121;
modelica_metatype tmpMeta122;
modelica_metatype tmpMeta123;
modelica_metatype tmpMeta124;
modelica_metatype tmpMeta125;
modelica_boolean tmp126;
modelica_metatype tmpMeta127;
modelica_metatype tmpMeta128;
modelica_metatype tmpMeta129;
modelica_metatype tmpMeta130;
modelica_metatype tmpMeta131;
modelica_metatype tmpMeta132;
modelica_metatype tmpMeta133;
modelica_metatype tmpMeta134;
modelica_metatype tmpMeta135;
modelica_metatype tmpMeta136;
modelica_metatype tmpMeta137;
modelica_metatype tmpMeta138;
modelica_metatype tmpMeta139;
modelica_metatype tmpMeta140;
modelica_boolean tmp141;
modelica_metatype tmpMeta142;
modelica_metatype tmpMeta143;
modelica_metatype tmpMeta144;
modelica_metatype tmpMeta145;
modelica_metatype tmpMeta146;
modelica_metatype tmpMeta147;
modelica_metatype tmpMeta148;
modelica_metatype tmpMeta149;
modelica_metatype tmpMeta150;
if (mmc__uniontype__metarecord__typedef__equal(tmp18_1,11,3) == 0) goto tmp17_end;
tmpMeta96 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta96,2,2) == 0) goto tmp17_end;
tmpMeta97 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta96), 2));
if (4 != MMC_STRLEN(tmpMeta97) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta97)) != 0) goto tmp17_end;
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta96), 3));
if (!listEmpty(tmpMeta98)) goto tmp17_end;
tmpMeta99 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta99,0,2) == 0) goto tmp17_end;
tmpMeta100 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta99), 2));
if (listEmpty(tmpMeta100)) goto tmp17_end;
tmpMeta101 = MMC_CAR(tmpMeta100);
tmpMeta102 = MMC_CDR(tmpMeta100);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta101,2,1) == 0) goto tmp17_end;
tmpMeta103 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta101), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta103,2,2) == 0) goto tmp17_end;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta103), 2));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta103), 3));
if (listEmpty(tmpMeta102)) goto tmp17_end;
tmpMeta106 = MMC_CAR(tmpMeta102);
tmpMeta107 = MMC_CDR(tmpMeta102);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta106,2,1) == 0) goto tmp17_end;
tmpMeta108 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta106), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta108,2,2) == 0) goto tmp17_end;
tmpMeta109 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta108), 2));
if (1 != MMC_STRLEN(tmpMeta109) || strcmp(MMC_STRINGDATA(_OMC_LIT0), MMC_STRINGDATA(tmpMeta109)) != 0) goto tmp17_end;
if (listEmpty(tmpMeta107)) goto tmp17_end;
tmpMeta110 = MMC_CAR(tmpMeta107);
tmpMeta111 = MMC_CDR(tmpMeta107);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta110,2,1) == 0) goto tmp17_end;
tmpMeta112 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta110), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta112,2,2) == 0) goto tmp17_end;
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta112), 2));
if (1 != MMC_STRLEN(tmpMeta113) || strcmp(MMC_STRINGDATA(_OMC_LIT0), MMC_STRINGDATA(tmpMeta113)) != 0) goto tmp17_end;
if (!listEmpty(tmpMeta111)) goto tmp17_end;
tmpMeta114 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 4));
if (!listEmpty(tmpMeta114)) goto tmp17_end;
_fieldCr = tmpMeta103;
_name = tmpMeta104;
_subscripts = tmpMeta105;
tmp18 += 2;
if((!omc_List_isMemberOnTrue(threadData, _fieldCr, _fieldLst, boxvar_AbsynUtil_crefEqual)))
{
_failVar = 1;
tmpMeta116 = stringAppend(_OMC_LIT8,_name);
tmpMeta117 = stringAppend(tmpMeta116,_OMC_LIT9);
tmpMeta115 = mmc_mk_cons(tmpMeta117, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT7, tmpMeta115, _info);
}
tmp126 = (modelica_boolean)(_i == ((modelica_integer) 1));
if(tmp126)
{
tmpMeta118 = stringAppend(_name,_OMC_LIT1);
tmpMeta119 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, tmpMeta118, _subscripts);
tmpMeta120 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta119);
tmpMeta127 = tmpMeta120;
}
else
{
tmpMeta122 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(((modelica_integer) -1) + _i));
tmpMeta123 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta122);
tmpMeta121 = mmc_mk_cons(tmpMeta123, _subscripts);
tmpMeta124 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta121);
tmpMeta125 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta124);
tmpMeta127 = tmpMeta125;
}
_leftVar = tmpMeta127;
tmpMeta129 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i));
tmpMeta130 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta129);
tmpMeta128 = mmc_mk_cons(tmpMeta130, _subscripts);
tmpMeta131 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta128);
tmpMeta132 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta131);
_actualVar = tmpMeta132;
tmp141 = (modelica_boolean)(_i == _N);
if(tmp141)
{
tmpMeta133 = stringAppend(_name,_OMC_LIT2);
tmpMeta134 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, tmpMeta133, _subscripts);
tmpMeta135 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta134);
tmpMeta142 = tmpMeta135;
}
else
{
tmpMeta137 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(((modelica_integer) 1) + _i));
tmpMeta138 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta137);
tmpMeta136 = mmc_mk_cons(tmpMeta138, _subscripts);
tmpMeta139 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta136);
tmpMeta140 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta139);
tmpMeta142 = tmpMeta140;
}
_rightVar = tmpMeta142;
tmpMeta143 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _OMC_LIT12, _OMC_LIT13, _actualVar);
tmpMeta144 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _leftVar, _OMC_LIT10, tmpMeta143);
tmpMeta145 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, tmpMeta144, _OMC_LIT16, _rightVar);
tmpMeta146 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta147 = mmc_mk_box4(4, &Absyn_ComponentRef_CREF__QUAL__desc, _domName, tmpMeta146, _OMC_LIT15);
tmpMeta148 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta147);
tmpMeta149 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, tmpMeta148, _OMC_LIT17, _OMC_LIT12);
tmpMeta150 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, tmpMeta145, _OMC_LIT11, tmpMeta149);
tmpMeta15 = tmpMeta150;
goto tmp17_done;
}
case 4: {
modelica_metatype tmpMeta151;
modelica_metatype tmpMeta152;
modelica_metatype tmpMeta153;
modelica_metatype tmpMeta154;
modelica_metatype tmpMeta155;
modelica_metatype tmpMeta156;
modelica_metatype tmpMeta157;
modelica_metatype tmpMeta158;
modelica_metatype tmpMeta159;
if (mmc__uniontype__metarecord__typedef__equal(tmp18_1,11,3) == 0) goto tmp17_end;
tmpMeta151 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta151,2,2) == 0) goto tmp17_end;
tmpMeta152 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta151), 2));
if (4 != MMC_STRLEN(tmpMeta152) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta152)) != 0) goto tmp17_end;
tmpMeta153 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta151), 3));
if (!listEmpty(tmpMeta153)) goto tmp17_end;
tmpMeta154 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta154,0,2) == 0) goto tmp17_end;
tmpMeta155 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta154), 2));
if (listEmpty(tmpMeta155)) goto tmp17_end;
tmpMeta156 = MMC_CAR(tmpMeta155);
tmpMeta157 = MMC_CDR(tmpMeta155);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta156,2,1) == 0) goto tmp17_end;
if (listEmpty(tmpMeta157)) goto tmp17_end;
tmpMeta158 = MMC_CAR(tmpMeta157);
tmpMeta159 = MMC_CDR(tmpMeta157);
if (!listEmpty(tmpMeta159)) goto tmp17_end;
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT7, _OMC_LIT19, _info);
tmpMeta15 = _inExp;
goto tmp17_done;
}
case 5: {
modelica_metatype tmpMeta160;
modelica_metatype tmpMeta161;
modelica_metatype tmpMeta162;
modelica_metatype tmpMeta163;
modelica_metatype tmpMeta164;
modelica_metatype tmpMeta165;
modelica_metatype tmpMeta166;
modelica_metatype tmpMeta167;
modelica_metatype tmpMeta168;
if (mmc__uniontype__metarecord__typedef__equal(tmp18_1,11,3) == 0) goto tmp17_end;
tmpMeta160 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta160,2,2) == 0) goto tmp17_end;
tmpMeta161 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta160), 2));
if (4 != MMC_STRLEN(tmpMeta161) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta161)) != 0) goto tmp17_end;
tmpMeta162 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta160), 3));
if (!listEmpty(tmpMeta162)) goto tmp17_end;
tmpMeta163 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp18_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta163,0,2) == 0) goto tmp17_end;
tmpMeta164 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta163), 2));
if (listEmpty(tmpMeta164)) goto tmp17_end;
tmpMeta165 = MMC_CAR(tmpMeta164);
tmpMeta166 = MMC_CDR(tmpMeta164);
if (listEmpty(tmpMeta166)) goto tmp17_end;
tmpMeta167 = MMC_CAR(tmpMeta166);
tmpMeta168 = MMC_CDR(tmpMeta166);
if (!listEmpty(tmpMeta168)) goto tmp17_end;
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT7, _OMC_LIT21, _info);
tmpMeta15 = _inExp;
goto tmp17_done;
}
case 6: {
tmpMeta15 = _inExp;
goto tmp17_done;
}
}
goto tmp17_end;
tmp17_end: ;
}
goto goto_16;
tmp17_done:
(void)tmp18;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp17_done2;
goto_16:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp18 < 7) {
goto tmp17_top;
}
MMC_THROW_INTERNAL();
tmp17_done2:;
}
}
_outExp = tmpMeta15;
if(_failVar)
{
MMC_THROW_INTERNAL();
}
tmpMeta169 = mmc_mk_box7(0, mmc_mk_integer(_i), _fieldLst, _domainCr, _info, mmc_mk_boolean(_skip), mmc_mk_integer(_N), mmc_mk_boolean(_isBC));
_outTup = tmpMeta169;
_return: OMC_LABEL_UNUSED
if (out_outTup) { *out_outTup = _outTup; }
threadData->mmc_jumper = old_mmc_jumper;
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_newEQFun(threadData_t *threadData, modelica_integer _i, modelica_metatype _inLhs_exp, modelica_metatype _inRhs_exp, modelica_metatype _domainCr, modelica_integer _N, modelica_boolean _isBC, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info)
{
modelica_metatype _outEQ = NULL;
modelica_metatype _outLhs_exp = NULL;
modelica_metatype _outRhs_exp = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box7(0, mmc_mk_integer(_i), _fieldLst, _domainCr, _info, mmc_mk_boolean(0), mmc_mk_integer(_N), mmc_mk_boolean(_isBC));
_outLhs_exp = omc_AbsynUtil_traverseExpTopDown(threadData, _inLhs_exp, boxvar_InstUtil_discretizeTraverseFun, tmpMeta1, NULL);
tmpMeta2 = mmc_mk_box7(0, mmc_mk_integer(_i), _fieldLst, _domainCr, _info, mmc_mk_boolean(0), mmc_mk_integer(_N), mmc_mk_boolean(_isBC));
_outRhs_exp = omc_AbsynUtil_traverseExpTopDown(threadData, _inRhs_exp, boxvar_InstUtil_discretizeTraverseFun, tmpMeta2, NULL);
tmpMeta3 = mmc_mk_box5(4, &SCode_Equation_EQ__EQUALS__desc, _outLhs_exp, _outRhs_exp, _comment, _info);
_outEQ = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outEQ;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_newEQFun(threadData_t *threadData, modelica_metatype _i, modelica_metatype _inLhs_exp, modelica_metatype _inRhs_exp, modelica_metatype _domainCr, modelica_metatype _N, modelica_metatype _isBC, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer tmp3;
modelica_metatype _outEQ = NULL;
tmp1 = mmc_unbox_integer(_i);
tmp2 = mmc_unbox_integer(_N);
tmp3 = mmc_unbox_integer(_isBC);
_outEQ = omc_InstUtil_newEQFun(threadData, tmp1, _inLhs_exp, _inRhs_exp, _domainCr, tmp2, tmp3, _fieldLst, _comment, _info);
return _outEQ;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_hasPderTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inHasPder, modelica_boolean *out_outHasPder)
{
modelica_metatype _outExp = NULL;
modelica_boolean _outHasPder;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inHasPder;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_2) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (4 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outHasPder = tmp1;
_return: OMC_LABEL_UNUSED
if (out_outHasPder) { *out_outHasPder = _outHasPder; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_hasPderTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHasPder, modelica_metatype *out_outHasPder)
{
modelica_integer tmp1;
modelica_boolean _outHasPder;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inHasPder);
_outExp = omc_InstUtil_hasPderTraverseFun(threadData, _inExp, tmp1, &_outHasPder);
if (out_outHasPder) { *out_outHasPder = mmc_mk_icon(_outHasPder); }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_creatFieldEqs(threadData_t *threadData, modelica_metatype _lhs_exp, modelica_metatype _rhs_exp, modelica_metatype _domainCr, modelica_integer _N, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info)
{
modelica_metatype _outDiscretizedEQs = NULL;
modelica_boolean _bl;
modelica_boolean _br;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
modelica_metatype tmpMeta3;
modelica_integer tmp4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_AbsynUtil_traverseExp(threadData, _lhs_exp, boxvar_InstUtil_hasPderTraverseFun, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_bl = tmp2;
omc_AbsynUtil_traverseExp(threadData, _rhs_exp, boxvar_InstUtil_hasPderTraverseFun, mmc_mk_boolean(0), &tmpMeta3);
tmp4 = mmc_unbox_integer(tmpMeta3);
_br = tmp4;
{
modelica_boolean tmp8_1;modelica_boolean tmp8_2;
tmp8_1 = _bl;
tmp8_2 = _br;
{
volatile mmc_switch_type tmp8;
int tmp9;
tmp8 = 0;
for (; tmp8 < 2; tmp8++) {
switch (MMC_SWITCH_CAST(tmp8)) {
case 0: {
modelica_metatype tmpMeta10;
if (0 != tmp8_1) goto tmp7_end;
if (0 != tmp8_2) goto tmp7_end;
{
modelica_metatype __omcQ_24tmpVar1;
modelica_metatype* tmp11;
modelica_metatype tmpMeta12;
modelica_metatype __omcQ_24tmpVar0;
modelica_integer tmp13;
modelica_integer tmp14;
modelica_integer tmp15;
modelica_integer _i;
tmp14 = 1;
tmp15 = _N;
_i = ((modelica_integer) 1);
_i = (((modelica_integer) 1) /* Range start-value */)-tmp14;
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar1 = tmpMeta12;
tmp11 = &__omcQ_24tmpVar1;
while(1) {
tmp13 = 1;
if (tmp14 > 0 ? _i+tmp14 <= tmp15 : _i+tmp14 >= tmp15) {
_i += tmp14;
tmp13--;
}
if (tmp13 == 0) {
__omcQ_24tmpVar0 = omc_InstUtil_newEQFun(threadData, _i, _lhs_exp, _rhs_exp, _domainCr, _N, 0, _fieldLst, _comment, _info);
*tmp11 = mmc_mk_cons(__omcQ_24tmpVar0,0);
tmp11 = &MMC_CDR(*tmp11);
} else if (tmp13 == 1) {
break;
} else {
goto goto_6;
}
}
*tmp11 = mmc_mk_nil();
tmpMeta10 = __omcQ_24tmpVar1;
}
tmpMeta5 = tmpMeta10;
goto tmp7_done;
}
case 1: {
modelica_metatype tmpMeta16;
{
modelica_metatype __omcQ_24tmpVar3;
modelica_metatype* tmp17;
modelica_metatype tmpMeta18;
modelica_metatype __omcQ_24tmpVar2;
modelica_integer tmp19;
modelica_integer tmp20;
modelica_integer tmp21;
modelica_integer _i;
tmp20 = 1;
tmp21 = _N;
_i = ((modelica_integer) 1);
_i = (((modelica_integer) 1) /* Range start-value */)-tmp20;
tmpMeta18 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar3 = tmpMeta18;
tmp17 = &__omcQ_24tmpVar3;
while(1) {
tmp19 = 1;
if (tmp20 > 0 ? _i+tmp20 <= tmp21 : _i+tmp20 >= tmp21) {
_i += tmp20;
tmp19--;
}
if (tmp19 == 0) {
__omcQ_24tmpVar2 = omc_InstUtil_newEQFun(threadData, _i, _lhs_exp, _rhs_exp, _domainCr, _N, 0, _fieldLst, _comment, _info);
*tmp17 = mmc_mk_cons(__omcQ_24tmpVar2,0);
tmp17 = &MMC_CDR(*tmp17);
} else if (tmp19 == 1) {
break;
} else {
goto goto_6;
}
}
*tmp17 = mmc_mk_nil();
tmpMeta16 = __omcQ_24tmpVar3;
}
tmpMeta5 = tmpMeta16;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
goto_6:;
MMC_THROW_INTERNAL();
goto tmp7_done;
tmp7_done:;
}
}
_outDiscretizedEQs = tmpMeta5;
_return: OMC_LABEL_UNUSED
return _outDiscretizedEQs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_creatFieldEqs(threadData_t *threadData, modelica_metatype _lhs_exp, modelica_metatype _rhs_exp, modelica_metatype _domainCr, modelica_metatype _N, modelica_metatype _fieldLst, modelica_metatype _comment, modelica_metatype _info)
{
modelica_integer tmp1;
modelica_metatype _outDiscretizedEQs = NULL;
tmp1 = mmc_unbox_integer(_N);
_outDiscretizedEQs = omc_InstUtil_creatFieldEqs(threadData, _lhs_exp, _rhs_exp, _domainCr, tmp1, _fieldLst, _comment, _info);
return _outDiscretizedEQs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extrapolateFieldEq(threadData_t *threadData, modelica_boolean _isRight, modelica_metatype _fieldCr, modelica_metatype _domainCr, modelica_integer _N, modelica_metatype _comment, modelica_metatype _info, modelica_metatype _fieldLst)
{
modelica_metatype _outEQ = NULL;
modelica_string _name = NULL;
modelica_metatype _subscripts = NULL;
modelica_integer _i1;
modelica_integer _i2;
modelica_integer _i3;
modelica_string tmp1_c0 __attribute__((unused)) = 0;
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 tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_i1 = ((modelica_integer) 1);
_i2 = ((modelica_integer) 2);
_i3 = ((modelica_integer) 3);
if(omc_List_isMemberOnTrue(threadData, _fieldCr, _fieldLst, boxvar_AbsynUtil_crefEqual))
{
{
modelica_metatype tmp4_1;
tmp4_1 = _fieldCr;
{
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_name = tmpMeta6;
_subscripts = tmpMeta7;
tmp1_c0 = _name;
tmpMeta[0+1] = _subscripts;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_name = tmp1_c0;
_subscripts = tmpMeta[0+1];
if(_isRight)
{
_i1 = _N;
_i2 = ((modelica_integer) -1) + _N;
_i3 = ((modelica_integer) -2) + _N;
}
tmpMeta9 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i1));
tmpMeta10 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta9);
tmpMeta8 = mmc_mk_cons(tmpMeta10, _subscripts);
tmpMeta11 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta8);
tmpMeta12 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta11);
tmpMeta14 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i2));
tmpMeta15 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta14);
tmpMeta13 = mmc_mk_cons(tmpMeta15, _subscripts);
tmpMeta16 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta13);
tmpMeta17 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta16);
tmpMeta18 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _OMC_LIT12, _OMC_LIT13, tmpMeta17);
tmpMeta20 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i3));
tmpMeta21 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta20);
tmpMeta19 = mmc_mk_cons(tmpMeta21, _subscripts);
tmpMeta22 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta19);
tmpMeta23 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta22);
tmpMeta24 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, tmpMeta18, _OMC_LIT10, tmpMeta23);
tmpMeta25 = mmc_mk_box5(4, &SCode_Equation_EQ__EQUALS__desc, tmpMeta12, tmpMeta24, _comment, _info);
_outEQ = tmpMeta25;
}
else
{
MMC_THROW_INTERNAL();
}
_return: OMC_LABEL_UNUSED
return _outEQ;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_extrapolateFieldEq(threadData_t *threadData, modelica_metatype _isRight, modelica_metatype _fieldCr, modelica_metatype _domainCr, modelica_metatype _N, modelica_metatype _comment, modelica_metatype _info, modelica_metatype _fieldLst)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outEQ = NULL;
tmp1 = mmc_unbox_integer(_isRight);
tmp2 = mmc_unbox_integer(_N);
_outEQ = omc_InstUtil_extrapolateFieldEq(threadData, tmp1, _fieldCr, _domainCr, tmp2, _comment, _info, _fieldLst);
return _outEQ;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_absynDAECrefEqualName(threadData_t *threadData, modelica_metatype _domainCr1, modelica_metatype _domainCr2)
{
modelica_boolean _equal;
modelica_string _name1 = NULL;
modelica_string _name2 = NULL;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _domainCr1;
tmp4_2 = _domainCr2;
{
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,2,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_name1 = tmpMeta6;
_name2 = tmpMeta7;
if (!(stringEqual(_name1, _name2))) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_equal = tmp1;
_return: OMC_LABEL_UNUSED
return _equal;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_absynDAECrefEqualName(threadData_t *threadData, modelica_metatype _domainCr1, modelica_metatype _domainCr2)
{
modelica_boolean _equal;
modelica_metatype out_equal;
_equal = omc_InstUtil_absynDAECrefEqualName(threadData, _domainCr1, _domainCr2);
out_equal = mmc_mk_icon(_equal);
return out_equal;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_domNFieldsFindFun(threadData_t *threadData, modelica_metatype _inDomFields, modelica_metatype _inDomainCr)
{
modelica_metatype _outOptNFields = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inDomFields;
{
modelica_metatype _domainCr = NULL;
modelica_metatype _fieldCrLst = NULL;
modelica_metatype _varLst = NULL;
modelica_integer _N;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_domainCr = tmpMeta6;
_fieldCrLst = tmpMeta7;
tmp8 = omc_InstUtil_absynDAECrefEqualName(threadData, _inDomainCr, _domainCr);
if (1 != tmp8) goto goto_2;
tmpMeta9 = _domainCr;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,3) == 0) goto goto_2;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,9,3) == 0) goto goto_2;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
_varLst = tmpMeta11;
_N = mmc_unbox_integer(omc_List_findSome(threadData, _varLst, boxvar_InstUtil_findN));
tmpMeta12 = mmc_mk_box2(0, mmc_mk_integer(_N), _fieldCrLst);
tmpMeta1 = mmc_mk_some(tmpMeta12);
goto tmp3_done;
}
case 1: {
tmpMeta1 = mmc_mk_none();
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outOptNFields = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outOptNFields;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_getDomNFields(threadData_t *threadData, modelica_metatype _inDomFieldLst, modelica_metatype _inDomainCr, modelica_metatype _info, modelica_metatype *out_outFieldLst)
{
modelica_integer _outN;
modelica_metatype _outFieldLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outN = ((modelica_integer) 0);
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outFieldLst = tmpMeta1;
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
tmpMeta6 = omc_List_findSome1(threadData, _inDomFieldLst, boxvar_InstUtil_domNFieldsFindFun, _inDomainCr);
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
tmp8 = mmc_unbox_integer(tmpMeta7);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_outN = tmp8;
_outFieldLst = tmpMeta9;
goto tmp3_done;
}
case 1: {
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT7, _OMC_LIT24, _info);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
if (out_outFieldLst) { *out_outFieldLst = _outFieldLst; }
return _outN;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getDomNFields(threadData_t *threadData, modelica_metatype _inDomFieldLst, modelica_metatype _inDomainCr, modelica_metatype _info, modelica_metatype *out_outFieldLst)
{
modelica_integer _outN;
modelica_metatype out_outN;
_outN = omc_InstUtil_getDomNFields(threadData, _inDomFieldLst, _inDomainCr, _info, out_outFieldLst);
out_outN = mmc_mk_icon(_outN);
return out_outN;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extrapFieldTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_integer _inN, modelica_integer *out_outN)
{
modelica_metatype _outExp = NULL;
modelica_integer _outN;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outN = _inN;
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_string _name = NULL;
modelica_metatype _subscripts = NULL;
modelica_integer _i;
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;
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (16 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT25), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (!listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmpMeta10);
tmpMeta12 = MMC_CDR(tmpMeta10);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,2,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,2,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
if (!listEmpty(tmpMeta12)) goto tmp3_end;
_name = tmpMeta14;
_subscripts = tmpMeta15;
if((_inN == ((modelica_integer) 1)))
{
_i = ((modelica_integer) 1);
}
else
{
_i = ((modelica_integer) -1);
}
tmpMeta17 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_inN));
tmpMeta18 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta17);
tmpMeta16 = mmc_mk_cons(tmpMeta18, _subscripts);
tmpMeta19 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta16);
tmpMeta20 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta19);
tmpMeta21 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _OMC_LIT12, _OMC_LIT13, tmpMeta20);
tmpMeta23 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_inN + _i));
tmpMeta24 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta23);
tmpMeta22 = mmc_mk_cons(tmpMeta24, _subscripts);
tmpMeta25 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta22);
tmpMeta26 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta25);
tmpMeta27 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, tmpMeta21, _OMC_LIT10, tmpMeta26);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outN) { *out_outN = _outN; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_extrapFieldTraverseFun(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inN, modelica_metatype *out_outN)
{
modelica_integer tmp1;
modelica_integer _outN;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inN);
_outExp = omc_InstUtil_extrapFieldTraverseFun(threadData, _inExp, tmp1, &_outN);
if (out_outN) { *out_outN = mmc_mk_icon(_outN); }
return _outExp;
}
DLLExport
modelica_metatype omc_InstUtil_discretizePDE(threadData_t *threadData, modelica_metatype _inEQ, modelica_metatype _inDomFieldLst, modelica_metatype _inDiscretizedEQs)
{
modelica_metatype _outDiscretizedEQs = NULL;
modelica_metatype _newDiscretizedEQs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inEQ;
{
modelica_metatype _lhs_exp = NULL;
modelica_metatype _rhs_exp = NULL;
modelica_metatype _domainCr = NULL;
modelica_metatype _domainCr1 = NULL;
modelica_metatype _comment = NULL;
modelica_metatype _info = NULL;
modelica_integer _N;
modelica_metatype _fieldLst = NULL;
modelica_string _name = NULL;
modelica_metatype _subscripts = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_lhs_exp = tmpMeta6;
_rhs_exp = tmpMeta7;
_domainCr = tmpMeta8;
_comment = tmpMeta9;
_info = tmpMeta10;
_N = omc_InstUtil_getDomNFields(threadData, _inDomFieldLst, _domainCr, _info ,&_fieldLst);
tmpMeta1 = omc_InstUtil_creatFieldEqs(threadData, _lhs_exp, _rhs_exp, _domainCr, _N, _fieldLst, _comment, _info);
goto tmp3_done;
}
case 1: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,2,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (8 != MMC_STRLEN(tmpMeta17) || strcmp(MMC_STRINGDATA(_OMC_LIT27), MMC_STRINGDATA(tmpMeta17)) != 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_lhs_exp = tmpMeta11;
_rhs_exp = tmpMeta12;
_domainCr = tmpMeta13;
_name = tmpMeta14;
_subscripts = tmpMeta15;
_comment = tmpMeta18;
_info = tmpMeta19;
tmpMeta20 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, _subscripts);
_domainCr1 = tmpMeta20;
_N = omc_InstUtil_getDomNFields(threadData, _inDomFieldLst, _domainCr1, _info ,&_fieldLst);
tmpMeta1 = omc_InstUtil_creatFieldEqs(threadData, _lhs_exp, _rhs_exp, _domainCr, _N, _fieldLst, _comment, _info);
goto tmp3_done;
}
case 2: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,1,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 3));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,2,2) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
if (4 != MMC_STRLEN(tmpMeta27) || strcmp(MMC_STRINGDATA(_OMC_LIT28), MMC_STRINGDATA(tmpMeta27)) != 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_lhs_exp = tmpMeta21;
_rhs_exp = tmpMeta22;
_name = tmpMeta24;
_subscripts = tmpMeta25;
_comment = tmpMeta28;
_info = tmpMeta29;
tmpMeta30 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, _subscripts);
_domainCr1 = tmpMeta30;
_N = omc_InstUtil_getDomNFields(threadData, _inDomFieldLst, _domainCr1, _info ,&_fieldLst);
_lhs_exp = omc_AbsynUtil_traverseExp(threadData, _lhs_exp, boxvar_InstUtil_extrapFieldTraverseFun, mmc_mk_integer(((modelica_integer) 1)), NULL);
_rhs_exp = omc_AbsynUtil_traverseExp(threadData, _rhs_exp, boxvar_InstUtil_extrapFieldTraverseFun, mmc_mk_integer(((modelica_integer) 1)), NULL);
tmpMeta31 = mmc_mk_cons(omc_InstUtil_newEQFun(threadData, ((modelica_integer) 1), _lhs_exp, _rhs_exp, _domainCr1, _N, 1, _fieldLst, _comment, _info), MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta31;
goto tmp3_done;
}
case 3: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,1,3) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 3));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,2,2) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
if (5 != MMC_STRLEN(tmpMeta38) || strcmp(MMC_STRINGDATA(_OMC_LIT29), MMC_STRINGDATA(tmpMeta38)) != 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_lhs_exp = tmpMeta32;
_rhs_exp = tmpMeta33;
_name = tmpMeta35;
_subscripts = tmpMeta36;
_comment = tmpMeta39;
_info = tmpMeta40;
tmpMeta41 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, _subscripts);
_domainCr1 = tmpMeta41;
_N = omc_InstUtil_getDomNFields(threadData, _inDomFieldLst, _domainCr1, _info ,&_fieldLst);
_lhs_exp = omc_AbsynUtil_traverseExp(threadData, _lhs_exp, boxvar_InstUtil_extrapFieldTraverseFun, mmc_mk_integer(_N), NULL);
_rhs_exp = omc_AbsynUtil_traverseExp(threadData, _rhs_exp, boxvar_InstUtil_extrapFieldTraverseFun, mmc_mk_integer(_N), NULL);
tmpMeta42 = mmc_mk_cons(omc_InstUtil_newEQFun(threadData, _N, _lhs_exp, _rhs_exp, _domainCr1, _N, 1, _fieldLst, _comment, _info), MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta42;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
fputs(MMC_STRINGDATA(_OMC_LIT26),stdout);
goto goto_2;
tmpMeta43 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta43;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta44;
tmpMeta44 = mmc_mk_cons(_inEQ, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta44;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_newDiscretizedEQs = tmpMeta1;
_outDiscretizedEQs = listAppend(_inDiscretizedEQs, _newDiscretizedEQs);
_return: OMC_LABEL_UNUSED
return _outDiscretizedEQs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optAppendFieldMapFun(threadData_t *threadData, modelica_metatype _inDomainFields, modelica_metatype _domainCrToAdd, modelica_metatype _fieldCrToAdd, modelica_boolean _inFound, modelica_boolean *out_outFound)
{
modelica_metatype _outDomainFields = NULL;
modelica_boolean _outFound;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_boolean tmp4_2;
tmp4_1 = _inDomainFields;
tmp4_2 = _inFound;
{
modelica_metatype _domainCr = NULL;
modelica_metatype _fieldCrLst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (0 != tmp4_2) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_domainCr = tmpMeta6;
_fieldCrLst = tmpMeta7;
tmp8 = omc_ComponentReference_crefEqual(threadData, _domainCr, _domainCrToAdd);
if (1 != tmp8) goto goto_2;
tmpMeta9 = mmc_mk_cons(_fieldCrToAdd, _fieldCrLst);
tmpMeta10 = mmc_mk_box2(0, _domainCr, tmpMeta9);
tmpMeta[0+0] = tmpMeta10;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inDomainFields;
tmp1_c1 = _inFound;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outDomainFields = tmpMeta[0+0];
_outFound = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_outFound) { *out_outFound = _outFound; }
return _outDomainFields;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_optAppendFieldMapFun(threadData_t *threadData, modelica_metatype _inDomainFields, modelica_metatype _domainCrToAdd, modelica_metatype _fieldCrToAdd, modelica_metatype _inFound, modelica_metatype *out_outFound)
{
modelica_integer tmp1;
modelica_boolean _outFound;
modelica_metatype _outDomainFields = NULL;
tmp1 = mmc_unbox_integer(_inFound);
_outDomainFields = omc_InstUtil_optAppendFieldMapFun(threadData, _inDomainFields, _domainCrToAdd, _fieldCrToAdd, tmp1, &_outFound);
if (out_outFound) { *out_outFound = mmc_mk_icon(_outFound); }
return _outDomainFields;
}
DLLExport
modelica_metatype omc_InstUtil_optAppendField(threadData_t *threadData, modelica_metatype _inDomFieldsLst, modelica_metatype _fieldDomOpt)
{
modelica_metatype _outDomFieldsLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _fieldDomOpt;
{
modelica_metatype _fieldCr = NULL;
modelica_metatype _domainCr = NULL;
modelica_boolean _found;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta1 = _inDomFieldsLst;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_fieldCr = tmpMeta7;
_domainCr = tmpMeta8;
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta12 = omc_List_map2Fold(threadData, _inDomFieldsLst, boxvar_InstUtil_optAppendFieldMapFun, _domainCr, _fieldCr, mmc_mk_boolean(0), tmpMeta11, &tmpMeta9);
_outDomFieldsLst = tmpMeta12;
tmp10 = mmc_unbox_integer(tmpMeta9);
_found = tmp10;
if((!_found))
{
tmpMeta14 = mmc_mk_cons(_fieldCr, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta15 = mmc_mk_box2(0, _domainCr, tmpMeta14);
tmpMeta13 = mmc_mk_cons(tmpMeta15, _inDomFieldsLst);
_outDomFieldsLst = tmpMeta13;
}
tmpMeta1 = _outDomFieldsLst;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDomFieldsLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDomFieldsLst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addEach(threadData_t *threadData, modelica_metatype _inSubMod)
{
modelica_metatype _outSubMod = NULL;
modelica_string _ident = NULL;
modelica_metatype _finalPrefix = NULL;
modelica_metatype _eachPrefix = NULL;
modelica_metatype _subModLst = NULL;
modelica_metatype _binding = NULL;
modelica_metatype _info = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubMod;
{
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_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 6));
_ident = tmpMeta6;
_finalPrefix = tmpMeta8;
_subModLst = tmpMeta9;
_binding = tmpMeta10;
_info = tmpMeta11;
tmpMeta12 = mmc_mk_box6(3, &DAE_Mod_MOD__desc, _finalPrefix, _OMC_LIT30, _subModLst, _binding, _info);
tmpMeta13 = mmc_mk_box3(3, &DAE_SubMod_NAMEMOD__desc, _ident, tmpMeta12);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubMod = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubMod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findN(threadData_t *threadData, modelica_metatype _inVar)
{
modelica_metatype _optN = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVar;
{
modelica_integer _N;
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_integer tmp11;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (1 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT31), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmp11 = mmc_unbox_integer(tmpMeta10);
_N = tmp11;
tmpMeta1 = mmc_mk_some(mmc_mk_integer(_N));
goto tmp3_done;
}
case 1: {
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_optN = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _optN;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_getNDcr(threadData_t *threadData, modelica_metatype _dcr, modelica_metatype *out_outCrOpt)
{
modelica_integer _outN;
modelica_metatype _outCrOpt = NULL;
modelica_integer tmp1_c0 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dcr;
{
modelica_metatype _cr1 = NULL;
modelica_metatype _varLst = NULL;
modelica_integer _N;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_cr1 = tmpMeta6;
_dcr = _cr1;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,9,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
_varLst = tmpMeta8;
_N = mmc_unbox_integer(omc_List_findSome(threadData, _varLst, boxvar_InstUtil_findN));
tmp1_c0 = _N;
tmpMeta[0+1] = _dcr;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outN = tmp1_c0;
_outCrOpt = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outCrOpt) { *out_outCrOpt = _outCrOpt; }
return _outN;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getNDcr(threadData_t *threadData, modelica_metatype _dcr, modelica_metatype *out_outCrOpt)
{
modelica_integer _outN;
modelica_metatype out_outN;
_outN = omc_InstUtil_getNDcr(threadData, _dcr, out_outCrOpt);
out_outN = mmc_mk_icon(_outN);
return out_outN;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getQualDcr(threadData_t *threadData, modelica_metatype _domainSubMod, modelica_metatype _inInfo)
{
modelica_metatype _dcr = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _domainSubMod;
{
modelica_metatype _cr = NULL;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT37), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,5) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,9,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,3,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,2,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
if (19 != MMC_STRLEN(tmpMeta16) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta16)) != 0) goto tmp3_end;
_cr = tmpMeta11;
tmpMeta1 = _cr;
goto tmp3_done;
}
case 1: {
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT34, _OMC_LIT36, _inInfo);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_dcr = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _dcr;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_findDomainSubMod(threadData_t *threadData, modelica_metatype _subMod)
{
modelica_boolean _isDomain;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _subMod;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT37), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isDomain = tmp1;
_return: OMC_LABEL_UNUSED
return _isDomain;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findDomainSubMod(threadData_t *threadData, modelica_metatype _subMod)
{
modelica_boolean _isDomain;
modelica_metatype out_isDomain;
_isDomain = omc_InstUtil_findDomainSubMod(threadData, _subMod);
out_isDomain = mmc_mk_icon(_isDomain);
return out_isDomain;
}
DLLExport
modelica_metatype omc_InstUtil_elabField(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_string _name, modelica_metatype _attr, modelica_metatype _inDims, modelica_metatype _inMod, modelica_metatype _inInfo, modelica_metatype *out_outMod, modelica_metatype *out_outFieldDomOpt)
{
modelica_metatype _outDims = NULL;
modelica_metatype _outMod = NULL;
modelica_metatype _outFieldDomOpt = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _attr;
tmp4_2 = _inMod;
{
modelica_metatype _dim_f = NULL;
modelica_metatype _finalPrefix = NULL;
modelica_metatype _eachPrefix = NULL;
modelica_metatype _subModLst = NULL;
modelica_metatype _binding = NULL;
modelica_metatype _info = NULL;
modelica_integer _N;
modelica_metatype _dcr = NULL;
modelica_metatype _domainSubMod = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
_N = ((modelica_integer) -1);
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
tmpMeta[0+0] = _inDims;
tmpMeta[0+1] = _inMod;
tmpMeta[0+2] = mmc_mk_none();
goto tmp3_done;
}
case 1: {
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;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
_finalPrefix = tmpMeta8;
_eachPrefix = tmpMeta9;
_subModLst = tmpMeta10;
_binding = tmpMeta11;
_info = tmpMeta12;
_domainSubMod = omc_List_findAndRemove(threadData, _subModLst, boxvar_InstUtil_findDomainSubMod ,&_subModLst);
_dcr = omc_InstUtil_getQualDcr(threadData, _domainSubMod, _inInfo);
_N = omc_InstUtil_getNDcr(threadData, _dcr ,&_dcr);
if((_N == ((modelica_integer) -1)))
{
tmpMeta14 = stringAppend(_OMC_LIT39,_name);
tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT40);
tmpMeta13 = mmc_mk_cons(tmpMeta15, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT34, tmpMeta13, _inInfo);
}
_subModLst = listReverse(_subModLst);
_subModLst = omc_List_map(threadData, _subModLst, boxvar_InstUtil_addEach);
tmpMeta16 = mmc_mk_box6(3, &DAE_Mod_MOD__desc, _finalPrefix, _eachPrefix, _subModLst, _binding, _info);
_outMod = tmpMeta16;
tmpMeta17 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_N));
_dim_f = tmpMeta17;
tmpMeta18 = mmc_mk_cons(_dim_f, _inDims);
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta20 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _name, tmpMeta19);
tmpMeta21 = mmc_mk_box2(0, tmpMeta20, _dcr);
tmpMeta[0+0] = tmpMeta18;
tmpMeta[0+1] = _outMod;
tmpMeta[0+2] = mmc_mk_some(tmpMeta21);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta23 = stringAppend(_OMC_LIT8,_name);
tmpMeta24 = stringAppend(tmpMeta23,_OMC_LIT41);
tmpMeta22 = mmc_mk_cons(tmpMeta24, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT34, tmpMeta22, _inInfo);
tmpMeta[0+0] = _inDims;
tmpMeta[0+1] = _inMod;
tmpMeta[0+2] = mmc_mk_none();
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDims = tmpMeta[0+0];
_outMod = tmpMeta[0+1];
_outFieldDomOpt = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outMod) { *out_outMod = _outMod; }
if (out_outFieldDomOpt) { *out_outFieldDomOpt = _outFieldDomOpt; }
return _outDims;
}
DLLExport
modelica_boolean omc_InstUtil_isSubModDomainOrStart(threadData_t *threadData, modelica_metatype _subMod)
{
modelica_boolean _isNotDomain;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _subMod;
{
modelica_string _idn = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_idn = tmpMeta6;
if (!((stringEqual(_idn, _OMC_LIT37)) || (stringEqual(_idn, _OMC_LIT42)))) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isNotDomain = tmp1;
_return: OMC_LABEL_UNUSED
return _isNotDomain;
}
modelica_metatype boxptr_InstUtil_isSubModDomainOrStart(threadData_t *threadData, modelica_metatype _subMod)
{
modelica_boolean _isNotDomain;
modelica_metatype out_isNotDomain;
_isNotDomain = omc_InstUtil_isSubModDomainOrStart(threadData, _subMod);
out_isNotDomain = mmc_mk_icon(_isNotDomain);
return out_isNotDomain;
}
DLLExport
modelica_metatype omc_InstUtil_addGhostCells2(threadData_t *threadData, modelica_metatype _inCompelt, modelica_metatype _fieldNamesP, modelica_metatype _inGhosts)
{
modelica_metatype _outGhosts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inCompelt;
{
modelica_string _name = NULL;
modelica_metatype _prefixes = NULL;
modelica_metatype _typeSpec = NULL;
modelica_metatype _comment = NULL;
modelica_metatype _condition = NULL;
modelica_metatype _info = NULL;
modelica_metatype _arrayDims = NULL;
modelica_metatype _connectorType = NULL;
modelica_metatype _parallelism = NULL;
modelica_metatype _variability = NULL;
modelica_metatype _direction = NULL;
modelica_metatype _finalPrefix = NULL;
modelica_metatype _eachPrefix = NULL;
modelica_metatype _subModLst = NULL;
modelica_metatype _binding = NULL;
modelica_metatype _info2 = NULL;
modelica_metatype _daeMod = NULL;
modelica_metatype _ghostL = NULL;
modelica_metatype _ghostR = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 5));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 6));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,0) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,5) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 3));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 4));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 5));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 6));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 7));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 8));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 9));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_name = tmpMeta7;
_prefixes = tmpMeta8;
_arrayDims = tmpMeta10;
_connectorType = tmpMeta11;
_parallelism = tmpMeta12;
_variability = tmpMeta13;
_direction = tmpMeta14;
_typeSpec = tmpMeta16;
_finalPrefix = tmpMeta18;
_eachPrefix = tmpMeta19;
_subModLst = tmpMeta20;
_binding = tmpMeta21;
_info2 = tmpMeta22;
_comment = tmpMeta23;
_condition = tmpMeta24;
_info = tmpMeta25;
_daeMod = tmpMeta26;
if((!listMember(_name, _fieldNamesP)))
{
goto goto_2;
}
_subModLst = omc_List_filterOnFalse(threadData, _subModLst, boxvar_InstUtil_isSubModDomainOrStart);
tmpMeta27 = stringAppend(_name,_OMC_LIT1);
tmpMeta28 = mmc_mk_box7(3, &SCode_Attributes_ATTR__desc, _arrayDims, _connectorType, _parallelism, _variability, _direction, _OMC_LIT43);
tmpMeta29 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _finalPrefix, _eachPrefix, _subModLst, _binding, _info2);
tmpMeta30 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, tmpMeta27, _prefixes, tmpMeta28, _typeSpec, tmpMeta29, _comment, _condition, _info);
tmpMeta31 = mmc_mk_box2(0, tmpMeta30, _daeMod);
_ghostL = tmpMeta31;
tmpMeta32 = stringAppend(_name,_OMC_LIT2);
tmpMeta33 = mmc_mk_box7(3, &SCode_Attributes_ATTR__desc, _arrayDims, _connectorType, _parallelism, _variability, _direction, _OMC_LIT43);
tmpMeta34 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _finalPrefix, _eachPrefix, _subModLst, _binding, _info2);
tmpMeta35 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, tmpMeta32, _prefixes, tmpMeta33, _typeSpec, tmpMeta34, _comment, _condition, _info);
tmpMeta36 = mmc_mk_box2(0, tmpMeta35, _daeMod);
_ghostR = tmpMeta36;
tmpMeta38 = mmc_mk_cons(_ghostR, _inGhosts);
tmpMeta37 = mmc_mk_cons(_ghostL, tmpMeta38);
tmpMeta1 = tmpMeta37;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inGhosts;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outGhosts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outGhosts;
}
DLLExport
modelica_metatype omc_InstUtil_fieldInPderExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inFieldNames, modelica_metatype *out_outFieldNames)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outFieldNames = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_string _newFieldName = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (4 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (listEmpty(tmpMeta11)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmpMeta11);
tmpMeta15 = MMC_CDR(tmpMeta11);
if (!listEmpty(tmpMeta15)) goto tmp3_end;
_newFieldName = tmpMeta13;
tmpMeta1 = omc_List_unionElt(threadData, _newFieldName, _inFieldNames);
goto tmp3_done;
}
case 1: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,2,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (4 != MMC_STRLEN(tmpMeta17) || strcmp(MMC_STRINGDATA(_OMC_LIT22), MMC_STRINGDATA(tmpMeta17)) != 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,0,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
if (listEmpty(tmpMeta19)) goto tmp3_end;
tmpMeta20 = MMC_CAR(tmpMeta19);
tmpMeta21 = MMC_CDR(tmpMeta19);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,2,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,2,2) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
if (listEmpty(tmpMeta21)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmpMeta21);
tmpMeta25 = MMC_CDR(tmpMeta21);
if (listEmpty(tmpMeta25)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmpMeta25);
tmpMeta27 = MMC_CDR(tmpMeta25);
if (!listEmpty(tmpMeta27)) goto tmp3_end;
_newFieldName = tmpMeta23;
tmpMeta1 = omc_List_unionElt(threadData, _newFieldName, _inFieldNames);
goto tmp3_done;
}
case 2: {
tmpMeta1 = _inFieldNames;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outFieldNames = tmpMeta1;
_outExp = _inExp;
_return: OMC_LABEL_UNUSED
if (out_outFieldNames) { *out_outFieldNames = _outFieldNames; }
return _outExp;
}
DLLExport
modelica_metatype omc_InstUtil_fieldsInPderEq(threadData_t *threadData, modelica_metatype _eq, modelica_metatype _inFieldNames)
{
modelica_metatype _outFieldNames = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _eq;
{
modelica_metatype _fieldNames1 = NULL;
modelica_metatype _lhs_exp = NULL;
modelica_metatype _rhs_exp = NULL;
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,2,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_lhs_exp = tmpMeta6;
_rhs_exp = tmpMeta7;
omc_AbsynUtil_traverseExpTopDown(threadData, _lhs_exp, boxvar_InstUtil_fieldInPderExp, _inFieldNames ,&_fieldNames1);
omc_AbsynUtil_traverseExpTopDown(threadData, _rhs_exp, boxvar_InstUtil_fieldInPderExp, _fieldNames1 ,&_fieldNames1);
tmpMeta1 = listAppend(_inFieldNames, _fieldNames1);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inFieldNames;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outFieldNames = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outFieldNames;
}
DLLExport
modelica_metatype omc_InstUtil_addGhostCells(threadData_t *threadData, modelica_metatype _inCompelts, modelica_metatype _inEqs)
{
modelica_metatype _outCompelts = NULL;
modelica_metatype _fieldNamesP = NULL;
modelica_metatype _ghostCompelts = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_fieldNamesP = omc_List_fold(threadData, _inEqs, boxvar_InstUtil_fieldsInPderEq, tmpMeta1);
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_ghostCompelts = omc_List_fold1(threadData, _inCompelts, boxvar_InstUtil_addGhostCells2, _fieldNamesP, tmpMeta2);
_outCompelts = listAppend(_inCompelts, _ghostCompelts);
_return: OMC_LABEL_UNUSED
return _outCompelts;
}
DLLExport
modelica_metatype omc_InstUtil_propagateModFinal(threadData_t *threadData, modelica_metatype _inMod, modelica_metatype _inFinal)
{
modelica_metatype _outFinal = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inMod;
tmp4_2 = _inFinal;
{
modelica_metatype _fp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
tmpMeta1 = _inFinal;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_fp = tmpMeta6;
tmpMeta1 = _fp;
goto tmp3_done;
}
case 2: {
tmpMeta1 = _inFinal;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outFinal = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outFinal;
}
DLLExport
modelica_metatype omc_InstUtil_noModForUpdatedComponents(threadData_t *threadData, modelica_metatype _variability, modelica_metatype _updatedComps, modelica_metatype _cref, modelica_metatype _mods, modelica_metatype _cmod, modelica_metatype _m, modelica_metatype *out_outCmod, modelica_metatype *out_outM)
{
modelica_metatype _outMods = NULL;
modelica_metatype _outCmod = NULL;
modelica_metatype _outM = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!omc_BaseHashTable_hasKey(threadData, _cref, _updatedComps)) goto tmp3_end;
omc_InstUtil_checkVariabilityOfUpdatedComponent(threadData, _variability, _cref);
tmpMeta[0+0] = _OMC_LIT44;
tmpMeta[0+1] = _OMC_LIT44;
tmpMeta[0+2] = _OMC_LIT45;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _mods;
tmpMeta[0+1] = _cmod;
tmpMeta[0+2] = _m;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outMods = tmpMeta[0+0];
_outCmod = tmpMeta[0+1];
_outM = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outCmod) { *out_outCmod = _outCmod; }
if (out_outM) { *out_outM = _outM; }
return _outMods;
}
DLLExport
modelica_boolean omc_InstUtil_instDimsHasZeroDims(threadData_t *threadData, modelica_metatype _inInstDims)
{
modelica_boolean _outHasZeroDims;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inInstDims;
{
modelica_metatype _dims = NULL;
modelica_metatype _rest_dims = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_dims = tmpMeta6;
tmp8 = omc_List_exist(threadData, _dims, boxvar_Expression_dimensionIsZero);
if (1 != tmp8) goto goto_2;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_1);
tmpMeta10 = MMC_CDR(tmp4_1);
_rest_dims = tmpMeta10;
tmp1 = omc_InstUtil_instDimsHasZeroDims(threadData, _rest_dims);
goto tmp3_done;
}
case 2: {
tmp1 = 0;
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:;
}
}
_outHasZeroDims = tmp1;
_return: OMC_LABEL_UNUSED
return _outHasZeroDims;
}
modelica_metatype boxptr_InstUtil_instDimsHasZeroDims(threadData_t *threadData, modelica_metatype _inInstDims)
{
modelica_boolean _outHasZeroDims;
modelica_metatype out_outHasZeroDims;
_outHasZeroDims = omc_InstUtil_instDimsHasZeroDims(threadData, _inInstDims);
out_outHasZeroDims = mmc_mk_icon(_outHasZeroDims);
return out_outHasZeroDims;
}
DLLExport
modelica_boolean omc_InstUtil_checkParallelismWRTEnv(threadData_t *threadData, modelica_metatype _inEnv, modelica_string _inName, modelica_metatype _inAttr, modelica_metatype _inInfo)
{
modelica_boolean _isValid;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inAttr;
{
modelica_string _errorString = NULL;
modelica_string _scopeName = NULL;
modelica_metatype _dir = NULL;
modelica_metatype _prl = NULL;
modelica_boolean _isparglobal;
modelica_boolean _hasnodir;
modelica_metatype _r = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_boolean tmp11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_prl = tmpMeta6;
_dir = tmpMeta7;
_r = omc_FGraph_lastScopeRef(threadData, _inEnv);
tmp8 = omc_FNode_isRefTop(threadData, _r);
if (0 != tmp8) goto goto_2;
_scopeName = omc_FNode_refName(threadData, _r);
tmpMeta9 = mmc_mk_cons(_r, MMC_REFSTRUCTLIT(mmc_nil));
tmp10 = omc_FGraph_checkScopeType(threadData, tmpMeta9, _OMC_LIT47);
if (1 != tmp10) goto goto_2;
_isparglobal = omc_SCodeUtil_parallelismEqual(threadData, _prl, _OMC_LIT48);
_hasnodir = (!omc_AbsynUtil_isInputOrOutput(threadData, _dir));
tmp11 = (_isparglobal && _hasnodir);
if (1 != tmp11) goto goto_2;
tmpMeta12 = stringAppend(_OMC_LIT49,_inName);
tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT50);
tmpMeta14 = stringAppend(tmpMeta13,_scopeName);
tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT51);
tmpMeta16 = stringAppend(tmpMeta15,_OMC_LIT52);
_errorString = tmpMeta16;
tmpMeta17 = mmc_mk_cons(_errorString, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT55, tmpMeta17, _inInfo);
tmp1 = 0;
goto tmp3_done;
}
case 1: {
tmp1 = 1;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_isValid = tmp1;
_return: OMC_LABEL_UNUSED
return _isValid;
}
modelica_metatype boxptr_InstUtil_checkParallelismWRTEnv(threadData_t *threadData, modelica_metatype _inEnv, modelica_metatype _inName, modelica_metatype _inAttr, modelica_metatype _inInfo)
{
modelica_boolean _isValid;
modelica_metatype out_isValid;
_isValid = omc_InstUtil_checkParallelismWRTEnv(threadData, _inEnv, _inName, _inAttr, _inInfo);
out_isValid = mmc_mk_icon(_isValid);
return out_isValid;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findUnboundVariableUseInCase(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _inUnbound)
{
modelica_metatype _unbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _case_;
tmp4_2 = _inUnbound;
{
modelica_metatype _info = NULL;
modelica_metatype _resultInfo = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _result = NULL;
modelica_metatype _patterns = NULL;
modelica_metatype _body = NULL;
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_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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_patterns = tmpMeta6;
_patternGuard = tmpMeta7;
_body = tmpMeta8;
_result = tmpMeta9;
_resultInfo = tmpMeta10;
_info = tmpMeta11;
_unbound = tmp4_2;
omc_Patternm_traversePatternList(threadData, _patterns, boxvar_InstUtil_patternFiltering, _unbound ,&_unbound);
tmpMeta14 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _patternGuard);
tmpMeta15 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, tmpMeta14, boxvar_InstUtil_findUnboundVariableUse, tmpMeta15, &tmpMeta12);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
_unbound = tmpMeta13;
tmpMeta16 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta17 = omc_List_fold1(threadData, _body, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(1), tmpMeta16);
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 3));
_unbound = tmpMeta18;
tmpMeta21 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _result);
tmpMeta22 = mmc_mk_box2(0, _unbound, _resultInfo);
omc_Expression_traverseExpTopDown(threadData, tmpMeta21, boxvar_InstUtil_findUnboundVariableUse, tmpMeta22, &tmpMeta19);
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 1));
_unbound = tmpMeta20;
tmpMeta1 = _unbound;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_unbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _unbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findUnboundVariableUse(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_metatype _exp = NULL;
modelica_metatype _unbound = NULL;
modelica_metatype _unboundLocal = NULL;
modelica_metatype _info = NULL;
modelica_string _str = NULL;
modelica_string _name = NULL;
modelica_metatype _cr = NULL;
modelica_boolean _b;
modelica_metatype _arg = NULL;
modelica_metatype _inputs = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _unbounds = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
_exp = tmp4_1;
_arg = tmp4_2;
tmpMeta[0+0] = _exp;
tmp1_c1 = 0;
tmpMeta[0+2] = _arg;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (9 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT62), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
tmp10 = mmc_unbox_integer(tmpMeta9);
if (1 != tmp10) goto tmp3_end;
_exp = tmp4_1;
_arg = tmp4_2;
tmpMeta[0+0] = _exp;
tmp1_c1 = 0;
tmpMeta[0+2] = _arg;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,3,0) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_info = tmpMeta12;
omc_Error_addSourceMessage(threadData, _OMC_LIT59, _OMC_LIT61, _info);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_exp = tmp4_1;
_cr = tmpMeta13;
_unbound = tmpMeta14;
_info = tmpMeta15;
_b = listMember(omc_ComponentReference_crefFirstIdent(threadData, _cr), _unbound);
_str = omc_ComponentReference_crefFirstIdent(threadData, _cr);
tmpMeta16 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!_b), _OMC_LIT59, tmpMeta16, _info);
_unbound = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, _str);
tmpMeta17 = mmc_mk_box2(0, _unbound, _info);
tmpMeta[0+0] = _exp;
tmp1_c1 = 1;
tmpMeta[0+2] = tmpMeta17;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,1,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_exp = tmp4_1;
_name = tmpMeta19;
_unbound = tmpMeta20;
_info = tmpMeta21;
_b = listMember(_name, _unbound);
tmpMeta22 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!_b), _OMC_LIT59, tmpMeta22, _info);
_unbound = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, _name);
tmpMeta23 = mmc_mk_box2(0, _unbound, _info);
tmpMeta[0+0] = _exp;
tmp1_c1 = 1;
tmpMeta[0+2] = tmpMeta23;
goto tmp3_done;
}
case 5: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_exp = tmp4_1;
_inputs = tmpMeta24;
_localDecls = tmpMeta25;
_cases = tmpMeta26;
_unbound = tmpMeta27;
_info = tmpMeta28;
tmpMeta31 = mmc_mk_box2(31, &DAE_Exp_LIST__desc, _inputs);
tmpMeta32 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, tmpMeta31, boxvar_InstUtil_findUnboundVariableUse, tmpMeta32, &tmpMeta29);
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 1));
_unbound = tmpMeta30;
tmpMeta33 = MMC_REFSTRUCTLIT(mmc_nil);
_unboundLocal = omc_InstUtil_checkFunctionDefUse2(threadData, _localDecls, mmc_mk_none(), _unbound, tmpMeta33, _info);
_unbounds = omc_List_map1(threadData, _cases, boxvar_InstUtil_findUnboundVariableUseInCase, _unboundLocal);
_unbound = omc_List_fold1r(threadData, _unbounds, boxvar_List_intersectionOnTrue, boxvar_stringEq, _unbound);
tmpMeta34 = mmc_mk_box2(0, _unbound, _info);
tmpMeta[0+0] = _exp;
tmp1_c1 = 0;
tmpMeta[0+2] = tmpMeta34;
goto tmp3_done;
}
case 6: {
_exp = tmp4_1;
_arg = tmp4_2;
tmpMeta[0+0] = _exp;
tmp1_c1 = 1;
tmpMeta[0+2] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findUnboundVariableUse(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_InstUtil_findUnboundVariableUse(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseCrefSubs(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _info, modelica_metatype _inUnbound)
{
modelica_metatype _outUnbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _exp;
tmp4_2 = _inUnbound;
{
modelica_metatype _unbound = NULL;
modelica_metatype _cr = NULL;
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
_unbound = tmp4_2;
tmpMeta9 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDownCrefHelper(threadData, _cr, boxvar_InstUtil_findUnboundVariableUse, tmpMeta9, &tmpMeta7);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
_unbound = tmpMeta8;
tmpMeta1 = _unbound;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inUnbound;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outUnbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_patternFiltering(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inLst, modelica_metatype *out_unbound)
{
modelica_metatype _outPat = NULL;
modelica_metatype _unbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outPat = _inPat;
_unbound = _inLst;
{
modelica_metatype tmp4_1;
tmp4_1 = _inPat;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
tmpMeta1 = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inPat), 2))));
goto tmp3_done;
}
case 6: {
tmpMeta1 = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inPat), 2))));
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _unbound;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_unbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_unbound) { *out_unbound = _unbound; }
return _outPat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_crefFiltering(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inUnbound)
{
modelica_metatype _outUnbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inUnbound;
{
modelica_metatype _unbound = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _pattern = NULL;
modelica_string _id1 = NULL;
modelica_string _id2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,0) == 0) goto tmp3_end;
tmpMeta1 = _inUnbound;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_id1 = tmpMeta8;
_id2 = tmpMeta10;
_unbound = tmp4_2;
tmpMeta11 = stringAppend(_id1,_OMC_LIT63);
tmpMeta12 = stringAppend(tmpMeta11,_id2);
tmpMeta1 = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, tmpMeta12);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,9,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,3,1) == 0) goto tmp3_end;
_id1 = tmpMeta14;
_unbound = tmp4_2;
tmpMeta17 = stringAppend(_id1,_OMC_LIT63);
_id1 = tmpMeta17;
tmpMeta1 = omc_List_filter2OnTrue(threadData, _unbound, boxvar_Util_notStrncmp, _id1, mmc_mk_integer(stringLength(_id1)));
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta18;
_unbound = tmp4_2;
tmpMeta1 = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, omc_ComponentReference_crefFirstIdent(threadData, _cr));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmpMeta19;
_unbound = tmp4_2;
_inExp = _exp;
_inUnbound = _unbound;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pattern = tmpMeta20;
_unbound = tmp4_2;
omc_Patternm_traversePattern(threadData, _pattern, boxvar_InstUtil_patternFiltering, _unbound ,&_unbound);
tmpMeta1 = _unbound;
goto tmp3_done;
}
case 6: {
tmpMeta1 = _inUnbound;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outUnbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkFunctionDefUseElse(threadData_t *threadData, modelica_metatype _inElse, modelica_metatype _inUnbound, modelica_boolean _inLoop, modelica_metatype _info)
{
modelica_metatype _outUnbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_boolean tmp4_3;
tmp4_1 = _inElse;
tmp4_2 = _inUnbound;
tmp4_3 = _inLoop;
{
modelica_metatype _exp = NULL;
modelica_metatype _stmts = NULL;
modelica_metatype _else_ = NULL;
modelica_metatype _unbound = NULL;
modelica_metatype _unboundBranch = NULL;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_boolean _b3;
modelica_boolean _b4;
modelica_boolean _iloop;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmpMeta5 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _inUnbound);
tmpMeta1 = tmpMeta5;
goto tmp3_done;
}
case 4: {
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_integer tmp14;
modelica_metatype tmpMeta15;
modelica_integer tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
modelica_metatype tmpMeta22;
modelica_integer tmp23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_exp = tmpMeta6;
_stmts = tmpMeta7;
_else_ = tmpMeta8;
_unbound = tmp4_2;
_iloop = tmp4_3;
tmpMeta11 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_InstUtil_findUnboundVariableUse, tmpMeta11, &tmpMeta9);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
_unbound = tmpMeta10;
tmpMeta12 = omc_InstUtil_checkFunctionDefUseElse(threadData, _else_, _unbound, _inLoop, _info);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
tmp14 = mmc_unbox_integer(tmpMeta13);
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp16 = mmc_unbox_integer(tmpMeta15);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
_b1 = tmp14;
_b2 = tmp16;
_unboundBranch = tmpMeta17;
tmpMeta18 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta19 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(_inLoop), tmpMeta18);
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 1));
tmp21 = mmc_unbox_integer(tmpMeta20);
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp23 = mmc_unbox_integer(tmpMeta22);
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
_b3 = tmp21;
_b4 = tmp23;
_unbound = tmpMeta24;
_iloop = 1;
_unbound = (_iloop?omc_List_intersectionOnTrue(threadData, _unboundBranch, _unbound, boxvar_stringEq):_unbound);
_unbound = ((!(_iloop || _b1))?omc_List_union(threadData, _unboundBranch, _unbound):_unbound);
_b1 = (_b1 && _b3);
_b2 = (_b2 && _b4);
tmpMeta25 = mmc_mk_box3(0, mmc_mk_boolean(_b1), mmc_mk_boolean(_b2), _unbound);
tmpMeta1 = tmpMeta25;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_integer tmp30;
modelica_metatype tmpMeta31;
modelica_integer tmp32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_stmts = tmpMeta26;
_unbound = tmp4_2;
tmpMeta27 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta28 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(_inLoop), tmpMeta27);
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 1));
tmp30 = mmc_unbox_integer(tmpMeta29);
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
tmp32 = mmc_unbox_integer(tmpMeta31);
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 3));
_b1 = tmp30;
_b2 = tmp32;
_unbound = tmpMeta33;
tmpMeta34 = mmc_mk_box3(0, mmc_mk_boolean(_b1), mmc_mk_boolean(_b2), _unbound);
tmpMeta1 = tmpMeta34;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outUnbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkFunctionDefUseElse(threadData_t *threadData, modelica_metatype _inElse, modelica_metatype _inUnbound, modelica_metatype _inLoop, modelica_metatype _info)
{
modelica_integer tmp1;
modelica_metatype _outUnbound = NULL;
tmp1 = mmc_unbox_integer(_inLoop);
_outUnbound = omc_InstUtil_checkFunctionDefUseElse(threadData, _inElse, _inUnbound, tmp1, _info);
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkFunctionDefUseStmt(threadData_t *threadData, modelica_metatype _inStmt, modelica_boolean _inLoop, modelica_metatype _inUnbound)
{
modelica_metatype _outUnbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inStmt;
tmp4_2 = _inUnbound;
{
modelica_metatype _source = NULL;
modelica_string _str = NULL;
modelica_string _iter = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _lhs = NULL;
modelica_metatype _rhs = NULL;
modelica_metatype _exp1 = NULL;
modelica_metatype _exp2 = NULL;
modelica_metatype _lhss = NULL;
modelica_metatype _unbound = NULL;
modelica_boolean _b;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_metatype _else_ = NULL;
modelica_metatype _stmts = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 20; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmp7 = mmc_unbox_integer(tmpMeta6);
if (1 != tmp7) goto tmp3_end;
tmpMeta1 = _inUnbound;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
modelica_integer tmp11;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmp9 = mmc_unbox_integer(tmpMeta8);
if (0 != tmp9) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp11 = mmc_unbox_integer(tmpMeta10);
if (1 != tmp11) goto tmp3_end;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, omc_ElementSource_getStatementSource(threadData, _inStmt));
omc_Error_addSourceMessage(threadData, _OMC_LIT66, _OMC_LIT68, _info);
goto goto_2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_lhs = tmpMeta12;
_rhs = tmpMeta13;
_source = tmpMeta14;
_unbound = tmpMeta15;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta18 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _rhs, boxvar_InstUtil_findUnboundVariableUse, tmpMeta18, &tmpMeta16);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 1));
_unbound = tmpMeta17;
_unbound = omc_InstUtil_traverseCrefSubs(threadData, _lhs, _info, _unbound);
_unbound = omc_InstUtil_crefFiltering(threadData, _lhs, _unbound);
tmpMeta19 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_lhss = tmpMeta20;
_rhs = tmpMeta21;
_source = tmpMeta22;
_unbound = tmpMeta23;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta26 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _rhs, boxvar_InstUtil_findUnboundVariableUse, tmpMeta26, &tmpMeta24);
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 1));
_unbound = tmpMeta25;
_unbound = omc_List_fold1(threadData, _lhss, boxvar_InstUtil_traverseCrefSubs, _info, _unbound);
_unbound = omc_List_fold(threadData, _lhss, boxvar_InstUtil_crefFiltering, _unbound);
tmpMeta27 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_lhs = tmpMeta28;
_rhs = tmpMeta29;
_source = tmpMeta30;
_unbound = tmpMeta31;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta34 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _rhs, boxvar_InstUtil_findUnboundVariableUse, tmpMeta34, &tmpMeta32);
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 1));
_unbound = tmpMeta33;
_unbound = omc_InstUtil_traverseCrefSubs(threadData, _lhs, _info, _unbound);
_unbound = omc_InstUtil_crefFiltering(threadData, _lhs, _unbound);
tmpMeta35 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta35;
goto tmp3_done;
}
case 5: {
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_integer tmp44;
modelica_metatype tmpMeta45;
modelica_integer tmp46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,4) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_exp = tmpMeta36;
_stmts = tmpMeta37;
_else_ = tmpMeta38;
_source = tmpMeta39;
_unbound = tmpMeta40;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta41 = mmc_mk_box4(4, &DAE_Else_ELSEIF__desc, _exp, _stmts, _else_);
tmpMeta42 = omc_InstUtil_checkFunctionDefUseElse(threadData, tmpMeta41, _unbound, _inLoop, _info);
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 1));
tmp44 = mmc_unbox_integer(tmpMeta43);
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 2));
tmp46 = mmc_unbox_integer(tmpMeta45);
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 3));
_b1 = tmp44;
_b2 = tmp46;
_unbound = tmpMeta47;
tmpMeta48 = mmc_mk_box3(0, mmc_mk_boolean(_b1), mmc_mk_boolean(_b2), _unbound);
tmpMeta1 = tmpMeta48;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_integer tmp60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,6) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_iter = tmpMeta49;
_exp = tmpMeta50;
_stmts = tmpMeta51;
_source = tmpMeta52;
_unbound = tmpMeta53;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
_unbound = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, _iter);
tmpMeta56 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_InstUtil_findUnboundVariableUse, tmpMeta56, &tmpMeta54);
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 1));
_unbound = tmpMeta55;
tmpMeta57 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta58 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(1), tmpMeta57);
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta58), 2));
tmp60 = mmc_unbox_integer(tmpMeta59);
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta58), 3));
_b = tmp60;
_unbound = tmpMeta61;
tmpMeta62 = mmc_mk_box3(0, mmc_mk_boolean(_b), mmc_mk_boolean(_b), _unbound);
tmpMeta1 = tmpMeta62;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_integer tmp74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,7) == 0) goto tmp3_end;
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_iter = tmpMeta63;
_exp = tmpMeta64;
_stmts = tmpMeta65;
_source = tmpMeta66;
_unbound = tmpMeta67;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
_unbound = omc_List_filter1OnTrue(threadData, _unbound, boxvar_Util_stringNotEqual, _iter);
tmpMeta70 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_InstUtil_findUnboundVariableUse, tmpMeta70, &tmpMeta68);
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta68), 1));
_unbound = tmpMeta69;
tmpMeta71 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta72 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(1), tmpMeta71);
tmpMeta73 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta72), 2));
tmp74 = mmc_unbox_integer(tmpMeta73);
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta72), 3));
_b = tmp74;
_unbound = tmpMeta75;
tmpMeta76 = mmc_mk_box3(0, mmc_mk_boolean(_b), mmc_mk_boolean(_b), _unbound);
tmpMeta1 = tmpMeta76;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
modelica_metatype tmpMeta81;
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_integer tmp87;
modelica_metatype tmpMeta88;
modelica_metatype tmpMeta89;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,3) == 0) goto tmp3_end;
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta80 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_exp = tmpMeta77;
_stmts = tmpMeta78;
_source = tmpMeta79;
_unbound = tmpMeta80;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta83 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_InstUtil_findUnboundVariableUse, tmpMeta83, &tmpMeta81);
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta81), 1));
_unbound = tmpMeta82;
tmpMeta84 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta85 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(1), tmpMeta84);
tmpMeta86 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta85), 2));
tmp87 = mmc_unbox_integer(tmpMeta86);
tmpMeta88 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta85), 3));
_b = tmp87;
_unbound = tmpMeta88;
tmpMeta89 = mmc_mk_box3(0, mmc_mk_boolean(_b), mmc_mk_boolean(_b), _unbound);
tmpMeta1 = tmpMeta89;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta90;
modelica_metatype tmpMeta91;
modelica_integer tmp92;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,4) == 0) goto tmp3_end;
tmpMeta90 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta90,3,1) == 0) goto tmp3_end;
tmpMeta91 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta90), 2));
tmp92 = mmc_unbox_integer(tmpMeta91);
if (0 != tmp92) goto tmp3_end;
tmpMeta1 = _OMC_LIT69;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_metatype tmpMeta100;
modelica_metatype tmpMeta101;
modelica_metatype tmpMeta102;
modelica_metatype tmpMeta103;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,4) == 0) goto tmp3_end;
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta94 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta95 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta96 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_exp1 = tmpMeta93;
_exp2 = tmpMeta94;
_source = tmpMeta95;
_unbound = tmpMeta96;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta99 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp1, boxvar_InstUtil_findUnboundVariableUse, tmpMeta99, &tmpMeta97);
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta97), 1));
_unbound = tmpMeta98;
tmpMeta102 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp2, boxvar_InstUtil_findUnboundVariableUse, tmpMeta102, &tmpMeta100);
tmpMeta101 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta100), 1));
_unbound = tmpMeta101;
tmpMeta103 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta103;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
modelica_metatype tmpMeta106;
modelica_metatype tmpMeta107;
modelica_metatype tmpMeta108;
modelica_metatype tmpMeta109;
modelica_metatype tmpMeta110;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,2) == 0) goto tmp3_end;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta106 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_exp = tmpMeta104;
_source = tmpMeta105;
_unbound = tmpMeta106;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta109 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_InstUtil_findUnboundVariableUse, tmpMeta109, &tmpMeta107);
tmpMeta108 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta107), 1));
_unbound = tmpMeta108;
tmpMeta110 = mmc_mk_box3(0, mmc_mk_boolean(1), mmc_mk_boolean(1), _unbound);
tmpMeta1 = tmpMeta110;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta111;
modelica_metatype tmpMeta112;
modelica_metatype tmpMeta113;
modelica_metatype tmpMeta114;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,2) == 0) goto tmp3_end;
tmpMeta111 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta111,13,3) == 0) goto tmp3_end;
tmpMeta112 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta111), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta112,1,1) == 0) goto tmp3_end;
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta112), 2));
if (4 != MMC_STRLEN(tmpMeta113) || strcmp(MMC_STRINGDATA(_OMC_LIT71), MMC_STRINGDATA(tmpMeta113)) != 0) goto tmp3_end;
tmpMeta114 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta111), 3));
if (!listEmpty(tmpMeta114)) goto tmp3_end;
tmpMeta1 = _OMC_LIT69;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta115;
modelica_metatype tmpMeta116;
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
modelica_metatype tmpMeta119;
modelica_metatype tmpMeta120;
modelica_metatype tmpMeta121;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,2) == 0) goto tmp3_end;
tmpMeta115 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta116 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta117 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_exp = tmpMeta115;
_source = tmpMeta116;
_unbound = tmpMeta117;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta120 = mmc_mk_box2(0, _unbound, _info);
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_InstUtil_findUnboundVariableUse, tmpMeta120, &tmpMeta118);
tmpMeta119 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta118), 1));
_unbound = tmpMeta119;
tmpMeta121 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta121;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta122;
modelica_metatype tmpMeta123;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
tmpMeta122 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_unbound = tmpMeta122;
tmpMeta123 = mmc_mk_box3(0, mmc_mk_boolean(1), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta123;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta124;
modelica_metatype tmpMeta125;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,1) == 0) goto tmp3_end;
tmpMeta124 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_unbound = tmpMeta124;
tmpMeta125 = mmc_mk_box3(0, mmc_mk_boolean(1), mmc_mk_boolean(1), _unbound);
tmpMeta1 = tmpMeta125;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta126;
modelica_metatype tmpMeta127;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,1) == 0) goto tmp3_end;
tmpMeta126 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_unbound = tmpMeta126;
tmpMeta127 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta1 = tmpMeta127;
goto tmp3_done;
}
case 17: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,3) == 0) goto tmp3_end;
tmpMeta1 = _inUnbound;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta128;
modelica_metatype tmpMeta129;
modelica_metatype tmpMeta130;
modelica_metatype tmpMeta131;
modelica_metatype tmpMeta132;
modelica_integer tmp133;
modelica_metatype tmpMeta134;
modelica_metatype tmpMeta135;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,2) == 0) goto tmp3_end;
tmpMeta128 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta129 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_stmts = tmpMeta128;
_unbound = tmpMeta129;
tmpMeta130 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta131 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(_inLoop), tmpMeta130);
tmpMeta132 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta131), 2));
tmp133 = mmc_unbox_integer(tmpMeta132);
tmpMeta134 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta131), 3));
_b = tmp133;
_unbound = tmpMeta134;
tmpMeta135 = mmc_mk_box3(0, mmc_mk_boolean(_b), mmc_mk_boolean(_b), _unbound);
tmpMeta1 = tmpMeta135;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta136;
modelica_metatype tmpMeta137;
_str = omc_DAEDump_ppStatementStr(threadData, _inStmt);
tmpMeta136 = stringAppend(_OMC_LIT70,_str);
_str = tmpMeta136;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, omc_ElementSource_getStatementSource(threadData, _inStmt));
tmpMeta137 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT66, tmpMeta137, _info);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outUnbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkFunctionDefUseStmt(threadData_t *threadData, modelica_metatype _inStmt, modelica_metatype _inLoop, modelica_metatype _inUnbound)
{
modelica_integer tmp1;
modelica_metatype _outUnbound = NULL;
tmp1 = mmc_unbox_integer(_inLoop);
_outUnbound = omc_InstUtil_checkFunctionDefUseStmt(threadData, _inStmt, tmp1, _inUnbound);
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkOutputDefUse(threadData_t *threadData, modelica_string _name, modelica_metatype _info, modelica_metatype _inUnbound)
{
modelica_metatype _outUnbound = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = listMember(_name, _inUnbound);
tmpMeta1 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!_b), _OMC_LIT59, tmpMeta1, _info);
_outUnbound = omc_List_filter1OnTrue(threadData, _inUnbound, boxvar_Util_stringNotEqual, _name);
_return: OMC_LABEL_UNUSED
return _outUnbound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkFunctionDefUse2(threadData_t *threadData, modelica_metatype _elts, modelica_metatype _alg, modelica_metatype _inUnbound, modelica_metatype _inOutputs, modelica_metatype _inInfo)
{
modelica_metatype _outUnbound = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;
tmp4_1 = _elts;
tmp4_2 = _alg;
tmp4_3 = _inUnbound;
tmp4_4 = _inOutputs;
{
modelica_metatype _rest = NULL;
modelica_metatype _stmts = NULL;
modelica_metatype _unbound = NULL;
modelica_metatype _outputs = NULL;
modelica_metatype _names = NULL;
modelica_metatype _outNames = NULL;
modelica_string _name = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _dir = NULL;
modelica_metatype _vars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (!optionNone(tmp4_2)) goto tmp3_end;
tmpMeta1 = _inUnbound;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_stmts = tmpMeta6;
_unbound = tmp4_3;
_outputs = tmp4_4;
tmpMeta7 = mmc_mk_box3(0, mmc_mk_boolean(0), mmc_mk_boolean(0), _unbound);
tmpMeta8 = omc_List_fold1(threadData, _stmts, boxvar_InstUtil_checkFunctionDefUseStmt, mmc_mk_boolean(0), tmpMeta7);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
_unbound = tmpMeta9;
tmpMeta1 = omc_List_fold1(threadData, _outputs, boxvar_InstUtil_checkOutputDefUse, _inInfo, _unbound);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,13) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,0) == 0) goto tmp3_end;
_rest = tmpMeta11;
_unbound = tmp4_3;
_elts = _rest;
_inUnbound = _unbound;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
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_boolean tmp25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_boolean tmp28;
modelica_metatype tmpMeta29;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_1);
tmpMeta14 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,13) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 4));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,9,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,3,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 3));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 8));
if (!optionNone(tmpMeta21)) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 9));
_name = tmpMeta16;
_dir = tmpMeta17;
_vars = tmpMeta20;
_dims = tmpMeta22;
_rest = tmpMeta14;
_unbound = tmp4_3;
_vars = omc_List_filterOnTrue(threadData, _vars, boxvar_Types_varIsVariable);
tmpMeta23 = stringAppend(_name,_OMC_LIT63);
_names = omc_List_map1r(threadData, omc_List_map(threadData, _vars, boxvar_Types_getVarName), boxvar_stringAppend, tmpMeta23);
tmp25 = (modelica_boolean)omc_DAEUtil_varDirectionEqual(threadData, _dir, _OMC_LIT72);
if(tmp25)
{
tmpMeta26 = _names;
}
else
{
tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta26 = tmpMeta24;
}
_outNames = tmpMeta26;
tmp28 = (modelica_boolean)omc_Expression_dimensionsKnownAndNonZero(threadData, _dims);
if(tmp28)
{
tmpMeta29 = _names;
}
else
{
tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta29 = tmpMeta27;
}
_names = tmpMeta29;
_unbound = listAppend(_names, _unbound);
_outputs = listAppend(_outNames, _inOutputs);
_elts = _rest;
_inUnbound = _unbound;
_inOutputs = _outputs;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta30 = MMC_CAR(tmp4_1);
tmpMeta31 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,0,13) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,1,3) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 2));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 4));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 8));
if (!optionNone(tmpMeta35)) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 9));
_name = tmpMeta33;
_dir = tmpMeta34;
_dims = tmpMeta36;
_rest = tmpMeta31;
_unbound = tmp4_3;
_unbound = omc_List_consOnTrue(threadData, omc_Expression_dimensionsKnownAndNonZero(threadData, _dims), _name, _unbound);
_outputs = omc_List_consOnTrue(threadData, omc_DAEUtil_varDirectionEqual(threadData, _dir, _OMC_LIT72), _name, _inOutputs);
_elts = _rest;
_inUnbound = _unbound;
_inOutputs = _outputs;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
if (!optionNone(tmp4_2)) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta37 = MMC_CAR(tmp4_1);
tmpMeta38 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,16,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
_stmts = tmpMeta40;
_rest = tmpMeta38;
_unbound = tmp4_3;
_elts = _rest;
_alg = mmc_mk_some(_stmts);
_inUnbound = _unbound;
goto _tailrecursive;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta41 = MMC_CAR(tmp4_1);
tmpMeta42 = MMC_CDR(tmp4_1);
_rest = tmpMeta42;
_unbound = tmp4_3;
_elts = _rest;
_inUnbound = _unbound;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outUnbound = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outUnbound;
}
DLLExport
void omc_InstUtil_checkFunctionDefUse(threadData_t *threadData, modelica_metatype _elts, modelica_metatype _info)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
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;
tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
omc_InstUtil_checkFunctionDefUse2(threadData, _elts, mmc_mk_none(), tmpMeta5, tmpMeta6, _info);
goto tmp2_done;
}
case 1: {
omc_Error_addSourceMessage(threadData, _OMC_LIT66, _OMC_LIT74, _info);
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:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_numStructuralParameterScopes(threadData_t *threadData, modelica_metatype _cache)
{
modelica_integer _i;
modelica_metatype _lst = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _cache;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,4) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
_lst = tmpMeta3;
_i = listLength(_lst);
_return: OMC_LABEL_UNUSED
return _i;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_numStructuralParameterScopes(threadData_t *threadData, modelica_metatype _cache)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_InstUtil_numStructuralParameterScopes(threadData, _cache);
out_i = mmc_mk_icon(_i);
return out_i;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_prefixAndAddCrefsToHt(threadData_t *threadData, modelica_metatype _cache, modelica_metatype __omcQ_24in_5Fset, modelica_metatype _pre, modelica_metatype _icrs)
{
modelica_metatype _set = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_set = __omcQ_24in_5Fset;
{
modelica_metatype _cr;
for (tmpMeta1 = _icrs; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_cr = MMC_CAR(tmpMeta1);
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
omc_PrefixUtil_prefixCref(threadData, _cache, omc_FGraph_empty(threadData), tmpMeta2, _pre, _cr ,&_cr);
_set = omc_AvlSetCR_add(threadData, _set, _cr);
}
}
_return: OMC_LABEL_UNUSED
return _set;
}
DLLExport
modelica_metatype omc_InstUtil_popStructuralParameters(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _pre)
{
modelica_metatype _ocache = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _cache;
{
modelica_metatype _ie = NULL;
modelica_metatype _f = NULL;
modelica_metatype _ht = NULL;
modelica_metatype _crs = NULL;
modelica_metatype _crss = NULL;
modelica_metatype _p = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmpMeta10);
tmpMeta12 = MMC_CDR(tmpMeta10);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_ie = tmpMeta6;
_f = tmpMeta7;
_ht = tmpMeta9;
_crs = tmpMeta11;
_crss = tmpMeta12;
_p = tmpMeta13;
_ht = omc_InstUtil_prefixAndAddCrefsToHt(threadData, _cache, _ht, _pre, _crs);
tmpMeta14 = mmc_mk_box2(0, _ht, _crss);
tmpMeta15 = mmc_mk_box5(3, &FCore_Cache_CACHE__desc, _ie, _f, tmpMeta14, _p);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (!listEmpty(tmpMeta17)) goto tmp3_end;
tmpMeta1 = _cache;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
tmpMeta1 = _cache;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ocache = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ocache;
}
DLLExport
modelica_metatype omc_InstUtil_pushStructuralParameters(threadData_t *threadData, modelica_metatype _cache)
{
modelica_metatype _ocache = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _cache;
{
modelica_metatype _ie = NULL;
modelica_metatype _f = NULL;
modelica_metatype _ht = NULL;
modelica_metatype _crs = NULL;
modelica_metatype _p = NULL;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_ie = tmpMeta6;
_f = tmpMeta7;
_ht = tmpMeta9;
_crs = tmpMeta10;
_p = tmpMeta11;
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta12 = mmc_mk_cons(tmpMeta13, _crs);
tmpMeta14 = mmc_mk_box2(0, _ht, tmpMeta12);
tmpMeta15 = mmc_mk_box5(3, &FCore_Cache_CACHE__desc, _ie, _f, tmpMeta14, _p);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _cache;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ocache = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ocache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTailMatchCases(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inCases, modelica_boolean _changed, modelica_metatype _inAcc, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source)
{
modelica_metatype _ocases = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_boolean tmp4_2;volatile modelica_metatype tmp4_3;
tmp4_1 = _inCases;
tmp4_2 = _changed;
tmp4_3 = _inAcc;
{
modelica_metatype _patterns = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = NULL;
modelica_integer _jump;
modelica_metatype _case_ = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _acc = NULL;
modelica_metatype _sourceStmt = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_2) goto tmp3_end;
if (!listEmpty(tmp4_1)) goto tmp3_end;
_acc = tmp4_3;
tmp4 += 3;
tmpMeta1 = listReverse(_acc);
goto tmp3_done;
}
case 1: {
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_integer tmp16;
modelica_metatype tmpMeta17;
modelica_boolean tmp18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
if (optionNone(tmpMeta12)) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 7));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 8));
tmp16 = mmc_unbox_integer(tmpMeta15);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 9));
_patterns = tmpMeta8;
_patternGuard = tmpMeta9;
_localDecls = tmpMeta10;
_body = tmpMeta11;
_exp = tmpMeta13;
_resultInfo = tmpMeta14;
_jump = tmp16;
_info = tmpMeta17;
_cases = tmpMeta7;
_acc = tmp4_3;
tmpMeta19 = omc_InstUtil_optimizeStatementTail3(threadData, _path, _exp, _vars, _lhsVars, _source, &tmp18);
_exp = tmpMeta19;
if (1 != tmp18) goto goto_2;
tmpMeta20 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _patternGuard, _localDecls, _body, mmc_mk_some(_exp), _resultInfo, mmc_mk_integer(_jump), _info);
_case_ = tmpMeta20;
tmpMeta21 = mmc_mk_cons(_case_, _acc);
tmpMeta1 = omc_InstUtil_optimizeStatementTailMatchCases(threadData, _path, _cases, 1, tmpMeta21, _vars, _lhsVars, _source);
goto tmp3_done;
}
case 2: {
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_integer tmp33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_boolean tmp38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta22 = MMC_CAR(tmp4_1);
tmpMeta23 = MMC_CDR(tmp4_1);
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 3));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 4));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 5));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 6));
if (optionNone(tmpMeta28)) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,19,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
if (!listEmpty(tmpMeta30)) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 7));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 8));
tmp33 = mmc_unbox_integer(tmpMeta32);
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 9));
_patterns = tmpMeta24;
_patternGuard = tmpMeta25;
_localDecls = tmpMeta26;
_body = tmpMeta27;
_resultInfo = tmpMeta31;
_jump = tmp33;
_info = tmpMeta34;
_cases = tmpMeta23;
_acc = tmp4_3;
tmpMeta35 = omc_List_last(threadData, _body);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,11,2) == 0) goto goto_2;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 3));
_exp = tmpMeta36;
_sourceStmt = tmpMeta37;
tmpMeta39 = omc_InstUtil_optimizeStatementTail3(threadData, _path, _exp, _vars, _lhsVars, _source, &tmp38);
_exp = tmpMeta39;
if (1 != tmp38) goto goto_2;
tmpMeta40 = mmc_mk_box3(14, &DAE_Statement_STMT__NORETCALL__desc, _exp, _sourceStmt);
_body = omc_List_set(threadData, _body, listLength(_body), tmpMeta40);
tmpMeta41 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _patternGuard, _localDecls, _body, _OMC_LIT76, _resultInfo, mmc_mk_integer(_jump), _info);
_case_ = tmpMeta41;
tmpMeta42 = mmc_mk_cons(_case_, _acc);
tmpMeta1 = omc_InstUtil_optimizeStatementTailMatchCases(threadData, _path, _cases, 1, tmpMeta42, _vars, _lhsVars, _source);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta43 = MMC_CAR(tmp4_1);
tmpMeta44 = MMC_CDR(tmp4_1);
_case_ = tmpMeta43;
_cases = tmpMeta44;
_acc = tmp4_3;
tmpMeta45 = mmc_mk_cons(_case_, _acc);
tmpMeta1 = omc_InstUtil_optimizeStatementTailMatchCases(threadData, _path, _cases, _changed, tmpMeta45, _vars, _lhsVars, _source);
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_ocases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ocases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_optimizeStatementTailMatchCases(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inCases, modelica_metatype _changed, modelica_metatype _inAcc, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source)
{
modelica_integer tmp1;
modelica_metatype _ocases = NULL;
tmp1 = mmc_unbox_integer(_changed);
_ocases = omc_InstUtil_optimizeStatementTailMatchCases(threadData, _path, _inCases, tmp1, _inAcc, _vars, _lhsVars, _source);
return _ocases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTail3(threadData_t *threadData, modelica_metatype _path, modelica_metatype _rhs, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source, modelica_boolean *out_isTailRecursive)
{
modelica_metatype _orhs = NULL;
modelica_boolean _isTailRecursive;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _path;
tmp4_2 = _rhs;
{
modelica_metatype _path1 = NULL;
modelica_metatype _path2 = NULL;
modelica_string _str = NULL;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_metatype _et = NULL;
modelica_metatype _inputs = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _matchType = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _call = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 8));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,0) == 0) goto tmp3_end;
_call = tmp4_2;
_path2 = tmpMeta6;
_attr = tmpMeta7;
_path1 = tmp4_1;
tmp4 += 2;
tmp9 = omc_AbsynUtil_pathEqual(threadData, _path1, _path2);
if (1 != tmp9) goto goto_2;
tmpMeta10 = stringAppend(_OMC_LIT77,omc_ExpressionDump_printExpStr(threadData, _rhs));
tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT78);
tmpMeta12 = stringAppend(tmpMeta11,stringDelimitList(_vars, _OMC_LIT79));
_str = tmpMeta12;
if(omc_Flags_isSet(threadData, _OMC_LIT85))
{
tmpMeta13 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT81, tmpMeta13, omc_ElementSource_getElementSourceFileInfo(threadData, _source));
}
tmpMeta15 = mmc_mk_box3(4, &DAE_TailCall_TAIL__desc, _vars, _lhsVars);
tmpMeta14 = MMC_TAGPTR(mmc_alloc_words(9));
memcpy(MMC_UNTAGPTR(tmpMeta14), MMC_UNTAGPTR(_attr), 9*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta14))[8] = tmpMeta15;
_attr = tmpMeta14;
tmpMeta16 = MMC_TAGPTR(mmc_alloc_words(5));
memcpy(MMC_UNTAGPTR(tmpMeta16), MMC_UNTAGPTR(_call), 5*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta16))[4] = _attr;
_call = tmpMeta16;
tmpMeta[0+0] = _call;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,12,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e1 = tmpMeta17;
_e2 = tmpMeta18;
_e3 = tmpMeta19;
tmp4 += 1;
_e2 = omc_InstUtil_optimizeStatementTail3(threadData, _path, _e2, _vars, _lhsVars, _source ,&_b1);
_e3 = omc_InstUtil_optimizeStatementTail3(threadData, _path, _e3, _vars, _lhsVars, _source ,&_b2);
tmp20 = (_b1 || _b2);
if (1 != tmp20) goto goto_2;
tmpMeta21 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _e1, _e2, _e3);
tmpMeta[0+0] = tmpMeta21;
tmp1_c1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,33,6) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,2,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
_matchType = tmpMeta22;
_inputs = tmpMeta23;
_aliases = tmpMeta24;
_localDecls = tmpMeta25;
_cases = tmpMeta26;
_et = tmpMeta27;
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
_cases = omc_InstUtil_optimizeStatementTailMatchCases(threadData, _path, _cases, 0, tmpMeta28, _vars, _lhsVars, _source);
tmpMeta29 = mmc_mk_box7(36, &DAE_Exp_MATCHEXPRESSION__desc, _matchType, _inputs, _aliases, _localDecls, _cases, _et);
tmpMeta[0+0] = tmpMeta29;
tmp1_c1 = 1;
goto tmp3_done;
}
case 3: {
tmpMeta[0+0] = _rhs;
tmp1_c1 = 0;
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_orhs = tmpMeta[0+0];
_isTailRecursive = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_isTailRecursive) { *out_isTailRecursive = _isTailRecursive; }
return _orhs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_optimizeStatementTail3(threadData_t *threadData, modelica_metatype _path, modelica_metatype _rhs, modelica_metatype _vars, modelica_metatype _lhsVars, modelica_metatype _source, modelica_metatype *out_isTailRecursive)
{
modelica_boolean _isTailRecursive;
modelica_metatype _orhs = NULL;
_orhs = omc_InstUtil_optimizeStatementTail3(threadData, _path, _rhs, _vars, _lhsVars, _source, &_isTailRecursive);
if (out_isTailRecursive) { *out_isTailRecursive = mmc_mk_icon(_isTailRecursive); }
return _orhs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTail2(threadData_t *threadData, modelica_metatype _path, modelica_metatype _rhs, modelica_metatype _lhsVars, modelica_metatype _invars, modelica_metatype _outvars, modelica_metatype _source)
{
modelica_metatype _orhs = NULL;
modelica_boolean tmp1;
modelica_boolean tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmp1 = valueEq(_lhsVars, _outvars);
if (1 != tmp1) MMC_THROW_INTERNAL();
tmpMeta3 = omc_InstUtil_optimizeStatementTail3(threadData, _path, _rhs, _invars, _lhsVars, _source, &tmp2);
_orhs = tmpMeta3;
if (1 != tmp2) MMC_THROW_INTERNAL();
_return: OMC_LABEL_UNUSED
return _orhs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeElseTail(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inElse, modelica_metatype _invars, modelica_metatype _outvars)
{
modelica_metatype _outElse = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inElse;
{
modelica_metatype _cond = NULL;
modelica_metatype _stmts = NULL;
modelica_metatype _else_ = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_cond = tmpMeta6;
_stmts = tmpMeta7;
_else_ = tmpMeta8;
tmp4 += 1;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_stmts = omc_InstUtil_optimizeLastStatementTail(threadData, _path, _stmts, _invars, _outvars, tmpMeta9);
_else_ = omc_InstUtil_optimizeElseTail(threadData, _path, _else_, _invars, _outvars);
tmpMeta10 = mmc_mk_box4(4, &DAE_Else_ELSEIF__desc, _cond, _stmts, _else_);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_stmts = tmpMeta11;
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
_stmts = omc_InstUtil_optimizeLastStatementTail(threadData, _path, _stmts, _invars, _outvars, tmpMeta12);
tmpMeta13 = mmc_mk_box2(5, &DAE_Else_ELSE__desc, _stmts);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 2: {
tmpMeta1 = _inElse;
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:;
}
}
_outElse = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElse;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeStatementTail(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inStmt, modelica_metatype _invars, modelica_metatype _outvars)
{
modelica_metatype _ostmt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inStmt;
tmp4_2 = _outvars;
{
modelica_metatype _tp = NULL;
modelica_metatype _lhs = NULL;
modelica_metatype _rhs = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _lhsLst = NULL;
modelica_string _name = NULL;
modelica_metatype _lhsNames = NULL;
modelica_metatype _stmts = NULL;
modelica_metatype _source = NULL;
modelica_metatype _else_ = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; 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;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_tp = tmpMeta6;
_lhs = tmpMeta7;
_rhs = tmpMeta8;
_source = tmpMeta9;
tmp4 += 3;
_name = omc_Expression_simpleCrefName(threadData, _lhs);
tmpMeta10 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
_rhs = omc_InstUtil_optimizeStatementTail2(threadData, _path, _rhs, tmpMeta10, _invars, _outvars, _source);
tmp13 = (modelica_boolean)omc_Expression_isTailCall(threadData, _rhs);
if(tmp13)
{
tmpMeta11 = mmc_mk_box3(14, &DAE_Statement_STMT__NORETCALL__desc, _rhs, _source);
tmpMeta14 = tmpMeta11;
}
else
{
tmpMeta12 = mmc_mk_box5(3, &DAE_Statement_STMT__ASSIGN__desc, _tp, _lhs, _rhs, _source);
tmpMeta14 = tmpMeta12;
}
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_boolean tmp21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_tp = tmpMeta15;
_lhsLst = tmpMeta16;
_rhs = tmpMeta17;
_source = tmpMeta18;
tmp4 += 2;
_lhsNames = omc_List_map(threadData, _lhsLst, boxvar_Expression_simpleCrefName);
_rhs = omc_InstUtil_optimizeStatementTail2(threadData, _path, _rhs, _lhsNames, _invars, _outvars, _source);
tmp21 = (modelica_boolean)omc_Expression_isTailCall(threadData, _rhs);
if(tmp21)
{
tmpMeta19 = mmc_mk_box3(14, &DAE_Statement_STMT__NORETCALL__desc, _rhs, _source);
tmpMeta22 = tmpMeta19;
}
else
{
tmpMeta20 = mmc_mk_box5(4, &DAE_Statement_STMT__TUPLE__ASSIGN__desc, _tp, _lhsLst, _rhs, _source);
tmpMeta22 = tmpMeta20;
}
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,4) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_cond = tmpMeta23;
_stmts = tmpMeta24;
_else_ = tmpMeta25;
_source = tmpMeta26;
tmp4 += 1;
tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
_stmts = omc_InstUtil_optimizeLastStatementTail(threadData, _path, _stmts, _invars, _outvars, tmpMeta27);
_else_ = omc_InstUtil_optimizeElseTail(threadData, _path, _else_, _invars, _outvars);
tmpMeta28 = mmc_mk_box5(6, &DAE_Statement_STMT__IF__desc, _cond, _stmts, _else_, _source);
tmpMeta1 = tmpMeta28;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,2) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!listEmpty(tmp4_2)) goto tmp3_end;
_rhs = tmpMeta29;
_source = tmpMeta30;
tmpMeta31 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta32 = MMC_REFSTRUCTLIT(mmc_nil);
_rhs = omc_InstUtil_optimizeStatementTail2(threadData, _path, _rhs, tmpMeta31, _invars, tmpMeta32, _source);
tmpMeta33 = mmc_mk_box3(14, &DAE_Statement_STMT__NORETCALL__desc, _rhs, _source);
tmpMeta1 = tmpMeta33;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _inStmt;
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_ostmt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ostmt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_optimizeLastStatementTail(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inStmts, modelica_metatype _invars, modelica_metatype _outvars, modelica_metatype _acc)
{
modelica_metatype _ostmts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inStmts;
{
modelica_metatype _stmt = NULL;
modelica_metatype _stmts = NULL;
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta7)) goto tmp3_end;
_stmt = tmpMeta6;
_stmt = omc_InstUtil_optimizeStatementTail(threadData, _path, _stmt, _invars, _outvars);
tmpMeta8 = mmc_mk_cons(_stmt, _acc);
tmpMeta1 = listReverse(tmpMeta8);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_1);
tmpMeta10 = MMC_CDR(tmp4_1);
_stmt = tmpMeta9;
_stmts = tmpMeta10;
tmpMeta11 = mmc_mk_cons(_stmt, _acc);
_inStmts = _stmts;
_acc = tmpMeta11;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ostmts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ostmts;
}
DLLExport
modelica_metatype omc_InstUtil_optimizeFunctionCheckForLocals(threadData_t *threadData, modelica_metatype _path, modelica_metatype _inElts, modelica_metatype _oalg, modelica_metatype _acc, modelica_metatype _invars, modelica_metatype _outvars)
{
modelica_metatype _outElts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inElts;
tmp4_2 = _oalg;
{
modelica_metatype _stmts = NULL;
modelica_metatype _elt = NULL;
modelica_metatype _elt1 = NULL;
modelica_metatype _elt2 = NULL;
modelica_metatype _source = NULL;
modelica_string _str = NULL;
modelica_string _name = NULL;
modelica_metatype _elts = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (!optionNone(tmp4_2)) goto tmp3_end;
tmpMeta1 = listReverse(_acc);
goto tmp3_done;
}
case 1: {
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 (!listEmpty(tmp4_1)) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,16,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
_stmts = tmpMeta8;
_source = tmpMeta9;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
_stmts = omc_InstUtil_optimizeLastStatementTail(threadData, _path, _stmts, listReverse(_invars), listReverse(_outvars), tmpMeta10);
tmpMeta12 = mmc_mk_box2(3, &DAE_Algorithm_ALGORITHM__STMTS__desc, _stmts);
tmpMeta13 = mmc_mk_box3(19, &DAE_Element_ALGORITHM__desc, tmpMeta12, _source);
tmpMeta11 = mmc_mk_cons(tmpMeta13, _acc);
tmpMeta1 = listReverse(tmpMeta11);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,16,2) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (!listEmpty(tmpMeta17)) goto tmp3_end;
_elts = tmpMeta15;
_inElts = _elts;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_1);
tmpMeta20 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,16,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
_elt2 = tmpMeta18;
_elt1 = tmpMeta19;
_source = tmpMeta21;
_elts = tmpMeta20;
_str = omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT63, 1, 0);
if((!omc_Config_acceptMetaModelicaGrammar(threadData)))
{
tmpMeta22 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT88, tmpMeta22, omc_ElementSource_getElementSourceFileInfo(threadData, _source));
}
tmpMeta23 = mmc_mk_cons(_elt2, _acc);
_inElts = _elts;
_oalg = mmc_mk_some(_elt1);
_acc = tmpMeta23;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (!optionNone(tmp4_2)) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmp4_1);
tmpMeta25 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,16,2) == 0) goto tmp3_end;
_elt = tmpMeta24;
_elts = tmpMeta25;
_inElts = _elts;
_oalg = mmc_mk_some(_elt);
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmp4_1);
tmpMeta27 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,0,13) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,1,3) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,1,0) == 0) goto tmp3_end;
_elt = tmpMeta26;
_name = tmpMeta29;
_elts = tmpMeta27;
tmpMeta31 = mmc_mk_cons(_elt, _acc);
tmpMeta32 = mmc_mk_cons(_name, _outvars);
_inElts = _elts;
_acc = tmpMeta31;
_outvars = tmpMeta32;
goto _tailrecursive;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta33 = MMC_CAR(tmp4_1);
tmpMeta34 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,0,13) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,1,3) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,0,0) == 0) goto tmp3_end;
_elt = tmpMeta33;
_name = tmpMeta36;
_elts = tmpMeta34;
tmpMeta38 = mmc_mk_cons(_elt, _acc);
tmpMeta39 = mmc_mk_cons(_name, _invars);
_inElts = _elts;
_acc = tmpMeta38;
_invars = tmpMeta39;
goto _tailrecursive;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta40 = MMC_CAR(tmp4_1);
tmpMeta41 = MMC_CDR(tmp4_1);
_elt = tmpMeta40;
_elts = tmpMeta41;
tmpMeta42 = mmc_mk_cons(_elt, _acc);
_inElts = _elts;
_acc = tmpMeta42;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outElts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElts;
}
DLLExport
modelica_boolean omc_InstUtil_redeclareBasicType(threadData_t *threadData, modelica_metatype _mod)
{
modelica_boolean _isRedeclareOfBasicType;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _mod;
{
modelica_string _name = NULL;
modelica_metatype _path = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_boolean tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_path = tmpMeta8;
tmp9 = omc_Config_synchronousFeaturesAllowed(threadData);
if (1 != tmp9) goto goto_2;
_name = omc_AbsynUtil_pathFirstIdent(threadData, _path);
tmp10 = listMember(_name, _OMC_LIT98);
if (1 != tmp10) goto goto_2;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_boolean tmp14;
modelica_boolean tmp15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,3,8) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_path = tmpMeta13;
tmp14 = omc_Config_synchronousFeaturesAllowed(threadData);
if (0 != tmp14) goto goto_2;
_name = omc_AbsynUtil_pathFirstIdent(threadData, _path);
tmp15 = listMember(_name, _OMC_LIT102);
if (1 != tmp15) goto goto_2;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
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:;
}
}
_isRedeclareOfBasicType = tmp1;
_return: OMC_LABEL_UNUSED
return _isRedeclareOfBasicType;
}
modelica_metatype boxptr_InstUtil_redeclareBasicType(threadData_t *threadData, modelica_metatype _mod)
{
modelica_boolean _isRedeclareOfBasicType;
modelica_metatype out_isRedeclareOfBasicType;
_isRedeclareOfBasicType = omc_InstUtil_redeclareBasicType(threadData, _mod);
out_isRedeclareOfBasicType = mmc_mk_icon(_isRedeclareOfBasicType);
return out_isRedeclareOfBasicType;
}
DLLExport
modelica_metatype omc_InstUtil_selectModifiers(threadData_t *threadData, modelica_metatype _fromMerging, modelica_metatype _fromRedeclareType, modelica_metatype _typePath, modelica_metatype *out_classMod)
{
modelica_metatype _bindingMod = NULL;
modelica_metatype _classMod = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
tmp6 = omc_InstUtil_redeclareBasicType(threadData, _fromMerging);
if (1 != tmp6) goto goto_2;
tmpMeta[0+0] = _fromRedeclareType;
tmpMeta[0+1] = _fromRedeclareType;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _fromMerging;
tmpMeta[0+1] = _fromRedeclareType;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_bindingMod = tmpMeta[0+0];
_classMod = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_classMod) { *out_classMod = _classMod; }
return _bindingMod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_splitClassDefsAndComponents(threadData_t *threadData, modelica_metatype _inLstElAndMod, modelica_metatype *out_outComponentDefs)
{
modelica_metatype _outClassDefs = NULL;
modelica_metatype _outComponentDefs = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inLstElAndMod;
{
modelica_metatype _e = NULL;
modelica_metatype _m = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _clsdefs = NULL;
modelica_metatype _compdefs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,3,8) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_e = tmpMeta10;
_m = tmpMeta11;
_rest = tmpMeta9;
_clsdefs = omc_InstUtil_splitClassDefsAndComponents(threadData, _rest ,&_compdefs);
tmpMeta13 = mmc_mk_box2(0, _e, _m);
tmpMeta12 = mmc_mk_cons(tmpMeta13, _compdefs);
tmpMeta[0+0] = _clsdefs;
tmpMeta[0+1] = tmpMeta12;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 1));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
_e = tmpMeta16;
_m = tmpMeta17;
_rest = tmpMeta15;
_clsdefs = omc_InstUtil_splitClassDefsAndComponents(threadData, _rest ,&_compdefs);
tmpMeta19 = mmc_mk_box2(0, _e, _m);
tmpMeta18 = mmc_mk_cons(tmpMeta19, _clsdefs);
tmpMeta[0+0] = tmpMeta18;
tmpMeta[0+1] = _compdefs;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outClassDefs = tmpMeta[0+0];
_outComponentDefs = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outComponentDefs) { *out_outComponentDefs = _outComponentDefs; }
return _outClassDefs;
}
DLLExport
modelica_string omc_InstUtil_printElementAndModList(threadData_t *threadData, modelica_metatype _inLstElAndMod)
{
modelica_string _outStr = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inLstElAndMod;
{
modelica_metatype _e = NULL;
modelica_metatype _m = NULL;
modelica_metatype _rest = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_string _s3 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp1 = _OMC_LIT103;
goto tmp3_done;
}
case 1: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_e = tmpMeta8;
_m = tmpMeta9;
_rest = tmpMeta7;
_s1 = omc_SCodeDump_unparseElementStr(threadData, _e, _OMC_LIT104);
_s2 = omc_Mod_printModStr(threadData, _m);
_s3 = omc_InstUtil_printElementAndModList(threadData, _rest);
tmpMeta10 = stringAppend(_OMC_LIT105,_s1);
tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT106);
tmpMeta12 = stringAppend(tmpMeta11,_s2);
tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT107);
tmpMeta14 = stringAppend(tmpMeta13,_s3);
tmp1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outStr = tmp1;
_return: OMC_LABEL_UNUSED
return _outStr;
}
DLLExport
void omc_InstUtil_checkFunctionElement(threadData_t *threadData, modelica_metatype _elt, modelica_boolean _isExternal, modelica_metatype _info)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_boolean tmp3_2;
tmp3_1 = _elt;
tmp3_2 = _isExternal;
{
modelica_string _str = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 5; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,13) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,16,2) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
if (listEmpty(tmpMeta6)) goto tmp2_end;
tmpMeta7 = MMC_CAR(tmpMeta6);
tmpMeta8 = MMC_CDR(tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,4) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,32,5) == 0) goto tmp2_end;
if (!listEmpty(tmpMeta8)) goto tmp2_end;
goto tmp2_done;
}
case 2: {
if (0 != tmp3_2) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,16,2) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,31,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 4: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
tmpMeta10 = mmc_mk_cons(_elt, MMC_REFSTRUCTLIT(mmc_nil));
_str = omc_DAEDump_dumpElementsStr(threadData, tmpMeta10);
tmpMeta11 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT110, tmpMeta11, _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;
}
void boxptr_InstUtil_checkFunctionElement(threadData_t *threadData, modelica_metatype _elt, modelica_metatype _isExternal, modelica_metatype _info)
{
modelica_integer tmp1;
tmp1 = mmc_unbox_integer(_isExternal);
omc_InstUtil_checkFunctionElement(threadData, _elt, tmp1, _info);
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getFunctionAttributes(threadData_t *threadData, modelica_metatype _cl, modelica_metatype _vl, modelica_metatype _inheritedComment)
{
modelica_metatype _attr = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _cl;
{
modelica_metatype _restriction = NULL;
modelica_boolean _isOpenModelicaPure;
modelica_boolean _isImpure;
modelica_boolean _hasOutVars;
modelica_boolean _unboxArgs;
modelica_metatype _isBuiltin = NULL;
modelica_metatype _inlineType = NULL;
modelica_string _name = NULL;
modelica_metatype _inVars = NULL;
modelica_metatype _outVars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
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), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,9,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
_isImpure = tmp9;
tmp4 += 3;
_inVars = omc_List_select(threadData, _vl, boxvar_Types_isInputVar);
_outVars = omc_List_select(threadData, _vl, boxvar_Types_isOutputVar);
_name = omc_SCodeUtil_isBuiltinFunction(threadData, _cl, omc_List_map(threadData, _inVars, boxvar_Types_getVarName), omc_List_map(threadData, _outVars, boxvar_Types_getVarName));
_inlineType = omc_InstUtil_commentIsInlineFunc(threadData, _inheritedComment);
_isOpenModelicaPure = (!omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT111));
_isImpure = (_isImpure?1:omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT112));
_unboxArgs = omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT113);
tmpMeta10 = mmc_mk_box3(4, &DAE_FunctionBuiltin_FUNCTION__BUILTIN__desc, mmc_mk_some(_name), mmc_mk_boolean(_unboxArgs));
tmpMeta11 = mmc_mk_box7(3, &DAE_FunctionAttributes_FUNCTION__ATTRIBUTES__desc, _inlineType, mmc_mk_boolean(_isOpenModelicaPure), mmc_mk_boolean(_isImpure), mmc_mk_boolean(0), tmpMeta10, _OMC_LIT114);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,9,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,4,0) == 0) goto tmp3_end;
_inVars = omc_List_select(threadData, _vl, boxvar_Types_isInputVar);
_outVars = omc_List_select(threadData, _vl, boxvar_Types_isOutputVar);
_name = omc_SCodeUtil_isBuiltinFunction(threadData, _cl, omc_List_map(threadData, _inVars, boxvar_Types_getVarName), omc_List_map(threadData, _outVars, boxvar_Types_getVarName));
_inlineType = omc_InstUtil_commentIsInlineFunc(threadData, _inheritedComment);
_isOpenModelicaPure = (!omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT111));
_unboxArgs = omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT113);
tmpMeta14 = mmc_mk_box3(4, &DAE_FunctionBuiltin_FUNCTION__BUILTIN__desc, mmc_mk_some(_name), mmc_mk_boolean(_unboxArgs));
tmpMeta15 = mmc_mk_box7(3, &DAE_FunctionAttributes_FUNCTION__ATTRIBUTES__desc, _inlineType, mmc_mk_boolean(_isOpenModelicaPure), mmc_mk_boolean(0), mmc_mk_boolean(0), tmpMeta14, _OMC_LIT115);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,9,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,4,0) == 0) goto tmp3_end;
tmp4 += 1;
_inlineType = omc_InstUtil_commentIsInlineFunc(threadData, _inheritedComment);
_isBuiltin = (omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT116)?_OMC_LIT117:_OMC_LIT118);
_isOpenModelicaPure = (!omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT111));
tmpMeta18 = mmc_mk_box7(3, &DAE_FunctionAttributes_FUNCTION__ATTRIBUTES__desc, _inlineType, mmc_mk_boolean(_isOpenModelicaPure), mmc_mk_boolean(0), mmc_mk_boolean(0), _isBuiltin, _OMC_LIT115);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,9,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,5,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT121;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_restriction = tmpMeta21;
_inlineType = omc_InstUtil_commentIsInlineFunc(threadData, _inheritedComment);
_hasOutVars = omc_List_exist(threadData, _vl, boxvar_Types_isOutputVar);
_isBuiltin = (omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT116)?_OMC_LIT117:_OMC_LIT118);
_isOpenModelicaPure = (!omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT111));
_isImpure = (omc_SCodeUtil_commentHasBooleanNamedAnnotation(threadData, _inheritedComment, _OMC_LIT112) || omc_SCodeUtil_isRestrictionImpure(threadData, _restriction, (_hasOutVars || omc_Config_languageStandardAtLeast(threadData, 6))));
tmpMeta22 = mmc_mk_box7(3, &DAE_FunctionAttributes_FUNCTION__ATTRIBUTES__desc, _inlineType, mmc_mk_boolean(_isOpenModelicaPure), mmc_mk_boolean(_isImpure), mmc_mk_boolean(0), _isBuiltin, _OMC_LIT114);
tmpMeta1 = tmpMeta22;
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_attr = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _attr;
}
DLLExport
modelica_metatype omc_InstUtil_makeNonExpSubscript(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
modelica_metatype _e = NULL;
modelica_metatype _subscript = NULL;
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,2,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta6;
tmpMeta7 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, _e);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
_subscript = tmp4_1;
tmpMeta1 = _subscript;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscript = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscript;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_mergeClassComments(threadData_t *threadData, modelica_metatype _comment1, modelica_metatype _comment2)
{
modelica_metatype _outComment = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _comment1;
tmp4_2 = _comment2;
{
modelica_metatype _ann1 = NULL;
modelica_metatype _ann2 = NULL;
modelica_metatype _ann = NULL;
modelica_metatype _str1 = NULL;
modelica_metatype _str2 = NULL;
modelica_metatype _str = NULL;
modelica_metatype _mods1 = NULL;
modelica_metatype _mods2 = NULL;
modelica_metatype _mods = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,5) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (optionNone(tmpMeta12)) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,0,5) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 4));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_mods1 = tmpMeta9;
_info = tmpMeta10;
_str1 = tmpMeta11;
_mods2 = tmpMeta15;
_str2 = tmpMeta16;
_str = (isSome(_str1)?_str1:_str2);
_mods = listAppend(_mods1, _mods2);
tmpMeta17 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _OMC_LIT122, _OMC_LIT123, _mods, mmc_mk_none(), _info);
tmpMeta18 = mmc_mk_box2(3, &SCode_Annotation_ANNOTATION__desc, tmpMeta17);
tmpMeta19 = mmc_mk_box3(3, &SCode_Comment_COMMENT__desc, mmc_mk_some(tmpMeta18), _str);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_ann1 = tmpMeta20;
_str1 = tmpMeta21;
_ann2 = tmpMeta22;
_str2 = tmpMeta23;
_str = (isSome(_str1)?_str1:_str2);
_ann = (isSome(_ann1)?_ann1:_ann2);
tmpMeta24 = mmc_mk_box3(3, &SCode_Comment_COMMENT__desc, _ann, _str);
tmpMeta1 = tmpMeta24;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outComment = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComment;
}
DLLExport
modelica_metatype omc_InstUtil_extractComment(threadData_t *threadData, modelica_metatype _elts)
{
modelica_metatype _cmt = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta7;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_cmt = _OMC_LIT124;
{
modelica_metatype _elt;
for (tmpMeta1 = _elts; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_elt = MMC_CAR(tmpMeta1);
{
modelica_metatype tmp4_1;
tmp4_1 = _elt;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cmt = tmpMeta6;
goto _return;
goto goto_2;
goto tmp3_done;
}
case 1: {
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
;
}
}
_return: OMC_LABEL_UNUSED
return _cmt;
}
DLLExport
modelica_boolean omc_InstUtil_isFunctionInput(threadData_t *threadData, modelica_metatype _classState, modelica_metatype _direction)
{
modelica_boolean _functionInput;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _classState;
tmp4_2 = _direction;
{
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,8,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_functionInput = tmp1;
_return: OMC_LABEL_UNUSED
return _functionInput;
}
modelica_metatype boxptr_InstUtil_isFunctionInput(threadData_t *threadData, modelica_metatype _classState, modelica_metatype _direction)
{
modelica_boolean _functionInput;
modelica_metatype out_functionInput;
_functionInput = omc_InstUtil_isFunctionInput(threadData, _classState, _direction);
out_functionInput = mmc_mk_icon(_functionInput);
return out_functionInput;
}
DLLExport
modelica_metatype omc_InstUtil_isPartial(threadData_t *threadData, modelica_metatype _partialPrefix, modelica_metatype _mods)
{
modelica_metatype _outPartial = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _partialPrefix;
tmp4_2 = _mods;
{
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,0,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT125;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _OMC_LIT126;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPartial = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outPartial;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_findCorrespondingBinding(threadData_t *threadData, modelica_metatype _inCref, modelica_metatype _inEquations, modelica_integer __omcQ_24in_5Fi, modelica_integer *out_i)
{
modelica_metatype _outExp = NULL;
modelica_integer _i;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_i = __omcQ_24in_5Fi;
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCref;
tmp4_2 = _inEquations;
{
modelica_metatype _cref = NULL;
modelica_metatype _cref2 = NULL;
modelica_metatype _cref3 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _equations = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_2);
tmpMeta7 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
_cref2 = tmpMeta8;
_e = tmpMeta9;
_cref = tmp4_1;
if (!omc_ComponentReference_crefEqual(threadData, _cref, _cref2)) goto tmp3_end;
tmpMeta1 = _e;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_2);
tmpMeta11 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,3,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
_cref2 = tmpMeta13;
_e = tmpMeta14;
_cref = tmp4_1;
if (!omc_ComponentReference_crefEqual(threadData, _cref, _cref2)) goto tmp3_end;
tmpMeta1 = _e;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_2);
tmpMeta16 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,4,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
_cref2 = tmpMeta17;
_cref3 = tmpMeta18;
_cref = tmp4_1;
if (!omc_ComponentReference_crefEqual(threadData, _cref, _cref2)) goto tmp3_end;
tmpMeta1 = omc_Expression_crefExp(threadData, _cref3);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_2);
tmpMeta20 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,8,3) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,6,2) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
_cref2 = tmpMeta22;
_e = tmpMeta23;
_cref = tmp4_1;
if (!omc_ComponentReference_crefEqual(threadData, _cref, _cref2)) goto tmp3_end;
tmpMeta1 = _e;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmp4_2);
tmpMeta25 = MMC_CDR(tmp4_2);
_equations = tmpMeta25;
_cref = tmp4_1;
_outExp = omc_InstUtil_findCorrespondingBinding(threadData, _cref, _equations, ((modelica_integer) 1) + _i ,&_i);
tmpMeta1 = _outExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_i) { *out_i = _i; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_findCorrespondingBinding(threadData_t *threadData, modelica_metatype _inCref, modelica_metatype _inEquations, modelica_metatype __omcQ_24in_5Fi, modelica_metatype *out_i)
{
modelica_integer tmp1;
modelica_integer _i;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(__omcQ_24in_5Fi);
_outExp = omc_InstUtil_findCorrespondingBinding(threadData, _inCref, _inEquations, tmp1, &_i);
if (out_i) { *out_i = mmc_mk_icon(_i); }
return _outExp;
}
DLLExport
modelica_metatype omc_InstUtil_propagateBinding(threadData_t *threadData, modelica_metatype _inVarsDae, modelica_metatype _inEquationsDae)
{
jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
modelica_metatype _outVarsDae = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _vars1 = NULL;
modelica_metatype _equations = NULL;
modelica_metatype _equations1 = NULL;
modelica_metatype _v1 = NULL;
modelica_integer _i;
modelica_metatype _is = NULL;
modelica_metatype _e = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _path = 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 tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inVarsDae;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_vars = tmpMeta2;
tmpMeta3 = _inEquationsDae;
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
_equations = tmpMeta4;
if((listEmpty(_vars) || listEmpty(_equations)))
{
_outVarsDae = _inVarsDae;
goto _return;
}
tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
_vars1 = tmpMeta5;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
_is = tmpMeta6;
{
modelica_metatype _v;
for (tmpMeta7 = _vars; !listEmpty(tmpMeta7); tmpMeta7=MMC_CDR(tmpMeta7))
{
_v = MMC_CAR(tmpMeta7);
{
volatile modelica_metatype tmp11_1;
tmp11_1 = _v;
{
volatile mmc_switch_type tmp11;
int tmp12;
tmp11 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp10_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp11 < 2; tmp11++) {
switch (MMC_SWITCH_CAST(tmp11)) {
case 0: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp11_1,0,13) == 0) goto tmp10_end;
_v1 = tmp11_1;
_e = omc_InstUtil_findCorrespondingBinding(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v1), 2))), _equations, ((modelica_integer) 0) ,&_i);
tmpMeta13 = MMC_TAGPTR(mmc_alloc_words(15));
memcpy(MMC_UNTAGPTR(tmpMeta13), MMC_UNTAGPTR(_v1), 15*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta13))[8] = mmc_mk_some(_e);
_v1 = tmpMeta13;
tmpMeta14 = mmc_mk_cons(mmc_mk_integer(_i), _is);
_is = tmpMeta14;
tmpMeta8 = _v1;
goto tmp10_done;
}
case 1: {
tmpMeta8 = _v;
goto tmp10_done;
}
}
goto tmp10_end;
tmp10_end: ;
}
goto goto_9;
tmp10_done:
(void)tmp11;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp10_done2;
goto_9:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp11 < 2) {
goto tmp10_top;
}
MMC_THROW_INTERNAL();
tmp10_done2:;
}
}
_v1 = tmpMeta8;
tmpMeta15 = mmc_mk_cons(_v1, _vars1);
_vars1 = tmpMeta15;
}
}
_vars1 = listReverse(_vars1);
_equations1 = omc_List_deletePositions(threadData, _equations, _is);
{
modelica_metatype __omcQ_24tmpVar5;
modelica_metatype* tmp18;
modelica_metatype tmpMeta19;
modelica_metatype __omcQ_24tmpVar4;
modelica_integer tmp20;
modelica_metatype _eq_loopVar = 0;
modelica_metatype _eq;
_eq_loopVar = _equations;
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar5 = tmpMeta19;
tmp18 = &__omcQ_24tmpVar5;
while(1) {
tmp20 = 1;
if (!listEmpty(_eq_loopVar)) {
_eq = MMC_CAR(_eq_loopVar);
_eq_loopVar = MMC_CDR(_eq_loopVar);
tmp20--;
}
if (tmp20 == 0) {
__omcQ_24tmpVar4 = omc_DAEUtil_moveElementToInitialSection(threadData, _eq);
*tmp18 = mmc_mk_cons(__omcQ_24tmpVar4,0);
tmp18 = &MMC_CDR(*tmp18);
} else if (tmp20 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp18 = mmc_mk_nil();
tmpMeta17 = __omcQ_24tmpVar5;
}
_equations1 = tmpMeta17;
_i = ((modelica_integer) 0);
{
modelica_metatype _eq;
for (tmpMeta21 = _equations1; !listEmpty(tmpMeta21); tmpMeta21=MMC_CDR(tmpMeta21))
{
_eq = MMC_CAR(tmpMeta21);
{
modelica_metatype tmp24_1;
tmp24_1 = _eq;
{
volatile mmc_switch_type tmp24;
int tmp25;
tmp24 = 0;
for (; tmp24 < 3; tmp24++) {
switch (MMC_SWITCH_CAST(tmp24)) {
case 0: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp24_1,15,3) == 0) goto tmp23_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp24_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,6,2) == 0) goto tmp23_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,9,3) == 0) goto tmp23_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp24_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,13,3) == 0) goto tmp23_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
_path = tmpMeta29;
if (!(stringEqual(omc_AbsynUtil_pathLastIdent(threadData, _path), _OMC_LIT127))) goto tmp23_end;
tmpMeta30 = mmc_mk_cons(mmc_mk_integer(_i), _is);
_is = tmpMeta30;
goto tmp23_done;
}
case 1: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp24_1,9,3) == 0) goto tmp23_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp24_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta31,6,2) == 0) goto tmp23_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta31), 2));
_cr = tmpMeta32;
{
modelica_metatype __omcQ_24tmpVar7;
modelica_metatype* tmp34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype __omcQ_24tmpVar6;
modelica_integer tmp47;
modelica_metatype _v_loopVar = 0;
modelica_metatype _v;
_v_loopVar = _vars1;
tmpMeta35 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar7 = tmpMeta35;
tmp34 = &__omcQ_24tmpVar7;
while(1) {
tmp47 = 1;
if (!listEmpty(_v_loopVar)) {
_v = MMC_CAR(_v_loopVar);
_v_loopVar = MMC_CDR(_v_loopVar);
tmp47--;
}
if (tmp47 == 0) {
{
modelica_metatype tmp39_1;
tmp39_1 = _v;
{
volatile mmc_switch_type tmp39;
int tmp40;
tmp39 = 0;
for (; tmp39 < 3; tmp39++) {
switch (MMC_SWITCH_CAST(tmp39)) {
case 0: {
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp39_1,0,13) == 0) goto tmp38_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp39_1), 8));
if (optionNone(tmpMeta41)) goto tmp38_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 1));
if (!omc_ComponentReference_crefPrefixOf(threadData, _cr, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 2))))) goto tmp38_end;
tmpMeta43 = mmc_mk_cons(mmc_mk_integer(_i), _is);
_is = tmpMeta43;
tmpMeta36 = _v;
goto tmp38_done;
}
case 1: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
if (mmc__uniontype__metarecord__typedef__equal(tmp39_1,0,13) == 0) goto tmp38_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp39_1), 8));
if (!optionNone(tmpMeta44)) goto tmp38_end;
if (!omc_ComponentReference_crefPrefixOf(threadData, _cr, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 2))))) goto tmp38_end;
tmpMeta45 = MMC_TAGPTR(mmc_alloc_words(15));
memcpy(MMC_UNTAGPTR(tmpMeta45), MMC_UNTAGPTR(_v), 15*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta45))[12] = omc_DAEUtil_setFixedAttr(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 12))), _OMC_LIT129);
_v = tmpMeta45;
tmpMeta46 = mmc_mk_cons(omc_ComponentReference_printComponentRefStr(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 2)))), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT132, tmpMeta46, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eq), 4)))), 2))));
tmpMeta36 = _v;
goto tmp38_done;
}
case 2: {
tmpMeta36 = _v;
goto tmp38_done;
}
}
goto tmp38_end;
tmp38_end: ;
}
goto goto_37;
goto_37:;
goto goto_22;
goto tmp38_done;
tmp38_done:;
}
}__omcQ_24tmpVar6 = tmpMeta36;
*tmp34 = mmc_mk_cons(__omcQ_24tmpVar6,0);
tmp34 = &MMC_CDR(*tmp34);
} else if (tmp47 == 1) {
break;
} else {
goto goto_22;
}
}
*tmp34 = mmc_mk_nil();
tmpMeta33 = __omcQ_24tmpVar7;
}
_vars1 = tmpMeta33;
goto tmp23_done;
}
case 2: {
goto tmp23_done;
}
}
goto tmp23_end;
tmp23_end: ;
}
goto goto_22;
goto_22:;
MMC_THROW_INTERNAL();
goto tmp23_done;
tmp23_done:;
}
}
;
_i = ((modelica_integer) 1) + _i;
}
}
_equations1 = omc_List_deletePositions(threadData, _equations1, _is);
tmpMeta49 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, listAppend(_equations1, _vars1));
_outVarsDae = tmpMeta49;
_return: OMC_LABEL_UNUSED
threadData->mmc_jumper = old_mmc_jumper;
return _outVarsDae;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkVariabilityOfUpdatedComponent(threadData_t *threadData, modelica_metatype _variability, modelica_metatype _cref)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _variability;
{
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;
goto tmp2_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,0) == 0) goto tmp2_end;
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;
}
DLLExport
modelica_metatype omc_InstUtil_getCrefFromCond(threadData_t *threadData, modelica_metatype _cond)
{
modelica_metatype _crefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _cond;
{
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_e = tmpMeta7;
tmpMeta1 = omc_AbsynUtil_getCrefFromExp(threadData, _e, 1, 1);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_crefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _crefs;
}
DLLExport
modelica_metatype omc_InstUtil_getCrefFromCompDim(threadData_t *threadData, modelica_metatype _inEle)
{
modelica_metatype _cref = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inEle;
{
modelica_metatype _ads = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_ads = tmpMeta7;
tmpMeta1 = omc_AbsynUtil_getCrefsFromSubs(threadData, _ads, 1, 1);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta8;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_cref = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _cref;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_makeCrefBaseType2(threadData_t *threadData, modelica_metatype _inBaseType, modelica_metatype _inDimensions)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inBaseType;
tmp4_2 = _inDimensions;
{
modelica_metatype _ty = NULL;
modelica_metatype _dims = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta6;
tmp7 = listEmpty(omc_Types_getDimensions(threadData, _ty));
if (0 != tmp7) goto goto_2;
tmpMeta1 = _ty;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta1 = _inBaseType;
goto tmp3_done;
}
case 2: {
_dims = omc_List_last(threadData, _inDimensions);
tmpMeta1 = omc_Expression_liftArrayLeftList(threadData, _inBaseType, _dims);
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:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_InstUtil_makeCrefBaseType(threadData_t *threadData, modelica_metatype _inBaseType, modelica_metatype _inDimensions)
{
modelica_metatype _outType = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outType = omc_Types_simplifyType(threadData, omc_InstUtil_makeCrefBaseType2(threadData, _inBaseType, _inDimensions));
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_InstUtil_propagateAbSCDirection2(threadData_t *threadData, modelica_metatype _v1, modelica_metatype _optDerAttr, modelica_metatype _inInfo)
{
modelica_metatype _v3 = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _v1;
tmp4_2 = _optDerAttr;
{
modelica_metatype _v2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_2)) goto tmp3_end;
tmpMeta1 = _v1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
_v2 = tmpMeta7;
tmpMeta1 = _v2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,0) == 0) goto tmp3_end;
tmpMeta1 = _v1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 6));
_v2 = tmpMeta11;
equality(_v1, _v2);
tmpMeta1 = _v1;
goto tmp3_done;
}
case 4: {
fputs(MMC_STRINGDATA(_OMC_LIT133),stdout);
omc_Error_addSourceMessage(threadData, _OMC_LIT136, _OMC_LIT138, _inInfo);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_v3 = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _v3;
}
DLLExport
modelica_metatype omc_InstUtil_propagateAbSCDirection(threadData_t *threadData, modelica_metatype _inVariability, modelica_metatype _inAttributes, modelica_metatype _inClassAttributes, modelica_metatype _inInfo)
{
modelica_metatype _outAttributes = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVariability;
{
modelica_metatype _dir = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 6: {
tmpMeta1 = _inAttributes;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _inAttributes;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
tmpMeta5 = _inAttributes;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 6));
_dir = tmpMeta6;
_dir = omc_InstUtil_propagateAbSCDirection2(threadData, _dir, _inClassAttributes, _inInfo);
tmpMeta1 = omc_SCodeUtil_setAttributesDirection(threadData, _inAttributes, _dir);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outAttributes = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAttributes;
}
DLLExport
modelica_metatype omc_InstUtil_checkUseConstValue(threadData_t *threadData, modelica_boolean _useConstValue, modelica_metatype _ie, modelica_metatype _v)
{
modelica_metatype _outE = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_boolean tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
tmp4_1 = _useConstValue;
tmp4_2 = _ie;
tmp4_3 = _v;
{
modelica_metatype _val = NULL;
modelica_metatype _e = NULL;
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 (0 != tmp4_1) goto tmp3_end;
_e = tmp4_2;
tmp4 += 1;
tmpMeta1 = _e;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (1 != tmp4_1) goto tmp3_end;
if (optionNone(tmp4_3)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
_val = tmpMeta6;
tmpMeta1 = omc_ValuesUtil_valueExp(threadData, _val, mmc_mk_none());
goto tmp3_done;
}
case 2: {
_e = tmp4_2;
tmpMeta1 = _e;
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:;
}
}
_outE = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outE;
}
modelica_metatype boxptr_InstUtil_checkUseConstValue(threadData_t *threadData, modelica_metatype _useConstValue, modelica_metatype _ie, modelica_metatype _v)
{
modelica_integer tmp1;
modelica_metatype _outE = NULL;
tmp1 = mmc_unbox_integer(_useConstValue);
_outE = omc_InstUtil_checkUseConstValue(threadData, tmp1, _ie, _v);
return _outE;
}
DLLExport
modelica_metatype omc_InstUtil_propagateClassPrefix(threadData_t *threadData, modelica_metatype _attr, modelica_metatype _pre)
{
modelica_metatype _outAttr = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _attr;
tmp4_2 = _pre;
{
modelica_metatype _ad = NULL;
modelica_metatype _ct = NULL;
modelica_metatype _dir = NULL;
modelica_metatype _prl = NULL;
modelica_metatype _vt = NULL;
modelica_metatype _isf = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
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,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,0) == 0) goto tmp3_end;
tmpMeta1 = _attr;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,0) == 0) goto tmp3_end;
tmpMeta1 = _attr;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
_vt = tmpMeta10;
_ad = tmpMeta11;
_ct = tmpMeta12;
_prl = tmpMeta13;
_dir = tmpMeta14;
_isf = tmpMeta15;
tmpMeta16 = mmc_mk_box7(3, &SCode_Attributes_ATTR__desc, _ad, _ct, _prl, _vt, _dir, _isf);
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 3: {
tmpMeta1 = _attr;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outAttr = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAttr;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_instConditionalDeclaration(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inCondition, modelica_metatype _inPrefix, modelica_metatype _inInfo, modelica_metatype *out_outCache)
{
modelica_boolean _outIsConditional;
modelica_metatype _outCache = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _e = NULL;
modelica_metatype _t = NULL;
modelica_metatype _c = NULL;
modelica_boolean _is_bool;
modelica_boolean _is_param;
modelica_boolean _b;
modelica_metatype _val = 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_boolean tmp9 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta5 = omc_Static_elabExp(threadData, _inCache, _inEnv, _inCondition, 0, 0, _inPrefix, _inInfo, &tmpMeta1, &tmpMeta2);
_outCache = tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta2,0,2) == 0) MMC_THROW_INTERNAL();
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 3));
_e = tmpMeta1;
_t = tmpMeta3;
_c = tmpMeta4;
if((!omc_Types_isBoolean(threadData, _t)))
{
tmpMeta6 = mmc_mk_cons(omc_Dump_printExpStr(threadData, _inCondition), mmc_mk_cons(omc_Types_unparseTypeNoAttr(threadData, _t), MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT141, tmpMeta6, _inInfo);
}
if((!omc_Types_isParameterOrConstant(threadData, _c)))
{
tmpMeta7 = mmc_mk_cons(omc_Dump_printExpStr(threadData, _inCondition), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT144, tmpMeta7, _inInfo);
}
tmpMeta8 = mmc_mk_box2(3, &Absyn_Msg_MSG__desc, _inInfo);
_outCache = omc_Ceval_ceval(threadData, _outCache, _inEnv, _e, 0, tmpMeta8, ((modelica_integer) 0) ,&_val);
{
modelica_metatype tmp12_1;
tmp12_1 = _val;
{
int tmp12;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp12_1))) {
case 6: {
modelica_metatype tmpMeta13;
modelica_integer tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp12_1,3,1) == 0) goto tmp11_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp12_1), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_b = tmp14;
tmp9 = _b;
goto tmp11_done;
}
case 19: {
modelica_metatype tmpMeta15;
if((!omc_Config_getGraphicsExpMode(threadData)))
{
tmpMeta15 = mmc_mk_cons(omc_Dump_printExpStr(threadData, _inCondition), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT147, tmpMeta15, _inInfo);
goto goto_10;
}
tmp9 = 1;
goto tmp11_done;
}
default:
tmp11_default: OMC_LABEL_UNUSED; {
modelica_metatype tmpMeta16;
tmpMeta16 = stringAppend(_OMC_LIT148,omc_ValuesUtil_valString(threadData, _val));
omc_Error_addInternalError(threadData, tmpMeta16, _OMC_LIT150);
goto goto_10;
goto tmp11_done;
}
}
goto tmp11_end;
tmp11_end: ;
}
goto goto_10;
goto_10:;
MMC_THROW_INTERNAL();
goto tmp11_done;
tmp11_done:;
}
}
_outIsConditional = tmp9;
_return: OMC_LABEL_UNUSED
if (out_outCache) { *out_outCache = _outCache; }
return _outIsConditional;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_instConditionalDeclaration(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inCondition, modelica_metatype _inPrefix, modelica_metatype _inInfo, modelica_metatype *out_outCache)
{
modelica_boolean _outIsConditional;
modelica_metatype out_outIsConditional;
_outIsConditional = omc_InstUtil_instConditionalDeclaration(threadData, _inCache, _inEnv, _inCondition, _inPrefix, _inInfo, out_outCache);
out_outIsConditional = mmc_mk_icon(_outIsConditional);
return out_outIsConditional;
}
DLLExport
modelica_metatype omc_InstUtil_instElementCondExp(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _component, modelica_metatype _prefix, modelica_metatype _info, modelica_metatype *out_outCache)
{
modelica_metatype _outCondValue = NULL;
modelica_metatype _outCache = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _component;
{
modelica_metatype _cond_exp = NULL;
modelica_boolean _cond_val;
modelica_metatype _cache = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_cond_exp = tmpMeta7;
_cond_val = omc_InstUtil_instConditionalDeclaration(threadData, _inCache, _inEnv, _cond_exp, _prefix, _info ,&_cache);
tmpMeta[0+0] = mmc_mk_some(mmc_mk_boolean(_cond_val));
tmpMeta[0+1] = _cache;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
tmpMeta[0+0] = mmc_mk_none();
tmpMeta[0+1] = _inCache;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _OMC_LIT151;
tmpMeta[0+1] = _inCache;
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:;
}
}
_outCondValue = tmpMeta[0+0];
_outCache = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outCache) { *out_outCache = _outCache; }
return _outCondValue;
}
DLLExport
modelica_boolean omc_InstUtil_componentHasCondition(threadData_t *threadData, modelica_metatype _component)
{
modelica_boolean _hasCondition;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
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;
modelica_metatype tmpMeta8;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 8));
if (optionNone(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_hasCondition = tmp1;
_return: OMC_LABEL_UNUSED
return _hasCondition;
}
modelica_metatype boxptr_InstUtil_componentHasCondition(threadData_t *threadData, modelica_metatype _component)
{
modelica_boolean _hasCondition;
modelica_metatype out_hasCondition;
_hasCondition = omc_InstUtil_componentHasCondition(threadData, _component);
out_hasCondition = mmc_mk_icon(_hasCondition);
return out_hasCondition;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_wrapIntoForLst(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inNames, modelica_metatype _inRanges)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inExp;
tmp4_2 = _inNames;
tmp4_3 = _inRanges;
{
modelica_metatype _e = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _n = NULL;
modelica_metatype _names = NULL;
modelica_metatype _r = NULL;
modelica_metatype _ranges = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
if (!listEmpty(tmp4_3)) goto tmp3_end;
_e = tmp4_1;
tmpMeta1 = _e;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_2);
tmpMeta7 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_3);
tmpMeta9 = MMC_CDR(tmp4_3);
_n = tmpMeta6;
_names = tmpMeta7;
_r = tmpMeta8;
_ranges = tmpMeta9;
_e = tmp4_1;
_e2 = omc_InstUtil_wrapIntoForLst(threadData, _e, _names, _ranges);
tmpMeta1 = omc_InstUtil_wrapIntoFor(threadData, _e2, _n, _r);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_wrapIntoFor(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inNames, modelica_metatype _inRanges)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inExp;
tmp4_2 = _inNames;
tmp4_3 = _inRanges;
{
modelica_metatype _e = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _r = NULL;
modelica_string _n = NULL;
modelica_metatype _names = NULL;
modelica_metatype _ranges = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
if (!listEmpty(tmp4_3)) goto tmp3_end;
_e = tmp4_1;
tmpMeta1 = _e;
goto tmp3_done;
}
case 1: {
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;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_2);
tmpMeta7 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_3);
tmpMeta9 = MMC_CDR(tmp4_3);
_n = tmpMeta6;
_names = tmpMeta7;
_r = tmpMeta8;
_ranges = tmpMeta9;
_e = tmp4_1;
_e2 = omc_InstUtil_wrapIntoFor(threadData, _e, _names, _ranges);
tmpMeta11 = mmc_mk_box4(18, &Absyn_Exp_RANGE__desc, _OMC_LIT155, mmc_mk_none(), _r);
tmpMeta12 = mmc_mk_box4(3, &Absyn_ForIterator_ITERATOR__desc, _n, mmc_mk_none(), mmc_mk_some(tmpMeta11));
tmpMeta10 = mmc_mk_cons(tmpMeta12, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta13 = mmc_mk_box4(4, &Absyn_FunctionArgs_FOR__ITER__FARG__desc, _e2, _OMC_LIT154, tmpMeta10);
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta15 = mmc_mk_box4(14, &Absyn_Exp_CALL__desc, _OMC_LIT153, tmpMeta13, tmpMeta14);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_stringSub(threadData_t *threadData, modelica_string _inName)
{
modelica_metatype _outSub = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_string tmp4_1;
tmp4_1 = _inName;
{
modelica_string _n = NULL;
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_metatype tmpMeta9;
_n = tmp4_1;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _n, tmpMeta6);
tmpMeta8 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta7);
tmpMeta9 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta8);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSub = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSub;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_stringsSubs(threadData_t *threadData, modelica_metatype _inNames)
{
modelica_metatype _outSubs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inNames;
{
modelica_string _n = NULL;
modelica_metatype _names = NULL;
modelica_metatype _subs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
_n = tmpMeta7;
_names = tmpMeta8;
_subs = omc_InstUtil_stringsSubs(threadData, _names);
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _n, tmpMeta10);
tmpMeta12 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta11);
tmpMeta13 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta12);
tmpMeta9 = mmc_mk_cons(tmpMeta13, _subs);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNamesLstCall(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inList)
{
modelica_metatype _outNames = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outNames = omc_InstUtil_generateUnusedNamesLst(threadData, _inList, ((modelica_integer) 1), NULL);
_return: OMC_LABEL_UNUSED
return _outNames;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNamesLst(threadData_t *threadData, modelica_metatype _inList, modelica_integer _inInt, modelica_integer *out_outInt)
{
modelica_metatype _outNames = NULL;
modelica_integer _outInt;
modelica_integer tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_integer tmp4_2;
tmp4_1 = _inList;
tmp4_2 = _inInt;
{
modelica_integer _i;
modelica_integer _i1;
modelica_integer _i2;
modelica_metatype _names = NULL;
modelica_metatype _ns = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _e0 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
_i = tmp4_2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmp1_c1 = _i;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
_e0 = tmpMeta7;
_exps = tmpMeta8;
_i = tmp4_2;
_ns = omc_InstUtil_generateUnusedNames2(threadData, _e0, _i ,&_i1);
_names = omc_InstUtil_generateUnusedNamesLst(threadData, _exps, _i1 ,&_i2);
tmpMeta9 = mmc_mk_cons(_ns, _names);
tmpMeta[0+0] = tmpMeta9;
tmp1_c1 = _i2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outNames = tmpMeta[0+0];
_outInt = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_outInt) { *out_outInt = _outInt; }
return _outNames;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_generateUnusedNamesLst(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _inInt, modelica_metatype *out_outInt)
{
modelica_integer tmp1;
modelica_integer _outInt;
modelica_metatype _outNames = NULL;
tmp1 = mmc_unbox_integer(_inInt);
_outNames = omc_InstUtil_generateUnusedNamesLst(threadData, _inList, tmp1, &_outInt);
if (out_outInt) { *out_outInt = mmc_mk_icon(_outInt); }
return _outNames;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNames2(threadData_t *threadData, modelica_metatype _inList, modelica_integer _inInt, modelica_integer *out_outInt)
{
modelica_metatype _outNames = NULL;
modelica_integer _outInt;
modelica_integer tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_integer tmp4_2;
tmp4_1 = _inList;
tmp4_2 = _inInt;
{
modelica_integer _i;
modelica_integer _i1;
modelica_integer _i2;
modelica_string _s = NULL;
modelica_metatype _names = NULL;
modelica_metatype _exps = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
_i = tmp4_2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmp1_c1 = _i;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
_exps = tmpMeta8;
_i = tmp4_2;
_s = intString(_i);
tmpMeta9 = stringAppend(_OMC_LIT156,_s);
_s = tmpMeta9;
_i1 = ((modelica_integer) 1) + _i;
_names = omc_InstUtil_generateUnusedNames2(threadData, _exps, _i1 ,&_i2);
tmpMeta10 = mmc_mk_cons(_s, _names);
tmpMeta[0+0] = tmpMeta10;
tmp1_c1 = _i2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outNames = tmpMeta[0+0];
_outInt = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_outInt) { *out_outInt = _outInt; }
return _outNames;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_generateUnusedNames2(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _inInt, modelica_metatype *out_outInt)
{
modelica_integer tmp1;
modelica_integer _outInt;
modelica_metatype _outNames = NULL;
tmp1 = mmc_unbox_integer(_inInt);
_outNames = omc_InstUtil_generateUnusedNames2(threadData, _inList, tmp1, &_outInt);
if (out_outInt) { *out_outInt = mmc_mk_icon(_outInt); }
return _outNames;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_generateUnusedNames(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inList)
{
modelica_metatype _outNames = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outNames = omc_InstUtil_generateUnusedNames2(threadData, _inList, ((modelica_integer) 1), NULL);
_return: OMC_LABEL_UNUSED
return _outNames;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_insertSubsInBinding(threadData_t *threadData, modelica_metatype _inOpt, modelica_metatype _inExps)
{
modelica_metatype _outOpt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inOpt;
tmp4_2 = _inExps;
{
modelica_metatype _exps = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _vars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_1)) goto tmp3_end;
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));
_e = tmpMeta6;
_exps = tmp4_2;
_vars = omc_InstUtil_generateUnusedNamesLstCall(threadData, _e, _exps);
_subs = omc_List_mapList(threadData, _vars, boxvar_InstUtil_stringSub);
_e2 = omc_AbsynUtil_traverseExp(threadData, _e, boxvar_AbsynUtil_crefInsertSubscriptLstLst, _subs, NULL);
_e2 = omc_InstUtil_wrapIntoForLst(threadData, _e2, _vars, _exps);
tmpMeta1 = mmc_mk_some(_e2);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outOpt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outOpt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddDims5(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMods, modelica_metatype _inExps)
{
modelica_metatype _outMods = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inPrefix;
tmp4_4 = _inMods;
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _pre = NULL;
modelica_metatype _mod = NULL;
modelica_metatype _mod2 = NULL;
modelica_metatype _smods = NULL;
modelica_metatype _smods2 = NULL;
modelica_string _n = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_4)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_4)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_4);
tmpMeta8 = MMC_CDR(tmp4_4);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
_n = tmpMeta9;
_mod = tmpMeta10;
_smods = tmpMeta8;
_cache = tmp4_1;
_env = tmp4_2;
_pre = tmp4_3;
_mod2 = omc_InstUtil_traverseModAddDims4(threadData, _cache, _env, _pre, _mod, _inExps, 0);
_smods2 = omc_InstUtil_traverseModAddDims5(threadData, _cache, _env, _pre, _smods, _inExps);
tmpMeta12 = mmc_mk_box3(3, &SCode_SubMod_NAMEMOD__desc, _n, _mod2);
tmpMeta11 = mmc_mk_cons(tmpMeta12, _smods2);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outMods = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outMods;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddDims4(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _inExps, modelica_boolean _inIsTop)
{
modelica_metatype _outMod = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inPrefix;
tmp4_4 = _inMod;
tmp4_5 = _inExps;
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _pre = NULL;
modelica_metatype _f = NULL;
modelica_metatype _submods = NULL;
modelica_metatype _submods2 = NULL;
modelica_metatype _binding = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _info = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_4))) {
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,2,0) == 0) goto tmp3_end;
tmpMeta1 = _inMod;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,1,3) == 0) goto tmp3_end;
tmpMeta1 = _inMod;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,0,5) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,0) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 5));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 6));
_f = tmpMeta5;
_submods = tmpMeta7;
_binding = tmpMeta8;
_info = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
_pre = tmp4_3;
_exps = tmp4_5;
_submods2 = omc_InstUtil_traverseModAddDims5(threadData, _cache, _env, _pre, _submods, _exps);
_binding = omc_InstUtil_insertSubsInBinding(threadData, _binding, _exps);
tmpMeta10 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _f, _OMC_LIT123, _submods2, _binding, _info);
tmpMeta1 = tmpMeta10;
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;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_traverseModAddDims4(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _inExps, modelica_metatype _inIsTop)
{
modelica_integer tmp1;
modelica_metatype _outMod = NULL;
tmp1 = mmc_unbox_integer(_inIsTop);
_outMod = omc_InstUtil_traverseModAddDims4(threadData, _inCache, _inEnv, _inPrefix, _inMod, _inExps, tmp1);
return _outMod;
}
DLLExport
modelica_metatype omc_InstUtil_traverseModAddDims(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _inInstDims)
{
modelica_metatype _outMod = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inPrefix;
tmp4_4 = _inMod;
tmp4_5 = _inInstDims;
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _pre = NULL;
modelica_metatype _mod = NULL;
modelica_metatype _inst_dims = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _aexps = NULL;
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: {
modelica_boolean tmp6;
_mod = tmp4_4;
tmp6 = omc_Config_splitArrays(threadData);
if (1 != tmp6) goto goto_2;
tmpMeta1 = _mod;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_5)) goto tmp3_end;
tmpMeta1 = _inMod;
goto tmp3_done;
}
case 2: {
_cache = tmp4_1;
_env = tmp4_2;
_pre = tmp4_3;
_mod = tmp4_4;
_inst_dims = tmp4_5;
_exps = omc_List_map(threadData, _inst_dims, boxvar_Expression_dimensionsToExps);
_aexps = omc_List_mapList(threadData, _exps, boxvar_Expression_unelabExp);
tmpMeta1 = omc_InstUtil_traverseModAddDims4(threadData, _cache, _env, _pre, _mod, _aexps, 1);
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:;
}
}
_outMod = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outMod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddFinal4(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fsub)
{
modelica_metatype _sub = NULL;
modelica_metatype _mod = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_sub = __omcQ_24in_5Fsub;
_mod = omc_InstUtil_traverseModAddFinal(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 3))));
if((!referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 3))), _mod)))
{
tmpMeta1 = MMC_TAGPTR(mmc_alloc_words(4));
memcpy(MMC_UNTAGPTR(tmpMeta1), MMC_UNTAGPTR(_sub), 4*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta1))[3] = _mod;
_sub = tmpMeta1;
}
_return: OMC_LABEL_UNUSED
return _sub;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_traverseModAddFinal3(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_metatype _outElement = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_metatype _attr = NULL;
modelica_metatype _tySpec = NULL;
modelica_metatype _mod = NULL;
modelica_metatype _oldmod = NULL;
modelica_string _name = NULL;
modelica_metatype _vis = NULL;
modelica_metatype _prefixes = NULL;
modelica_metatype _cmt = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _p = NULL;
modelica_metatype _ann = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; 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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_name = tmpMeta6;
_prefixes = tmpMeta7;
_attr = tmpMeta8;
_tySpec = tmpMeta9;
_oldmod = tmpMeta10;
_cmt = tmpMeta11;
_cond = tmpMeta12;
_info = tmpMeta13;
tmp4 += 3;
_mod = omc_InstUtil_traverseModAddFinal(threadData, _oldmod);
tmp15 = (modelica_boolean)referenceEq(_oldmod, _mod);
if(tmp15)
{
tmpMeta16 = _inElement;
}
else
{
tmpMeta14 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, _name, _prefixes, _attr, _tySpec, _mod, _cmt, _cond, _info);
tmpMeta16 = tmpMeta14;
}
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,3) == 0) goto tmp3_end;
tmp4 += 2;
tmpMeta1 = _inElement;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmp4 += 1;
tmpMeta1 = _inElement;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,5) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_p = tmpMeta17;
_vis = tmpMeta18;
_oldmod = tmpMeta19;
_ann = tmpMeta20;
_info = tmpMeta21;
_mod = omc_InstUtil_traverseModAddFinal(threadData, _oldmod);
tmp23 = (modelica_boolean)referenceEq(_oldmod, _mod);
if(tmp23)
{
tmpMeta24 = _inElement;
}
else
{
tmpMeta22 = mmc_mk_box6(4, &SCode_Element_EXTENDS__desc, _p, _vis, _mod, _ann, _info);
tmpMeta24 = tmpMeta22;
}
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
case 4: {
fputs(MMC_STRINGDATA(_OMC_LIT157),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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outElement = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElement;
}
DLLExport
modelica_metatype omc_InstUtil_traverseModAddFinal(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fmod)
{
modelica_metatype _mod = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_mod = __omcQ_24in_5Fmod;
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _mod;
{
modelica_metatype _element1 = NULL;
modelica_metatype _element2 = NULL;
modelica_metatype _each_ = NULL;
modelica_metatype _subs1 = NULL;
modelica_metatype _subs2 = NULL;
modelica_metatype _eq = NULL;
modelica_metatype _info = NULL;
modelica_metatype _f = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmp4 += 2;
tmpMeta1 = _mod;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_each_ = tmpMeta6;
_element1 = tmpMeta7;
tmp4 += 1;
_element2 = omc_InstUtil_traverseModAddFinal3(threadData, _element1);
tmp9 = (modelica_boolean)referenceEq(_element1, _element2);
if(tmp9)
{
tmpMeta10 = _mod;
}
else
{
tmpMeta8 = mmc_mk_box4(4, &SCode_Mod_REDECL__desc, _OMC_LIT158, _each_, _element2);
tmpMeta10 = tmpMeta8;
}
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_f = tmpMeta11;
_each_ = tmpMeta12;
_subs1 = tmpMeta13;
_eq = tmpMeta14;
_info = tmpMeta15;
_subs2 = omc_List_mapCheckReferenceEq(threadData, _subs1, boxvar_InstUtil_traverseModAddFinal4);
tmp17 = (modelica_boolean)(valueEq(_OMC_LIT158, _f) && referenceEq(_subs1, _subs2));
if(tmp17)
{
tmpMeta18 = _mod;
}
else
{
tmpMeta16 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _OMC_LIT158, _each_, _subs2, _eq, _info);
tmpMeta18 = tmpMeta16;
}
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 3: {
omc_Error_addInternalError(threadData, _OMC_LIT159, _OMC_LIT160);
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_mod = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _mod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractCorrectClassMod2(threadData_t *threadData, modelica_metatype _smod, modelica_string _name, modelica_metatype _premod, modelica_metatype *out_restmods)
{
modelica_metatype _omod = NULL;
modelica_metatype _restmods = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _smod;
{
modelica_metatype _mod = NULL;
modelica_metatype _sub = NULL;
modelica_string _id = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _rest2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta[0+0] = _OMC_LIT44;
tmpMeta[0+1] = _premod;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
_id = tmpMeta8;
_mod = tmpMeta9;
_rest = tmpMeta7;
if (!(stringEqual(_id, _name))) goto tmp3_end;
_rest2 = listAppend(_premod, _rest);
tmpMeta[0+0] = _mod;
tmpMeta[0+1] = _rest2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
_sub = tmpMeta10;
_rest = tmpMeta11;
_mod = omc_InstUtil_extractCorrectClassMod2(threadData, _rest, _name, _premod ,&_rest2);
tmpMeta12 = mmc_mk_cons(_sub, _rest2);
tmpMeta[0+0] = _mod;
tmpMeta[0+1] = tmpMeta12;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_omod = tmpMeta[0+0];
_restmods = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_restmods) { *out_restmods = _restmods; }
return _omod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addClassdefsToEnv3(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inMod, modelica_metatype _sele, modelica_metatype *out_oenv, modelica_metatype *out_outIH, modelica_metatype *out_osele)
{
modelica_metatype _outCache = NULL;
modelica_metatype _oenv = NULL;
modelica_metatype _outIH = NULL;
modelica_metatype _osele = NULL;
modelica_metatype tmpMeta[4] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inIH;
tmp4_3 = _inPrefix;
tmp4_4 = _inMod;
tmp4_5 = _sele;
{
modelica_metatype _mo2 = NULL;
modelica_metatype _sele2 = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _env2 = NULL;
modelica_string _str = NULL;
modelica_metatype _ih = NULL;
modelica_metatype _lsm = NULL;
modelica_metatype _pre = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_4)) goto tmp3_end;
goto goto_2;
goto tmp3_done;
}
case 1: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
_str = tmpMeta6;
_lsm = tmpMeta8;
_cache = tmp4_1;
_ih = tmp4_2;
_pre = tmp4_3;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_mo2 = omc_InstUtil_extractCorrectClassMod2(threadData, _lsm, _str, tmpMeta9, NULL);
tmpMeta13 = mmc_mk_box2(4, &Absyn_Path_IDENT__desc, _str);
tmpMeta14 = mmc_mk_box2(5, &ClassInf_State_MODEL__desc, tmpMeta13);
tmpMeta15 = omc_Inst_redeclareType(threadData, _cache, _env, _ih, _mo2, _sele, _pre, tmpMeta14, 1, _OMC_LIT44, &tmpMeta10, &tmpMeta11, &tmpMeta12, NULL);
_cache = tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,8) == 0) goto goto_2;
_env2 = tmpMeta10;
_ih = tmpMeta11;
_sele2 = tmpMeta12;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env2;
tmpMeta[0+2] = _ih;
tmpMeta[0+3] = _sele2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_oenv = tmpMeta[0+1];
_outIH = tmpMeta[0+2];
_osele = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_oenv) { *out_oenv = _oenv; }
if (out_outIH) { *out_outIH = _outIH; }
if (out_osele) { *out_osele = _osele; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_splitClassExtendsElts(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_outElts)
{
modelica_metatype _classextendsElts = NULL;
modelica_metatype _outElts = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elts;
{
modelica_metatype _res = NULL;
modelica_metatype _xs = NULL;
modelica_metatype _cdef = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,8) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,2) == 0) goto tmp3_end;
_cdef = tmpMeta8;
_xs = tmpMeta9;
_classextendsElts = omc_InstUtil_splitClassExtendsElts(threadData, _xs ,&_res);
tmpMeta11 = mmc_mk_cons(_cdef, _classextendsElts);
tmpMeta[0+0] = tmpMeta11;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
_cdef = tmpMeta12;
_xs = tmpMeta13;
_classextendsElts = omc_InstUtil_splitClassExtendsElts(threadData, _xs ,&_res);
tmpMeta14 = mmc_mk_cons(_cdef, _res);
tmpMeta[0+0] = _classextendsElts;
tmpMeta[0+1] = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_classextendsElts = tmpMeta[0+0];
_outElts = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outElts) { *out_outElts = _outElts; }
return _classextendsElts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_orderComponents(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _inCompElts)
{
modelica_metatype _outCompElts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inComp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,0) == 0) goto tmp3_end;
tmpMeta8 = mmc_mk_cons(_inComp, _inCompElts);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,0) == 0) goto tmp3_end;
tmpMeta11 = mmc_mk_cons(_inComp, _inCompElts);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
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), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,0) == 0) goto tmp3_end;
tmpMeta14 = mmc_mk_cons(_inComp, _inCompElts);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,2,0) == 0) goto tmp3_end;
tmpMeta17 = mmc_mk_cons(_inComp, _inCompElts);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,3,0) == 0) goto tmp3_end;
tmpMeta20 = mmc_mk_cons(_inComp, _inCompElts);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,2,0) == 0) goto tmp3_end;
tmpMeta23 = mmc_mk_cons(_inComp, _inCompElts);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta24 = mmc_mk_cons(_inComp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = listAppend(_inCompElts, tmpMeta24);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCompElts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCompElts;
}
DLLExport
modelica_metatype omc_InstUtil_splitEltsInnerAndOther(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_classextendsElts, modelica_metatype *out_extElts, modelica_metatype *out_innerCompElts, modelica_metatype *out_otherCompElts)
{
modelica_metatype _cdefImpElts = NULL;
modelica_metatype _classextendsElts = NULL;
modelica_metatype _extElts = NULL;
modelica_metatype _innerCompElts = NULL;
modelica_metatype _otherCompElts = NULL;
modelica_metatype tmpMeta[5] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elts;
{
modelica_metatype _xs = NULL;
modelica_metatype _innerComps = NULL;
modelica_metatype _otherComps = NULL;
modelica_metatype _cdef = NULL;
modelica_metatype _imp = NULL;
modelica_metatype _ext = NULL;
modelica_metatype _comp = NULL;
modelica_metatype _io = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
tmpMeta[0+2] = tmpMeta8;
tmpMeta[0+3] = tmpMeta9;
tmpMeta[0+4] = tmpMeta10;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,2,8) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,2) == 0) goto tmp3_end;
_cdef = tmpMeta11;
_xs = tmpMeta12;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta14 = mmc_mk_cons(_cdef, _classextendsElts);
tmpMeta[0+0] = _cdefImpElts;
tmpMeta[0+1] = tmpMeta14;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = _innerComps;
tmpMeta[0+4] = _otherComps;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_1);
tmpMeta16 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,2,8) == 0) goto tmp3_end;
_cdef = tmpMeta15;
_xs = tmpMeta16;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta17 = mmc_mk_cons(_cdef, _cdefImpElts);
tmpMeta[0+0] = tmpMeta17;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = _innerComps;
tmpMeta[0+4] = _otherComps;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,0,3) == 0) goto tmp3_end;
_imp = tmpMeta18;
_xs = tmpMeta19;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta20 = mmc_mk_cons(_imp, _cdefImpElts);
tmpMeta[0+0] = tmpMeta20;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = _innerComps;
tmpMeta[0+4] = _otherComps;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta21 = MMC_CAR(tmp4_1);
tmpMeta22 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,4,5) == 0) goto tmp3_end;
_imp = tmpMeta21;
_xs = tmpMeta22;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta23 = mmc_mk_cons(_imp, _cdefImpElts);
tmpMeta[0+0] = tmpMeta23;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = _innerComps;
tmpMeta[0+4] = _otherComps;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmp4_1);
tmpMeta25 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,1,5) == 0) goto tmp3_end;
_ext = tmpMeta24;
_xs = tmpMeta25;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta26 = mmc_mk_cons(_ext, _extElts);
tmpMeta[0+0] = _cdefImpElts;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = tmpMeta26;
tmpMeta[0+3] = _innerComps;
tmpMeta[0+4] = _otherComps;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_boolean tmp31;
modelica_metatype tmpMeta32;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta27 = MMC_CAR(tmp4_1);
tmpMeta28 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,3,8) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 3));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 5));
_comp = tmpMeta27;
_io = tmpMeta30;
_xs = tmpMeta28;
tmp31 = omc_AbsynUtil_isInner(threadData, _io);
if (1 != tmp31) goto goto_2;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta32 = mmc_mk_cons(_comp, _innerComps);
tmpMeta[0+0] = _cdefImpElts;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = tmpMeta32;
tmpMeta[0+4] = _otherComps;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta33 = MMC_CAR(tmp4_1);
tmpMeta34 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,3,8) == 0) goto tmp3_end;
_comp = tmpMeta33;
_xs = tmpMeta34;
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _xs ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
tmpMeta35 = mmc_mk_cons(_comp, _otherComps);
tmpMeta[0+0] = _cdefImpElts;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = _innerComps;
tmpMeta[0+4] = tmpMeta35;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cdefImpElts = tmpMeta[0+0];
_classextendsElts = tmpMeta[0+1];
_extElts = tmpMeta[0+2];
_innerCompElts = tmpMeta[0+3];
_otherCompElts = tmpMeta[0+4];
_return: OMC_LABEL_UNUSED
if (out_classextendsElts) { *out_classextendsElts = _classextendsElts; }
if (out_extElts) { *out_extElts = _extElts; }
if (out_innerCompElts) { *out_innerCompElts = _innerCompElts; }
if (out_otherCompElts) { *out_otherCompElts = _otherCompElts; }
return _cdefImpElts;
}
DLLExport
modelica_metatype omc_InstUtil_splitEltsNoComponents(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_defElts, modelica_metatype *out_classextendsElts, modelica_metatype *out_filtered)
{
modelica_metatype _impElts = NULL;
modelica_metatype _defElts = NULL;
modelica_metatype _classextendsElts = NULL;
modelica_metatype _filtered = NULL;
modelica_metatype tmpMeta[4] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elts;
{
modelica_metatype _xs = NULL;
modelica_metatype _elt = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
tmpMeta[0+2] = tmpMeta8;
tmpMeta[0+3] = tmpMeta9;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,8) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,1,2) == 0) goto tmp3_end;
_elt = tmpMeta10;
_xs = tmpMeta11;
_impElts = omc_InstUtil_splitEltsNoComponents(threadData, _xs ,&_defElts ,&_classextendsElts ,&_filtered);
tmpMeta13 = mmc_mk_cons(_elt, _classextendsElts);
tmpMeta[0+0] = _impElts;
tmpMeta[0+1] = _defElts;
tmpMeta[0+2] = tmpMeta13;
tmpMeta[0+3] = _filtered;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,2,8) == 0) goto tmp3_end;
_elt = tmpMeta14;
_xs = tmpMeta15;
_impElts = omc_InstUtil_splitEltsNoComponents(threadData, _xs ,&_defElts ,&_classextendsElts ,&_filtered);
tmpMeta16 = mmc_mk_cons(_elt, _defElts);
tmpMeta17 = mmc_mk_cons(_elt, _filtered);
tmpMeta[0+0] = _impElts;
tmpMeta[0+1] = tmpMeta16;
tmpMeta[0+2] = _classextendsElts;
tmpMeta[0+3] = tmpMeta17;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,0,3) == 0) goto tmp3_end;
_elt = tmpMeta18;
_xs = tmpMeta19;
_impElts = omc_InstUtil_splitEltsNoComponents(threadData, _xs ,&_defElts ,&_classextendsElts ,&_filtered);
tmpMeta20 = mmc_mk_cons(_elt, _impElts);
tmpMeta[0+0] = tmpMeta20;
tmpMeta[0+1] = _defElts;
tmpMeta[0+2] = _classextendsElts;
tmpMeta[0+3] = _filtered;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta21 = MMC_CAR(tmp4_1);
tmpMeta22 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,4,5) == 0) goto tmp3_end;
_elt = tmpMeta21;
_xs = tmpMeta22;
_impElts = omc_InstUtil_splitEltsNoComponents(threadData, _xs ,&_defElts ,&_classextendsElts ,&_filtered);
tmpMeta23 = mmc_mk_cons(_elt, _defElts);
tmpMeta24 = mmc_mk_cons(_elt, _filtered);
tmpMeta[0+0] = _impElts;
tmpMeta[0+1] = tmpMeta23;
tmpMeta[0+2] = _classextendsElts;
tmpMeta[0+3] = tmpMeta24;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta25 = MMC_CAR(tmp4_1);
tmpMeta26 = MMC_CDR(tmp4_1);
_elt = tmpMeta25;
_xs = tmpMeta26;
_impElts = omc_InstUtil_splitEltsNoComponents(threadData, _xs ,&_defElts ,&_classextendsElts ,&_filtered);
tmpMeta27 = mmc_mk_cons(_elt, _filtered);
tmpMeta[0+0] = _impElts;
tmpMeta[0+1] = _defElts;
tmpMeta[0+2] = _classextendsElts;
tmpMeta[0+3] = tmpMeta27;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_impElts = tmpMeta[0+0];
_defElts = tmpMeta[0+1];
_classextendsElts = tmpMeta[0+2];
_filtered = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_defElts) { *out_defElts = _defElts; }
if (out_classextendsElts) { *out_classextendsElts = _classextendsElts; }
if (out_filtered) { *out_filtered = _filtered; }
return _impElts;
}
DLLExport
modelica_metatype omc_InstUtil_splitElts(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_classextendsElts, modelica_metatype *out_extElts, modelica_metatype *out_compElts)
{
modelica_metatype _cdefImpElts = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _classextendsElts = NULL;
modelica_metatype tmpMeta2;
modelica_metatype _extElts = NULL;
modelica_metatype tmpMeta3;
modelica_metatype _compElts = NULL;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta20;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_cdefImpElts = tmpMeta1;
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_classextendsElts = tmpMeta2;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
_extElts = tmpMeta3;
tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
_compElts = tmpMeta4;
{
modelica_metatype _elt;
for (tmpMeta5 = _elts; !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
{
_elt = MMC_CAR(tmpMeta5);
{
modelica_metatype tmp8_1;
tmp8_1 = _elt;
{
int tmp8;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp8_1))) {
case 5: {
modelica_boolean tmp9 = 0;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
{
modelica_metatype tmp12_1;
tmp12_1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_elt), 7)));
{
volatile mmc_switch_type tmp12;
int tmp13;
tmp12 = 0;
for (; tmp12 < 2; tmp12++) {
switch (MMC_SWITCH_CAST(tmp12)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp12_1,1,2) == 0) goto tmp11_end;
tmp9 = 1;
goto tmp11_done;
}
case 1: {
tmp9 = 0;
goto tmp11_done;
}
}
goto tmp11_end;
tmp11_end: ;
}
goto goto_10;
goto_10:;
goto goto_6;
goto tmp11_done;
tmp11_done:;
}
}
if(tmp9)
{
tmpMeta14 = mmc_mk_cons(_elt, _classextendsElts);
_classextendsElts = tmpMeta14;
}
else
{
tmpMeta15 = mmc_mk_cons(_elt, _cdefImpElts);
_cdefImpElts = tmpMeta15;
}
goto tmp7_done;
}
case 3: {
modelica_metatype tmpMeta16;
tmpMeta16 = mmc_mk_cons(_elt, _cdefImpElts);
_cdefImpElts = tmpMeta16;
goto tmp7_done;
}
case 7: {
modelica_metatype tmpMeta17;
tmpMeta17 = mmc_mk_cons(_elt, _cdefImpElts);
_cdefImpElts = tmpMeta17;
goto tmp7_done;
}
case 4: {
modelica_metatype tmpMeta18;
tmpMeta18 = mmc_mk_cons(_elt, _extElts);
_extElts = tmpMeta18;
goto tmp7_done;
}
case 6: {
modelica_metatype tmpMeta19;
tmpMeta19 = mmc_mk_cons(_elt, _compElts);
_compElts = tmpMeta19;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
goto_6:;
MMC_THROW_INTERNAL();
goto tmp7_done;
tmp7_done:;
}
}
;
}
}
_cdefImpElts = listReverseInPlace(_cdefImpElts);
_classextendsElts = listReverseInPlace(_classextendsElts);
_extElts = listReverseInPlace(_extElts);
_compElts = listReverseInPlace(_compElts);
_return: OMC_LABEL_UNUSED
if (out_classextendsElts) { *out_classextendsElts = _classextendsElts; }
if (out_extElts) { *out_extElts = _extElts; }
if (out_compElts) { *out_compElts = _compElts; }
return _cdefImpElts;
}
DLLExport
modelica_metatype omc_InstUtil_splitEltsOrderInnerOuter(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_classextendsElts, modelica_metatype *out_extElts, modelica_metatype *out_compElts)
{
modelica_metatype _cdefImpElts = NULL;
modelica_metatype _classextendsElts = NULL;
modelica_metatype _extElts = NULL;
modelica_metatype _compElts = NULL;
modelica_metatype tmpMeta[4] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_metatype _innerComps = NULL;
modelica_metatype _otherComps = NULL;
modelica_metatype _comps = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_cdefImpElts = omc_InstUtil_splitEltsInnerAndOther(threadData, _elts ,&_classextendsElts ,&_extElts ,&_innerComps ,&_otherComps);
_comps = listAppend(_innerComps, _otherComps);
tmpMeta[0+0] = _cdefImpElts;
tmpMeta[0+1] = _classextendsElts;
tmpMeta[0+2] = _extElts;
tmpMeta[0+3] = _comps;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cdefImpElts = tmpMeta[0+0];
_classextendsElts = tmpMeta[0+1];
_extElts = tmpMeta[0+2];
_compElts = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_classextendsElts) { *out_classextendsElts = _classextendsElts; }
if (out_extElts) { *out_extElts = _extElts; }
if (out_compElts) { *out_compElts = _compElts; }
return _cdefImpElts;
}
DLLExport
modelica_metatype omc_InstUtil_splitInnerAndOtherTplLstElementMod(threadData_t *threadData, modelica_metatype _inTplLstElementMod, modelica_metatype *out_outInnerOuterTplLstElementMod, modelica_metatype *out_outOtherTplLstElementMod)
{
modelica_metatype _outInnerTplLstElementMod = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _outInnerOuterTplLstElementMod = NULL;
modelica_metatype tmpMeta2;
modelica_metatype _outOtherTplLstElementMod = NULL;
modelica_metatype tmpMeta3;
modelica_metatype _comp = NULL;
modelica_metatype _io = NULL;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta16;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outInnerTplLstElementMod = tmpMeta1;
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_outInnerOuterTplLstElementMod = tmpMeta2;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
_outOtherTplLstElementMod = tmpMeta3;
{
modelica_metatype _e;
for (tmpMeta4 = listReverse(_inTplLstElementMod); !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
{
_e = MMC_CAR(tmpMeta4);
tmpMeta5 = _e;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
_comp = tmpMeta6;
{
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,3,8) == 0) goto tmp8_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp9_1), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 5));
_io = tmpMeta12;
if (!omc_AbsynUtil_isInner(threadData, _io)) goto tmp8_end;
if(omc_AbsynUtil_isOuter(threadData, _io))
{
tmpMeta13 = mmc_mk_cons(_e, _outInnerOuterTplLstElementMod);
_outInnerOuterTplLstElementMod = tmpMeta13;
}
else
{
tmpMeta14 = mmc_mk_cons(_e, _outInnerTplLstElementMod);
_outInnerTplLstElementMod = tmpMeta14;
}
goto tmp8_done;
}
case 1: {
modelica_metatype tmpMeta15;
tmpMeta15 = mmc_mk_cons(_e, _outOtherTplLstElementMod);
_outOtherTplLstElementMod = tmpMeta15;
goto tmp8_done;
}
}
goto tmp8_end;
tmp8_end: ;
}
goto goto_7;
goto_7:;
MMC_THROW_INTERNAL();
goto tmp8_done;
tmp8_done:;
}
}
;
}
}
_return: OMC_LABEL_UNUSED
if (out_outInnerOuterTplLstElementMod) { *out_outInnerOuterTplLstElementMod = _outInnerOuterTplLstElementMod; }
if (out_outOtherTplLstElementMod) { *out_outOtherTplLstElementMod = _outOtherTplLstElementMod; }
return _outInnerTplLstElementMod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_splitInners(threadData_t *threadData, modelica_metatype _inTplLstElementMod, modelica_metatype _inAcc1, modelica_metatype _inAcc2, modelica_metatype _inAcc3, modelica_metatype *out_outModelica, modelica_metatype *out_outOthers)
{
modelica_metatype _outModelicaServices = NULL;
modelica_metatype _outModelica = NULL;
modelica_metatype _outOthers = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inTplLstElementMod;
{
modelica_metatype _rest = NULL;
modelica_metatype _e = NULL;
modelica_metatype _em = NULL;
modelica_metatype _p = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 3;
tmpMeta[0+0] = listReverse(_inAcc1);
tmpMeta[0+1] = listReverse(_inAcc2);
tmpMeta[0+2] = listReverse(_inAcc3);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_em = tmpMeta6;
_rest = tmpMeta7;
_e = omc_Util_tuple21(threadData, _em);
tmpMeta8 = omc_SCodeUtil_getComponentTypeSpec(threadData, _e);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,2) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_p = tmpMeta9;
tmp10 = (stringEqual(_OMC_LIT161, omc_AbsynUtil_pathFirstIdent(threadData, _p)));
if (1 != tmp10) goto goto_2;
tmpMeta11 = mmc_mk_cons(_em, _inAcc1);
tmpMeta[0+0] = omc_InstUtil_splitInners(threadData, _rest, tmpMeta11, _inAcc2, _inAcc3, &tmpMeta[0+1], &tmpMeta[0+2]);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
_em = tmpMeta12;
_rest = tmpMeta13;
_e = omc_Util_tuple21(threadData, _em);
tmpMeta14 = omc_SCodeUtil_getComponentTypeSpec(threadData, _e);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,0,2) == 0) goto goto_2;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
_p = tmpMeta15;
tmp16 = (stringEqual(_OMC_LIT162, omc_AbsynUtil_pathFirstIdent(threadData, _p)));
if (1 != tmp16) goto goto_2;
tmpMeta17 = mmc_mk_cons(_em, _inAcc2);
tmpMeta[0+0] = omc_InstUtil_splitInners(threadData, _rest, _inAcc1, tmpMeta17, _inAcc3, &tmpMeta[0+1], &tmpMeta[0+2]);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
_em = tmpMeta18;
_rest = tmpMeta19;
tmpMeta20 = mmc_mk_cons(_em, _inAcc3);
tmpMeta[0+0] = omc_InstUtil_splitInners(threadData, _rest, _inAcc1, _inAcc2, tmpMeta20, &tmpMeta[0+1], &tmpMeta[0+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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outModelicaServices = tmpMeta[0+0];
_outModelica = tmpMeta[0+1];
_outOthers = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outModelica) { *out_outModelica = _outModelica; }
if (out_outOthers) { *out_outOthers = _outOthers; }
return _outModelicaServices;
}
DLLExport
modelica_metatype omc_InstUtil_sortInnerFirstTplLstElementMod(threadData_t *threadData, modelica_metatype _inTplLstElementMod)
{
modelica_metatype _outTplLstElementMod = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_metatype _innerElts = NULL;
modelica_metatype _innerouterElts = NULL;
modelica_metatype _otherElts = NULL;
modelica_metatype _innerModelicaServices = NULL;
modelica_metatype _innerModelica = NULL;
modelica_metatype _innerOthers = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
tmp6 = omc_System_getHasInnerOuterDefinitions(threadData);
if (0 != tmp6) goto goto_2;
tmpMeta1 = _inTplLstElementMod;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
_innerElts = omc_InstUtil_splitInnerAndOtherTplLstElementMod(threadData, _inTplLstElementMod ,&_innerouterElts ,&_otherElts);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_innerModelicaServices = omc_InstUtil_splitInners(threadData, _innerElts, tmpMeta7, tmpMeta8, tmpMeta9 ,&_innerModelica ,&_innerOthers);
tmpMeta1 = listAppend(_innerModelicaServices, listAppend(_innerModelica, listAppend(_innerOthers, listAppend(_innerouterElts, _otherElts))));
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outTplLstElementMod = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outTplLstElementMod;
}
DLLExport
modelica_metatype omc_InstUtil_reorderConnectEquationsExpandable(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fcache, modelica_metatype _env, modelica_metatype _inEquations, modelica_metatype *out_outEquations)
{
modelica_metatype _cache = NULL;
modelica_metatype _outEquations = NULL;
modelica_metatype _delst = NULL;
modelica_metatype _expandableEqs = NULL;
modelica_metatype _crefLeft = NULL;
modelica_metatype _crefRight = NULL;
modelica_metatype _ty1 = NULL;
modelica_metatype _ty2 = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta23;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_cache = __omcQ_24in_5Fcache;
if((listEmpty(_inEquations)?1:(!omc_System_getHasExpandableConnectors(threadData))))
{
_outEquations = _inEquations;
goto _return;
}
omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT163);
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_delst = omc_DoubleEnded_fromList(threadData, tmpMeta1);
{
modelica_metatype __omcQ_24tmpVar9;
modelica_metatype* tmp3;
modelica_metatype tmpMeta4;
modelica_metatype __omcQ_24tmpVar8;
modelica_integer tmp5;
modelica_metatype _eq_loopVar = 0;
modelica_boolean tmp6 = 0;
modelica_metatype _eq;
_eq_loopVar = _inEquations;
tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar9 = tmpMeta4;
tmp3 = &__omcQ_24tmpVar9;
while(1) {
tmp5 = 1;
while (!listEmpty(_eq_loopVar)) {
_eq = MMC_CAR(_eq_loopVar);
_eq_loopVar = MMC_CDR(_eq_loopVar);
{
volatile modelica_metatype tmp9_1;
tmp9_1 = _eq;
{
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_boolean tmp13;
modelica_boolean tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp9_1,3,4) == 0) goto tmp8_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp9_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp9_1), 3));
_crefLeft = tmpMeta11;
_crefRight = tmpMeta12;
omc_Lookup_lookupConnectorVar(threadData, _env, omc_ComponentReference_toExpCref(threadData, _crefLeft), 1 ,&_ty1 ,NULL, NULL);
tmp13 = omc_Types_isExpandableConnector(threadData, _ty1);
if (1 != tmp13) goto goto_7;
omc_Lookup_lookupConnectorVar(threadData, _env, omc_ComponentReference_toExpCref(threadData, _crefRight), 1 ,&_ty2 ,NULL, NULL);
tmp14 = omc_Types_isExpandableConnector(threadData, _ty2);
if (1 != tmp14) goto goto_7;
tmp6 = 1;
goto tmp8_done;
}
case 1: {
omc_DoubleEnded_push__back(threadData, _delst, _eq);
tmp6 = 0;
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:;
}
}
if (tmp6) {
tmp5--;
break;
}
}
if (tmp5 == 0) {
__omcQ_24tmpVar8 = _eq;
*tmp3 = mmc_mk_cons(__omcQ_24tmpVar8,0);
tmp3 = &MMC_CDR(*tmp3);
} else if (tmp5 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp3 = mmc_mk_nil();
tmpMeta2 = __omcQ_24tmpVar9;
}
_expandableEqs = tmpMeta2;
if(listEmpty(_expandableEqs))
{
omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT163);
_outEquations = _inEquations;
goto _return;
}
omc_ErrorExt_rollBack(threadData, _OMC_LIT163);
omc_DoubleEnded_push__list__front(threadData, _delst, _expandableEqs);
omc_DoubleEnded_push__list__back(threadData, _delst, _expandableEqs);
{
modelica_metatype tmp17_1;
tmp17_1 = _expandableEqs;
{
volatile mmc_switch_type tmp17;
int tmp18;
tmp17 = 0;
for (; tmp17 < 2; tmp17++) {
switch (MMC_SWITCH_CAST(tmp17)) {
case 0: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (listEmpty(tmp17_1)) goto tmp16_end;
tmpMeta19 = MMC_CAR(tmp17_1);
tmpMeta20 = MMC_CDR(tmp17_1);
if (listEmpty(tmpMeta20)) goto tmp16_end;
tmpMeta21 = MMC_CAR(tmpMeta20);
tmpMeta22 = MMC_CDR(tmpMeta20);
omc_DoubleEnded_push__list__back(threadData, _delst, _expandableEqs);
goto tmp16_done;
}
case 1: {
goto tmp16_done;
}
}
goto tmp16_end;
tmp16_end: ;
}
goto goto_15;
goto_15:;
MMC_THROW_INTERNAL();
goto tmp16_done;
tmp16_done:;
}
}
;
tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
_outEquations = omc_DoubleEnded_toListAndClear(threadData, _delst, tmpMeta23);
_return: OMC_LABEL_UNUSED
if (out_outEquations) { *out_outEquations = _outEquations; }
return _cache;
}
DLLExport
modelica_string omc_InstUtil_extractCurrentName(threadData_t *threadData, modelica_metatype _sele, modelica_metatype *out_oinfo)
{
modelica_string _ostring = NULL;
modelica_metatype _oinfo = NULL;
modelica_string tmp1_c0 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _sele;
{
modelica_metatype _path = NULL;
modelica_string _name = NULL;
modelica_string _ret = NULL;
modelica_metatype _imp = NULL;
modelica_metatype _info = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_name = tmpMeta5;
_info = tmpMeta6;
tmp1_c0 = _name;
tmpMeta[0+1] = _info;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_name = tmpMeta7;
_info = tmpMeta8;
tmp1_c0 = _name;
tmpMeta[0+1] = _info;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,5) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_path = tmpMeta9;
_info = tmpMeta10;
_ret = omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT63, 1, 0);
tmp1_c0 = _ret;
tmpMeta[0+1] = _info;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_imp = tmpMeta11;
_info = tmpMeta12;
_name = omc_AbsynUtil_printImportString(threadData, _imp);
tmp1_c0 = _name;
tmpMeta[0+1] = _info;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ostring = tmp1_c0;
_oinfo = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_oinfo) { *out_oinfo = _oinfo; }
return _ostring;
}
DLLExport
modelica_boolean omc_InstUtil_isTopCall(threadData_t *threadData, modelica_metatype _inCallingScope)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCallingScope;
{
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,0,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_InstUtil_isTopCall(threadData_t *threadData, modelica_metatype _inCallingScope)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_InstUtil_isTopCall(threadData, _inCallingScope);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_metatype omc_InstUtil_liftRecordBinding(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inExp, modelica_metatype _inValue, modelica_metatype *out_outValue)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outValue = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _dim = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _val = NULL;
modelica_metatype _ety = NULL;
modelica_integer _int_dim;
modelica_metatype _expl = NULL;
modelica_metatype _vals = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (!listEmpty(tmpMeta9)) goto tmp3_end;
_ty = tmpMeta6;
_dim = tmpMeta8;
_int_dim = omc_Expression_dimensionSize(threadData, _dim);
_exp = omc_InstUtil_liftRecordBinding(threadData, _ty, _inExp, _inValue ,&_val);
_ety = omc_Types_simplifyType(threadData, _inType);
_expl = omc_List_fill(threadData, _exp, _int_dim);
_vals = omc_List_fill(threadData, _val, _int_dim);
tmpMeta10 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ety, mmc_mk_boolean(1), _expl);
_exp = tmpMeta10;
tmpMeta11 = mmc_mk_cons(mmc_mk_integer(_int_dim), MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta12 = mmc_mk_box3(8, &Values_Value_ARRAY__desc, _vals, tmpMeta11);
_val = tmpMeta12;
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _val;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp13;
tmp13 = omc_Types_isArray(threadData, _inType);
if (0 != tmp13) goto goto_2;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inValue;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outValue = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outValue) { *out_outValue = _outValue; }
return _outExp;
}
DLLExport
modelica_boolean omc_InstUtil_isSubModNamed(threadData_t *threadData, modelica_string _inName, modelica_metatype _inSubMod)
{
modelica_boolean _isNamed;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubMod;
{
modelica_string _submod_name = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_submod_name = tmpMeta6;
tmp1 = (stringEqual(_inName, _submod_name));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isNamed = tmp1;
_return: OMC_LABEL_UNUSED
return _isNamed;
}
modelica_metatype boxptr_InstUtil_isSubModNamed(threadData_t *threadData, modelica_metatype _inName, modelica_metatype _inSubMod)
{
modelica_boolean _isNamed;
modelica_metatype out_isNamed;
_isNamed = omc_InstUtil_isSubModNamed(threadData, _inName, _inSubMod);
out_isNamed = mmc_mk_icon(_isNamed);
return out_isNamed;
}
DLLExport
modelica_metatype omc_InstUtil_getStateSelectFromExpOption(threadData_t *threadData, modelica_metatype _inExpExpOption)
{
modelica_metatype _outDAEStateSelectOption = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExpExpOption;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (11 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT174), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (5 != MMC_STRLEN(tmpMeta10) || strcmp(MMC_STRINGDATA(_OMC_LIT175), MMC_STRINGDATA(tmpMeta10)) != 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT165;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,5,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (11 != MMC_STRLEN(tmpMeta13) || strcmp(MMC_STRINGDATA(_OMC_LIT174), MMC_STRINGDATA(tmpMeta13)) != 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (5 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT176), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT167;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,5,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
if (11 != MMC_STRLEN(tmpMeta18) || strcmp(MMC_STRINGDATA(_OMC_LIT174), MMC_STRINGDATA(tmpMeta18)) != 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (7 != MMC_STRLEN(tmpMeta20) || strcmp(MMC_STRINGDATA(_OMC_LIT177), MMC_STRINGDATA(tmpMeta20)) != 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT169;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,5,2) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,0,2) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
if (11 != MMC_STRLEN(tmpMeta23) || strcmp(MMC_STRINGDATA(_OMC_LIT174), MMC_STRINGDATA(tmpMeta23)) != 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,1,1) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
if (6 != MMC_STRLEN(tmpMeta25) || strcmp(MMC_STRINGDATA(_OMC_LIT178), MMC_STRINGDATA(tmpMeta25)) != 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT171;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,5,2) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,0,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 2));
if (11 != MMC_STRLEN(tmpMeta28) || strcmp(MMC_STRINGDATA(_OMC_LIT174), MMC_STRINGDATA(tmpMeta28)) != 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,1,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
if (6 != MMC_STRLEN(tmpMeta30) || strcmp(MMC_STRINGDATA(_OMC_LIT179), MMC_STRINGDATA(tmpMeta30)) != 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT173;
goto tmp3_done;
}
case 5: {
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDAEStateSelectOption = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDAEStateSelectOption;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkProt(threadData_t *threadData, modelica_metatype _inVisibility, modelica_metatype _inMod, modelica_metatype _inComponentRef, modelica_metatype _info)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;modelica_metatype tmp3_3;
tmp3_1 = _inVisibility;
tmp3_2 = _inMod;
tmp3_3 = _inComponentRef;
{
modelica_metatype _cref = NULL;
modelica_string _str1 = NULL;
modelica_string _str2 = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 4; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,5) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 4));
if (!listEmpty(tmpMeta5)) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 5));
if (!optionNone(tmpMeta6)) goto tmp2_end;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,0) == 0) goto tmp2_end;
_cref = tmp3_3;
_str1 = omc_ComponentReference_printComponentRefStr(threadData, _cref);
_str2 = omc_Mod_prettyPrintMod(threadData, _inMod, ((modelica_integer) 0));
tmpMeta7 = mmc_mk_cons(_str1, mmc_mk_cons(_str2, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT182, tmpMeta7, _info);
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;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getOptPath(threadData_t *threadData, modelica_metatype _inPath)
{
modelica_metatype _outAbsynPathOption = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inPath;
{
modelica_metatype _p = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (0 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT103), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
case 1: {
_p = tmp4_1;
tmpMeta1 = mmc_mk_some(_p);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outAbsynPathOption = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAbsynPathOption;
}
DLLExport
modelica_metatype omc_InstUtil_mktypeWithArrays(threadData_t *threadData, modelica_metatype _inPath, modelica_metatype _inState, modelica_metatype _inTypesVarLst, modelica_metatype _inTypesTypeOption, modelica_metatype _inClass, modelica_metatype _inheritedComment)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;
tmp4_1 = _inPath;
tmp4_2 = _inState;
tmp4_3 = _inTypesVarLst;
tmp4_4 = _inTypesTypeOption;
tmp4_5 = _inClass;
{
modelica_metatype _p = NULL;
modelica_metatype _ci = NULL;
modelica_metatype _st = NULL;
modelica_metatype _v = NULL;
modelica_metatype _vl = NULL;
modelica_metatype _l = NULL;
modelica_metatype _tp = NULL;
modelica_metatype _enumtype = NULL;
modelica_metatype _cl = NULL;
modelica_metatype _bc = NULL;
modelica_metatype _funcattr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 12; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
modelica_boolean tmp8;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_tp = tmpMeta6;
_ci = tmp4_2;
tmp7 = omc_Types_isArray(threadData, _tp);
if (1 != tmp7) goto goto_2;
tmp8 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_ClassInf_isConnector(threadData, _ci);
tmp8 = 1;
goto goto_9;
goto_9:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp8) {goto goto_2;}
tmpMeta1 = _tp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,1) == 0) goto tmp3_end;
_p = tmp4_1;
_v = tmp4_3;
tmp4 += 7;
omc_InstUtil_getOptPath(threadData, _p);
tmpMeta10 = mmc_mk_box2(3, &DAE_Type_T__INTEGER__desc, _v);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,12,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 6;
tmpMeta11 = mmc_mk_box2(4, &DAE_Type_T__REAL__desc, _v);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 5;
tmpMeta12 = mmc_mk_box2(5, &DAE_Type_T__STRING__desc, _v);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,14,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 4;
tmpMeta13 = mmc_mk_box2(6, &DAE_Type_T__BOOL__desc, _v);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,15,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 3;
tmpMeta14 = mmc_mk_box2(7, &DAE_Type_T__CLOCK__desc, _v);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,1) == 0) goto tmp3_end;
_p = tmp4_1;
tmp4 += 2;
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta18 = mmc_mk_box6(8, &DAE_Type_T__ENUMERATION__desc, mmc_mk_none(), _p, tmpMeta15, tmpMeta16, tmpMeta17);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 7: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
_p = tmp4_1;
_vl = tmp4_3;
_cl = tmp4_5;
tmp4 += 1;
_funcattr = omc_InstUtil_getFunctionAttributes(threadData, _cl, _vl, _inheritedComment);
tmpMeta1 = omc_Types_makeFunctionType(threadData, _p, _vl, _funcattr);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,1) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_enumtype = tmpMeta19;
_p = tmp4_1;
tmp4 += 1;
tmpMeta1 = omc_Types_makeEnumerationType(threadData, _p, _enumtype);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta20;
if (!optionNone(tmp4_4)) goto tmp3_end;
_st = tmp4_2;
_l = tmp4_3;
tmp4 += 1;
tmpMeta20 = mmc_mk_box4(12, &DAE_Type_T__COMPLEX__desc, _st, _l, mmc_mk_none());
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc = tmpMeta21;
_st = tmp4_2;
_l = tmp4_3;
tmpMeta22 = mmc_mk_box5(13, &DAE_Type_T__SUBTYPE__BASIC__desc, _st, _l, _bc, mmc_mk_none());
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
case 11: {
fputs(MMC_STRINGDATA(_OMC_LIT183),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 < 12) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_arrayTTypeToClassInfState(threadData_t *threadData, modelica_metatype _arrayType)
{
modelica_metatype _classInfState = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _arrayType;
{
modelica_metatype _t = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT185;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT186;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT187;
goto tmp3_done;
}
case 6: {
tmpMeta1 = _OMC_LIT188;
goto tmp3_done;
}
case 7: {
tmpMeta1 = _OMC_LIT189;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta5;
_arrayType = _t;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_classInfState = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _classInfState;
}
DLLExport
modelica_metatype omc_InstUtil_mktype(threadData_t *threadData, modelica_metatype _inPath, modelica_metatype _inState, modelica_metatype _inTypesVarLst, modelica_metatype _inTypesTypeOption, modelica_metatype _inEqualityConstraint, modelica_metatype _inClass, modelica_metatype _inheritedComment)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;volatile modelica_metatype tmp4_6;
tmp4_1 = _inPath;
tmp4_2 = _inState;
tmp4_3 = _inTypesVarLst;
tmp4_4 = _inTypesTypeOption;
tmp4_5 = _inEqualityConstraint;
tmp4_6 = _inClass;
{
modelica_metatype _p = NULL;
modelica_metatype _v = NULL;
modelica_metatype _vl = NULL;
modelica_metatype _l = NULL;
modelica_metatype _bc2 = NULL;
modelica_metatype _enumtype = NULL;
modelica_metatype _st = NULL;
modelica_metatype _bc = NULL;
modelica_metatype _cl = NULL;
modelica_metatype _arrayType = NULL;
modelica_metatype _resType = NULL;
modelica_metatype _classState = NULL;
modelica_metatype _equalityConstraint = NULL;
modelica_metatype _funcattr = NULL;
modelica_string _pstr = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 19; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 16;
tmpMeta6 = mmc_mk_box2(3, &DAE_Type_T__INTEGER__desc, _v);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,12,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 15;
tmpMeta7 = mmc_mk_box2(4, &DAE_Type_T__REAL__desc, _v);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 14;
tmpMeta8 = mmc_mk_box2(5, &DAE_Type_T__STRING__desc, _v);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,14,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 13;
tmpMeta9 = mmc_mk_box2(6, &DAE_Type_T__BOOL__desc, _v);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,15,1) == 0) goto tmp3_end;
_v = tmp4_3;
tmp4 += 12;
tmpMeta10 = mmc_mk_box2(7, &DAE_Type_T__CLOCK__desc, _v);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,1) == 0) goto tmp3_end;
_p = tmp4_1;
tmp4 += 11;
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta14 = mmc_mk_box6(8, &DAE_Type_T__ENUMERATION__desc, mmc_mk_none(), _p, tmpMeta11, tmpMeta12, tmpMeta13);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
_p = tmp4_1;
_vl = tmp4_3;
_cl = tmp4_6;
tmp4 += 10;
_funcattr = omc_InstUtil_getFunctionAttributes(threadData, _cl, _vl, _inheritedComment);
tmpMeta1 = omc_Types_makeFunctionType(threadData, _p, _vl, _funcattr);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_p = tmpMeta15;
_enumtype = tmpMeta16;
tmp4 += 10;
tmpMeta1 = omc_Types_makeEnumerationType(threadData, _p, _enumtype);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,1) == 0) goto tmp3_end;
if (!optionNone(tmp4_5)) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,6,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
_arrayType = tmpMeta18;
tmp4 += 9;
_classState = omc_InstUtil_arrayTTypeToClassInfState(threadData, _arrayType);
tmpMeta1 = omc_InstUtil_mktype(threadData, _inPath, _classState, _inTypesVarLst, _inTypesTypeOption, _inEqualityConstraint, _inClass, _inheritedComment);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,1) == 0) goto tmp3_end;
if (optionNone(tmp4_5)) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 1));
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,6,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
_arrayType = tmpMeta21;
tmp4 += 8;
_classState = omc_InstUtil_arrayTTypeToClassInfState(threadData, _arrayType);
_resType = omc_InstUtil_mktype(threadData, _inPath, _classState, _inTypesVarLst, _inTypesTypeOption, _inEqualityConstraint, _inClass, _inheritedComment);
tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta23 = mmc_mk_box5(13, &DAE_Type_T__SUBTYPE__BASIC__desc, _inState, tmpMeta22, _resType, _inEqualityConstraint);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,18,1) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc2 = tmpMeta24;
tmp4 += 7;
tmpMeta1 = _bc2;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,20,1) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc2 = tmpMeta25;
tmp4 += 6;
tmpMeta1 = _bc2;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,1) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc2 = tmpMeta26;
tmp4 += 5;
tmpMeta1 = _bc2;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,24,1) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc2 = tmpMeta27;
tmp4 += 4;
tmpMeta1 = _bc2;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,23,1) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc2 = tmpMeta28;
tmp4 += 3;
tmpMeta1 = _bc2;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,22,2) == 0) goto tmp3_end;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc2 = tmpMeta29;
tmpMeta1 = _bc2;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,22,2) == 0) goto tmp3_end;
_p = tmp4_1;
_pstr = omc_AbsynUtil_pathString(threadData, _p, _OMC_LIT63, 1, 0);
_info = omc_SCodeUtil_elementInfo(threadData, _inClass);
tmpMeta30 = mmc_mk_cons(_pstr, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT192, tmpMeta30, _info);
goto goto_2;
goto tmp3_done;
}
case 17: {
modelica_boolean tmp31;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (!optionNone(tmp4_4)) goto tmp3_end;
_st = tmp4_2;
_l = tmp4_3;
_equalityConstraint = tmp4_5;
tmp4 += 1;
tmp31 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmpMeta33 = _st;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,22,2) == 0) goto goto_32;
tmp31 = 1;
goto goto_32;
goto_32:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp31) {goto goto_2;}
tmpMeta34 = mmc_mk_box4(12, &DAE_Type_T__COMPLEX__desc, _st, _l, _equalityConstraint);
tmpMeta1 = tmpMeta34;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta35;
modelica_boolean tmp36;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_bc = tmpMeta35;
_st = tmp4_2;
_l = tmp4_3;
_equalityConstraint = tmp4_5;
tmp36 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmpMeta38 = _st;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,22,2) == 0) goto goto_37;
tmp36 = 1;
goto goto_37;
goto_37:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp36) {goto goto_2;}
tmpMeta39 = mmc_mk_box5(13, &DAE_Type_T__SUBTYPE__BASIC__desc, _st, _l, _bc, _equalityConstraint);
tmpMeta1 = tmpMeta39;
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 < 19) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_InstUtil_makeDaeDirection(threadData_t *threadData, modelica_metatype _inDirection)
{
modelica_metatype _outDirection = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDirection;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT193;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT72;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT194;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDirection = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDirection;
}
DLLExport
modelica_metatype omc_InstUtil_makeDaeVariability(threadData_t *threadData, modelica_metatype _inVariability)
{
modelica_metatype _outVariability = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVariability;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT195;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT196;
goto tmp3_done;
}
case 6: {
tmpMeta1 = _OMC_LIT197;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT198;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVariability = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVariability;
}
DLLExport
modelica_metatype omc_InstUtil_makeDaeProt(threadData_t *threadData, modelica_metatype _visibility)
{
modelica_metatype _res = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _visibility;
{
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,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT199;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT200;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _res;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_assertExtArgOutputIsCrefVariable(threadData_t *threadData, modelica_metatype _lang, modelica_metatype _arg, modelica_metatype _ty, modelica_metatype _c, modelica_metatype _info)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;modelica_metatype tmp3_3;modelica_metatype tmp3_4;
tmp3_1 = _lang;
tmp3_2 = _arg;
tmp3_3 = _ty;
tmp3_4 = _c;
{
modelica_string _str = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 5; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
if (optionNone(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 1));
if (7 != MMC_STRLEN(tmpMeta5) || strcmp(MMC_STRINGDATA(_OMC_LIT210), MMC_STRINGDATA(tmpMeta5)) != 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_3,6,2) == 0) goto tmp2_end;
_str = omc_Types_unparseType(threadData, _ty);
tmpMeta6 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT203, tmpMeta6, _info);
goto goto_1;
goto tmp2_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,3) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_4,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_4,2,0) == 0) goto tmp2_end;
_str = omc_DAEDump_dumpExtArgStr(threadData, _arg);
tmpMeta7 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT206, tmpMeta7, _info);
goto goto_1;
goto tmp2_done;
}
case 4: {
modelica_metatype tmpMeta8;
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Error_addSourceMessage(threadData, _OMC_LIT209, tmpMeta8, _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;
}
DLLExport
modelica_metatype omc_InstUtil_instExtGetRettype(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExternalDecl, modelica_boolean _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExtArg)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outExtArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_boolean tmp4_4;volatile modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inExternalDecl;
tmp4_4 = _inBoolean;
tmp4_5 = _inPrefix;
{
modelica_metatype _exp = NULL;
modelica_metatype _prop = NULL;
modelica_metatype _extarg = NULL;
modelica_metatype _env = NULL;
modelica_metatype _lang = NULL;
modelica_metatype _cref = NULL;
modelica_boolean _impl;
modelica_metatype _cache = NULL;
modelica_metatype _pre = NULL;
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: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
if (!optionNone(tmpMeta6)) goto tmp3_end;
_cache = tmp4_1;
tmp4 += 1;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _OMC_LIT211;
goto tmp3_done;
}
case 1: {
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;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
_lang = tmpMeta7;
_cref = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
_impl = tmp4_4;
_pre = tmp4_5;
tmpMeta14 = omc_Static_elabCref(threadData, _cache, _env, _cref, _impl, 0, _pre, _info, &tmpMeta10);
_cache = tmpMeta14;
if (optionNone(tmpMeta10)) goto goto_2;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_exp = tmpMeta12;
_prop = tmpMeta13;
tmpMeta17 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, _cref);
tmpMeta18 = omc_InstUtil_instExtGetFargsSingle(threadData, _cache, _env, tmpMeta17, _exp, _prop, _lang, _info, &tmpMeta15);
_cache = tmpMeta18;
if (optionNone(tmpMeta15)) goto goto_2;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 1));
_extarg = tmpMeta16;
omc_InstUtil_assertExtArgOutputIsCrefVariable(threadData, _lang, _extarg, omc_Types_getPropType(threadData, _prop), omc_Types_propAllConst(threadData, _prop), _info);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _extarg;
goto tmp3_done;
}
case 2: {
modelica_boolean tmp19;
tmp19 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp19) goto goto_2;
omc_Debug_traceln(threadData, _OMC_LIT216);
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:;
}
}
_outCache = tmpMeta[0+0];
_outExtArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outExtArg) { *out_outExtArg = _outExtArg; }
return _outCache;
}
modelica_metatype boxptr_InstUtil_instExtGetRettype(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExternalDecl, modelica_metatype _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExtArg)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
_outCache = omc_InstUtil_instExtGetRettype(threadData, _inCache, _inEnv, _inExternalDecl, tmp1, _inPrefix, _info, out_outExtArg);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_instExtGetFargsSingle(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _absynExp, modelica_metatype _inExp, modelica_metatype _inProperties, modelica_metatype _lang, modelica_metatype _info, modelica_metatype *out_outExtArg)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outExtArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;volatile modelica_metatype tmp4_6;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _absynExp;
tmp4_4 = _inExp;
tmp4_5 = _inProperties;
tmp4_6 = _lang;
{
modelica_metatype _attr = NULL;
modelica_metatype _fattr = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _varty = NULL;
modelica_metatype _env = NULL;
modelica_metatype _cref = NULL;
modelica_metatype _fcr = NULL;
modelica_string _crefstr = NULL;
modelica_string _scope = NULL;
modelica_metatype _dim = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _cache = NULL;
modelica_string _str = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,4) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,2,0) == 0) goto tmp3_end;
_cref = tmpMeta6;
tmp4 += 1;
_cache = omc_Lookup_lookupVarLocal(threadData, _inCache, _inEnv, _cref ,NULL ,&_ty ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL);
_fcr = omc_ComponentReference_crefFirstCref(threadData, _cref);
_cache = omc_Lookup_lookupVarLocal(threadData, _cache, _inEnv, _fcr ,&_fattr ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL);
tmpMeta8 = mmc_mk_box4(3, &DAE_ExtArg_EXTARG__desc, _cref, omc_DAEUtil_getAttrDirection(threadData, _fattr), _ty);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta8);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,3) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,0) == 0) goto tmp3_end;
_cref = tmpMeta9;
_cache = omc_Lookup_lookupVarLocal(threadData, _inCache, _inEnv, _cref ,&_attr ,&_ty ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL);
tmpMeta11 = mmc_mk_box4(3, &DAE_ExtArg_EXTARG__desc, _cref, omc_DAEUtil_getAttrDirection(threadData, _attr), _ty);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta11);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
_cref = tmpMeta12;
_cache = tmp4_1;
_env = tmp4_2;
tmp4 += 1;
tmp13 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupVarLocal(threadData, _cache, _env, _cref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
tmp13 = 1;
goto goto_14;
goto_14:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp13) {goto goto_2;}
_crefstr = omc_ComponentReference_printComponentRefStr(threadData, _cref);
_scope = omc_FGraph_printGraphPathStr(threadData, _env);
tmpMeta15 = mmc_mk_cons(_crefstr, mmc_mk_cons(_scope, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addMessage(threadData, _OMC_LIT219, tmpMeta15);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_none();
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,24,2) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,6,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 3));
if (optionNone(tmpMeta18)) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 1));
_cref = tmpMeta17;
_dim = tmpMeta19;
_cache = tmp4_1;
_env = tmp4_2;
_cache = omc_Lookup_lookupVarLocal(threadData, _cache, _env, _cref ,NULL ,&_varty ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL);
tmpMeta20 = mmc_mk_box4(5, &DAE_ExtArg_EXTARGSIZE__desc, _cref, _varty, _dim);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta20);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,0,0) == 0) goto tmp3_end;
_ty = tmpMeta21;
_cache = tmp4_1;
_env = tmp4_2;
_cache = omc_Ceval_cevalIfConstant(threadData, _cache, _env, _inExp, _inProperties, 0, _info ,&_exp, NULL);
tmp23 = omc_Expression_isScalarConst(threadData, _exp);
if (1 != tmp23) goto goto_2;
tmpMeta24 = mmc_mk_box3(4, &DAE_ExtArg_EXTARGEXP__desc, _exp, _ty);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta24);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
if (optionNone(tmp4_6)) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_6), 1));
if (7 != MMC_STRLEN(tmpMeta26) || strcmp(MMC_STRINGDATA(_OMC_LIT210), MMC_STRINGDATA(tmpMeta26)) != 0) goto tmp3_end;
_ty = tmpMeta25;
_cache = tmp4_1;
tmpMeta27 = mmc_mk_box3(4, &DAE_ExtArg_EXTARGEXP__desc, _inExp, _ty);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta27);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_integer tmp31;
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,13,3) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 4));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 4));
tmp31 = mmc_unbox_integer(tmpMeta30);
if (1 != tmp31) goto tmp3_end;
_ty = tmpMeta28;
_cache = tmp4_1;
tmpMeta32 = mmc_mk_box3(4, &DAE_ExtArg_EXTARGEXP__desc, _inExp, _ty);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta32);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,2,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
_ty = tmpMeta33;
_cache = tmp4_1;
tmpMeta34 = mmc_mk_box3(4, &DAE_ExtArg_EXTARGEXP__desc, _inExp, _ty);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta34);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,2) == 0) goto tmp3_end;
_cache = tmp4_1;
_exp = tmp4_4;
_str = omc_ExpressionDump_printExpStr(threadData, _exp);
tmpMeta35 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT222, tmpMeta35, _info);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_none();
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 < 9) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outExtArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outExtArg) { *out_outExtArg = _outExtArg; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_instExtGetFargs2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _absynExps, modelica_metatype _inExpExpLst, modelica_metatype _inTypesPropertiesLst, modelica_metatype _lang, modelica_metatype _info, modelica_metatype *out_outDAEExtArgLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDAEExtArgLst = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _absynExps;
tmp4_4 = _inExpExpLst;
tmp4_5 = _inTypesPropertiesLst;
{
modelica_metatype _extargs = NULL;
modelica_metatype _extarg = NULL;
modelica_metatype _env = NULL;
modelica_metatype _e = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _p = NULL;
modelica_metatype _props = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _ae = NULL;
modelica_metatype _aes = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_4)) goto tmp3_end;
_cache = tmp4_1;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta6;
goto tmp3_done;
}
case 1: {
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;
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_3);
tmpMeta8 = MMC_CDR(tmp4_3);
if (listEmpty(tmp4_4)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_4);
tmpMeta10 = MMC_CDR(tmp4_4);
if (listEmpty(tmp4_5)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_5);
tmpMeta12 = MMC_CDR(tmp4_5);
_ae = tmpMeta7;
_aes = tmpMeta8;
_e = tmpMeta9;
_exps = tmpMeta10;
_p = tmpMeta11;
_props = tmpMeta12;
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta15 = omc_InstUtil_instExtGetFargsSingle(threadData, _cache, _env, _ae, _e, _p, _lang, _info, &tmpMeta13);
_cache = tmpMeta15;
if (optionNone(tmpMeta13)) goto goto_2;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
_extarg = tmpMeta14;
_cache = omc_InstUtil_instExtGetFargs2(threadData, _cache, _env, _aes, _exps, _props, _lang, _info ,&_extargs);
tmpMeta16 = mmc_mk_cons(_extarg, _extargs);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta16;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_outDAEExtArgLst = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outDAEExtArgLst) { *out_outDAEExtArgLst = _outDAEExtArgLst; }
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_instExtGetFargs(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExternalDecl, modelica_boolean _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outDAEExtArgLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDAEExtArgLst = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_boolean tmp4_4;volatile modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inExternalDecl;
tmp4_4 = _inBoolean;
tmp4_5 = _inPrefix;
{
modelica_metatype _exps = NULL;
modelica_metatype _props = NULL;
modelica_metatype _env = NULL;
modelica_metatype _lang = NULL;
modelica_metatype _absexps = NULL;
modelica_boolean _impl;
modelica_metatype _cache = NULL;
modelica_metatype _pre = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
_cache = tmp4_1;
_env = tmp4_2;
_lang = tmpMeta6;
_absexps = tmpMeta7;
_impl = tmp4_4;
_pre = tmp4_5;
_cache = omc_InstUtil_elabExpListExt(threadData, _cache, _env, _absexps, _impl, _pre, _info ,&_exps ,&_props);
tmpMeta[0+0] = omc_InstUtil_instExtGetFargs2(threadData, _cache, _env, _absexps, _exps, _props, _lang, _info, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
modelica_boolean tmp8;
tmp8 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp8) goto goto_2;
omc_Debug_traceln(threadData, _OMC_LIT223);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outDAEExtArgLst = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outDAEExtArgLst) { *out_outDAEExtArgLst = _outDAEExtArgLst; }
return _outCache;
}
modelica_metatype boxptr_InstUtil_instExtGetFargs(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExternalDecl, modelica_metatype _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outDAEExtArgLst)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
_outCache = omc_InstUtil_instExtGetFargs(threadData, _inCache, _inEnv, _inExternalDecl, tmp1, _inPrefix, _info, out_outDAEExtArgLst);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabExpExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExp, modelica_boolean _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outProperties)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outExp = NULL;
modelica_metatype _outProperties = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_boolean tmp4_4;volatile modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inExp;
tmp4_4 = _inBoolean;
tmp4_5 = _inPrefix;
{
modelica_metatype _dimp = NULL;
modelica_metatype _arraycrefe = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _e = NULL;
modelica_metatype _arraycrprop = NULL;
modelica_metatype _prop = NULL;
modelica_metatype _env = NULL;
modelica_metatype _arraycr = NULL;
modelica_metatype _dim = NULL;
modelica_boolean _impl;
modelica_metatype _cache = NULL;
modelica_metatype _absynExp = NULL;
modelica_metatype _pre = NULL;
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: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,11,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (4 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT228), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (listEmpty(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmpMeta11);
tmpMeta13 = MMC_CDR(tmpMeta11);
if (!listEmpty(tmpMeta13)) goto tmp3_end;
_arraycr = tmpMeta10;
_dim = tmpMeta12;
_cache = tmp4_1;
_env = tmp4_2;
_impl = tmp4_4;
_pre = tmp4_5;
tmpMeta16 = omc_Static_elabExp(threadData, _cache, _env, _dim, _impl, 0, _pre, _info, &tmpMeta14, &tmpMeta15);
_cache = tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,0,2) == 0) goto goto_2;
_dimp = tmpMeta14;
_prop = tmpMeta15;
_cache = omc_Ceval_cevalIfConstant(threadData, _cache, _env, _dimp, _prop, _impl, _info ,&_dimp ,&_prop);
_cache = omc_Static_elabExp(threadData, _cache, _env, _arraycr, _impl, 0, _pre, _info ,&_arraycrefe ,&_arraycrprop);
_cache = omc_Ceval_cevalIfConstant(threadData, _cache, _env, _arraycrefe, _arraycrprop, _impl, _info ,&_arraycrefe ,&_arraycrprop);
tmpMeta17 = mmc_mk_box3(27, &DAE_Exp_SIZE__desc, _arraycrefe, mmc_mk_some(_dimp));
_exp = tmpMeta17;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _exp;
tmpMeta[0+2] = _OMC_LIT226;
goto tmp3_done;
}
case 1: {
_cache = tmp4_1;
_env = tmp4_2;
_absynExp = tmp4_3;
_impl = tmp4_4;
_pre = tmp4_5;
_cache = omc_Static_elabExp(threadData, _cache, _env, _absynExp, _impl, 0, _pre, _info ,&_e ,&_prop);
tmpMeta[0+0] = omc_Ceval_cevalIfConstant(threadData, _cache, _env, _e, _prop, _impl, _info, &tmpMeta[0+1], &tmpMeta[0+2]);
goto tmp3_done;
}
case 2: {
modelica_boolean tmp18;
tmp18 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp18) goto goto_2;
omc_Debug_traceln(threadData, _OMC_LIT227);
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:;
}
}
_outCache = tmpMeta[0+0];
_outExp = tmpMeta[0+1];
_outProperties = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outExp) { *out_outExp = _outExp; }
if (out_outProperties) { *out_outProperties = _outProperties; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_elabExpExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inExp, modelica_metatype _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outProperties)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
_outCache = omc_InstUtil_elabExpExt(threadData, _inCache, _inEnv, _inExp, tmp1, _inPrefix, _info, out_outExp, out_outProperties);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabExpListExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inAbsynExpLst, modelica_boolean _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExpExpLst, modelica_metatype *out_outTypesPropertiesLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outExpExpLst = NULL;
modelica_metatype _outTypesPropertiesLst = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_boolean tmp4_4;modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inAbsynExpLst;
tmp4_4 = _inBoolean;
tmp4_5 = _inPrefix;
{
modelica_boolean _impl;
modelica_metatype _exp = NULL;
modelica_metatype _p = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _props = NULL;
modelica_metatype _env = NULL;
modelica_metatype _e = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _pre = NULL;
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 (!listEmpty(tmp4_3)) goto tmp3_end;
_cache = tmp4_1;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta6;
tmpMeta[0+2] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_3);
tmpMeta9 = MMC_CDR(tmp4_3);
_e = tmpMeta8;
_rest = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
_impl = tmp4_4;
_pre = tmp4_5;
_cache = omc_InstUtil_elabExpExt(threadData, _cache, _env, _e, _impl, _pre, _info ,&_exp ,&_p);
_cache = omc_InstUtil_elabExpListExt(threadData, _cache, _env, _rest, _impl, _pre, _info ,&_exps ,&_props);
tmpMeta10 = mmc_mk_cons(_exp, _exps);
tmpMeta11 = mmc_mk_cons(_p, _props);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta10;
tmpMeta[0+2] = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_outExpExpLst = tmpMeta[0+1];
_outTypesPropertiesLst = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outExpExpLst) { *out_outExpExpLst = _outExpExpLst; }
if (out_outTypesPropertiesLst) { *out_outTypesPropertiesLst = _outTypesPropertiesLst; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_elabExpListExt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inAbsynExpLst, modelica_metatype _inBoolean, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExpExpLst, modelica_metatype *out_outTypesPropertiesLst)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
_outCache = omc_InstUtil_elabExpListExt(threadData, _inCache, _inEnv, _inAbsynExpLst, tmp1, _inPrefix, _info, out_outExpExpLst, out_outTypesPropertiesLst);
return _outCache;
}
DLLExport
modelica_string omc_InstUtil_instExtGetLang(threadData_t *threadData, modelica_metatype _inExternalDecl)
{
modelica_string _outString = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExternalDecl;
{
modelica_string _lang = NULL;
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_lang = tmpMeta7;
tmp1 = _lang;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta8)) goto tmp3_end;
tmp1 = _OMC_LIT229;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outString = tmp1;
_return: OMC_LABEL_UNUSED
return _outString;
}
DLLExport
modelica_metatype omc_InstUtil_instExtGetAnnotation(threadData_t *threadData, modelica_metatype _inExternalDecl)
{
modelica_metatype _outAnnotation = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExternalDecl;
{
modelica_metatype _ann = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_ann = tmpMeta6;
tmpMeta1 = _ann;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outAnnotation = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAnnotation;
}
DLLExport
modelica_string omc_InstUtil_instExtGetFname(threadData_t *threadData, modelica_metatype _inExternalDecl, modelica_string _inIdent)
{
modelica_string _outIdent = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_string tmp4_2;
tmp4_1 = _inExternalDecl;
tmp4_2 = _inIdent;
{
modelica_string _id = NULL;
modelica_string _fid = NULL;
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_id = tmpMeta7;
tmp1 = _id;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (!optionNone(tmpMeta8)) goto tmp3_end;
_fid = tmp4_2;
tmp1 = _fid;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIdent = tmp1;
_return: OMC_LABEL_UNUSED
return _outIdent;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isInputVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
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,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isInputVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_InstUtil_isInputVar(threadData, _inElement);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isOutputVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
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,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isOutputVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_InstUtil_isOutputVar(threadData, _inElement);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isInoutVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _b;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = (omc_InstUtil_isOutputVar(threadData, _inElement) || omc_InstUtil_isInputVar(threadData, _inElement));
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isInoutVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_InstUtil_isInoutVar(threadData, _inElement);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_InstUtil_isExtExplicitCall(threadData_t *threadData, modelica_metatype _inExternalDecl)
{
modelica_boolean _isExplicit;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExternalDecl;
{
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isExplicit = tmp1;
_return: OMC_LABEL_UNUSED
return _isExplicit;
}
modelica_metatype boxptr_InstUtil_isExtExplicitCall(threadData_t *threadData, modelica_metatype _inExternalDecl)
{
modelica_boolean _isExplicit;
modelica_metatype out_isExplicit;
_isExplicit = omc_InstUtil_isExtExplicitCall(threadData, _inExternalDecl);
out_isExplicit = mmc_mk_icon(_isExplicit);
return out_isExplicit;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_extArgCrefEq(threadData_t *threadData, modelica_metatype _v, modelica_metatype _arg)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _v;
tmp4_2 = _arg;
{
modelica_metatype _cr1 = NULL;
modelica_metatype _cr2 = NULL;
modelica_metatype _exp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_cr1 = tmpMeta6;
_cr2 = tmpMeta7;
_cr2 = omc_ComponentReference_crefFirstCref(threadData, _cr2);
tmp1 = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr1, _cr2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_cr1 = tmpMeta9;
_cr2 = tmpMeta10;
_cr2 = omc_ComponentReference_crefFirstCref(threadData, _cr2);
tmp1 = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr1, _cr2);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_cr1 = tmpMeta11;
_exp = tmpMeta12;
tmp1 = omc_Expression_expHasCref(threadData, _exp, _cr1);
goto tmp3_done;
}
case 4: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_extArgCrefEq(threadData_t *threadData, modelica_metatype _v, modelica_metatype _arg)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_InstUtil_extArgCrefEq(threadData, _v, _arg);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkExternalFunctionOutputAssigned(threadData_t *threadData, modelica_metatype _v, modelica_metatype _decl, modelica_string _name)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;
tmp3_1 = _v;
tmp3_2 = _decl;
{
modelica_metatype _arg = NULL;
modelica_metatype _args = NULL;
modelica_metatype _binding = NULL;
modelica_string _str = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _source = NULL;
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,13) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,0) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 8));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 11));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 4));
_cr = tmpMeta5;
_binding = tmpMeta7;
_source = tmpMeta8;
_args = tmpMeta9;
_arg = tmpMeta10;
tmpMeta11 = mmc_mk_cons(_arg, _args);
if((!(omc_List_isMemberOnTrue(threadData, _v, tmpMeta11, boxvar_InstUtil_extArgCrefEq) || isSome(_binding))))
{
_str = omc_ComponentReference_printComponentRefStr(threadData, _cr);
tmpMeta12 = mmc_mk_cons(_str, mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT232, tmpMeta12, omc_ElementSource_getElementSourceFileInfo(threadData, _source));
goto goto_1;
}
goto tmp2_done;
}
case 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;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkExternalDeclArgs(threadData_t *threadData, modelica_metatype _v, modelica_metatype _args)
{
modelica_boolean _notfound;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_notfound = (!omc_List_isMemberOnTrue(threadData, _v, _args, boxvar_InstUtil_extArgCrefEq));
_return: OMC_LABEL_UNUSED
return _notfound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkExternalDeclArgs(threadData_t *threadData, modelica_metatype _v, modelica_metatype _args)
{
modelica_boolean _notfound;
modelica_metatype out_notfound;
_notfound = omc_InstUtil_checkExternalDeclArgs(threadData, _v, _args);
out_notfound = mmc_mk_icon(_notfound);
return out_notfound;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkVarBindingInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _el)
{
modelica_boolean _found;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _v;
tmp4_2 = _el;
{
modelica_metatype _exp = NULL;
modelica_metatype _cr = NULL;
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,0,13) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,13) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
_cr = tmpMeta7;
_exp = tmpMeta9;
tmp1 = omc_Expression_expHasCref(threadData, _exp, _cr);
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_found = tmp1;
_return: OMC_LABEL_UNUSED
return _found;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkVarBindingInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _el)
{
modelica_boolean _found;
modelica_metatype out_found;
_found = omc_InstUtil_checkVarBindingInputUsed(threadData, _v, _el);
out_found = mmc_mk_icon(_found);
return out_found;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkVarBindingsInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _els)
{
modelica_boolean _notfound;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_notfound = (!omc_List_isMemberOnTrue(threadData, _v, _els, boxvar_InstUtil_checkVarBindingInputUsed));
_return: OMC_LABEL_UNUSED
return _notfound;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkVarBindingsInputUsed(threadData_t *threadData, modelica_metatype _v, modelica_metatype _els)
{
modelica_boolean _notfound;
modelica_metatype out_notfound;
_notfound = omc_InstUtil_checkVarBindingsInputUsed(threadData, _v, _els);
out_notfound = mmc_mk_icon(_notfound);
return out_notfound;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkExpInputUsed3(threadData_t *threadData, modelica_metatype _el, modelica_metatype _cr2)
{
modelica_boolean _noteq;
modelica_metatype _cr1 = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _el;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,13) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_cr1 = tmpMeta2;
_noteq = (!omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr1, _cr2));
_return: OMC_LABEL_UNUSED
return _noteq;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkExpInputUsed3(threadData_t *threadData, modelica_metatype _el, modelica_metatype _cr2)
{
modelica_boolean _noteq;
modelica_metatype out_noteq;
_noteq = omc_InstUtil_checkExpInputUsed3(threadData, _el, _cr2);
out_noteq = mmc_mk_icon(_noteq);
return out_noteq;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkExpInputUsed(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inEls, modelica_metatype *out_els)
{
modelica_metatype _exp = NULL;
modelica_metatype _els = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inEls;
{
modelica_metatype _cr = NULL;
modelica_metatype _path = NULL;
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: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmp4_1;
_cr = tmpMeta6;
_els = tmp4_2;
tmp4 += 1;
_els = omc_List_select1(threadData, _els, boxvar_InstUtil_checkExpInputUsed3, _cr);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _els;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmp4_1;
_path = tmpMeta7;
_els = tmp4_2;
tmp8 = omc_Config_acceptMetaModelicaGrammar(threadData);
if (1 != tmp8) goto goto_2;
_cr = omc_ComponentReference_pathToCref(threadData, _path);
_els = omc_List_select1(threadData, _els, boxvar_InstUtil_checkExpInputUsed3, _cr);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _els;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inEls;
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:;
}
}
_exp = tmpMeta[0+0];
_els = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_els) { *out_els = _els; }
return _exp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_checkExternalDeclInputUsed(threadData_t *threadData, modelica_metatype _inames, modelica_metatype _decl)
{
modelica_metatype _onames = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inames;
tmp4_2 = _decl;
{
modelica_metatype _args = NULL;
modelica_metatype _arg = NULL;
modelica_metatype _names = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_2)) goto tmp3_end;
_names = tmp4_1;
tmpMeta1 = _names;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
_args = tmpMeta8;
_arg = tmpMeta9;
_names = tmp4_1;
tmpMeta10 = mmc_mk_cons(_arg, _args);
tmpMeta1 = omc_List_select1(threadData, _names, boxvar_InstUtil_checkExternalDeclArgs, tmpMeta10);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_onames = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _onames;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_warnUnusedFunctionVar(threadData_t *threadData, modelica_metatype _v, modelica_string _name)
{
modelica_metatype _cr = NULL;
modelica_metatype _source = NULL;
modelica_string _str = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _v;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,13) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
_cr = tmpMeta2;
_source = tmpMeta3;
_str = omc_ComponentReference_printComponentRefStr(threadData, _cr);
tmpMeta4 = mmc_mk_cons(_str, mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT236, tmpMeta4, omc_ElementSource_getElementSourceFileInfo(threadData, _source));
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
modelica_boolean omc_InstUtil_checkInputUsedAnnotation(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _result;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_metatype _cmt = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 13));
_cmt = tmpMeta6;
_result = omc_SCodeUtil_optCommentHasBooleanNamedAnnotation(threadData, _cmt, _OMC_LIT237);
tmp1 = (!_result);
goto tmp3_done;
}
case 1: {
tmp1 = 1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_result = tmp1;
_return: OMC_LABEL_UNUSED
return _result;
}
modelica_metatype boxptr_InstUtil_checkInputUsedAnnotation(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _result;
modelica_metatype out_result;
_result = omc_InstUtil_checkInputUsedAnnotation(threadData, _inElement);
out_result = mmc_mk_icon(_result);
return out_result;
}
DLLExport
void omc_InstUtil_checkFunctionInputUsed(threadData_t *threadData, modelica_metatype _elts, modelica_metatype _decl, modelica_string _name)
{
modelica_metatype _invars = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _algs = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_vars = omc_DAEUtil_splitElements(threadData, _elts ,NULL ,NULL ,NULL ,&_algs ,NULL ,NULL ,NULL ,NULL, NULL);
_invars = omc_List_filterOnTrue(threadData, _vars, boxvar_DAEUtil_isInputVar);
_invars = omc_List_select(threadData, _invars, boxvar_InstUtil_checkInputUsedAnnotation);
_invars = omc_InstUtil_checkExternalDeclInputUsed(threadData, _invars, _decl);
_invars = omc_List_select1(threadData, _invars, boxvar_InstUtil_checkVarBindingsInputUsed, _vars);
tmpMeta3 = mmc_mk_box2(0, boxvar_InstUtil_checkExpInputUsed, _invars);
omc_DAEUtil_traverseDAEElementList(threadData, _algs, boxvar_Expression_traverseSubexpressionsHelper, tmpMeta3, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_invars = tmpMeta2;
omc_List_map1__0(threadData, _invars, boxvar_InstUtil_warnUnusedFunctionVar, _name);
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
void omc_InstUtil_checkExternalFunction(threadData_t *threadData, modelica_metatype _els, modelica_metatype _decl, modelica_string _name)
{
modelica_integer _i;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
if((stringEqual((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_decl), 5))), _OMC_LIT210)))
{
goto _return;
}
omc_List_map2__0(threadData, _els, boxvar_InstUtil_checkExternalFunctionOutputAssigned, _decl, _name);
omc_InstUtil_checkFunctionInputUsed(threadData, _els, mmc_mk_some(_decl), _name);
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
modelica_metatype omc_InstUtil_stripFuncOutputsMod(threadData_t *threadData, modelica_metatype _elem)
{
modelica_metatype _stripped_elem = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _elem;
{
modelica_string _id = NULL;
modelica_metatype _inOut = NULL;
modelica_metatype _finPre = NULL;
modelica_metatype _repPre = NULL;
modelica_metatype _vis = NULL;
modelica_metatype _redecl = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _typeSpc = NULL;
modelica_metatype _comm = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _info = NULL;
modelica_metatype _modFinPre = NULL;
modelica_metatype _modEachPre = NULL;
modelica_metatype _modSubML = NULL;
modelica_metatype _e = NULL;
modelica_metatype _modBla = NULL;
modelica_metatype _mod_info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 6));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,0) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,0,5) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 5));
if (optionNone(tmpMeta20)) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 1));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 6));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_id = tmpMeta6;
_vis = tmpMeta8;
_redecl = tmpMeta9;
_finPre = tmpMeta10;
_inOut = tmpMeta11;
_repPre = tmpMeta12;
_attr = tmpMeta13;
_typeSpc = tmpMeta15;
_modFinPre = tmpMeta17;
_modEachPre = tmpMeta18;
_modSubML = tmpMeta19;
_mod_info = tmpMeta22;
_comm = tmpMeta23;
_cond = tmpMeta24;
_info = tmpMeta25;
tmpMeta26 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _modFinPre, _modEachPre, _modSubML, mmc_mk_none(), _mod_info);
_modBla = tmpMeta26;
tmpMeta27 = mmc_mk_box6(3, &SCode_Prefixes_PREFIXES__desc, _vis, _redecl, _finPre, _inOut, _repPre);
tmpMeta28 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, _id, tmpMeta27, _attr, _typeSpc, _modBla, _comm, _cond, _info);
tmpMeta1 = tmpMeta28;
goto tmp3_done;
}
case 1: {
_e = tmp4_1;
tmpMeta1 = _e;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_stripped_elem = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _stripped_elem;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_isInlineFunc2(threadData_t *threadData, modelica_metatype _inSubModList)
{
modelica_metatype _res = NULL;
modelica_boolean _stop;
modelica_metatype tmpMeta1;
modelica_boolean tmp2 = 0;
modelica_metatype tmpMeta49;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_stop = 0;
_res = _OMC_LIT238;
{
modelica_metatype _tp;
for (tmpMeta1 = _inSubModList; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_tp = MMC_CAR(tmpMeta1);
{
modelica_metatype tmp5_1;
tmp5_1 = _tp;
{
volatile mmc_switch_type tmp5;
int tmp6;
tmp5 = 0;
for (; tmp5 < 8; tmp5++) {
switch (MMC_SWITCH_CAST(tmp5)) {
case 0: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (6 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT242), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp4_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,5) == 0) goto tmp4_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 5));
if (optionNone(tmpMeta9)) goto tmp4_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,4,1) == 0) goto tmp4_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
if (1 != tmp12) goto tmp4_end;
_res = _OMC_LIT239;
tmp2 = 0;
goto tmp4_done;
}
case 1: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (6 != MMC_STRLEN(tmpMeta13) || strcmp(MMC_STRINGDATA(_OMC_LIT242), MMC_STRINGDATA(tmpMeta13)) != 0) goto tmp4_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,0,5) == 0) goto tmp4_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 5));
if (optionNone(tmpMeta15)) goto tmp4_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,4,1) == 0) goto tmp4_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmp18 = mmc_unbox_integer(tmpMeta17);
if (0 != tmp18) goto tmp4_end;
_res = _OMC_LIT119;
tmp2 = 0;
goto tmp4_done;
}
case 2: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_integer tmp24;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (10 != MMC_STRLEN(tmpMeta19) || strcmp(MMC_STRINGDATA(_OMC_LIT243), MMC_STRINGDATA(tmpMeta19)) != 0) goto tmp4_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,0,5) == 0) goto tmp4_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 5));
if (optionNone(tmpMeta21)) goto tmp4_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,4,1) == 0) goto tmp4_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmp24 = mmc_unbox_integer(tmpMeta23);
if (1 != tmp24) goto tmp4_end;
_res = _OMC_LIT240;
tmp2 = 1;
goto tmp4_done;
}
case 3: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_integer tmp30;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (36 != MMC_STRLEN(tmpMeta25) || strcmp(MMC_STRINGDATA(_OMC_LIT244), MMC_STRINGDATA(tmpMeta25)) != 0) goto tmp4_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,0,5) == 0) goto tmp4_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 5));
if (optionNone(tmpMeta27)) goto tmp4_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,4,1) == 0) goto tmp4_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
tmp30 = mmc_unbox_integer(tmpMeta29);
if (1 != tmp30) goto tmp4_end;
_res = _OMC_LIT240;
tmp2 = 1;
goto tmp4_done;
}
case 4: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_integer tmp36;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (34 != MMC_STRLEN(tmpMeta31) || strcmp(MMC_STRINGDATA(_OMC_LIT245), MMC_STRINGDATA(tmpMeta31)) != 0) goto tmp4_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,0,5) == 0) goto tmp4_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 5));
if (optionNone(tmpMeta33)) goto tmp4_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,4,1) == 0) goto tmp4_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
tmp36 = mmc_unbox_integer(tmpMeta35);
if (1 != tmp36) goto tmp4_end;
_res = _OMC_LIT240;
tmp2 = 1;
goto tmp4_done;
}
case 5: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_integer tmp42;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (25 != MMC_STRLEN(tmpMeta37) || strcmp(MMC_STRINGDATA(_OMC_LIT246), MMC_STRINGDATA(tmpMeta37)) != 0) goto tmp4_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,0,5) == 0) goto tmp4_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 5));
if (optionNone(tmpMeta39)) goto tmp4_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta40,4,1) == 0) goto tmp4_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta40), 2));
tmp42 = mmc_unbox_integer(tmpMeta41);
if (1 != tmp42) goto tmp4_end;
_res = _OMC_LIT240;
tmp2 = 1;
goto tmp4_done;
}
case 6: {
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_integer tmp48;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (26 != MMC_STRLEN(tmpMeta43) || strcmp(MMC_STRINGDATA(_OMC_LIT247), MMC_STRINGDATA(tmpMeta43)) != 0) goto tmp4_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,0,5) == 0) goto tmp4_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta44), 5));
if (optionNone(tmpMeta45)) goto tmp4_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta45), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,4,1) == 0) goto tmp4_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
tmp48 = mmc_unbox_integer(tmpMeta47);
if (1 != tmp48) goto tmp4_end;
_res = _OMC_LIT241;
tmp2 = 1;
goto tmp4_done;
}
case 7: {
tmp2 = 0;
goto tmp4_done;
}
}
goto tmp4_end;
tmp4_end: ;
}
goto goto_3;
goto_3:;
MMC_THROW_INTERNAL();
goto tmp4_done;
tmp4_done:;
}
}
_stop = tmp2;
if(_stop)
{
break;
}
}
}
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_InstUtil_commentIsInlineFunc(threadData_t *threadData, modelica_metatype _cmt)
{
modelica_metatype _outInlineType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _cmt;
{
modelica_metatype _smlst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,5) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
_smlst = tmpMeta9;
tmpMeta1 = omc_InstUtil_isInlineFunc2(threadData, _smlst);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _OMC_LIT238;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outInlineType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outInlineType;
}
DLLExport
modelica_metatype omc_InstUtil_classIsInlineFunc(threadData_t *threadData, modelica_metatype _elt)
{
modelica_metatype _outInlineType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elt;
{
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,2,8) == 0) goto tmp3_end;
tmpMeta1 = omc_InstUtil_commentIsInlineFunc(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_elt), 8))));
goto tmp3_done;
}
case 1: {
tmpMeta1 = _OMC_LIT238;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outInlineType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outInlineType;
}
DLLExport
modelica_metatype omc_InstUtil_setFullyQualifiedTypename(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _path)
{
modelica_metatype _resType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,4) == 0) goto tmp3_end;
_resType = tmp4_1;
tmpMeta6 = MMC_TAGPTR(mmc_alloc_words(6));
memcpy(MMC_UNTAGPTR(tmpMeta6), MMC_UNTAGPTR(_resType), 6*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta6))[5] = _path;
_resType = tmpMeta6;
tmpMeta1 = _resType;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inType;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_resType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _resType;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_getDerivativeOrder(threadData_t *threadData, modelica_metatype _inSubs)
{
modelica_integer _order;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubs;
{
modelica_metatype _subs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_integer tmp13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (5 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT248), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,5) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 5));
if (optionNone(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
tmp13 = mmc_unbox_integer(tmpMeta12);
_order = tmp13;
tmp1 = _order;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
_subs = tmpMeta15;
_inSubs = _subs;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_order = tmp1;
_return: OMC_LABEL_UNUSED
return _order;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getDerivativeOrder(threadData_t *threadData, modelica_metatype _inSubs)
{
modelica_integer _order;
modelica_metatype out_order;
_order = omc_InstUtil_getDerivativeOrder(threadData, _inSubs);
out_order = mmc_mk_icon(_order);
return out_order;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDerivativeSubModsOptDefault(threadData_t *threadData, modelica_metatype _inSubs, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inPrefix)
{
modelica_metatype _defaultDerivative = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inSubs;
{
modelica_metatype _acr = NULL;
modelica_metatype _p = NULL;
modelica_metatype _subs = NULL;
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 (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (10 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT249), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,5) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 5));
if (optionNone(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,2,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_acr = tmpMeta12;
_p = omc_AbsynUtil_crefToPath(threadData, _acr);
omc_Inst_makeFullyQualified(threadData, _inCache, _inEnv, _p ,&_p);
tmpMeta1 = mmc_mk_some(_p);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_1);
tmpMeta14 = MMC_CDR(tmp4_1);
_subs = tmpMeta14;
tmpMeta1 = omc_InstUtil_getDerivativeSubModsOptDefault(threadData, _subs, _inCache, _inEnv, _inPrefix);
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:;
}
}
_defaultDerivative = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _defaultDerivative;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_InstUtil_extractNameAndExp(threadData_t *threadData, modelica_metatype _m, modelica_metatype *out_cond)
{
modelica_string _inputVar = NULL;
modelica_metatype _cond = NULL;
modelica_string tmp1_c0 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _m;
{
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; 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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,5) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_inputVar = tmpMeta6;
_e = tmpMeta10;
tmpMeta11 = mmc_mk_box2(4, &DAE_derivativeCond_NO__DERIVATIVE__desc, _e);
tmp1_c0 = _inputVar;
tmpMeta[0+1] = tmpMeta11;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,5) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 5));
if (!optionNone(tmpMeta14)) goto tmp3_end;
_inputVar = tmpMeta12;
tmp1_c0 = _inputVar;
tmpMeta[0+1] = _OMC_LIT251;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,0,5) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 5));
if (!optionNone(tmpMeta17)) goto tmp3_end;
_inputVar = tmpMeta15;
tmp1_c0 = _inputVar;
tmpMeta[0+1] = _OMC_LIT252;
goto tmp3_done;
}
case 3: {
tmp1_c0 = _OMC_LIT103;
tmpMeta[0+1] = _OMC_LIT252;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_inputVar = tmp1_c0;
_cond = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_cond) { *out_cond = _cond; }
return _inputVar;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_setFunctionInputIndex(threadData_t *threadData, modelica_metatype _inElemDecl, modelica_string _str, modelica_integer _currPos)
{
modelica_integer _index;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inElemDecl;
{
modelica_string _str2 = NULL;
modelica_metatype _elemDecl = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 3;
tmpMeta6 = stringAppend(_OMC_LIT253,_str);
tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT107);
fputs(MMC_STRINGDATA(tmpMeta7),stdout);
goto goto_2;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,8) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,0) == 0) goto tmp3_end;
_str2 = tmpMeta10;
tmp13 = (stringEqual(_str2, _str));
if (1 != tmp13) goto goto_2;
tmp1 = _currPos;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,3,8) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 4));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,0) == 0) goto tmp3_end;
_elemDecl = tmpMeta15;
tmp1 = omc_InstUtil_setFunctionInputIndex(threadData, _elemDecl, _str, ((modelica_integer) 1) + _currPos);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
_elemDecl = tmpMeta19;
tmp1 = omc_InstUtil_setFunctionInputIndex(threadData, _elemDecl, _str, _currPos);
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_index = tmp1;
_return: OMC_LABEL_UNUSED
return _index;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_setFunctionInputIndex(threadData_t *threadData, modelica_metatype _inElemDecl, modelica_metatype _str, modelica_metatype _currPos)
{
modelica_integer tmp1;
modelica_integer _index;
modelica_metatype out_index;
tmp1 = mmc_unbox_integer(_currPos);
_index = omc_InstUtil_setFunctionInputIndex(threadData, _inElemDecl, _str, tmp1);
out_index = mmc_mk_icon(_index);
return out_index;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDeriveCondition(threadData_t *threadData, modelica_metatype _inSubs, modelica_metatype _elemDecl, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info)
{
modelica_metatype _outconds = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inSubs;
{
modelica_metatype _m = NULL;
modelica_metatype _sub = NULL;
modelica_string _name = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _acr = NULL;
modelica_integer _varPos;
modelica_metatype _subs = NULL;
modelica_metatype _cache = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 4;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (12 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT256), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,5) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 5));
if (optionNone(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_acr = tmpMeta13;
_subs = tmpMeta8;
tmp4 += 1;
_name = omc_Dump_printComponentRefStr(threadData, _acr);
_outconds = omc_InstUtil_getDeriveCondition(threadData, _subs, _elemDecl, _inCache, _inEnv, _inIH, _inPrefix, _info);
_varPos = omc_InstUtil_setFunctionInputIndex(threadData, _elemDecl, _name, ((modelica_integer) 1));
tmpMeta15 = mmc_mk_box2(0, mmc_mk_integer(_varPos), _OMC_LIT255);
tmpMeta14 = mmc_mk_cons(tmpMeta15, _outconds);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 2: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmp4_1);
tmpMeta17 = MMC_CDR(tmp4_1);
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (14 != MMC_STRLEN(tmpMeta18) || strcmp(MMC_STRINGDATA(_OMC_LIT258), MMC_STRINGDATA(tmpMeta18)) != 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,5) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 5));
if (optionNone(tmpMeta20)) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,2,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
_acr = tmpMeta22;
_subs = tmpMeta17;
tmp4 += 1;
_name = omc_Dump_printComponentRefStr(threadData, _acr);
_outconds = omc_InstUtil_getDeriveCondition(threadData, _subs, _elemDecl, _inCache, _inEnv, _inIH, _inPrefix, _info);
_varPos = omc_InstUtil_setFunctionInputIndex(threadData, _elemDecl, _name, ((modelica_integer) 1));
tmpMeta24 = mmc_mk_box2(0, mmc_mk_integer(_varPos), _OMC_LIT252);
tmpMeta23 = mmc_mk_cons(tmpMeta24, _outconds);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 3: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta25 = MMC_CAR(tmp4_1);
tmpMeta26 = MMC_CDR(tmp4_1);
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 2));
if (12 != MMC_STRLEN(tmpMeta27) || strcmp(MMC_STRINGDATA(_OMC_LIT256), MMC_STRINGDATA(tmpMeta27)) != 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,0,5) == 0) goto tmp3_end;
_m = tmpMeta28;
_subs = tmpMeta26;
tmpMeta33 = omc_Mod_elabMod(threadData, _inCache, _inEnv, _inIH, _inPrefix, _m, 0, _OMC_LIT257, _info, &tmpMeta29);
_cache = tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,0,5) == 0) goto goto_2;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 4));
if (listEmpty(tmpMeta30)) goto goto_2;
tmpMeta31 = MMC_CAR(tmpMeta30);
tmpMeta32 = MMC_CDR(tmpMeta30);
if (!listEmpty(tmpMeta32)) goto goto_2;
_sub = tmpMeta31;
_name = omc_InstUtil_extractNameAndExp(threadData, _sub ,&_cond);
_outconds = omc_InstUtil_getDeriveCondition(threadData, _subs, _elemDecl, _cache, _inEnv, _inIH, _inPrefix, _info);
_varPos = omc_InstUtil_setFunctionInputIndex(threadData, _elemDecl, _name, ((modelica_integer) 1));
tmpMeta35 = mmc_mk_box2(0, mmc_mk_integer(_varPos), _cond);
tmpMeta34 = mmc_mk_cons(tmpMeta35, _outconds);
tmpMeta1 = tmpMeta34;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta36 = MMC_CAR(tmp4_1);
tmpMeta37 = MMC_CDR(tmp4_1);
_subs = tmpMeta37;
tmpMeta1 = omc_InstUtil_getDeriveCondition(threadData, _subs, _elemDecl, _inCache, _inEnv, _inIH, _inPrefix, _info);
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outconds = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outconds;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDeriveAnnotation3(threadData_t *threadData, modelica_metatype _inSubs, modelica_metatype _elemDecl, modelica_metatype _baseFunc, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info)
{
modelica_metatype _element = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inSubs;
{
modelica_metatype _acr = NULL;
modelica_metatype _deriveFunc = NULL;
modelica_metatype _defaultDerivative = NULL;
modelica_metatype _subs2 = NULL;
modelica_integer _order;
modelica_metatype _conditionRefs = NULL;
modelica_metatype _mapper = NULL;
modelica_metatype _subs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (10 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT249), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,5) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 5));
if (optionNone(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_subs2 = tmpMeta10;
_acr = tmpMeta13;
_subs = tmpMeta7;
_deriveFunc = omc_AbsynUtil_crefToPath(threadData, _acr);
omc_Inst_makeFullyQualified(threadData, _inCache, _inEnv, _deriveFunc ,&_deriveFunc);
_order = omc_InstUtil_getDerivativeOrder(threadData, _subs2);
omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT259);
_conditionRefs = omc_InstUtil_getDeriveCondition(threadData, _subs2, _elemDecl, _inCache, _inEnv, _inIH, _inPrefix, _info);
omc_ErrorExt_rollBack(threadData, _OMC_LIT259);
_conditionRefs = omc_List_sort(threadData, _conditionRefs, boxvar_DAEUtil_derivativeOrder);
_defaultDerivative = omc_InstUtil_getDerivativeSubModsOptDefault(threadData, _subs, _inCache, _inEnv, _inPrefix);
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta15 = mmc_mk_box7(5, &DAE_FunctionDefinition_FUNCTION__DER__MAPPER__desc, _baseFunc, _deriveFunc, mmc_mk_integer(_order), _conditionRefs, _defaultDerivative, tmpMeta14);
_mapper = tmpMeta15;
tmpMeta16 = mmc_mk_cons(_mapper, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta17 = MMC_CAR(tmp4_1);
tmpMeta18 = MMC_CDR(tmp4_1);
_subs = tmpMeta18;
tmpMeta1 = omc_InstUtil_getDeriveAnnotation3(threadData, _subs, _elemDecl, _baseFunc, _inCache, _inEnv, _inIH, _inPrefix, _info);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_element = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _element;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDeriveAnnotation2(threadData_t *threadData, modelica_metatype _ann, modelica_metatype _elemDecl, modelica_metatype _baseFunc, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info)
{
modelica_metatype _element = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ann;
{
modelica_metatype _smlst = NULL;
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,5) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
_smlst = tmpMeta7;
tmpMeta1 = omc_InstUtil_getDeriveAnnotation3(threadData, _smlst, _elemDecl, _baseFunc, _inCache, _inEnv, _inIH, _inPrefix, _info);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_element = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _element;
}
DLLExport
modelica_metatype omc_InstUtil_getDeriveAnnotation(threadData_t *threadData, modelica_metatype _cd, modelica_metatype _cmt, modelica_metatype _baseFunc, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _info)
{
modelica_metatype _element = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _cd;
tmp4_2 = _cmt;
{
modelica_metatype _elemDecl = NULL;
modelica_metatype _ann = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
if (optionNone(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
if (optionNone(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
_elemDecl = tmpMeta6;
_ann = tmpMeta10;
tmpMeta1 = omc_InstUtil_getDeriveAnnotation2(threadData, _ann, _elemDecl, _baseFunc, _inCache, _inEnv, _inIH, _inPrefix, _info);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,8) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (optionNone(tmpMeta12)) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
_elemDecl = tmpMeta11;
_ann = tmpMeta13;
tmpMeta1 = omc_InstUtil_getDeriveAnnotation2(threadData, _ann, _elemDecl, _baseFunc, _inCache, _inEnv, _inIH, _inPrefix, _info);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta14;
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:;
}
}
_element = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _element;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addNameToDerivativeMappingFunctionDefs(threadData_t *threadData, modelica_metatype _inFuncs, modelica_metatype _path)
{
modelica_metatype _outFuncs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar11;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype __omcQ_24tmpVar10;
modelica_integer tmp11;
modelica_metatype _fn_loopVar = 0;
modelica_metatype _fn;
_fn_loopVar = _inFuncs;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar11 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar11;
while(1) {
tmp11 = 1;
if (!listEmpty(_fn_loopVar)) {
_fn = MMC_CAR(_fn_loopVar);
_fn_loopVar = MMC_CDR(_fn_loopVar);
tmp11--;
}
if (tmp11 == 0) {
{
modelica_metatype tmp7_1;
tmp7_1 = _fn;
{
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,2,6) == 0) goto tmp6_end;
tmpMeta10 = mmc_mk_cons(_path, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_fn), 7))));
tmpMeta9 = MMC_TAGPTR(mmc_alloc_words(8));
memcpy(MMC_UNTAGPTR(tmpMeta9), MMC_UNTAGPTR(_fn), 8*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta9))[7] = tmpMeta10;
_fn = tmpMeta9;
tmpMeta4 = _fn;
goto tmp6_done;
}
case 1: {
tmpMeta4 = _fn;
goto tmp6_done;
}
}
goto tmp6_end;
tmp6_end: ;
}
goto goto_5;
goto_5:;
MMC_THROW_INTERNAL();
goto tmp6_done;
tmp6_done:;
}
}__omcQ_24tmpVar10 = tmpMeta4;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar10,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp11 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar11;
}
_outFuncs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outFuncs;
}
DLLExport
modelica_metatype omc_InstUtil_addNameToDerivativeMapping(threadData_t *threadData, modelica_metatype _inElts, modelica_metatype _path)
{
modelica_metatype _outElts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar13;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype __omcQ_24tmpVar12;
modelica_integer tmp10;
modelica_metatype _fn_loopVar = 0;
modelica_metatype _fn;
_fn_loopVar = _inElts;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar13 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar13;
while(1) {
tmp10 = 1;
if (!listEmpty(_fn_loopVar)) {
_fn = MMC_CAR(_fn_loopVar);
_fn_loopVar = MMC_CDR(_fn_loopVar);
tmp10--;
}
if (tmp10 == 0) {
{
modelica_metatype tmp7_1;
tmp7_1 = _fn;
{
volatile mmc_switch_type tmp7;
int tmp8;
tmp7 = 0;
for (; tmp7 < 2; tmp7++) {
switch (MMC_SWITCH_CAST(tmp7)) {
case 0: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp7_1,0,10) == 0) goto tmp6_end;
tmpMeta9 = MMC_TAGPTR(mmc_alloc_words(12));
memcpy(MMC_UNTAGPTR(tmpMeta9), MMC_UNTAGPTR(_fn), 12*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta9))[3] = omc_InstUtil_addNameToDerivativeMappingFunctionDefs(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_fn), 3))), _path);
_fn = tmpMeta9;
tmpMeta4 = _fn;
goto tmp6_done;
}
case 1: {
tmpMeta4 = _fn;
goto tmp6_done;
}
}
goto tmp6_end;
tmp6_end: ;
}
goto goto_5;
goto_5:;
MMC_THROW_INTERNAL();
goto tmp6_done;
tmp6_done:;
}
}__omcQ_24tmpVar12 = tmpMeta4;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar12,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp10 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar13;
}
_outElts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElts;
}
DLLExport
modelica_metatype omc_InstUtil_addFunctionsToDAE(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _funcs, modelica_metatype _inPartialPrefix)
{
modelica_metatype _outCache = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCache;
{
modelica_metatype _cache = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_cache = tmp4_1;
tmpMeta1 = omc_FCore_addDaeFunction(threadData, _cache, _funcs);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabArraydimType2(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inArrayDim, modelica_metatype _inDims)
{
modelica_metatype _outDimensions = NULL;
modelica_metatype _tyDims = NULL;
modelica_metatype _tydim = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
tmp4_1 = _inType;
tmp4_2 = _inArrayDim;
tmp4_3 = _inDims;
{
modelica_metatype _d = NULL;
modelica_metatype _dim = NULL;
modelica_metatype _rest_dims = NULL;
modelica_metatype _t = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; 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 (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_3);
tmpMeta7 = MMC_CDR(tmp4_3);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_dim = tmpMeta6;
_rest_dims = tmpMeta7;
_t = tmpMeta8;
_d = tmpMeta10;
tmp4 += 2;
omc_InstUtil_compatibleArraydim(threadData, _d, _dim);
tmpMeta1 = omc_InstUtil_elabArraydimType2(threadData, _t, _inArrayDim, _rest_dims);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (!listEmpty(tmp4_3)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta13)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmpMeta13);
tmpMeta15 = MMC_CDR(tmpMeta13);
if (!listEmpty(tmpMeta15)) goto tmp3_end;
_t = tmpMeta12;
_d = tmpMeta14;
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = mmc_mk_cons(_d, omc_InstUtil_elabArraydimType2(threadData, _t, listRest(_inArrayDim), tmpMeta17));
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta18;
if (!listEmpty(tmp4_2)) goto tmp3_end;
if (!listEmpty(tmp4_3)) goto tmp3_end;
tmp4 += 1;
tmpMeta18 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_boolean tmp21;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_2);
tmpMeta20 = MMC_CDR(tmp4_2);
tmp21 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp21) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT260);
omc_Debug_traceln(threadData, omc_Types_printTypeStr(threadData, _inType));
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outDimensions = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDimensions;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabArraydimType(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inArrayDim, modelica_metatype _inExp, modelica_metatype _inPath, modelica_metatype _inPrefix, modelica_metatype _inCref, modelica_metatype _inInfo, modelica_metatype _inInstDims)
{
modelica_metatype _outDimensions = NULL;
modelica_metatype _flat_id = NULL;
modelica_string _ad_str = NULL;
modelica_string _ty_str = NULL;
modelica_string _exp_str = NULL;
modelica_string _name_str = NULL;
modelica_metatype tmpMeta1;
modelica_boolean tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmp2 = (modelica_boolean)omc_Config_splitArrays(threadData);
if(tmp2)
{
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = tmpMeta1;
}
else
{
tmpMeta3 = omc_List_flatten(threadData, _inInstDims);
}
_flat_id = tmpMeta3;
{
{
volatile mmc_switch_type tmp6;
int tmp7;
tmp6 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp5_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp6 < 2; tmp6++) {
switch (MMC_SWITCH_CAST(tmp6)) {
case 0: {
modelica_boolean tmp8;
tmp8 = (omc_Types_numberOfDimensions(threadData, _inType) >= listLength(_inArrayDim) + listLength(_flat_id));
if (1 != tmp8) goto goto_4;
_outDimensions = omc_InstUtil_elabArraydimType2(threadData, _inType, _inArrayDim, _flat_id);
goto tmp5_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
tmpMeta9 = stringAppend(omc_AbsynUtil_pathString(threadData, _inPath, _OMC_LIT63, 1, 0),omc_Dump_printArraydimStr(threadData, _inArrayDim));
_ad_str = tmpMeta9;
_ty_str = omc_Types_unparseTypeNoAttr(threadData, _inType);
_exp_str = omc_ExpressionDump_printExpStr(threadData, _inExp);
tmpMeta10 = stringAppend(omc_PrefixUtil_printPrefixStrIgnoreNoPre(threadData, _inPrefix),omc_Dump_printComponentRefStr(threadData, _inCref));
_name_str = tmpMeta10;
tmpMeta11 = mmc_mk_cons(_name_str, mmc_mk_cons(_ad_str, mmc_mk_cons(_exp_str, mmc_mk_cons(_ty_str, MMC_REFSTRUCTLIT(mmc_nil)))));
omc_Error_addSourceMessageAndFail(threadData, _OMC_LIT263, tmpMeta11, _inInfo);
goto tmp5_done;
}
}
goto tmp5_end;
tmp5_end: ;
}
goto goto_4;
tmp5_done:
(void)tmp6;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp5_done2;
goto_4:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp6 < 2) {
goto tmp5_top;
}
MMC_THROW_INTERNAL();
tmp5_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return _outDimensions;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_compatibleArraydim(threadData_t *threadData, modelica_metatype _inDimension1, modelica_metatype _inDimension2)
{
modelica_metatype _outDimension = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inDimension1;
tmp4_2 = _inDimension2;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT264;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,0) == 0) goto tmp3_end;
tmpMeta1 = _inDimension1;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmpMeta1 = _inDimension2;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmpMeta1 = _inDimension1;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta1 = _inDimension2;
goto tmp3_done;
}
case 5: {
modelica_boolean tmp6;
tmp6 = (omc_Expression_dimensionSize(threadData, _inDimension1) == omc_Expression_dimensionSize(threadData, _inDimension2));
if (1 != tmp6) goto goto_2;
tmpMeta1 = _inDimension1;
goto tmp3_done;
}
case 6: {
modelica_boolean tmp7;
tmp7 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp7) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT265);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDimension = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDimension;
}
DLLExport
modelica_metatype omc_InstUtil_elabArraydim(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inComponentRef, modelica_metatype _path, modelica_metatype _inArrayDim, modelica_metatype _inTypesEqModOption, modelica_boolean _inBoolean, modelica_boolean _performVectorization, modelica_boolean _isFunctionInput, modelica_metatype _inPrefix, modelica_metatype _inInfo, modelica_metatype _inInstDims, modelica_metatype *out_outDimensionLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDimensionLst = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;volatile modelica_boolean tmp4_6;volatile modelica_boolean tmp4_7;volatile modelica_boolean tmp4_8;volatile modelica_metatype tmp4_9;volatile modelica_metatype tmp4_10;volatile modelica_metatype tmp4_11;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inComponentRef;
tmp4_4 = _inArrayDim;
tmp4_5 = _inTypesEqModOption;
tmp4_6 = _inBoolean;
tmp4_7 = _performVectorization;
tmp4_8 = _isFunctionInput;
tmp4_9 = _inPrefix;
tmp4_10 = _inInfo;
tmp4_11 = _inInstDims;
{
modelica_metatype _dim1 = NULL;
modelica_metatype _dim2 = NULL;
modelica_metatype _dim3 = NULL;
modelica_metatype _env = NULL;
modelica_metatype _cref = NULL;
modelica_metatype _ad = NULL;
modelica_boolean _impl;
modelica_metatype _e = NULL;
modelica_metatype _e_1 = NULL;
modelica_metatype _t = NULL;
modelica_string _e_str = NULL;
modelica_string _t_str = NULL;
modelica_string _dim_str = NULL;
modelica_metatype _cache = NULL;
modelica_boolean _doVect;
modelica_metatype _prop = NULL;
modelica_metatype _pre = NULL;
modelica_metatype _aexp = NULL;
modelica_metatype _eq = NULL;
modelica_metatype _inst_dims = NULL;
modelica_metatype _info = NULL;
modelica_metatype _info2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_8) goto tmp3_end;
_cache = tmp4_1;
_env = tmp4_2;
_cref = tmp4_3;
_ad = tmp4_4;
_doVect = tmp4_7;
_pre = tmp4_9;
_info = tmp4_10;
tmpMeta[0+0] = omc_Static_elabArrayDims(threadData, _cache, _env, _cref, _ad, 1, _doVect, _pre, _info, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_4)) goto tmp3_end;
_cache = tmp4_1;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta6;
goto tmp3_done;
}
case 2: {
if (!optionNone(tmp4_5)) goto tmp3_end;
_cache = tmp4_1;
_env = tmp4_2;
_cref = tmp4_3;
_ad = tmp4_4;
_impl = tmp4_6;
_doVect = tmp4_7;
_pre = tmp4_9;
_info = tmp4_10;
tmp4 += 3;
tmpMeta[0+0] = omc_Static_elabArrayDims(threadData, _cache, _env, _cref, _ad, _impl, _doVect, _pre, _info, &tmpMeta[0+1]);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (optionNone(tmp4_5)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
_e = tmpMeta8;
_prop = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
_cref = tmp4_3;
_ad = tmp4_4;
_impl = tmp4_6;
_doVect = tmp4_7;
_pre = tmp4_9;
_info = tmp4_10;
_inst_dims = tmp4_11;
tmp4 += 1;
_t = omc_Types_getPropType(threadData, _prop);
_cache = omc_Static_elabArrayDims(threadData, _cache, _env, _cref, _ad, _impl, _doVect, _pre, _info ,&_dim1);
_dim2 = omc_InstUtil_elabArraydimType(threadData, _t, _ad, _e, _path, _pre, _cref, _info, _inst_dims);
_dim3 = omc_List_threadMap(threadData, _dim1, _dim2, boxvar_InstUtil_compatibleArraydim);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _dim3;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (optionNone(tmp4_5)) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_aexp = tmpMeta11;
_cache = tmp4_1;
_env = tmp4_2;
_cref = tmp4_3;
_ad = tmp4_4;
_impl = tmp4_6;
_doVect = tmp4_7;
_pre = tmp4_9;
_info = tmp4_10;
_inst_dims = tmp4_11;
tmp4 += 1;
_cache = omc_Static_elabExp(threadData, _cache, _env, _aexp, _impl, _doVect, _pre, _info ,&_e_1 ,&_prop);
_cache = omc_Ceval_cevalIfConstant(threadData, _cache, _env, _e_1, _prop, _impl, _info ,&_e_1 ,&_prop);
_t = omc_Types_getPropType(threadData, _prop);
_cache = omc_Static_elabArrayDims(threadData, _cache, _env, _cref, _ad, _impl, _doVect, _pre, _info ,&_dim1);
_dim2 = omc_InstUtil_elabArraydimType(threadData, _t, _ad, _e_1, _path, _pre, _cref, _info, _inst_dims);
_dim3 = omc_List_threadMap(threadData, _dim1, _dim2, boxvar_InstUtil_compatibleArraydim);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _dim3;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_boolean tmp18;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (optionNone(tmp4_5)) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,5) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,0,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 6));
_e = tmpMeta13;
_t = tmpMeta15;
_info2 = tmpMeta16;
_cache = tmp4_1;
_env = tmp4_2;
_cref = tmp4_3;
_ad = tmp4_4;
_impl = tmp4_6;
_doVect = tmp4_7;
_pre = tmp4_9;
_info = tmp4_10;
_inst_dims = tmp4_11;
tmp17 = omc_Flags_getConfigBool(threadData, _OMC_LIT271);
if (0 != tmp17) goto goto_2;
omc_Static_elabArrayDims(threadData, _cache, _env, _cref, _ad, _impl, _doVect, _pre, _info ,&_dim1);
_dim2 = omc_InstUtil_elabArraydimType(threadData, _t, _ad, _e, _path, _pre, _cref, _info, _inst_dims);
tmp18 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_List_threadMap(threadData, _dim1, _dim2, boxvar_InstUtil_compatibleArraydim);
tmp18 = 1;
goto goto_19;
goto_19:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp18) {goto goto_2;}
_e_str = omc_ExpressionDump_printExpStr(threadData, _e);
_t_str = omc_Types_unparseType(threadData, _t);
_dim_str = omc_ExpressionDump_dimensionsString(threadData, _dim1);
tmpMeta20 = mmc_mk_cons(_e_str, mmc_mk_cons(_t_str, mmc_mk_cons(_dim_str, MMC_REFSTRUCTLIT(mmc_nil))));
tmpMeta21 = mmc_mk_cons(_info2, mmc_mk_cons(_info, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addMultiSourceMessage(threadData, _OMC_LIT274, tmpMeta20, tmpMeta21);
goto goto_2;
goto tmp3_done;
}
case 6: {
modelica_boolean tmp22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
_cref = tmp4_3;
_ad = tmp4_4;
_eq = tmp4_5;
tmp22 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp22) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT275);
tmpMeta23 = stringAppend(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT63, 1, 0),_OMC_LIT276);
tmpMeta24 = stringAppend(tmpMeta23,omc_Dump_printComponentRefStr(threadData, _cref));
omc_Debug_trace(threadData, tmpMeta24);
tmpMeta25 = stringAppend(omc_Dump_printArraydimStr(threadData, _ad),_OMC_LIT277);
tmpMeta26 = stringAppend(tmpMeta25,omc_Types_unparseOptionEqMod(threadData, _eq));
omc_Debug_traceln(threadData, tmpMeta26);
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 < 7) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outDimensionLst = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outDimensionLst) { *out_outDimensionLst = _outDimensionLst; }
return _outCache;
}
modelica_metatype boxptr_InstUtil_elabArraydim(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inComponentRef, modelica_metatype _path, modelica_metatype _inArrayDim, modelica_metatype _inTypesEqModOption, modelica_metatype _inBoolean, modelica_metatype _performVectorization, modelica_metatype _isFunctionInput, modelica_metatype _inPrefix, modelica_metatype _inInfo, modelica_metatype _inInstDims, modelica_metatype *out_outDimensionLst)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer tmp3;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
tmp2 = mmc_unbox_integer(_performVectorization);
tmp3 = mmc_unbox_integer(_isFunctionInput);
_outCache = omc_InstUtil_elabArraydim(threadData, _inCache, _inEnv, _inComponentRef, _path, _inArrayDim, _inTypesEqModOption, tmp1, tmp2, tmp3, _inPrefix, _inInfo, _inInstDims, out_outDimensionLst);
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_elabArraydimOpt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inComponentRef, modelica_metatype _path, modelica_metatype _inAbsynArrayDimOption, modelica_metatype _inTypesEqModOption, modelica_boolean _inBoolean, modelica_boolean _performVectorization, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype _inInstDims, modelica_metatype *out_outDimensionLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDimensionLst = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_boolean tmp4_6;modelica_boolean tmp4_7;modelica_metatype tmp4_8;modelica_metatype tmp4_9;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inComponentRef;
tmp4_4 = _inAbsynArrayDimOption;
tmp4_5 = _inTypesEqModOption;
tmp4_6 = _inBoolean;
tmp4_7 = _performVectorization;
tmp4_8 = _inPrefix;
tmp4_9 = _inInstDims;
{
modelica_metatype _env = NULL;
modelica_metatype _owncref = NULL;
modelica_metatype _ad = NULL;
modelica_metatype _eq = NULL;
modelica_boolean _impl;
modelica_metatype _cache = NULL;
modelica_boolean _doVect;
modelica_metatype _pre = NULL;
modelica_metatype _inst_dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_4)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 1));
_ad = tmpMeta6;
_cache = tmp4_1;
_env = tmp4_2;
_owncref = tmp4_3;
_eq = tmp4_5;
_impl = tmp4_6;
_doVect = tmp4_7;
_pre = tmp4_8;
_inst_dims = tmp4_9;
tmpMeta[0+0] = omc_InstUtil_elabArraydim(threadData, _cache, _env, _owncref, _path, _ad, _eq, _impl, _doVect, 0, _pre, _info, _inst_dims, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (!optionNone(tmp4_4)) goto tmp3_end;
_cache = tmp4_1;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_outDimensionLst = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outDimensionLst) { *out_outDimensionLst = _outDimensionLst; }
return _outCache;
}
modelica_metatype boxptr_InstUtil_elabArraydimOpt(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inComponentRef, modelica_metatype _path, modelica_metatype _inAbsynArrayDimOption, modelica_metatype _inTypesEqModOption, modelica_metatype _inBoolean, modelica_metatype _performVectorization, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype _inInstDims, modelica_metatype *out_outDimensionLst)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_InstUtil_elabArraydimOpt(threadData, _inCache, _inEnv, _inComponentRef, _path, _inAbsynArrayDimOption, _inTypesEqModOption, tmp1, tmp2, _inPrefix, _info, _inInstDims, out_outDimensionLst);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_elabComponentArraydimFromEnv2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEqMod, modelica_metatype _inEnv, modelica_metatype *out_outDimensionLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDimensionLst = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCache;
tmp4_2 = _inEqMod;
{
modelica_metatype _lst = NULL;
modelica_metatype _lst_1 = NULL;
modelica_metatype _t = NULL;
modelica_metatype _cache = NULL;
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_t = tmpMeta7;
_cache = tmp4_1;
_lst = omc_Types_getDimensionSizes(threadData, _t);
_lst_1 = omc_List_map(threadData, _lst, boxvar_Expression_intDimension);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _lst_1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_outDimensionLst = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outDimensionLst) { *out_outDimensionLst = _outDimensionLst; }
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_elabComponentArraydimFromEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inComponentRef, modelica_metatype _info, modelica_metatype *out_outDimensionLst)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDimensionLst = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inComponentRef;
{
modelica_string _id = NULL;
modelica_metatype _ad = NULL;
modelica_metatype _m = NULL;
modelica_metatype _m_1 = NULL;
modelica_metatype _cmod = NULL;
modelica_metatype _cmod_1 = NULL;
modelica_metatype _m_2 = NULL;
modelica_metatype _mod_2 = NULL;
modelica_metatype _eq = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _env = NULL;
modelica_metatype _cref = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _subs = NULL;
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: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,1,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_id = tmpMeta6;
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta10 = omc_Lookup_lookupIdent(threadData, _cache, _env, _id, NULL, &tmpMeta7, &tmpMeta9, NULL, NULL);
_cache = tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,3,8) == 0) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 6));
_m = tmpMeta8;
_cmod = tmpMeta9;
_cmod_1 = omc_Mod_stripSubmod(threadData, _cmod);
_m_1 = omc_SCodeUtil_stripSubmod(threadData, _m);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta12 = mmc_mk_box2(3, &Mod_ModScope_COMPONENT__desc, _id);
_cache = omc_Mod_elabMod(threadData, _cache, _env, tmpMeta11, _OMC_LIT278, _m_1, 0, tmpMeta12, _info ,&_m_2);
_mod_2 = omc_Mod_merge(threadData, _cmod_1, _m_2, _OMC_LIT103, 1);
tmpMeta13 = omc_Mod_modEquation(threadData, _mod_2);
if (optionNone(tmpMeta13)) goto goto_2;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
_eq = tmpMeta14;
tmpMeta[0+0] = omc_InstUtil_elabComponentArraydimFromEnv2(threadData, _cache, _eq, _env, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,1,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_id = tmpMeta15;
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta19 = omc_Lookup_lookupIdent(threadData, _cache, _env, _id, NULL, &tmpMeta16, NULL, NULL, NULL);
_cache = tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,3,8) == 0) goto goto_2;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
_ad = tmpMeta18;
_cache = omc_Static_elabSubscripts(threadData, _cache, _env, _ad, 1, _OMC_LIT278, _info ,&_subs, NULL);
_dims = omc_Expression_subscriptDimensions(threadData, _subs);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _dims;
goto tmp3_done;
}
case 2: {
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
_cref = tmp4_3;
tmp20 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp20) goto goto_2;
tmpMeta21 = stringAppend(_OMC_LIT279,omc_ComponentReference_printComponentRefStr(threadData, _cref));
omc_Debug_traceln(threadData, tmpMeta21);
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:;
}
}
_outCache = tmpMeta[0+0];
_outDimensionLst = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outDimensionLst) { *out_outDimensionLst = _outDimensionLst; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_attrIsParam(threadData_t *threadData, modelica_metatype _inAttributes)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inAttributes;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_attrIsParam(threadData_t *threadData, modelica_metatype _inAttributes)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_InstUtil_attrIsParam(threadData, _inAttributes);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_absynDirToDaeDir(threadData_t *threadData, modelica_metatype _inDirection)
{
modelica_metatype _outVarDirection = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDirection;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT193;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT72;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT194;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarDirection = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarDirection;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateConnectorType(threadData_t *threadData, modelica_metatype _inVarConnectorType, modelica_metatype _inConnectorType, modelica_metatype _inCref, modelica_metatype _inInfo)
{
modelica_metatype _outVarConnectorType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inVarConnectorType;
tmp4_2 = _inConnectorType;
{
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_string _s3 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarConnectorType;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT280;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT280;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT281;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT281;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
_s1 = omc_SCodeDump_connectorTypeStr(threadData, _inConnectorType);
_s2 = omc_ComponentReference_printComponentRefStr(threadData, _inCref);
_s3 = omc_DAEDump_dumpConnectorType(threadData, _inVarConnectorType);
tmpMeta6 = mmc_mk_cons(_s1, mmc_mk_cons(_OMC_LIT285, mmc_mk_cons(_s2, mmc_mk_cons(_s3, MMC_REFSTRUCTLIT(mmc_nil)))));
omc_Error_addSourceMessage(threadData, _OMC_LIT284, tmpMeta6, _inInfo);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarConnectorType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarConnectorType;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateInnerOuter(threadData_t *threadData, modelica_metatype _inVarInnerOuter, modelica_metatype _inInnerOuter)
{
modelica_metatype _outVarInnerOuter = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inVarInnerOuter;
tmp4_2 = _inInnerOuter;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarInnerOuter;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
tmpMeta1 = _inInnerOuter;
goto tmp3_done;
}
case 2: {
tmpMeta1 = _inVarInnerOuter;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarInnerOuter = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarInnerOuter;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateFinal(threadData_t *threadData, modelica_metatype _inVarAttributes, modelica_metatype _inFinal)
{
modelica_metatype _outVarAttributes = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inFinal;
{
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,0,0) == 0) goto tmp3_end;
tmpMeta1 = omc_DAEUtil_setFinalAttr(threadData, _inVarAttributes, omc_SCodeUtil_finalBool(threadData, _inFinal));
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inVarAttributes;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarAttributes = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarAttributes;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateVariability(threadData_t *threadData, modelica_metatype _inVarKind, modelica_metatype _inVariability)
{
modelica_metatype _outVarKind = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inVarKind;
tmp4_2 = _inVariability;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarKind;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarKind;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT198;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarKind;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT197;
goto tmp3_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarKind;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT196;
goto tmp3_done;
}
case 7: {
tmpMeta1 = _inVarKind;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarKind = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarKind;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateVisibility(threadData_t *threadData, modelica_metatype _inVarVisibility, modelica_metatype _inVisibility)
{
modelica_metatype _outVarVisibility = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVisibility;
{
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,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT199;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inVarVisibility;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarVisibility = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarVisibility;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateParallelism(threadData_t *threadData, modelica_metatype _inVarParallelism, modelica_metatype _inParallelism, modelica_metatype _inCref, modelica_metatype _inInfo)
{
modelica_metatype _outVarParallelism = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inVarParallelism;
tmp4_2 = _inParallelism;
{
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_string _s3 = NULL;
modelica_string _s4 = NULL;
modelica_metatype _daeprl1 = NULL;
modelica_metatype _daeprl2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarParallelism;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmpMeta1 = omc_DAEUtil_scodePrlToDaePrl(threadData, _inParallelism);
goto tmp3_done;
}
case 2: {
modelica_boolean tmp6;
_daeprl1 = tmp4_1;
_daeprl2 = omc_DAEUtil_scodePrlToDaePrl(threadData, _inParallelism);
tmp6 = omc_DAEUtil_daeParallelismEqual(threadData, _daeprl1, _daeprl2);
if (1 != tmp6) goto goto_2;
tmpMeta1 = _daeprl1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
_daeprl2 = omc_DAEUtil_scodePrlToDaePrl(threadData, _inParallelism);
_s1 = omc_DAEDump_dumpVarParallelismStr(threadData, _daeprl2);
_s2 = omc_ComponentReference_printComponentRefStr(threadData, _inCref);
_s3 = omc_DAEDump_dumpVarParallelismStr(threadData, _inVarParallelism);
tmpMeta7 = stringAppend(_OMC_LIT286,_s1);
tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT287);
tmpMeta9 = stringAppend(tmpMeta8,_s2);
tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT288);
tmpMeta11 = stringAppend(tmpMeta10,_s3);
tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT289);
tmpMeta13 = stringAppend(tmpMeta12,_s1);
_s4 = tmpMeta13;
tmpMeta14 = mmc_mk_cons(_s4, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT290, tmpMeta14, _inInfo);
tmpMeta1 = _daeprl2;
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outVarParallelism = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarParallelism;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateDirection(threadData_t *threadData, modelica_metatype _inVarDirection, modelica_metatype _inDirection, modelica_metatype _inCref, modelica_metatype _inInfo)
{
modelica_metatype _outVarDirection = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inVarDirection;
tmp4_2 = _inDirection;
{
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_string _s3 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,0) == 0) goto tmp3_end;
tmpMeta1 = _inVarDirection;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmpMeta1 = omc_InstUtil_absynDirToDaeDir(threadData, _inDirection);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
_s1 = omc_Dump_directionSymbol(threadData, _inDirection);
_s2 = omc_ComponentReference_printComponentRefStr(threadData, _inCref);
_s3 = omc_DAEDump_dumpDirectionStr(threadData, _inVarDirection);
tmpMeta6 = mmc_mk_cons(_s1, mmc_mk_cons(_s2, mmc_mk_cons(_s3, MMC_REFSTRUCTLIT(mmc_nil))));
omc_Error_addSourceMessage(threadData, _OMC_LIT136, tmpMeta6, _inInfo);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVarDirection = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVarDirection;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_propagateAllAttributes(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _inAttributes, modelica_metatype _inPrefixes, modelica_metatype _inInfo)
{
modelica_metatype _outElement = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inElement;
tmp4_2 = _inAttributes;
tmp4_3 = _inPrefixes;
{
modelica_metatype _cr = NULL;
modelica_metatype _vk = NULL;
modelica_metatype _vdir = NULL;
modelica_metatype _vprl = NULL;
modelica_metatype _vvis = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _binding = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _ct1 = NULL;
modelica_metatype _ct2 = NULL;
modelica_metatype _source = NULL;
modelica_metatype _var_attrs = NULL;
modelica_metatype _cmt = NULL;
modelica_metatype _io1 = NULL;
modelica_metatype _io2 = NULL;
modelica_metatype _sprl = NULL;
modelica_metatype _var = NULL;
modelica_metatype _dir = NULL;
modelica_metatype _fp = NULL;
modelica_string _ident = NULL;
modelica_metatype _el = NULL;
modelica_metatype _vis = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; 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;
modelica_metatype tmpMeta12;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,0) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,0) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,0) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,0) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,0) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,0) == 0) goto tmp3_end;
tmpMeta1 = _inElement;
goto tmp3_done;
}
case 1: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 11));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 12));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 13));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 14));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
_cr = tmpMeta13;
_vk = tmpMeta14;
_vdir = tmpMeta15;
_vprl = tmpMeta16;
_vvis = tmpMeta17;
_ty = tmpMeta18;
_binding = tmpMeta19;
_dims = tmpMeta20;
_ct2 = tmpMeta21;
_source = tmpMeta22;
_var_attrs = tmpMeta23;
_cmt = tmpMeta24;
_io2 = tmpMeta25;
_ct1 = tmpMeta26;
_sprl = tmpMeta27;
_var = tmpMeta28;
_dir = tmpMeta29;
_vis = tmpMeta30;
_fp = tmpMeta31;
_io1 = tmpMeta32;
_vdir = omc_InstUtil_propagateDirection(threadData, _vdir, _dir, _cr, _inInfo);
_vk = omc_InstUtil_propagateVariability(threadData, _vk, _var);
_vprl = omc_InstUtil_propagateParallelism(threadData, _vprl, _sprl, _cr, _inInfo);
_vvis = omc_InstUtil_propagateVisibility(threadData, _vvis, _vis);
_var_attrs = omc_InstUtil_propagateFinal(threadData, _var_attrs, _fp);
_io2 = omc_InstUtil_propagateInnerOuter(threadData, _io2, _io1);
_ct2 = omc_InstUtil_propagateConnectorType(threadData, _ct2, _ct1, _cr, _inInfo);
tmpMeta33 = mmc_mk_box14(3, &DAE_Element_VAR__desc, _cr, _vk, _vdir, _vprl, _vvis, _ty, _binding, _dims, _ct2, _source, _var_attrs, _cmt, _io2);
tmpMeta1 = tmpMeta33;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_ident = tmpMeta34;
_el = tmpMeta35;
_source = tmpMeta36;
_cmt = tmpMeta37;
_el = omc_List_map3(threadData, _el, boxvar_InstUtil_propagateAllAttributes, _inAttributes, _inPrefixes, _inInfo);
tmpMeta38 = mmc_mk_box5(21, &DAE_Element_COMP__desc, _ident, _el, _source, _cmt);
tmpMeta1 = tmpMeta38;
goto tmp3_done;
}
case 3: {
tmpMeta1 = _inElement;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outElement = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElement;
}
DLLExport
modelica_metatype omc_InstUtil_propagateAttributes(threadData_t *threadData, modelica_metatype _inDae, modelica_metatype _inAttributes, modelica_metatype _inPrefixes, modelica_metatype _inInfo)
{
modelica_metatype _outDae = NULL;
modelica_metatype _elts = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inDae;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_elts = tmpMeta2;
_elts = omc_List_map3(threadData, _elts, boxvar_InstUtil_propagateAllAttributes, _inAttributes, _inPrefixes, _inInfo);
tmpMeta3 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
_outDae = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outDae;
}
DLLExport
modelica_metatype omc_InstUtil_instWholeDimFromMod(threadData_t *threadData, modelica_metatype _dimensionExp, modelica_metatype _modifier, modelica_string _inVarName, modelica_metatype _inInfo)
{
modelica_metatype _outDimension = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _dimensionExp;
tmp4_2 = _modifier;
{
modelica_metatype _d = NULL;
modelica_metatype _exp = NULL;
modelica_string _exp_str = NULL;
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: {
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,4,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_exp = tmpMeta8;
tmpMeta9 = omc_Expression_expDimensions(threadData, _exp);
if (listEmpty(tmpMeta9)) goto goto_2;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
_d = tmpMeta10;
tmpMeta1 = _d;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,5) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
if (optionNone(tmpMeta12)) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,5) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
_exp = tmpMeta14;
_exp_str = omc_ExpressionDump_printExpStr(threadData, _exp);
tmpMeta15 = mmc_mk_cons(_inVarName, mmc_mk_cons(_exp_str, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT293, tmpMeta15, _inInfo);
goto goto_2;
goto tmp3_done;
}
case 2: {
modelica_boolean tmp16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp16 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp16) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT294);
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:;
}
}
_outDimension = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDimension;
}
DLLExport
modelica_metatype omc_InstUtil_instDimExpNonSplit(threadData_t *threadData, modelica_metatype _inDimension, modelica_boolean _inBoolean)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDimension;
{
modelica_metatype _e = NULL;
modelica_integer _i;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 7: {
tmpMeta1 = _OMC_LIT295;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmpMeta7 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta8 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, tmpMeta7);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp10 = mmc_unbox_integer(tmpMeta9);
_i = tmp10;
tmpMeta11 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta12 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, tmpMeta11);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT297;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta13;
tmpMeta14 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, _e);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscript = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscript;
}
modelica_metatype boxptr_InstUtil_instDimExpNonSplit(threadData_t *threadData, modelica_metatype _inDimension, modelica_metatype _inBoolean)
{
modelica_integer tmp1;
modelica_metatype _outSubscript = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
_outSubscript = omc_InstUtil_instDimExpNonSplit(threadData, _inDimension, tmp1);
return _outSubscript;
}
DLLExport
modelica_metatype omc_InstUtil_evalEnumAndBoolDim(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_metatype _outDimension = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDimension;
{
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,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT298;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inDimension;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDimension = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDimension;
}
DLLExport
modelica_metatype omc_InstUtil_updateClassInfState(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inNewEnv, modelica_metatype _inOldEnv, modelica_metatype _inCIState)
{
modelica_metatype _outCIState = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inCIState;
{
modelica_metatype _ci_state = NULL;
modelica_metatype _rest = NULL;
modelica_string _id = NULL;
modelica_metatype _cls = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
_ci_state = tmp4_1;
tmp6 = omc_FGraph_isTopScope(threadData, _inNewEnv);
if (1 != tmp6) goto goto_2;
tmpMeta1 = _ci_state;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp7;
_ci_state = tmp4_1;
tmp7 = (stringEqual(omc_FGraph_getGraphNameStr(threadData, _inNewEnv), omc_FGraph_getGraphNameStr(threadData, _inOldEnv)));
if (1 != tmp7) goto goto_2;
tmpMeta1 = _ci_state;
goto tmp3_done;
}
case 2: {
modelica_boolean tmp8;
tmp8 = omc_FGraph_isTopScope(threadData, _inNewEnv);
if (0 != tmp8) goto goto_2;
_id = omc_FNode_refName(threadData, omc_FGraph_lastScopeRef(threadData, _inNewEnv));
_rest = omc_FGraph_stripLastScopeRef(threadData, _inNewEnv, NULL);
omc_Lookup_lookupClassIdent(threadData, _inCache, _rest, _id, mmc_mk_none() ,&_cls ,NULL);
tmpMeta1 = omc_ClassInf_start(threadData, omc_SCodeUtil_getClassRestriction(threadData, _cls), omc_FGraph_getGraphName(threadData, _inNewEnv));
goto tmp3_done;
}
case 3: {
tmpMeta1 = _inCIState;
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCIState = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCIState;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addEnumerationLiteralToEnv(threadData_t *threadData, modelica_metatype _inEnum, modelica_metatype _inEnv)
{
modelica_metatype _outEnv = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inEnum;
{
modelica_string _lit = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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,3,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_lit = tmpMeta6;
tmpMeta7 = mmc_mk_box7(3, &DAE_Var_TYPES__VAR__desc, _lit, _OMC_LIT305, _OMC_LIT306, _OMC_LIT307, mmc_mk_boolean(0), mmc_mk_none());
tmpMeta1 = omc_FGraph_mkComponentNode(threadData, _inEnv, tmpMeta7, _inEnum, _OMC_LIT44, _OMC_LIT308, omc_FGraph_empty(threadData));
goto tmp3_done;
}
case 1: {
fputs(MMC_STRINGDATA(_OMC_LIT309),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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outEnv = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outEnv;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addEnumerationLiteralsToEnv(threadData_t *threadData, modelica_metatype _inEnv, modelica_metatype _inClass)
{
modelica_metatype _outEnv = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inClass;
{
modelica_metatype _enums = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,10,0) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,8) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_enums = tmpMeta8;
tmpMeta1 = omc_List_fold(threadData, _enums, boxvar_InstUtil_addEnumerationLiteralToEnv, _inEnv);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inEnv;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outEnv = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outEnv;
}
DLLExport
modelica_metatype omc_InstUtil_getUsertypeDimensions(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inClass, modelica_metatype _inInstDims, modelica_boolean _inBoolean, modelica_metatype *out_outDimensionLst, modelica_metatype *out_classToInstantiate, modelica_metatype *out_outMods)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outDimensionLst = NULL;
modelica_metatype _classToInstantiate = NULL;
modelica_metatype _outMods = NULL;
modelica_metatype tmpMeta[4] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;volatile modelica_metatype tmp4_6;volatile modelica_boolean tmp4_7;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inIH;
tmp4_4 = _inPrefix;
tmp4_5 = _inClass;
tmp4_6 = _inInstDims;
tmp4_7 = _inBoolean;
{
modelica_metatype _cl = NULL;
modelica_metatype _cenv = NULL;
modelica_metatype _env = NULL;
modelica_metatype _owncref = NULL;
modelica_metatype _ad_1 = NULL;
modelica_metatype _mod_1 = NULL;
modelica_metatype _type_mods = NULL;
modelica_metatype _eq = NULL;
modelica_metatype _dim1 = NULL;
modelica_metatype _dim2 = NULL;
modelica_metatype _res = NULL;
modelica_metatype _pre = NULL;
modelica_string _id = NULL;
modelica_metatype _cn = NULL;
modelica_metatype _ad = NULL;
modelica_metatype _mod = NULL;
modelica_metatype _dims = NULL;
modelica_boolean _impl;
modelica_metatype _cache = NULL;
modelica_metatype _ih = NULL;
modelica_metatype _info = NULL;
modelica_metatype _els = NULL;
modelica_metatype _path = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 11; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
_cl = tmp4_5;
_id = tmpMeta6;
_cache = tmp4_1;
if (!((((stringEqual(_id, _OMC_LIT89)) || (stringEqual(_id, _OMC_LIT90))) || (stringEqual(_id, _OMC_LIT92))) || (stringEqual(_id, _OMC_LIT91)))) goto tmp3_end;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta7;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
if (5 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT93), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
_cl = tmp4_5;
_cache = tmp4_1;
tmp9 = omc_Config_synchronousFeaturesAllowed(threadData);
if (1 != tmp9) goto goto_2;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta10;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,3,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,8) == 0) goto tmp3_end;
_cl = tmp4_5;
_cache = tmp4_1;
tmp4 += 5;
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta13;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,2,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,1,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,1,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 9));
_cl = tmp4_5;
_id = tmpMeta14;
_ad = tmpMeta18;
_info = tmpMeta19;
_cache = tmp4_1;
_env = tmp4_2;
_pre = tmp4_4;
_dims = tmp4_6;
_impl = tmp4_7;
tmp20 = omc_Config_acceptMetaModelicaGrammar(threadData);
if (1 != tmp20) goto goto_2;
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta22 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _id, tmpMeta21);
_owncref = tmpMeta22;
_ad_1 = omc_InstUtil_getOptionArraydim(threadData, _ad);
_cache = omc_InstUtil_elabArraydim(threadData, _cache, _env, _owncref, _OMC_LIT310, _ad_1, mmc_mk_none(), _impl, 1, 0, _pre, _info, _dims ,&_dim1);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _dim1;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,0,0) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,9,1) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,0,1) == 0) goto tmp3_end;
_cl = tmp4_5;
_cache = tmp4_1;
tmp4 += 3;
tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta26;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 5: {
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_5,2,8) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,1,0) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,9,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,0,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 9));
_id = tmpMeta27;
_info = tmpMeta31;
tmp4 += 2;
tmpMeta32 = mmc_mk_cons(_id, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT313, tmpMeta32, _info);
goto goto_2;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,18,1) == 0) goto tmp3_end;
_cl = tmp4_5;
_cache = tmp4_1;
tmp4 += 1;
tmpMeta34 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta34;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 7: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 2));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,7,0) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,2,3) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,0,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 3));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 3));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 9));
_id = tmpMeta35;
_cn = tmpMeta39;
_ad = tmpMeta40;
_mod = tmpMeta41;
_info = tmpMeta42;
_cache = tmp4_1;
_env = tmp4_2;
_ih = tmp4_3;
_pre = tmp4_4;
_dims = tmp4_6;
_impl = tmp4_7;
tmp4 += 1;
_cache = omc_Lookup_lookupClass(threadData, _cache, _env, _cn, mmc_mk_some(_info) ,&_cl ,&_cenv);
tmpMeta43 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta44 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _id, tmpMeta43);
_owncref = tmpMeta44;
_ad_1 = omc_InstUtil_getOptionArraydim(threadData, _ad);
_env = omc_InstUtil_addEnumerationLiteralsToEnv(threadData, _env, _cl);
tmpMeta45 = mmc_mk_box2(5, &Mod_ModScope_DERIVED__desc, _cn);
_cache = omc_Mod_elabMod(threadData, _cache, _env, _ih, _pre, _mod, _impl, tmpMeta45, _info ,&_mod_1);
_eq = omc_Mod_modEquation(threadData, _mod_1);
_cache = omc_InstUtil_getUsertypeDimensions(threadData, _cache, _cenv, _ih, _pre, _cl, _dims, _impl ,&_dim1 ,&_cl ,&_type_mods);
_cache = omc_InstUtil_elabArraydim(threadData, _cache, _env, _owncref, _cn, _ad_1, _eq, _impl, 1, 0, _pre, _info, _dims ,&_dim2);
_type_mods = omc_Mod_addEachIfNeeded(threadData, _type_mods, _dim2);
_type_mods = omc_Mod_merge(threadData, _mod_1, _type_mods, _OMC_LIT103, 1);
_res = listAppend(_dim2, _dim1);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _res;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _type_mods;
goto tmp3_done;
}
case 8: {
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;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_5), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,0,8) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 3));
if (!listEmpty(tmpMeta48)) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 4));
if (!listEmpty(tmpMeta49)) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 5));
if (!listEmpty(tmpMeta50)) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 6));
if (!listEmpty(tmpMeta51)) goto tmp3_end;
_els = tmpMeta47;
_cache = tmp4_1;
_env = tmp4_2;
_ih = tmp4_3;
_pre = tmp4_4;
_impl = tmp4_7;
omc_InstUtil_splitElts(threadData, _els, NULL, &tmpMeta52, &tmpMeta58);
if (listEmpty(tmpMeta52)) goto goto_2;
tmpMeta53 = MMC_CAR(tmpMeta52);
tmpMeta54 = MMC_CDR(tmpMeta52);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta53,1,5) == 0) goto goto_2;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta53), 2));
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta53), 4));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta53), 6));
if (!listEmpty(tmpMeta54)) goto goto_2;
if (!listEmpty(tmpMeta58)) goto goto_2;
_path = tmpMeta55;
_mod = tmpMeta56;
_info = tmpMeta57;
tmpMeta59 = mmc_mk_box2(4, &Mod_ModScope_EXTENDS__desc, _path);
_cache = omc_Mod_elabModForBasicType(threadData, _cache, _env, _ih, _pre, _mod, _impl, tmpMeta59, _info ,&_mod_1);
_cache = omc_Lookup_lookupClass(threadData, _cache, _env, _path, mmc_mk_none() ,&_cl ,NULL);
tmpMeta60 = MMC_REFSTRUCTLIT(mmc_nil);
_cache = omc_InstUtil_getUsertypeDimensions(threadData, _cache, _env, _ih, _pre, _cl, tmpMeta60, _impl ,&_res ,&_cl ,&_type_mods);
_type_mods = omc_Mod_merge(threadData, _mod_1, _type_mods, _OMC_LIT103, 1);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _res;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _type_mods;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta61;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
_cl = tmp4_5;
_cache = tmp4_1;
tmpMeta61 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta61;
tmpMeta[0+2] = _cl;
tmpMeta[0+3] = _OMC_LIT44;
goto tmp3_done;
}
case 10: {
modelica_boolean tmp62;
modelica_metatype tmpMeta63;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
tmp62 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp62) goto goto_2;
_id = omc_SCodeDump_unparseElementStr(threadData, _inClass, _OMC_LIT104);
tmpMeta63 = stringAppend(_OMC_LIT314,_id);
omc_Debug_traceln(threadData, tmpMeta63);
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 < 11) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outDimensionLst = tmpMeta[0+1];
_classToInstantiate = tmpMeta[0+2];
_outMods = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_outDimensionLst) { *out_outDimensionLst = _outDimensionLst; }
if (out_classToInstantiate) { *out_classToInstantiate = _classToInstantiate; }
if (out_outMods) { *out_outMods = _outMods; }
return _outCache;
}
modelica_metatype boxptr_InstUtil_getUsertypeDimensions(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inClass, modelica_metatype _inInstDims, modelica_metatype _inBoolean, modelica_metatype *out_outDimensionLst, modelica_metatype *out_classToInstantiate, modelica_metatype *out_outMods)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
_outCache = omc_InstUtil_getUsertypeDimensions(threadData, _inCache, _inEnv, _inIH, _inPrefix, _inClass, _inInstDims, tmp1, out_outDimensionLst, out_classToInstantiate, out_outMods);
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_makeArrayType(threadData_t *threadData, modelica_metatype _inDimensionLst, modelica_metatype _inType)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inDimensionLst;
tmp4_2 = _inType;
{
modelica_metatype _ty = NULL;
modelica_metatype _ty_1 = NULL;
modelica_metatype _xs = NULL;
modelica_metatype _tty = NULL;
modelica_metatype _dim = NULL;
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 (!listEmpty(tmp4_1)) goto tmp3_end;
_ty = tmp4_2;
tmp4 += 1;
tmpMeta1 = _ty;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_dim = tmpMeta6;
_xs = tmpMeta7;
_tty = tmp4_2;
_ty_1 = omc_InstUtil_makeArrayType(threadData, _xs, _tty);
tmpMeta8 = mmc_mk_cons(_dim, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta9 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty_1, tmpMeta8);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 2: {
modelica_boolean tmp10;
tmp10 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp10) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT315);
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:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
void omc_InstUtil_checkHigherVariability(threadData_t *threadData, modelica_metatype _compConst, modelica_metatype _bindConst, modelica_metatype _pre, modelica_string _name, modelica_metatype _binding, modelica_metatype _info)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;volatile modelica_metatype tmp3_2;volatile modelica_string tmp3_3;volatile modelica_metatype tmp3_4;
tmp3_1 = _compConst;
tmp3_2 = _bindConst;
tmp3_3 = _name;
tmp3_4 = _binding;
{
modelica_metatype _c = NULL;
modelica_metatype _c1 = NULL;
modelica_string _n = NULL;
modelica_string _sc = NULL;
modelica_string _sc1 = NULL;
modelica_string _se = NULL;
modelica_string _sn = NULL;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 3; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
_c = tmp3_1;
_c1 = tmp3_2;
equality(_c, _c1);
goto tmp2_done;
}
case 1: {
modelica_boolean tmp5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,3,0) == 0) goto tmp2_end;
tmp5 = omc_Flags_getConfigBool(threadData, _OMC_LIT271);
if (1 != tmp5) goto goto_1;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
_c = tmp3_1;
_c1 = tmp3_2;
_n = tmp3_3;
_e = tmp3_4;
tmpMeta6 = stringAppend(omc_PrefixUtil_printPrefixStr2(threadData, _pre),_n);
_sn = tmpMeta6;
_sc = omc_DAEUtil_constStr(threadData, _c);
_sc1 = omc_DAEUtil_constStr(threadData, _c1);
_se = omc_ExpressionDump_printExpStr(threadData, _e);
tmpMeta7 = mmc_mk_cons(_sn, mmc_mk_cons(_sc, mmc_mk_cons(_se, mmc_mk_cons(_sc1, MMC_REFSTRUCTLIT(mmc_nil)))));
omc_Error_addSourceMessage(threadData, _OMC_LIT318, tmpMeta7, _info);
goto goto_1;
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 < 3) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
modelica_metatype omc_InstUtil_liftNonBasicTypes(threadData_t *threadData, modelica_metatype _tp, modelica_metatype _dimt)
{
modelica_metatype _outTp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _tp;
{
modelica_metatype _ty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta6;
tmp7 = listEmpty(omc_Types_getDimensions(threadData, _ty));
if (0 != tmp7) goto goto_2;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 1: {
tmpMeta1 = omc_Types_liftArray(threadData, _tp, _dimt);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outTp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outTp;
}
DLLExport
void omc_InstUtil_checkFunctionVarType(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inState, modelica_string _inVarName, modelica_metatype _inInfo)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _ty_str = NULL;
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_boolean tmp5;
tmp5 = omc_Types_isValidFunctionVarType(threadData, _inType);
if (1 != tmp5) goto goto_1;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta6;
_ty_str = omc_Types_getTypeName(threadData, _inType);
tmpMeta6 = mmc_mk_cons(_ty_str, mmc_mk_cons(_inVarName, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT321, tmpMeta6, _inInfo);
goto goto_1;
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:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
void omc_InstUtil_checkFunctionVar(threadData_t *threadData, modelica_string _inName, modelica_metatype _inAttributes, modelica_metatype _inPrefixes, modelica_metatype _inInfo)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;
tmp3_1 = _inAttributes;
tmp3_2 = _inPrefixes;
{
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;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,2,0) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp2_end;
tmpMeta7 = mmc_mk_cons(_inName, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT324, tmpMeta7, _inInfo);
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,0) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,0) == 0) goto tmp2_end;
tmpMeta11 = mmc_mk_cons(_inName, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT327, tmpMeta11, _inInfo);
goto goto_1;
goto tmp2_done;
}
case 3: {
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;
}
DLLExport
void omc_InstUtil_checkModificationOnOuter(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_string _inName, modelica_metatype _inCref, modelica_metatype _inMod, modelica_metatype _inVariability, modelica_metatype _inInnerOuter, modelica_boolean _inImpl, modelica_metatype _inInfo)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;volatile modelica_metatype tmp3_2;volatile modelica_metatype tmp3_3;volatile modelica_metatype tmp3_4;
tmp3_1 = _inIH;
tmp3_2 = _inMod;
tmp3_3 = _inVariability;
tmp3_4 = _inInnerOuter;
{
modelica_metatype _sm = NULL;
modelica_metatype _cref = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 4; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_3,3,0) == 0) goto tmp2_end;
tmp3 += 1;
goto tmp2_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_3,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_CAR(tmp3_1);
tmpMeta6 = MMC_CDR(tmp3_1);
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,5) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_4,1,0) == 0) goto tmp2_end;
_sm = tmpMeta7;
_cref = omc_PrefixUtil_prefixToCref(threadData, _inPrefix);
tmp8 = omc_BaseHashSet_has(threadData, _cref, _sm);
if (1 != tmp8) goto goto_1;
goto tmp2_done;
}
case 3: {
modelica_boolean tmp9;
tmp9 = omc_InnerOuter_modificationOnOuter(threadData, _inCache, _inEnv, _inIH, _inPrefix, _inName, _inCref, _inMod, _inInnerOuter, _inImpl, _inInfo);
if (0 != tmp9) goto goto_1;
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 < 4) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
void boxptr_InstUtil_checkModificationOnOuter(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inName, modelica_metatype _inCref, modelica_metatype _inMod, modelica_metatype _inVariability, modelica_metatype _inInnerOuter, modelica_metatype _inImpl, modelica_metatype _inInfo)
{
modelica_integer tmp1;
tmp1 = mmc_unbox_integer(_inImpl);
omc_InstUtil_checkModificationOnOuter(threadData, _inCache, _inEnv, _inIH, _inPrefix, _inName, _inCref, _inMod, _inVariability, _inInnerOuter, tmp1, _inInfo);
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_moveBindings3(threadData_t *threadData, modelica_metatype _inEquation)
{
modelica_metatype _outBinding = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inEquation;
{
modelica_metatype _bind_exp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_bind_exp = tmpMeta6;
tmpMeta1 = _bind_exp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_bind_exp = tmpMeta7;
tmpMeta1 = _bind_exp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBinding = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outBinding;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_moveBindings2(threadData_t *threadData, modelica_metatype _inEquation, modelica_metatype _inVariable)
{
modelica_metatype _outVariable = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inVariable;
{
modelica_metatype _cref = NULL;
modelica_metatype _kind = NULL;
modelica_metatype _dir = NULL;
modelica_metatype _prl = NULL;
modelica_metatype _vis = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _ct = NULL;
modelica_metatype _src = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _cmt = NULL;
modelica_metatype _io = NULL;
modelica_metatype _bind_exp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 11));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 12));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 13));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 14));
_cref = tmpMeta6;
_kind = tmpMeta7;
_dir = tmpMeta8;
_prl = tmpMeta9;
_vis = tmpMeta10;
_ty = tmpMeta11;
_dims = tmpMeta12;
_ct = tmpMeta13;
_src = tmpMeta14;
_attr = tmpMeta15;
_cmt = tmpMeta16;
_io = tmpMeta17;
_bind_exp = omc_InstUtil_moveBindings3(threadData, _inEquation);
tmpMeta18 = mmc_mk_box14(3, &DAE_Element_VAR__desc, _cref, _kind, _dir, _prl, _vis, _ty, mmc_mk_some(_bind_exp), _dims, _ct, _src, _attr, _cmt, _io);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cref = tmpMeta19;
tmp20 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp20) goto goto_2;
tmpMeta21 = stringAppend(_OMC_LIT328,omc_ComponentReference_printComponentRefStr(threadData, _cref));
omc_Debug_traceln(threadData, tmpMeta21);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outVariable = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVariable;
}
DLLExport
modelica_metatype omc_InstUtil_moveBindings(threadData_t *threadData, modelica_metatype _inEquations, modelica_metatype _inVariables)
{
modelica_metatype _outVariables = NULL;
modelica_metatype _eqs = NULL;
modelica_metatype _vars = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
if(omc_Config_getGraphicsExpMode(threadData))
{
_outVariables = _inVariables;
goto _return;
}
tmpMeta1 = _inEquations;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_eqs = tmpMeta2;
tmpMeta3 = _inVariables;
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
_vars = tmpMeta4;
omc_Error_assertion(threadData, (listLength(_eqs) == listLength(_vars)), _OMC_LIT329, _OMC_LIT331);
_vars = omc_List_threadMap(threadData, _eqs, _vars, boxvar_InstUtil_moveBindings2);
tmpMeta5 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _vars);
_outVariables = tmpMeta5;
_return: OMC_LABEL_UNUSED
return _outVariables;
}
DLLExport
modelica_metatype omc_InstUtil_extractConstrainingComps(threadData_t *threadData, modelica_metatype _cc, modelica_metatype _env, modelica_metatype _pre)
{
modelica_metatype _elems = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _cc;
{
modelica_metatype _path = NULL;
modelica_string _name = NULL;
modelica_metatype _selems = NULL;
modelica_metatype _extendselts = NULL;
modelica_metatype _compelts = NULL;
modelica_metatype _extcompelts = NULL;
modelica_metatype _classextendselts = NULL;
modelica_metatype _classes = NULL;
modelica_metatype _extcomps = NULL;
modelica_metatype _mod = NULL;
modelica_metatype _cmt = NULL;
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: {
modelica_metatype tmpMeta6;
if (!optionNone(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_path = tmpMeta8;
omc_Lookup_lookupClass(threadData, omc_FCore_emptyCache(threadData), _env, _path, mmc_mk_none(), &tmpMeta9, NULL);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,8) == 0) goto goto_2;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,8) == 0) goto goto_2;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_name = tmpMeta10;
_selems = tmpMeta12;
_classes = omc_InstUtil_splitElts(threadData, _selems ,&_classextendselts ,&_extendselts ,&_compelts);
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
omc_InstExtends_instExtendsAndClassExtendsList(threadData, omc_FCore_emptyCache(threadData), _env, tmpMeta13, _OMC_LIT44, _pre, _extendselts, _classextendselts, _selems, _OMC_LIT332, _name, 1, 0 ,NULL ,NULL ,NULL ,&_extcomps ,NULL ,NULL ,NULL ,NULL, NULL);
_extcompelts = omc_List_map(threadData, _extcomps, boxvar_Util_tuple21);
tmpMeta1 = listAppend(_classes, listAppend(_compelts, _extcompelts));
goto tmp3_done;
}
case 2: {
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;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 3));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 4));
_path = tmpMeta15;
_mod = tmpMeta16;
_cmt = tmpMeta17;
omc_Lookup_lookupClass(threadData, omc_FCore_emptyCache(threadData), _env, _path, mmc_mk_none(), &tmpMeta18, NULL);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,8) == 0) goto goto_2;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,2,3) == 0) goto goto_2;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,0,2) == 0) goto goto_2;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
_path = tmpMeta21;
tmpMeta22 = mmc_mk_box4(3, &SCode_ConstrainClass_CONSTRAINCLASS__desc, _path, _mod, _cmt);
tmpMeta1 = omc_InstUtil_extractConstrainingComps(threadData, mmc_mk_some(tmpMeta22), _env, _pre);
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:;
}
}
_elems = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _elems;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_keepConstrainingTypeModifersOnly2(threadData_t *threadData, modelica_metatype _isubs, modelica_metatype _elems)
{
modelica_metatype _osubs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _isubs;
tmp4_2 = _elems;
{
modelica_metatype _sub = NULL;
modelica_string _n = NULL;
modelica_metatype _subs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
_subs = tmp4_1;
tmpMeta1 = _subs;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_sub = tmpMeta7;
_n = tmpMeta9;
_subs = tmpMeta8;
if (!omc_List_isMemberOnTrue(threadData, _n, _elems, boxvar_stringEq)) goto tmp3_end;
tmpMeta10 = mmc_mk_cons(_sub, omc_InstUtil_keepConstrainingTypeModifersOnly2(threadData, _subs, _elems));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
_subs = tmpMeta12;
_isubs = _subs;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_osubs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _osubs;
}
DLLExport
modelica_metatype omc_InstUtil_keepConstrainingTypeModifersOnly(threadData_t *threadData, modelica_metatype _inMod, modelica_metatype _elems)
{
modelica_metatype _filteredMod = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inMod;
tmp4_2 = _elems;
{
modelica_metatype _f = NULL;
modelica_metatype _e = NULL;
modelica_metatype _oe = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _compNames = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta1 = _inMod;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT44;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta1 = _inMod;
goto tmp3_done;
}
case 3: {
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,0,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_f = tmpMeta6;
_e = tmpMeta7;
_subs = tmpMeta8;
_oe = tmpMeta9;
_info = tmpMeta10;
_compNames = omc_List_map(threadData, _elems, boxvar_SCodeUtil_elementName);
_subs = omc_InstUtil_keepConstrainingTypeModifersOnly2(threadData, _subs, _compNames);
tmpMeta11 = mmc_mk_box6(3, &DAE_Mod_MOD__desc, _f, _e, _subs, _oe, _info);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_filteredMod = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _filteredMod;
}
DLLExport
modelica_metatype omc_InstUtil_removeCrefFromCrefs(threadData_t *threadData, modelica_metatype _inAbsynComponentRefLst, modelica_metatype _inComponentRef)
{
modelica_metatype _outAbsynComponentRefLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inAbsynComponentRefLst;
tmp4_2 = _inComponentRef;
{
modelica_string _n1 = NULL;
modelica_string _n2 = NULL;
modelica_metatype _rest_1 = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _cr1 = NULL;
modelica_metatype _cr2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (!listEmpty(tmpMeta8)) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_1);
tmpMeta10 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
if (!listEmpty(tmpMeta12)) goto tmp3_end;
_cr2 = tmp4_2;
_n2 = tmpMeta7;
_n1 = tmpMeta11;
_rest = tmpMeta10;
if (!(stringEqual(_n1, _n2))) goto tmp3_end;
_inAbsynComponentRefLst = _rest;
_inComponentRef = _cr2;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
_cr2 = tmp4_2;
_n2 = tmpMeta13;
_n1 = tmpMeta16;
_rest = tmpMeta15;
if (!(stringEqual(_n1, _n2))) goto tmp3_end;
_inAbsynComponentRefLst = _rest;
_inComponentRef = _cr2;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta17 = MMC_CAR(tmp4_1);
tmpMeta18 = MMC_CDR(tmp4_1);
_cr1 = tmpMeta17;
_rest = tmpMeta18;
_cr2 = tmp4_2;
_rest_1 = omc_InstUtil_removeCrefFromCrefs(threadData, _rest, _cr2);
tmpMeta19 = mmc_mk_cons(_cr1, _rest_1);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outAbsynComponentRefLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAbsynComponentRefLst;
}
DLLExport
modelica_metatype omc_InstUtil_removeOptCrefFromCrefs(threadData_t *threadData, modelica_metatype _inCrefs, modelica_metatype _inCref)
{
modelica_metatype _outCrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCref;
{
modelica_metatype _cref = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_cref = tmpMeta6;
tmpMeta1 = omc_InstUtil_removeCrefFromCrefs(threadData, _inCrefs, _cref);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inCrefs;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCrefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCrefs;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkMultipleClassesEquivalent(threadData_t *threadData, modelica_metatype _oldClass, modelica_metatype _newClass)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;volatile modelica_metatype tmp3_2;
tmp3_1 = _oldClass;
tmp3_2 = _newClass;
{
modelica_metatype _oldCl = NULL;
modelica_metatype _newCl = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_metatype _sl1 = NULL;
modelica_metatype _sl2 = NULL;
modelica_metatype _enumLst = NULL;
modelica_metatype _elementLst = NULL;
modelica_metatype _info1 = NULL;
modelica_metatype _info2 = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 4; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,3,1) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,2,8) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,10,0) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,8) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_enumLst = tmpMeta6;
_elementLst = tmpMeta9;
tmp3 += 1;
_sl1 = omc_List_map(threadData, _enumLst, boxvar_SCodeUtil_enumName);
_sl2 = omc_List_map(threadData, _elementLst, boxvar_SCodeUtil_elementName);
omc_List_threadMapAllValue(threadData, _sl1, _sl2, boxvar_stringEq, mmc_mk_boolean(1));
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,2,8) == 0) goto tmp2_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,3,1) == 0) goto tmp2_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,10,0) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,8) == 0) goto tmp2_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
_enumLst = tmpMeta11;
_elementLst = tmpMeta14;
_sl1 = omc_List_map(threadData, _enumLst, boxvar_SCodeUtil_enumName);
_sl2 = omc_List_map(threadData, _elementLst, boxvar_SCodeUtil_elementName);
omc_List_threadMapAllValue(threadData, _sl1, _sl2, boxvar_stringEq, mmc_mk_boolean(1));
goto tmp2_done;
}
case 2: {
modelica_boolean tmp15;
_oldCl = tmp3_1;
_newCl = tmp3_2;
tmp15 = omc_SCodeUtil_elementEqual(threadData, _oldCl, _newCl);
if (1 != tmp15) goto goto_1;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
_oldCl = tmp3_1;
_newCl = tmp3_2;
_s1 = omc_SCodeDump_unparseElementStr(threadData, _oldCl, _OMC_LIT104);
_s2 = omc_SCodeDump_unparseElementStr(threadData, _newCl, _OMC_LIT104);
_info1 = omc_SCodeUtil_elementInfo(threadData, _oldCl);
_info2 = omc_SCodeUtil_elementInfo(threadData, _newCl);
tmpMeta16 = mmc_mk_cons(_s1, mmc_mk_cons(_s2, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta17 = mmc_mk_cons(_info1, mmc_mk_cons(_info2, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addMultiSourceMessage(threadData, _OMC_LIT335, tmpMeta16, tmpMeta17);
goto goto_1;
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 < 4) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkMultipleElementsIdentical(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _oldComponent, modelica_metatype _newComponent)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;volatile modelica_metatype tmp3_2;volatile modelica_metatype tmp3_3;volatile modelica_metatype tmp3_4;
tmp3_1 = _inCache;
tmp3_2 = _inEnv;
tmp3_3 = _oldComponent;
tmp3_4 = _newComponent;
{
modelica_metatype _oldElt = NULL;
modelica_metatype _newElt = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_string _s = NULL;
modelica_metatype _smod1 = NULL;
modelica_metatype _smod2 = NULL;
modelica_metatype _env = NULL;
modelica_metatype _env1 = NULL;
modelica_metatype _env2 = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _c1 = NULL;
modelica_metatype _c2 = NULL;
modelica_metatype _tpath1 = NULL;
modelica_metatype _tpath2 = NULL;
modelica_metatype _old_info = NULL;
modelica_metatype _new_info = NULL;
modelica_metatype _prefixes1 = NULL;
modelica_metatype _prefixes2 = NULL;
modelica_metatype _attr1 = NULL;
modelica_metatype _attr2 = NULL;
modelica_string _n1 = NULL;
modelica_string _n2 = NULL;
modelica_metatype _ad1 = NULL;
modelica_metatype _ad2 = NULL;
modelica_metatype _cond1 = NULL;
modelica_metatype _cond2 = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 4; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_3), 1));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_4), 1));
_oldElt = tmpMeta5;
_newElt = tmpMeta6;
tmp7 = omc_SCodeUtil_elementEqual(threadData, _oldElt, _newElt);
if (1 != tmp7) goto goto_1;
goto tmp2_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;
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_boolean tmp26;
modelica_boolean tmp27;
modelica_boolean tmp28;
modelica_boolean tmp29;
modelica_boolean tmp30;
modelica_boolean tmp31;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_3), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,8) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,2) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 8));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_4), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,3,8) == 0) goto tmp2_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 3));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 4));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,0,2) == 0) goto tmp2_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 3));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 6));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 8));
_n1 = tmpMeta9;
_prefixes1 = tmpMeta10;
_attr1 = tmpMeta11;
_tpath1 = tmpMeta13;
_ad1 = tmpMeta14;
_smod1 = tmpMeta15;
_cond1 = tmpMeta16;
_n2 = tmpMeta18;
_prefixes2 = tmpMeta19;
_attr2 = tmpMeta20;
_tpath2 = tmpMeta22;
_ad2 = tmpMeta23;
_smod2 = tmpMeta24;
_cond2 = tmpMeta25;
_cache = tmp3_1;
_env = tmp3_2;
tmp26 = (stringEqual(_n1, _n2));
if (1 != tmp26) goto goto_1;
tmp27 = omc_SCodeUtil_prefixesEqual(threadData, _prefixes1, _prefixes2);
if (1 != tmp27) goto goto_1;
tmp28 = omc_SCodeUtil_attributesEqual(threadData, _attr1, _attr2);
if (1 != tmp28) goto goto_1;
tmp29 = omc_SCodeUtil_modEqual(threadData, _smod1, _smod2);
if (1 != tmp29) goto goto_1;
equality(_ad1, _ad2);
equality(_cond1, _cond2);
omc_Lookup_lookupClass(threadData, _cache, _env, _tpath1, mmc_mk_none() ,&_c1 ,&_env1);
omc_Lookup_lookupClass(threadData, _cache, _env, _tpath2, mmc_mk_none() ,&_c2 ,&_env2);
tmp30 = (stringEqual(omc_FGraph_printGraphPathStr(threadData, _env1), omc_FGraph_printGraphPathStr(threadData, _env2)));
if (1 != tmp30) goto goto_1;
tmp31 = omc_SCodeUtil_elementEqual(threadData, _c1, _c2);
if (1 != tmp31) goto goto_1;
goto tmp2_done;
}
case 2: {
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_boolean tmp52;
modelica_boolean tmp53;
modelica_boolean tmp54;
modelica_boolean tmp55;
modelica_boolean tmp56;
modelica_boolean tmp57;
modelica_boolean tmp58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_3), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,3,8) == 0) goto tmp2_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 2));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 3));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 4));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,0,2) == 0) goto tmp2_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 2));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 3));
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 6));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 8));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 9));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_4), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta42,3,8) == 0) goto tmp2_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 2));
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 3));
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 4));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,0,2) == 0) goto tmp2_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 3));
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 6));
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 8));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 9));
_oldElt = tmpMeta32;
_n1 = tmpMeta33;
_prefixes1 = tmpMeta34;
_attr1 = tmpMeta35;
_tpath1 = tmpMeta37;
_ad1 = tmpMeta38;
_smod1 = tmpMeta39;
_cond1 = tmpMeta40;
_old_info = tmpMeta41;
_newElt = tmpMeta42;
_n2 = tmpMeta43;
_prefixes2 = tmpMeta44;
_attr2 = tmpMeta45;
_tpath2 = tmpMeta47;
_ad2 = tmpMeta48;
_smod2 = tmpMeta49;
_cond2 = tmpMeta50;
_new_info = tmpMeta51;
_cache = tmp3_1;
_env = tmp3_2;
tmp52 = (stringEqual(_n1, _n2));
if (1 != tmp52) goto goto_1;
tmp53 = (stringEqual(_n1, _OMC_LIT336));
if (1 != tmp53) goto goto_1;
tmp54 = omc_SCodeUtil_prefixesEqual(threadData, _prefixes1, _prefixes2);
if (1 != tmp54) goto goto_1;
tmp55 = omc_SCodeUtil_attributesEqual(threadData, _attr1, _attr2);
if (1 != tmp55) goto goto_1;
tmp56 = omc_SCodeUtil_modEqual(threadData, _smod1, _smod2);
if (0 != tmp56) goto goto_1;
equality(_ad1, _ad2);
equality(_cond1, _cond2);
omc_Lookup_lookupClass(threadData, _cache, _env, _tpath1, mmc_mk_none() ,&_c1 ,&_env1);
omc_Lookup_lookupClass(threadData, _cache, _env, _tpath2, mmc_mk_none() ,&_c2 ,&_env2);
tmp57 = (stringEqual(omc_FGraph_printGraphPathStr(threadData, _env1), omc_FGraph_printGraphPathStr(threadData, _env2)));
if (1 != tmp57) goto goto_1;
tmp58 = omc_SCodeUtil_elementEqual(threadData, _c1, _c2);
if (1 != tmp58) goto goto_1;
_s1 = omc_SCodeDump_unparseElementStr(threadData, _oldElt, _OMC_LIT104);
_s2 = omc_SCodeDump_unparseElementStr(threadData, _newElt, _OMC_LIT104);
tmpMeta59 = stringAppend(_OMC_LIT337,_s1);
tmpMeta60 = stringAppend(tmpMeta59,_OMC_LIT338);
tmpMeta61 = stringAppend(tmpMeta60,_s2);
tmpMeta62 = stringAppend(tmpMeta61,_OMC_LIT339);
_s = tmpMeta62;
tmpMeta63 = mmc_mk_cons(_s, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta64 = mmc_mk_cons(_old_info, mmc_mk_cons(_new_info, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addMultiSourceMessage(threadData, _OMC_LIT340, tmpMeta63, tmpMeta64);
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_3), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta65,3,8) == 0) goto tmp2_end;
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta65), 9));
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_4), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta67,3,8) == 0) goto tmp2_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta67), 9));
_oldElt = tmpMeta65;
_old_info = tmpMeta66;
_newElt = tmpMeta67;
_new_info = tmpMeta68;
_s1 = omc_SCodeDump_unparseElementStr(threadData, _oldElt, _OMC_LIT104);
_s2 = omc_SCodeDump_unparseElementStr(threadData, _newElt, _OMC_LIT104);
tmpMeta69 = mmc_mk_cons(_s1, mmc_mk_cons(_s2, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta70 = mmc_mk_cons(_old_info, mmc_mk_cons(_new_info, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addMultiSourceMessage(threadData, _OMC_LIT343, tmpMeta69, tmpMeta70);
goto goto_1;
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 < 4) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_instStatusToBool(threadData_t *threadData, modelica_metatype _instStatus)
{
modelica_boolean _alreadyDeclared;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _instStatus;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 3: {
tmp1 = 0;
goto tmp3_done;
}
case 4: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_alreadyDeclared = tmp1;
_return: OMC_LABEL_UNUSED
return _alreadyDeclared;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_instStatusToBool(threadData_t *threadData, modelica_metatype _instStatus)
{
modelica_boolean _alreadyDeclared;
modelica_metatype out_alreadyDeclared;
_alreadyDeclared = omc_InstUtil_instStatusToBool(threadData, _instStatus);
out_alreadyDeclared = mmc_mk_icon(_alreadyDeclared);
return out_alreadyDeclared;
}
DLLExport
modelica_boolean omc_InstUtil_checkMultiplyDeclared(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _mod, modelica_metatype _prefix, modelica_metatype _ciState, modelica_metatype _compTuple, modelica_metatype _instDims, modelica_boolean _impl)
{
modelica_boolean _alreadyDeclared;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _compTuple;
{
modelica_string _n = NULL;
modelica_string _n2 = NULL;
modelica_metatype _oldElt = NULL;
modelica_metatype _oldMod = NULL;
modelica_metatype _newComp = NULL;
modelica_metatype _instStatus = NULL;
modelica_metatype _oldClass = NULL;
modelica_metatype _newClass = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 11; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT344);
goto goto_2;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,1) == 0) goto tmp3_end;
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,8) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,4) == 0) goto tmp3_end;
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,3,8) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_newComp = tmp4_1;
_n = tmpMeta12;
omc_Lookup_lookupIdentLocal(threadData, _cache, _env, _n ,NULL ,&_oldElt ,&_oldMod ,&_instStatus ,NULL);
tmpMeta13 = mmc_mk_box2(0, _oldElt, _oldMod);
omc_InstUtil_checkMultipleElementsIdentical(threadData, _cache, _env, tmpMeta13, _newComp);
_alreadyDeclared = omc_InstUtil_instStatusToBool(threadData, _instStatus);
omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT344);
tmp1 = _alreadyDeclared;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,3,8) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
_n = tmpMeta15;
tmp4 += 5;
tmp16 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupIdentLocal(threadData, _cache, _env, _n, NULL, NULL, NULL, NULL, NULL);
tmp16 = 1;
goto goto_17;
goto_17:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp16) {goto goto_2;}
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,8) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 3));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,0,1) == 0) goto tmp3_end;
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,2,8) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,1,4) == 0) goto tmp3_end;
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 7: {
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_integer tmp32;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,2,8) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,0,8) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 2));
if (listEmpty(tmpMeta26)) goto tmp3_end;
tmpMeta27 = MMC_CAR(tmpMeta26);
tmpMeta28 = MMC_CDR(tmpMeta26);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,1,5) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,1,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
_n = tmpMeta24;
_n2 = tmpMeta30;
tmpMeta31 = stringAppend(_OMC_LIT345,_n);
_n = tmpMeta31;
tmp32 = omc_System_stringFind(threadData, _n, _n2);
if (0 != tmp32) goto goto_2;
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,2,8) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
_newClass = tmpMeta33;
_n = tmpMeta34;
_oldClass = omc_Lookup_lookupClassLocal(threadData, _env, _n, NULL);
omc_InstUtil_checkMultipleClassesEquivalent(threadData, _oldClass, _newClass);
omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT344);
tmp1 = 1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_boolean tmp37;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,2,8) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
_n = tmpMeta36;
tmp37 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupClassLocal(threadData, _env, _n, NULL);
tmp37 = 1;
goto goto_38;
goto_38:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp37) {goto goto_2;}
omc_ErrorExt_rollBack(threadData, _OMC_LIT344);
tmp1 = 0;
goto tmp3_done;
}
case 10: {
omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT344);
if(omc_Flags_isSet(threadData, _OMC_LIT215))
{
omc_Debug_trace(threadData, _OMC_LIT346);
}
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 < 11) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_alreadyDeclared = tmp1;
_return: OMC_LABEL_UNUSED
return _alreadyDeclared;
}
modelica_metatype boxptr_InstUtil_checkMultiplyDeclared(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _mod, modelica_metatype _prefix, modelica_metatype _ciState, modelica_metatype _compTuple, modelica_metatype _instDims, modelica_metatype _impl)
{
modelica_integer tmp1;
modelica_boolean _alreadyDeclared;
modelica_metatype out_alreadyDeclared;
tmp1 = mmc_unbox_integer(_impl);
_alreadyDeclared = omc_InstUtil_checkMultiplyDeclared(threadData, _cache, _env, _mod, _prefix, _ciState, _compTuple, _instDims, tmp1);
out_alreadyDeclared = mmc_mk_icon(_alreadyDeclared);
return out_alreadyDeclared;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addRecordConstructorsToTheCache(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inMod, modelica_metatype _inPrefix, modelica_metatype _inState, modelica_metatype _inDirection, modelica_metatype _inClass, modelica_metatype _inInstDims, modelica_metatype *out_outEnv, modelica_metatype *out_outIH)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outEnv = NULL;
modelica_metatype _outIH = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inState;
tmp4_2 = _inClass;
{
modelica_string _name = NULL;
modelica_metatype _path = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_boolean tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,1) == 0) goto tmp3_end;
_path = tmpMeta6;
_name = tmpMeta7;
fputs(MMC_STRINGDATA(_OMC_LIT347),stdout);
tmp9 = omc_AbsynUtil_isInputOrOutput(threadData, _inDirection);
if (1 != tmp9) goto goto_2;
tmp10 = (stringEqual(omc_AbsynUtil_pathLastIdent(threadData, _path), _name));
if (0 != tmp10) goto goto_2;
tmpMeta[0+0] = omc_InstFunction_implicitFunctionInstantiation(threadData, _inCache, _inEnv, _inIH, _inMod, _inPrefix, _inClass, _inInstDims, &tmpMeta[0+1], &tmpMeta[0+2]);
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inCache;
tmpMeta[0+1] = _inEnv;
tmpMeta[0+2] = _inIH;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outEnv = tmpMeta[0+1];
_outIH = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outEnv) { *out_outEnv = _outEnv; }
if (out_outIH) { *out_outIH = _outIH; }
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_chainRedeclare__dispatch(threadData_t *threadData, modelica_metatype _inModOuter, modelica_metatype _inModInner, modelica_boolean *out_change)
{
modelica_metatype _outMod = NULL;
modelica_boolean _change;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inModInner;
{
modelica_metatype _f = NULL;
modelica_metatype _e = NULL;
modelica_metatype _cls = NULL;
modelica_string _name = NULL;
modelica_string _nInner = NULL;
modelica_string _nDerivedInner = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _b = NULL;
modelica_metatype _m = NULL;
modelica_metatype _m2 = NULL;
modelica_metatype _sm = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; 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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,1,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_f = tmpMeta6;
_e = tmpMeta7;
_nInner = tmpMeta9;
_nDerivedInner = tmpMeta13;
tmpMeta14 = omc_Mod_lookupCompModification(threadData, _inModOuter, _nDerivedInner);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,4) == 0) goto goto_2;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 4));
_cls = tmpMeta15;
_cls = omc_SCodeUtil_setClassName(threadData, _nInner, _cls);
tmpMeta16 = mmc_mk_box4(4, &SCode_Mod_REDECL__desc, _f, _e, _cls);
tmpMeta[0+0] = tmpMeta16;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,2,8) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,2,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,0,2) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,1,1) == 0) goto tmp3_end;
_f = tmpMeta17;
_e = tmpMeta18;
_nInner = tmpMeta20;
tmp4 += 2;
tmpMeta24 = omc_Mod_lookupCompModification(threadData, _inModOuter, _nInner);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,1,4) == 0) goto goto_2;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 4));
_cls = tmpMeta25;
tmpMeta26 = mmc_mk_box4(4, &SCode_Mod_REDECL__desc, _f, _e, _cls);
tmpMeta[0+0] = tmpMeta26;
tmp1_c1 = 1;
goto tmp3_done;
}
case 2: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta29)) goto tmp3_end;
tmpMeta30 = MMC_CAR(tmpMeta29);
tmpMeta31 = MMC_CDR(tmpMeta29);
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,1,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_f = tmpMeta27;
_e = tmpMeta28;
_name = tmpMeta32;
_m = tmpMeta33;
_rest = tmpMeta31;
_b = tmpMeta34;
_info = tmpMeta35;
_m2 = omc_InstUtil_chainRedeclare__dispatch(threadData, _inModOuter, _m, NULL);
tmpMeta36 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _f, _e, _rest, _b, _info);
tmpMeta37 = omc_InstUtil_chainRedeclare__dispatch(threadData, _inModOuter, tmpMeta36, NULL);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,0,5) == 0) goto goto_2;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 4));
_subs = tmpMeta38;
tmpMeta40 = mmc_mk_box3(3, &SCode_SubMod_NAMEMOD__desc, _name, _m2);
tmpMeta39 = mmc_mk_cons(tmpMeta40, _subs);
tmpMeta41 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _f, _e, tmpMeta39, _b, _info);
tmpMeta[0+0] = tmpMeta41;
tmp1_c1 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_boolean tmp49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta44)) goto tmp3_end;
tmpMeta45 = MMC_CAR(tmpMeta44);
tmpMeta46 = MMC_CDR(tmpMeta44);
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_f = tmpMeta42;
_e = tmpMeta43;
_sm = tmpMeta45;
_rest = tmpMeta46;
_b = tmpMeta47;
_info = tmpMeta48;
tmpMeta50 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _f, _e, _rest, _b, _info);
tmpMeta51 = omc_InstUtil_chainRedeclare__dispatch(threadData, _inModOuter, tmpMeta50, &tmp49);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta51,0,5) == 0) goto goto_2;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta51), 4));
_subs = tmpMeta52;
_change = tmp49;
tmpMeta53 = mmc_mk_cons(_sm, _subs);
tmpMeta54 = mmc_mk_box6(3, &SCode_Mod_MOD__desc, _f, _e, tmpMeta53, _b, _info);
tmpMeta[0+0] = tmpMeta54;
tmp1_c1 = _change;
goto tmp3_done;
}
case 4: {
tmpMeta[0+0] = _inModInner;
tmp1_c1 = 0;
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outMod = tmpMeta[0+0];
_change = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_change) { *out_change = _change; }
return _outMod;
}
modelica_metatype boxptr_InstUtil_chainRedeclare__dispatch(threadData_t *threadData, modelica_metatype _inModOuter, modelica_metatype _inModInner, modelica_metatype *out_change)
{
modelica_boolean _change;
modelica_metatype _outMod = NULL;
_outMod = omc_InstUtil_chainRedeclare__dispatch(threadData, _inModOuter, _inModInner, &_change);
if (out_change) { *out_change = mmc_mk_icon(_change); }
return _outMod;
}
DLLExport
modelica_metatype omc_InstUtil_chainRedeclares(threadData_t *threadData, modelica_metatype _inModOuter, modelica_metatype _inModInner)
{
modelica_metatype _outMod = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_outMod = omc_InstUtil_chainRedeclare__dispatch(threadData, _inModOuter, _inModInner ,&_b);
tmpMeta1 = (_b?_outMod:_inModInner);
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;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_memberCrefs(threadData_t *threadData, modelica_metatype _inComponentRef, modelica_metatype _inComponentRefs)
{
modelica_boolean _outIsMember;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outIsMember = omc_List_isMemberOnTrue(threadData, _inComponentRef, _inComponentRefs, boxvar_AbsynUtil_crefEqualNoSubs);
_return: OMC_LABEL_UNUSED
return _outIsMember;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_memberCrefs(threadData_t *threadData, modelica_metatype _inComponentRef, modelica_metatype _inComponentRefs)
{
modelica_boolean _outIsMember;
modelica_metatype out_outIsMember;
_outIsMember = omc_InstUtil_memberCrefs(threadData, _inComponentRef, _inComponentRefs);
out_outIsMember = mmc_mk_icon(_outIsMember);
return out_outIsMember;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getCrefsFromCompdims(threadData_t *threadData, modelica_metatype _inComponents)
{
modelica_metatype _outCrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inComponents;
{
modelica_metatype _crefs1 = NULL;
modelica_metatype _crefs2 = NULL;
modelica_metatype _arraydim = NULL;
modelica_metatype _xs = NULL;
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: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,8) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_arraydim = tmpMeta11;
_xs = tmpMeta8;
_crefs1 = omc_InstUtil_getCrefFromDim(threadData, _arraydim);
_crefs2 = omc_InstUtil_getCrefsFromCompdims(threadData, _xs);
tmpMeta1 = listAppend(_crefs1, _crefs2);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
_xs = tmpMeta13;
tmpMeta1 = omc_InstUtil_getCrefsFromCompdims(threadData, _xs);
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:;
}
}
_outCrefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCrefs;
}
DLLExport
modelica_metatype omc_InstUtil_addComponentsToEnv(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fcache, modelica_metatype __omcQ_24in_5Fenv, modelica_metatype __omcQ_24in_5Fih, modelica_metatype _mod, modelica_metatype _prefix, modelica_metatype _state, modelica_metatype _components, modelica_boolean _impl, modelica_metatype *out_env, modelica_metatype *out_ih)
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _ih = NULL;
modelica_metatype _comp = NULL;
modelica_metatype _comp2 = NULL;
modelica_metatype _cmod = NULL;
modelica_metatype _local_mod = NULL;
modelica_metatype _comp_mod = NULL;
modelica_metatype _mod2 = NULL;
modelica_metatype _ty_path = NULL;
modelica_metatype _prefs = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _dattr = NULL;
modelica_boolean _error;
modelica_string _err_msg = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_boolean tmp5 = 0;
modelica_metatype tmpMeta19;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_cache = __omcQ_24in_5Fcache;
_env = __omcQ_24in_5Fenv;
_ih = __omcQ_24in_5Fih;
_error = 0;
{
modelica_metatype _compmod;
for (tmpMeta1 = _components; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_compmod = MMC_CAR(tmpMeta1);
tmpMeta2 = _compmod;
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 1));
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
_comp = tmpMeta3;
_cmod = tmpMeta4;
{
volatile modelica_metatype tmp8_1;
tmp8_1 = _comp;
{
volatile mmc_switch_type tmp8;
int tmp9;
tmp8 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp7_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp8 < 4; tmp8++) {
switch (MMC_SWITCH_CAST(tmp8)) {
case 0: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,3,8) == 0) goto tmp7_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,2) == 0) goto tmp7_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_ty_path = tmpMeta11;
if (!(stringEqual((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 2))), omc_AbsynUtil_pathLastIdent(threadData, _ty_path)))) goto tmp7_end;
omc_InstUtil_checkCompEnvPathVsCompTypePath(threadData, omc_FGraph_getScopePath(threadData, _env), _ty_path);
tmpMeta12 = stringAppend((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 2))),_OMC_LIT348);
tmpMeta13 = stringAppend(tmpMeta12,omc_FGraph_printGraphPathStr(threadData, _env));
_err_msg = tmpMeta13;
tmpMeta14 = mmc_mk_cons(_err_msg, mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _ty_path, _OMC_LIT63, 1, 0), MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT351, tmpMeta14, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 9))));
tmp5 = 1;
goto tmp7_done;
}
case 1: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,3,8) == 0) goto tmp7_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 3));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 4));
_prefs = tmpMeta15;
_attr = tmpMeta16;
_ty_path = omc_AbsynUtil_typeSpecPath(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 5))));
_local_mod = omc_Mod_lookupModificationP(threadData, _mod, _ty_path);
if(omc_SCodeUtil_finalBool(threadData, omc_SCodeUtil_prefixesFinal(threadData, _prefs)))
{
tmpMeta17 = MMC_TAGPTR(mmc_alloc_words(10));
memcpy(MMC_UNTAGPTR(tmpMeta17), MMC_UNTAGPTR(_comp), 10*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta17))[6] = omc_InstUtil_traverseModAddFinal(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 6))));
_comp = tmpMeta17;
}
_cache = omc_Inst_redeclareType(threadData, _cache, _env, _ih, _local_mod, _comp, _prefix, _state, _impl, _cmod ,&_env ,&_ih ,&_comp2 ,&_mod2);
_comp_mod = omc_Mod_lookupCompModification(threadData, _mod, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 2))));
_cmod = omc_Mod_merge(threadData, _comp_mod, _cmod, _OMC_LIT103, 1);
_dattr = omc_DAEUtil_translateSCodeAttrToDAEAttr(threadData, _attr, _prefs);
tmpMeta18 = mmc_mk_box7(3, &DAE_Var_TYPES__VAR__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_comp), 2))), _dattr, _OMC_LIT306, _OMC_LIT307, mmc_mk_boolean(0), mmc_mk_none());
_env = omc_FGraph_mkComponentNode(threadData, _env, tmpMeta18, _comp, _cmod, _OMC_LIT308, omc_FGraph_empty(threadData));
tmp5 = 0;
goto tmp7_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,3,8) == 0) goto tmp7_end;
tmp5 = 1;
goto tmp7_done;
}
case 3: {
tmp5 = 0;
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 < 4) {
goto tmp7_top;
}
MMC_THROW_INTERNAL();
tmp7_done2:;
}
}
_error = tmp5;
if(_error)
{
MMC_THROW_INTERNAL();
}
}
}
_return: OMC_LABEL_UNUSED
if (out_env) { *out_env = _env; }
if (out_ih) { *out_ih = _ih; }
return _cache;
}
modelica_metatype boxptr_InstUtil_addComponentsToEnv(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fcache, modelica_metatype __omcQ_24in_5Fenv, modelica_metatype __omcQ_24in_5Fih, modelica_metatype _mod, modelica_metatype _prefix, modelica_metatype _state, modelica_metatype _components, modelica_metatype _impl, modelica_metatype *out_env, modelica_metatype *out_ih)
{
modelica_integer tmp1;
modelica_metatype _cache = NULL;
tmp1 = mmc_unbox_integer(_impl);
_cache = omc_InstUtil_addComponentsToEnv(threadData, __omcQ_24in_5Fcache, __omcQ_24in_5Fenv, __omcQ_24in_5Fih, _mod, _prefix, _state, _components, tmp1, out_env, out_ih);
return _cache;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkCompEnvPathVsCompTypePath(threadData_t *threadData, modelica_metatype _inCompEnvPath, modelica_metatype _inCompTypePath)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;
tmp3_1 = _inCompEnvPath;
tmp3_2 = _inCompTypePath;
{
modelica_metatype _ep = NULL;
modelica_metatype _tp = NULL;
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_2,1,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_boolean tmp6;
if (optionNone(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 1));
_ep = tmpMeta5;
_tp = tmp3_2;
_tp = omc_AbsynUtil_stripLast(threadData, _tp);
tmp6 = omc_AbsynUtil_pathPrefixOf(threadData, _tp, _ep);
if (1 != tmp6) 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;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_addClassdefToEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inSCodeElement, modelica_boolean _inBoolean, modelica_metatype _redeclareMod, modelica_boolean _checkDuplicates, modelica_metatype *out_outEnv, modelica_metatype *out_outIH)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outEnv = NULL;
modelica_metatype _outIH = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;volatile modelica_metatype tmp4_6;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inIH;
tmp4_4 = _inPrefix;
tmp4_5 = _inSCodeElement;
tmp4_6 = _redeclareMod;
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _env_1 = NULL;
modelica_metatype _cl2 = NULL;
modelica_metatype _imp = NULL;
modelica_metatype _sel1 = NULL;
modelica_metatype _elt = NULL;
modelica_metatype _ih = NULL;
modelica_metatype _pre = NULL;
modelica_metatype _m = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
if (optionNone(tmp4_6)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_6), 1));
_sel1 = tmp4_5;
_m = tmpMeta6;
_cache = tmp4_1;
_env = tmp4_2;
_ih = tmp4_3;
_pre = tmp4_4;
_m = omc_Mod_lookupCompModification(threadData, _m, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sel1), 2))));
tmp7 = valueEq(_m, _OMC_LIT44);
if (0 != tmp7) goto goto_2;
_env_1 = omc_FGraph_mkClassNode(threadData, _env, _sel1, _pre, _m, 0);
_cache = omc_InstUtil_addClassdefsToEnv3(threadData, _cache, _env_1, _ih, _pre, _redeclareMod, _sel1 ,&_env_1 ,&_ih ,&_cl2);
_ih = omc_InnerOuter_addClassIfInner(threadData, _cl2, _pre, _env_1, _ih);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env_1;
tmpMeta[0+2] = _ih;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,2,8) == 0) goto tmp3_end;
_sel1 = tmp4_5;
_cache = tmp4_1;
_env = tmp4_2;
_ih = tmp4_3;
_pre = tmp4_4;
tmp4 += 2;
_env_1 = omc_FGraph_mkClassNode(threadData, _env, _sel1, _pre, _OMC_LIT44, _checkDuplicates);
_ih = omc_InnerOuter_addClassIfInner(threadData, _sel1, _pre, _env_1, _ih);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env_1;
tmpMeta[0+2] = _ih;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,0,3) == 0) goto tmp3_end;
_imp = tmp4_5;
_cache = tmp4_1;
_env = tmp4_2;
_ih = tmp4_3;
tmp4 += 1;
_env_1 = omc_FGraph_mkImportNode(threadData, _env, _imp);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env_1;
tmpMeta[0+2] = _ih;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_5,4,5) == 0) goto tmp3_end;
_elt = tmp4_5;
_cache = tmp4_1;
_env = tmp4_2;
_ih = tmp4_3;
_env_1 = omc_FGraph_mkDefunitNode(threadData, _env, _elt);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env_1;
tmpMeta[0+2] = _ih;
goto tmp3_done;
}
case 4: {
modelica_boolean tmp8;
tmp8 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp8) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT352);
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outEnv = tmpMeta[0+1];
_outIH = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outEnv) { *out_outEnv = _outEnv; }
if (out_outIH) { *out_outIH = _outIH; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_addClassdefToEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inSCodeElement, modelica_metatype _inBoolean, modelica_metatype _redeclareMod, modelica_metatype _checkDuplicates, modelica_metatype *out_outEnv, modelica_metatype *out_outIH)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inBoolean);
tmp2 = mmc_unbox_integer(_checkDuplicates);
_outCache = omc_InstUtil_addClassdefToEnv(threadData, _inCache, _inEnv, _inIH, _inPrefix, _inSCodeElement, tmp1, _redeclareMod, tmp2, out_outEnv, out_outIH);
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_addClassdefsToEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inClasses, modelica_boolean _inImpl, modelica_metatype _inRedeclareMod, modelica_boolean _checkDuplicates, modelica_metatype *out_outEnv, modelica_metatype *out_outIH)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outEnv = NULL;
modelica_metatype _outIH = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outCache = _inCache;
_outEnv = _inEnv;
_outIH = _inIH;
{
modelica_metatype _c;
for (tmpMeta1 = _inClasses; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_c = MMC_CAR(tmpMeta1);
_outCache = omc_InstUtil_addClassdefToEnv(threadData, _outCache, _outEnv, _outIH, _inPrefix, _c, _inImpl, _inRedeclareMod, _checkDuplicates ,&_outEnv ,&_outIH);
}
}
_return: OMC_LABEL_UNUSED
if (out_outEnv) { *out_outEnv = _outEnv; }
if (out_outIH) { *out_outIH = _outIH; }
return _outCache;
}
modelica_metatype boxptr_InstUtil_addClassdefsToEnv(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inPrefix, modelica_metatype _inClasses, modelica_metatype _inImpl, modelica_metatype _inRedeclareMod, modelica_metatype _checkDuplicates, modelica_metatype *out_outEnv, modelica_metatype *out_outIH)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_inImpl);
tmp2 = mmc_unbox_integer(_checkDuplicates);
_outCache = omc_InstUtil_addClassdefsToEnv(threadData, _inCache, _inEnv, _inIH, _inPrefix, _inClasses, tmp1, _inRedeclareMod, tmp2, out_outEnv, out_outIH);
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_componentElts(threadData_t *threadData, modelica_metatype _inSCodeElementLst)
{
modelica_metatype _outSCodeElementLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSCodeElementLst;
{
modelica_metatype _res = NULL;
modelica_metatype _xs = NULL;
modelica_metatype _cdef = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,3,8) == 0) goto tmp3_end;
_cdef = tmpMeta7;
_xs = tmpMeta8;
_res = omc_InstUtil_componentElts(threadData, _xs);
tmpMeta9 = mmc_mk_cons(_cdef, _res);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
_xs = tmpMeta11;
_inSCodeElementLst = _xs;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSCodeElementLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSCodeElementLst;
}
DLLExport
modelica_metatype omc_InstUtil_classdefAndImpElts(threadData_t *threadData, modelica_metatype _elts, modelica_metatype *out_restElts)
{
modelica_metatype _cdefElts = NULL;
modelica_metatype _restElts = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elts;
{
modelica_metatype _xs = NULL;
modelica_metatype _cdef = NULL;
modelica_metatype _imp = NULL;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,8) == 0) goto tmp3_end;
_cdef = tmpMeta8;
_xs = tmpMeta9;
omc_InstUtil_classdefAndImpElts(threadData, _xs ,&_restElts);
tmpMeta10 = mmc_mk_cons(_cdef, _restElts);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = _restElts;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,3) == 0) goto tmp3_end;
_imp = tmpMeta11;
_xs = tmpMeta12;
_cdefElts = omc_InstUtil_classdefAndImpElts(threadData, _xs ,&_restElts);
tmpMeta13 = mmc_mk_cons(_imp, _cdefElts);
tmpMeta[0+0] = tmpMeta13;
tmpMeta[0+1] = _restElts;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
_e = tmpMeta14;
_xs = tmpMeta15;
_cdefElts = omc_InstUtil_classdefAndImpElts(threadData, _xs ,&_restElts);
tmpMeta16 = mmc_mk_cons(_e, _restElts);
tmpMeta[0+0] = _cdefElts;
tmpMeta[0+1] = tmpMeta16;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cdefElts = tmpMeta[0+0];
_restElts = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_restElts) { *out_restElts = _restElts; }
return _cdefElts;
}
DLLExport
modelica_metatype omc_InstUtil_classdefElts2(threadData_t *threadData, modelica_metatype _inElements, modelica_metatype _partialPrefix, modelica_metatype *out_outConstEls)
{
modelica_metatype _outClassDefs = NULL;
modelica_metatype _outConstEls = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inElements;
tmp4_2 = _partialPrefix;
{
modelica_metatype _cdefs = NULL;
modelica_metatype _cdef = NULL;
modelica_metatype _el = NULL;
modelica_metatype _xs = NULL;
modelica_metatype _els = NULL;
modelica_metatype _attr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 4;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,8) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,8,0) == 0) goto tmp3_end;
_cdef = tmpMeta10;
_xs = tmpMeta9;
tmp4 += 2;
_cdefs = omc_InstUtil_classdefElts2(threadData, _xs, _partialPrefix ,&_els);
tmpMeta12 = mmc_mk_cons(_cdef, _cdefs);
tmpMeta[0+0] = tmpMeta12;
tmpMeta[0+1] = _els;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,0) == 0) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_1);
tmpMeta14 = MMC_CDR(tmp4_1);
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,2,8) == 0) goto tmp3_end;
_cdef = tmpMeta15;
_xs = tmpMeta14;
tmp4 += 1;
_cdefs = omc_InstUtil_classdefElts2(threadData, _xs, _partialPrefix ,&_els);
tmpMeta16 = mmc_mk_cons(_cdef, _cdefs);
tmpMeta[0+0] = tmpMeta16;
tmpMeta[0+1] = _els;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,0) == 0) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta17 = MMC_CAR(tmp4_1);
tmpMeta18 = MMC_CDR(tmp4_1);
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,3,8) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 4));
_el = tmpMeta17;
_attr = tmpMeta20;
_xs = tmpMeta18;
tmpMeta21 = omc_SCodeUtil_attrVariability(threadData, _attr);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,3,0) == 0) goto goto_2;
_cdefs = omc_InstUtil_classdefElts2(threadData, _xs, _partialPrefix ,&_els);
tmpMeta22 = mmc_mk_cons(_el, _els);
tmpMeta[0+0] = _cdefs;
tmpMeta[0+1] = tmpMeta22;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta23 = MMC_CAR(tmp4_1);
tmpMeta24 = MMC_CDR(tmp4_1);
_xs = tmpMeta24;
tmpMeta[0+0] = omc_InstUtil_classdefElts2(threadData, _xs, _partialPrefix, &tmpMeta[0+1]);
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outClassDefs = tmpMeta[0+0];
_outConstEls = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outConstEls) { *out_outConstEls = _outConstEls; }
return _outClassDefs;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_InstUtil_elementName(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_string _outName = NULL;
modelica_metatype _elem = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = _inElement;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_elem = tmpMeta7;
tmp1 = omc_SCodeUtil_elementName(threadData, _elem);
goto tmp3_done;
}
case 1: {
tmp1 = omc_SCodeDump_shortElementStr(threadData, omc_Util_tuple21(threadData, _inElement));
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outName = tmp1;
_return: OMC_LABEL_UNUSED
return _outName;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isElementParamOrConst(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _outIsParamOrConst;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_metatype _var = NULL;
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
_var = tmpMeta8;
tmp1 = omc_SCodeUtil_isParameterOrConst(threadData, _var);
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsParamOrConst = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsParamOrConst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isElementParamOrConst(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _outIsParamOrConst;
modelica_metatype out_outIsParamOrConst;
_outIsParamOrConst = omc_InstUtil_isElementParamOrConst(threadData, _inElement);
out_outIsParamOrConst = mmc_mk_icon(_outIsParamOrConst);
return out_outIsParamOrConst;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkCyclicalComponents(threadData_t *threadData, modelica_metatype _inCycles, modelica_metatype _inEnv)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;
tmp3_1 = _inCycles;
{
modelica_metatype _cycles = NULL;
modelica_metatype _names = NULL;
modelica_metatype _cycles_strs = NULL;
modelica_string _cycles_str = NULL;
modelica_string _scope_str = NULL;
modelica_metatype _graph = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 3; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (!listEmpty(tmp3_1)) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
_graph = omc_Graph_filterGraph(threadData, _inCycles, boxvar_InstUtil_isElementParamOrConst);
tmpMeta5 = omc_Graph_findCycles(threadData, _graph, boxvar_InstUtil_isElementEqual);
if (!listEmpty(tmpMeta5)) goto goto_1;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
_cycles = omc_Graph_findCycles(threadData, _inCycles, boxvar_InstUtil_isElementEqual);
_names = omc_List_mapList(threadData, _cycles, boxvar_InstUtil_elementName);
_cycles_strs = omc_List_map1(threadData, _names, boxvar_stringDelimitList, _OMC_LIT79);
_cycles_str = stringDelimitList(_cycles_strs, _OMC_LIT353);
tmpMeta6 = stringAppend(_OMC_LIT354,_cycles_str);
tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT355);
_cycles_str = tmpMeta7;
_scope_str = omc_FGraph_printGraphPathStr(threadData, _inEnv);
tmpMeta8 = mmc_mk_cons(_scope_str, mmc_mk_cons(_cycles_str, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addMessage(threadData, _OMC_LIT358, tmpMeta8);
if((!omc_Flags_isSet(threadData, _OMC_LIT362)))
{
goto goto_1;
}
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 < 3) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isElementEqual(threadData_t *threadData, modelica_metatype _inElement1, modelica_metatype _inElement2)
{
modelica_boolean _isEqual;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inElement1;
tmp4_2 = _inElement2;
{
modelica_string _id1 = NULL;
modelica_string _id2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_id1 = tmpMeta7;
_id2 = tmpMeta9;
tmp1 = (stringEqual(_id1, _id2));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,8) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,8) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_id1 = tmpMeta11;
_id2 = tmpMeta13;
tmp1 = (stringEqual(_id1, _id2));
goto tmp3_done;
}
case 2: {
tmp1 = (stringEqual(omc_InstUtil_elementName(threadData, _inElement1), omc_InstUtil_elementName(threadData, _inElement2)));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isEqual = tmp1;
_return: OMC_LABEL_UNUSED
return _isEqual;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isElementEqual(threadData_t *threadData, modelica_metatype _inElement1, modelica_metatype _inElement2)
{
modelica_boolean _isEqual;
modelica_metatype out_isEqual;
_isEqual = omc_InstUtil_isElementEqual(threadData, _inElement1, _inElement2);
out_isEqual = mmc_mk_icon(_isEqual);
return out_isEqual;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isElementNamed(threadData_t *threadData, modelica_metatype _inElement, modelica_string _inName)
{
modelica_boolean _isNamed;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_string _name = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_name = tmpMeta7;
tmp1 = (stringEqual(_name, _inName));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_name = tmpMeta9;
tmp1 = (stringEqual(_name, _inName));
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isNamed = tmp1;
_return: OMC_LABEL_UNUSED
return _isNamed;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isElementNamed(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _inName)
{
modelica_boolean _isNamed;
modelica_metatype out_isNamed;
_isNamed = omc_InstUtil_isElementNamed(threadData, _inElement, _inName);
out_isNamed = mmc_mk_icon(_isNamed);
return out_isNamed;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getElementDependenciesTraverserExit(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTuple, modelica_metatype *out_outTuple)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTuple = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTuple;
{
modelica_metatype _all_el = NULL;
modelica_metatype _stack_el = NULL;
modelica_metatype _deps = NULL;
modelica_metatype _rest_stack = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _ifExp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmpMeta8);
tmpMeta10 = MMC_CDR(tmpMeta8);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmp12 = mmc_unbox_integer(tmpMeta11);
if (0 != tmp12) goto tmp3_end;
_exp = tmp4_1;
_ifExp = tmpMeta6;
_all_el = tmpMeta7;
_stack_el = tmpMeta9;
_rest_stack = tmpMeta10;
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta17 = mmc_mk_box4(0, _all_el, tmpMeta15, tmpMeta16, mmc_mk_boolean(0));
omc_AbsynUtil_traverseExpBidir(threadData, _ifExp, boxvar_InstUtil_getElementDependenciesTraverserEnter, boxvar_InstUtil_getElementDependenciesTraverserExit, tmpMeta17, &tmpMeta13);
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
_deps = tmpMeta14;
tmpMeta18 = mmc_mk_box4(0, _all_el, _rest_stack, listAppend(_deps, _stack_el), mmc_mk_boolean(0));
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = tmpMeta18;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTuple;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outTuple = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTuple) { *out_outTuple = _outTuple; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getElementDependenciesTraverserEnter(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTuple, modelica_metatype *out_outTuple)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTuple = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTuple;
{
modelica_metatype _exp = NULL;
modelica_string _id = NULL;
modelica_metatype _all_el = NULL;
modelica_metatype _accum_el = NULL;
modelica_metatype _stack = NULL;
modelica_metatype _e = NULL;
modelica_metatype _cref = NULL;
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_integer tmp11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmp11 = mmc_unbox_integer(tmpMeta10);
_exp = tmp4_1;
_cref = tmpMeta6;
_all_el = tmpMeta7;
_stack = tmpMeta8;
_accum_el = tmpMeta9;
_b = tmp11;
tmp4 += 2;
_id = omc_AbsynUtil_crefFirstIdent(threadData, _cref);
_e = omc_List_find1(threadData, _all_el, boxvar_InstUtil_isElementNamed, _id);
tmpMeta12 = mmc_mk_cons(_e, _accum_el);
tmpMeta13 = mmc_mk_box4(0, _all_el, _stack, tmpMeta12, mmc_mk_boolean(_b));
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = tmpMeta13;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_integer tmp19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmp19 = mmc_unbox_integer(tmpMeta18);
_exp = tmp4_1;
_cref = tmpMeta14;
_all_el = tmpMeta15;
_stack = tmpMeta16;
_accum_el = tmpMeta17;
_b = tmp19;
tmp4 += 1;
_id = omc_AbsynUtil_crefFirstIdent(threadData, _cref);
_e = omc_List_find1(threadData, _all_el, boxvar_InstUtil_isElementNamed, _id);
tmpMeta20 = mmc_mk_cons(_e, _accum_el);
tmpMeta21 = mmc_mk_box4(0, _all_el, _stack, tmpMeta20, mmc_mk_boolean(_b));
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = tmpMeta21;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_integer tmp26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmp26 = mmc_unbox_integer(tmpMeta25);
if (0 != tmp26) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
_all_el = tmpMeta22;
_stack = tmpMeta23;
_accum_el = tmpMeta24;
_exp = tmp4_1;
tmpMeta27 = mmc_mk_cons(_accum_el, _stack);
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta29 = mmc_mk_box4(0, _all_el, tmpMeta27, tmpMeta28, mmc_mk_boolean(0));
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = tmpMeta29;
goto tmp3_done;
}
case 3: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTuple;
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outTuple = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTuple) { *out_outTuple = _outTuple; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getExpsFromDefaults(threadData_t *threadData, modelica_metatype _inEls, modelica_metatype _inAcc)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inEls;
{
modelica_metatype _rest = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _sexps = NULL;
modelica_metatype _bexps = NULL;
modelica_metatype _m = NULL;
modelica_metatype _rp = NULL;
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 (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta1 = _inAcc;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
_rp = tmpMeta9;
_m = tmpMeta10;
_rest = tmpMeta7;
_exps = _inAcc;
_bexps = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
_bexps = omc_InstUtil_getExpsFromMod(threadData, _m ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
tmpMeta1 = omc_InstUtil_getExpsFromDefaults(threadData, _rest, _exps);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
_rest = tmpMeta12;
tmpMeta1 = omc_InstUtil_getExpsFromDefaults(threadData, _rest, _inAcc);
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:;
}
}
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getExpsFromExternalDecl(threadData_t *threadData, modelica_metatype _inExternalDecl)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExternalDecl;
{
modelica_metatype _exps = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
_exps = tmpMeta8;
tmpMeta1 = _exps;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExps;
}
DLLExport
modelica_metatype omc_InstUtil_getElementDependencies(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _inAllElementsAndIsFunctionScope)
{
modelica_metatype _outDependencies = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inElement;
tmp4_2 = _inAllElementsAndIsFunctionScope;
{
modelica_metatype _var = NULL;
modelica_metatype _cExpOpt = NULL;
modelica_metatype _deps = NULL;
modelica_metatype _daeMod = NULL;
modelica_metatype _ad = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _sexps = NULL;
modelica_metatype _bexps = NULL;
modelica_metatype _mod = NULL;
modelica_string _name = NULL;
modelica_metatype _direction = NULL;
modelica_metatype _inAllElements = NULL;
modelica_metatype _rp = NULL;
modelica_metatype _externalDecl = NULL;
modelica_boolean _isFunction;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 6; 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;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
modelica_boolean tmp19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 5));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 8));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp18 = mmc_unbox_integer(tmpMeta17);
_name = tmpMeta7;
_rp = tmpMeta9;
_ad = tmpMeta11;
_var = tmpMeta12;
_mod = tmpMeta13;
_cExpOpt = tmpMeta14;
_daeMod = tmpMeta15;
_inAllElements = tmpMeta16;
_isFunction = tmp18;
tmp19 = omc_SCodeUtil_isParameterOrConst(threadData, _var);
if (1 != tmp19) goto goto_2;
omc_AbsynUtil_getExpsFromArrayDim(threadData, _ad ,&_exps);
_bexps = omc_InstUtil_getExpsFromMod(threadData, _mod ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
_bexps = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
_bexps = omc_InstUtil_getExpsFromMod(threadData, omc_Mod_unelabMod(threadData, _daeMod) ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
_deps = omc_InstUtil_getDepsFromExps(threadData, _exps, _inAllElements, tmpMeta20, _isFunction);
_deps = omc_InstUtil_removeCurrentElementFromArrayDimDeps(threadData, _name, _deps);
_deps = omc_InstUtil_getDepsFromExps(threadData, omc_Util_optionList(threadData, _cExpOpt), _inAllElements, _deps, _isFunction);
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_List_union(threadData, _deps, tmpMeta21);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta22;
modelica_integer tmp23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_boolean tmp27;
modelica_metatype tmpMeta28;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp23 = mmc_unbox_integer(tmpMeta22);
if (1 != tmp23) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,3,8) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 4));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 6));
_direction = tmpMeta26;
tmp27 = omc_AbsynUtil_isInputOrOutput(threadData, _direction);
if (1 != tmp27) goto goto_2;
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta28;
goto tmp3_done;
}
case 2: {
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_integer tmp40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,3,8) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 3));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta31), 6));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 4));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 6));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 8));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp40 = mmc_unbox_integer(tmpMeta39);
_name = tmpMeta30;
_rp = tmpMeta32;
_ad = tmpMeta34;
_mod = tmpMeta35;
_cExpOpt = tmpMeta36;
_daeMod = tmpMeta37;
_inAllElements = tmpMeta38;
_isFunction = tmp40;
tmp4 += 2;
omc_AbsynUtil_getExpsFromArrayDim(threadData, _ad ,&_exps);
_bexps = omc_InstUtil_getExpsFromMod(threadData, _mod ,&_sexps);
_exps = listAppend(_sexps, _exps);
_exps = listAppend(_bexps, _exps);
_bexps = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
_bexps = omc_InstUtil_getExpsFromMod(threadData, omc_Mod_unelabMod(threadData, _daeMod) ,&_sexps);
_exps = listAppend(_sexps, _exps);
_exps = listAppend(_bexps, _exps);
tmpMeta41 = MMC_REFSTRUCTLIT(mmc_nil);
_deps = omc_InstUtil_getDepsFromExps(threadData, _exps, _inAllElements, tmpMeta41, _isFunction);
_deps = omc_InstUtil_removeCurrentElementFromArrayDimDeps(threadData, _name, _deps);
_deps = omc_InstUtil_getDepsFromExps(threadData, omc_Util_optionList(threadData, _cExpOpt), _inAllElements, _deps, _isFunction);
tmpMeta42 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_List_union(threadData, _deps, tmpMeta42);
goto tmp3_done;
}
case 3: {
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_integer tmp54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,2,8) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 2));
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 3));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta45), 6));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta47,2,3) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta47), 3));
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta47), 4));
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp54 = mmc_unbox_integer(tmpMeta53);
_name = tmpMeta44;
_rp = tmpMeta46;
_mod = tmpMeta48;
_ad = tmpMeta50;
_daeMod = tmpMeta51;
_inAllElements = tmpMeta52;
_isFunction = tmp54;
tmp4 += 1;
omc_AbsynUtil_getExpsFromArrayDim(threadData, _ad ,&_exps);
omc_InstUtil_getExpsFromMod(threadData, _mod ,&_sexps);
_exps = listAppend(_sexps, _exps);
_bexps = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_sexps);
_exps = listAppend(_bexps, listAppend(_sexps, _exps));
omc_InstUtil_getExpsFromMod(threadData, omc_Mod_unelabMod(threadData, _daeMod) ,&_sexps);
_exps = listAppend(_sexps, _exps);
tmpMeta55 = MMC_REFSTRUCTLIT(mmc_nil);
_deps = omc_InstUtil_getDepsFromExps(threadData, _exps, _inAllElements, tmpMeta55, _isFunction);
_deps = omc_InstUtil_removeCurrentElementFromArrayDimDeps(threadData, _name, _deps);
tmpMeta56 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_List_union(threadData, _deps, tmpMeta56);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_integer tmp64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta57,2,8) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta57), 2));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta57), 3));
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta57), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta60,0,8) == 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 9));
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp64 = mmc_unbox_integer(tmpMeta63);
_name = tmpMeta58;
_externalDecl = tmpMeta61;
_inAllElements = tmpMeta62;
_isFunction = tmp64;
_exps = omc_InstUtil_getExpsFromExternalDecl(threadData, _externalDecl);
tmpMeta65 = MMC_REFSTRUCTLIT(mmc_nil);
_deps = omc_InstUtil_getDepsFromExps(threadData, _exps, _inAllElements, tmpMeta65, _isFunction);
_deps = omc_InstUtil_removeCurrentElementFromArrayDimDeps(threadData, _name, _deps);
tmpMeta66 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_List_union(threadData, _deps, tmpMeta66);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta67;
tmpMeta67 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta67;
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 < 6) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outDependencies = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDependencies;
}
DLLExport
modelica_metatype omc_InstUtil_getCrefFromDim(threadData_t *threadData, modelica_metatype _inArrayDim)
{
modelica_metatype _outAbsynComponentRefLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inArrayDim;
{
modelica_metatype _l1 = NULL;
modelica_metatype _l2 = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _rest = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_exp = tmpMeta8;
_rest = tmpMeta7;
tmp4 += 2;
_l1 = omc_InstUtil_getCrefFromDim(threadData, _rest);
_l2 = omc_AbsynUtil_getCrefFromExp(threadData, _exp, 1, 1);
tmpMeta1 = omc_List_union(threadData, _l1, _l2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_1);
tmpMeta10 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,0) == 0) goto tmp3_end;
_rest = tmpMeta10;
tmp4 += 1;
tmpMeta1 = omc_InstUtil_getCrefFromDim(threadData, _rest);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 3: {
modelica_boolean tmp12;
tmp12 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp12) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT363);
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outAbsynComponentRefLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAbsynComponentRefLst;
}
DLLExport
modelica_metatype omc_InstUtil_getExpsFromMod(threadData_t *threadData, modelica_metatype _inMod, modelica_metatype *out_outSubsExps)
{
modelica_metatype _outBindingExp = NULL;
modelica_metatype _outSubsExps = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inMod;
{
modelica_metatype _se = NULL;
modelica_metatype _l1 = NULL;
modelica_metatype _l2 = NULL;
modelica_metatype _l3 = NULL;
modelica_metatype _l4 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _ado = NULL;
modelica_metatype _m = NULL;
modelica_metatype _ad = NULL;
modelica_metatype _rp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (!optionNone(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (optionNone(tmpMeta13)) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
_subs = tmpMeta12;
_e = tmpMeta14;
_se = omc_InstUtil_getExpsFromSubMods(threadData, _subs);
tmpMeta15 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta[0+0] = tmpMeta15;
tmpMeta[0+1] = _se;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (!optionNone(tmpMeta17)) goto tmp3_end;
_subs = tmpMeta16;
_se = omc_InstUtil_getExpsFromSubMods(threadData, _subs);
tmpMeta18 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta18;
tmpMeta[0+1] = _se;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,2,8) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 6));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,2,3) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,0,2) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 3));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 3));
_rp = tmpMeta21;
_ado = tmpMeta24;
_m = tmpMeta25;
_l1 = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_l2);
omc_AbsynUtil_getExpsFromArrayDimOpt(threadData, _ado ,&_se);
_l3 = omc_InstUtil_getExpsFromMod(threadData, _m ,&_l4);
_l1 = listAppend(_se, listAppend(_l1, _l3));
_l4 = listAppend(_l2, _l4);
tmpMeta[0+0] = _l1;
tmpMeta[0+1] = _l4;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,2,8) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 3));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 6));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,1,2) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
_rp = tmpMeta28;
_m = tmpMeta30;
_l1 = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_l2);
_l3 = omc_InstUtil_getExpsFromMod(threadData, _m ,&_l4);
_l3 = listAppend(_l1, _l3);
_l4 = listAppend(_l2, _l4);
tmpMeta[0+0] = _l3;
tmpMeta[0+1] = _l4;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta31,2,8) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta31), 3));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 6));
_rp = tmpMeta33;
tmpMeta[0+0] = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp, &tmpMeta[0+1]);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,3,8) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 3));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 6));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 4));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 6));
_rp = tmpMeta36;
_ad = tmpMeta38;
_m = tmpMeta39;
_l1 = omc_InstUtil_getExpsFromConstrainClass(threadData, _rp ,&_l2);
omc_AbsynUtil_getExpsFromArrayDim(threadData, _ad ,&_se);
_l3 = omc_InstUtil_getExpsFromMod(threadData, _m ,&_l4);
_l1 = listAppend(_se, listAppend(_l1, _l3));
_l4 = listAppend(_l2, _l4);
tmpMeta[0+0] = _l1;
tmpMeta[0+1] = _l4;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBindingExp = tmpMeta[0+0];
_outSubsExps = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outSubsExps) { *out_outSubsExps = _outSubsExps; }
return _outBindingExp;
}
DLLExport
modelica_metatype omc_InstUtil_getCrefFromMod(threadData_t *threadData, modelica_metatype _inMod)
{
modelica_metatype _outCrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_metatype _l1 = NULL;
modelica_metatype _l2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_l1 = omc_InstUtil_getExpsFromMod(threadData, _inMod ,&_l2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map2(threadData, listAppend(_l1, _l2), boxvar_AbsynUtil_getCrefFromExp, mmc_mk_boolean(1), mmc_mk_boolean(1)));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = stringAppend(_OMC_LIT364,omc_SCodeDump_printModStr(threadData, _inMod, _OMC_LIT104));
tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT107);
fputs(MMC_STRINGDATA(tmpMeta7),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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCrefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCrefs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getExpsFromSubMods(threadData_t *threadData, modelica_metatype _inSubMods)
{
modelica_metatype _outSubsExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubMods;
{
modelica_metatype _mod = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _e = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _sm = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
_mod = tmpMeta9;
_rest = tmpMeta8;
_e = omc_InstUtil_getExpsFromMod(threadData, _mod ,&_sm);
_exps = omc_InstUtil_getExpsFromSubMods(threadData, _rest);
tmpMeta1 = listAppend(_e, listAppend(_sm, _exps));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubsExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubsExps;
}
DLLExport
modelica_metatype omc_InstUtil_getExpsFromConstrainClass(threadData_t *threadData, modelica_metatype _inRP, modelica_metatype *out_outSubsExps)
{
modelica_metatype _outBindingExp = NULL;
modelica_metatype _outSubsExps = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inRP;
{
modelica_metatype _m = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
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_1,1,0) == 0) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (!optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta9;
tmpMeta[0+1] = tmpMeta10;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
_m = tmpMeta13;
tmpMeta[0+0] = omc_InstUtil_getExpsFromMod(threadData, _m, &tmpMeta[0+1]);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBindingExp = tmpMeta[0+0];
_outSubsExps = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outSubsExps) { *out_outSubsExps = _outSubsExps; }
return _outBindingExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_removeCurrentElementFromArrayDimDeps(threadData_t *threadData, modelica_string _name, modelica_metatype _inDependencies)
{
modelica_metatype _outDependencies = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar15;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype __omcQ_24tmpVar14;
modelica_integer tmp4;
modelica_metatype _dep_loopVar = 0;
modelica_metatype _dep;
_dep_loopVar = _inDependencies;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar15 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar15;
while(1) {
tmp4 = 1;
while (!listEmpty(_dep_loopVar)) {
_dep = MMC_CAR(_dep_loopVar);
_dep_loopVar = MMC_CDR(_dep_loopVar);
if ((!(stringEqual(_name, omc_SCodeUtil_elementName(threadData, omc_Util_tuple21(threadData, _dep)))))) {
tmp4--;
break;
}
}
if (tmp4 == 0) {
__omcQ_24tmpVar14 = _dep;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar14,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp4 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar15;
}
_outDependencies = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDependencies;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getDepsFromExps(threadData_t *threadData, modelica_metatype _inExps, modelica_metatype _inAllElements, modelica_metatype _inDependencies, modelica_boolean _isFunction)
{
modelica_metatype _outDependencies = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExps;
tmp4_2 = _inDependencies;
{
modelica_metatype _rest = NULL;
modelica_metatype _e = NULL;
modelica_metatype _deps = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta1 = _inDependencies;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_e = tmpMeta6;
_rest = tmpMeta7;
_deps = tmp4_2;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = mmc_mk_box4(0, _inAllElements, tmpMeta10, _deps, mmc_mk_boolean(_isFunction));
omc_AbsynUtil_traverseExpBidir(threadData, _e, boxvar_InstUtil_getElementDependenciesTraverserEnter, boxvar_InstUtil_getElementDependenciesTraverserExit, tmpMeta11, &tmpMeta8);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
_deps = tmpMeta9;
_inExps = _rest;
_inDependencies = _deps;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDependencies = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDependencies;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_getDepsFromExps(threadData_t *threadData, modelica_metatype _inExps, modelica_metatype _inAllElements, modelica_metatype _inDependencies, modelica_metatype _isFunction)
{
modelica_integer tmp1;
modelica_metatype _outDependencies = NULL;
tmp1 = mmc_unbox_integer(_isFunction);
_outDependencies = omc_InstUtil_getDepsFromExps(threadData, _inExps, _inAllElements, _inDependencies, tmp1);
return _outDependencies;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_printGraph(threadData_t *threadData, modelica_metatype _env, modelica_metatype _g, modelica_metatype _order, modelica_metatype _cycles)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;
tmp3_1 = _g;
{
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: {
if (!listEmpty(tmp3_1)) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
tmpMeta5 = stringAppend(_OMC_LIT365,omc_FGraph_printGraphPathStr(threadData, _env));
tmpMeta6 = stringAppend(tmpMeta5,_OMC_LIT107);
tmpMeta7 = stringAppend(tmpMeta6,omc_Graph_printGraph(threadData, _g, boxvar_InstUtil_elementName));
tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT107);
fputs(MMC_STRINGDATA(tmpMeta8),stdout);
tmpMeta9 = stringAppend(_OMC_LIT366,stringDelimitList(omc_List_map(threadData, _order, boxvar_InstUtil_elementName), _OMC_LIT367));
tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT107);
fputs(MMC_STRINGDATA(tmpMeta10),stdout);
tmpMeta11 = stringAppend(_OMC_LIT368,omc_Graph_printGraph(threadData, _cycles, boxvar_InstUtil_elementName));
tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT107);
fputs(MMC_STRINGDATA(tmpMeta12),stdout);
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:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
modelica_metatype omc_InstUtil_sortElementList(threadData_t *threadData, modelica_metatype __omcQ_24in_5FinElements, modelica_metatype _inEnv, modelica_boolean _isFunctionScope)
{
modelica_metatype _inElements = NULL;
modelica_metatype _outE = NULL;
modelica_metatype _cycleElts = NULL;
modelica_metatype _cycles = NULL;
modelica_metatype _g = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_inElements = __omcQ_24in_5FinElements;
tmpMeta1 = mmc_mk_box2(0, _inElements, mmc_mk_boolean(_isFunctionScope));
_g = omc_Graph_buildGraph(threadData, _inElements, boxvar_InstUtil_getElementDependencies, tmpMeta1);
_outE = omc_Graph_topologicalSort(threadData, _g, boxvar_InstUtil_isElementEqual ,&_cycles);
if((!omc_Config_acceptMetaModelicaGrammar(threadData)))
{
_inElements = listAppend(_outE, omc_List_map(threadData, _cycles, boxvar_Util_tuple21));
}
omc_InstUtil_checkCyclicalComponents(threadData, _cycles, _inEnv);
_return: OMC_LABEL_UNUSED
return _inElements;
}
modelica_metatype boxptr_InstUtil_sortElementList(threadData_t *threadData, modelica_metatype __omcQ_24in_5FinElements, modelica_metatype _inEnv, modelica_metatype _isFunctionScope)
{
modelica_integer tmp1;
modelica_metatype _inElements = NULL;
tmp1 = mmc_unbox_integer(_isFunctionScope);
_inElements = omc_InstUtil_sortElementList(threadData, __omcQ_24in_5FinElements, _inEnv, tmp1);
return _inElements;
}
DLLExport
modelica_metatype omc_InstUtil_addNomod(threadData_t *threadData, modelica_metatype _inElements)
{
modelica_metatype _outElements = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar17;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype __omcQ_24tmpVar16;
modelica_integer tmp5;
modelica_metatype _x_loopVar = 0;
modelica_metatype _x;
_x_loopVar = _inElements;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar17 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar17;
while(1) {
tmp5 = 1;
if (!listEmpty(_x_loopVar)) {
_x = MMC_CAR(_x_loopVar);
_x_loopVar = MMC_CDR(_x_loopVar);
tmp5--;
}
if (tmp5 == 0) {
tmpMeta4 = mmc_mk_box2(0, _x, _OMC_LIT44);
__omcQ_24tmpVar16 = tmpMeta4;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar16,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp5 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar17;
}
_outElements = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElements;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_getOptionArraydim(threadData_t *threadData, modelica_metatype _inAbsynArrayDimOption)
{
modelica_metatype _outArrayDim = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inAbsynArrayDimOption;
{
modelica_metatype _dim = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_dim = tmpMeta6;
tmpMeta1 = _dim;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArrayDim = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outArrayDim;
}
DLLExport
modelica_metatype omc_InstUtil_getModsForDep(threadData_t *threadData, modelica_metatype _inDepCref, modelica_metatype _inElems)
{
modelica_metatype _omods = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inDepCref;
tmp4_2 = _inElems;
{
modelica_string _name1 = NULL;
modelica_string _name2 = NULL;
modelica_metatype _cmod = NULL;
modelica_metatype _dep = NULL;
modelica_metatype _elems = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp4 += 3;
tmpMeta1 = _OMC_LIT44;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_2);
tmpMeta7 = MMC_CDR(tmp4_2);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,0) == 0) goto tmp3_end;
_elems = tmpMeta7;
_dep = tmp4_1;
tmpMeta1 = omc_InstUtil_getModsForDep(threadData, _dep, _elems);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_2);
tmpMeta11 = MMC_CDR(tmp4_2);
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,3,8) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_name1 = tmpMeta13;
_cmod = tmpMeta14;
_dep = tmp4_1;
_name2 = omc_Dump_printComponentRefStr(threadData, _dep);
tmp15 = (stringEqual(_name2, _name1));
if (1 != tmp15) goto goto_2;
tmpMeta17 = mmc_mk_box3(3, &DAE_SubMod_NAMEMOD__desc, _name2, _cmod);
tmpMeta16 = mmc_mk_cons(tmpMeta17, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta18 = mmc_mk_box6(3, &DAE_Mod_MOD__desc, _OMC_LIT122, _OMC_LIT123, tmpMeta16, mmc_mk_none(), _OMC_LIT331);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_2);
tmpMeta20 = MMC_CDR(tmp4_2);
_elems = tmpMeta20;
_dep = tmp4_1;
tmpMeta1 = omc_InstUtil_getModsForDep(threadData, _dep, _elems);
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_omods = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _omods;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_removeExtBindings(threadData_t *threadData, modelica_metatype _elements)
{
modelica_metatype _outElements = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elements;
{
modelica_metatype _el = NULL;
modelica_metatype _els = NULL;
modelica_metatype _els1 = NULL;
modelica_string _name = NULL;
modelica_metatype _prefixes = NULL;
modelica_metatype _attributes = NULL;
modelica_metatype _typeSpec = NULL;
modelica_metatype _comment = NULL;
modelica_metatype _condition = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,8) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 5));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 7));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 8));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 9));
_name = tmpMeta10;
_prefixes = tmpMeta11;
_attributes = tmpMeta12;
_typeSpec = tmpMeta13;
_comment = tmpMeta14;
_condition = tmpMeta15;
_info = tmpMeta16;
_els = tmpMeta8;
_els1 = omc_InstUtil_removeExtBindings(threadData, _els);
tmpMeta18 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, _name, _prefixes, _attributes, _typeSpec, _OMC_LIT45, _comment, _condition, _info);
tmpMeta19 = mmc_mk_box2(0, tmpMeta18, _OMC_LIT44);
tmpMeta17 = mmc_mk_cons(tmpMeta19, _els1);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta20 = MMC_CAR(tmp4_1);
tmpMeta21 = MMC_CDR(tmp4_1);
_el = tmpMeta20;
_els = tmpMeta21;
_els1 = omc_InstUtil_removeExtBindings(threadData, _els);
tmpMeta22 = mmc_mk_cons(_el, _els1);
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outElements = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElements;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_removeBindings(threadData_t *threadData, modelica_metatype _elements)
{
modelica_metatype _outElements = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _elements;
{
modelica_metatype _el = NULL;
modelica_metatype _els = NULL;
modelica_metatype _els1 = NULL;
modelica_string _name = NULL;
modelica_metatype _prefixes = NULL;
modelica_metatype _attributes = NULL;
modelica_metatype _typeSpec = NULL;
modelica_metatype _comment = NULL;
modelica_metatype _condition = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,3,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 7));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 8));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 9));
_name = tmpMeta9;
_prefixes = tmpMeta10;
_attributes = tmpMeta11;
_typeSpec = tmpMeta12;
_comment = tmpMeta13;
_condition = tmpMeta14;
_info = tmpMeta15;
_els = tmpMeta8;
_els1 = omc_InstUtil_removeBindings(threadData, _els);
tmpMeta17 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, _name, _prefixes, _attributes, _typeSpec, _OMC_LIT45, _comment, _condition, _info);
tmpMeta16 = mmc_mk_cons(tmpMeta17, _els1);
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
_el = tmpMeta18;
_els = tmpMeta19;
_els1 = omc_InstUtil_removeBindings(threadData, _els);
tmpMeta20 = mmc_mk_cons(_el, _els1);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outElements = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElements;
}
DLLExport
modelica_metatype omc_InstUtil_constantAndParameterEls(threadData_t *threadData, modelica_metatype _elements)
{
modelica_metatype _outElements = NULL;
modelica_metatype _attr = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar19;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype __omcQ_24tmpVar18;
modelica_integer tmp4;
modelica_metatype _el_loopVar = 0;
modelica_boolean tmp5 = 0;
modelica_metatype _el;
_el_loopVar = _elements;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar19 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar19;
while(1) {
tmp4 = 1;
while (!listEmpty(_el_loopVar)) {
_el = MMC_CAR(_el_loopVar);
_el_loopVar = MMC_CDR(_el_loopVar);
{
modelica_metatype tmp8_1;
tmp8_1 = _el;
{
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,3,8) == 0) goto tmp7_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 4));
_attr = tmpMeta10;
tmp5 = omc_SCodeUtil_isParameterOrConst(threadData, omc_SCodeUtil_attrVariability(threadData, _attr));
goto tmp7_done;
}
case 1: {
tmp5 = 0;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
goto_6:;
MMC_THROW_INTERNAL();
goto tmp7_done;
tmp7_done:;
}
}
if (tmp5) {
tmp4--;
break;
}
}
if (tmp4 == 0) {
__omcQ_24tmpVar18 = _el;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar18,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp4 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar19;
}
_outElements = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElements;
}
DLLExport
modelica_metatype omc_InstUtil_constantEls(threadData_t *threadData, modelica_metatype _elements)
{
modelica_metatype _outElements = NULL;
modelica_metatype _attr = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar21;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype __omcQ_24tmpVar20;
modelica_integer tmp4;
modelica_metatype _el_loopVar = 0;
modelica_boolean tmp5 = 0;
modelica_metatype _el;
_el_loopVar = _elements;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar21 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar21;
while(1) {
tmp4 = 1;
while (!listEmpty(_el_loopVar)) {
_el = MMC_CAR(_el_loopVar);
_el_loopVar = MMC_CDR(_el_loopVar);
{
modelica_metatype tmp8_1;
tmp8_1 = _el;
{
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,3,8) == 0) goto tmp7_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 4));
_attr = tmpMeta10;
tmp5 = omc_SCodeUtil_isConstant(threadData, omc_SCodeUtil_attrVariability(threadData, _attr));
goto tmp7_done;
}
case 1: {
tmp5 = 0;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
goto_6:;
MMC_THROW_INTERNAL();
goto tmp7_done;
tmp7_done:;
}
}
if (tmp5) {
tmp4--;
break;
}
}
if (tmp4 == 0) {
__omcQ_24tmpVar20 = _el;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar20,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp4 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar21;
}
_outElements = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElements;
}
DLLExport
void omc_InstUtil_printExtcomps(threadData_t *threadData, modelica_metatype _inElements)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _inElements;
{
modelica_string _s = NULL;
modelica_metatype _el = NULL;
modelica_metatype _mod = NULL;
modelica_metatype _els = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 2; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (!listEmpty(tmp3_1)) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_CAR(tmp3_1);
tmpMeta6 = MMC_CDR(tmp3_1);
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
_el = tmpMeta7;
_mod = tmpMeta8;
_els = tmpMeta6;
_s = omc_SCodeDump_unparseElementStr(threadData, _el, _OMC_LIT104);
fputs(MMC_STRINGDATA(_s),stdout);
fputs(MMC_STRINGDATA(_OMC_LIT369),stdout);
fputs(MMC_STRINGDATA(omc_Mod_printModStr(threadData, _mod)),stdout);
fputs(MMC_STRINGDATA(_OMC_LIT107),stdout);
_inElements = _els;
goto _tailrecursive;
;
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;
}
DLLExport
modelica_metatype omc_InstUtil_removeSelfReference(threadData_t *threadData, modelica_string _className, modelica_metatype _path)
{
modelica_metatype _outPath = NULL;
modelica_metatype tmpMeta1;
modelica_boolean tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmp2 = (modelica_boolean)(stringEqual(_className, omc_AbsynUtil_pathFirstIdent(threadData, _path)));
if(tmp2)
{
tmpMeta1 = mmc_mk_box2(4, &Absyn_Path_IDENT__desc, _className);
tmpMeta3 = omc_AbsynUtil_removePrefix(threadData, tmpMeta1, _path);
}
else
{
tmpMeta3 = _path;
}
_outPath = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outPath;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractConstantPlusDeps3(threadData_t *threadData, modelica_metatype _inAcrefs, modelica_metatype _remainingComps, modelica_string _className, modelica_metatype _inExisting)
{
modelica_metatype _outComps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inAcrefs;
tmp4_2 = _inExisting;
{
modelica_string _s1 = NULL;
modelica_metatype _acr = NULL;
modelica_metatype _localComps = NULL;
modelica_metatype _names = NULL;
modelica_metatype _cref_ = NULL;
modelica_metatype _acrefs = NULL;
modelica_metatype _existing = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 5;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_acr = tmpMeta9;
_acrefs = tmpMeta8;
_existing = tmp4_2;
tmp4 += 4;
tmpMeta10 = mmc_mk_cons(_acr, _acrefs);
tmpMeta1 = omc_InstUtil_extractConstantPlusDeps3(threadData, tmpMeta10, _remainingComps, _className, _existing);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,2,2) == 0) goto tmp3_end;
_s1 = tmpMeta13;
_acr = tmpMeta14;
_acrefs = tmpMeta12;
_existing = tmp4_2;
if (!(stringEqual(_className, _s1))) goto tmp3_end;
tmpMeta15 = mmc_mk_cons(_acr, _acrefs);
tmpMeta1 = omc_InstUtil_extractConstantPlusDeps3(threadData, tmpMeta15, _remainingComps, _className, _existing);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmp4_1);
tmpMeta17 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,1,3) == 0) goto tmp3_end;
_acrefs = tmpMeta17;
_existing = tmp4_2;
tmp4 += 2;
tmpMeta1 = omc_InstUtil_extractConstantPlusDeps3(threadData, _acrefs, _remainingComps, _className, _existing);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,2) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
_s1 = tmpMeta20;
_acrefs = tmpMeta19;
_existing = tmp4_2;
if (!omc_List_isMemberOnTrue(threadData, _s1, _existing, boxvar_stringEq)) goto tmp3_end;
tmpMeta1 = omc_InstUtil_extractConstantPlusDeps3(threadData, _acrefs, _remainingComps, _className, _existing);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta21 = MMC_CAR(tmp4_1);
tmpMeta22 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,2,2) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
_s1 = tmpMeta23;
_acrefs = tmpMeta22;
_existing = tmp4_2;
tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
_cref_ = omc_ComponentReference_makeCrefIdent(threadData, _s1, _OMC_LIT306, tmpMeta24);
tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
_localComps = omc_InstUtil_extractConstantPlusDeps2(threadData, _remainingComps, mmc_mk_some(_cref_), tmpMeta25, _className, _existing);
_names = omc_SCodeUtil_componentNamesFromElts(threadData, _localComps);
_existing = listAppend(_names, _existing);
_outComps = omc_InstUtil_extractConstantPlusDeps3(threadData, _acrefs, _remainingComps, _className, _existing);
tmpMeta1 = listAppend(_localComps, _outComps);
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 < 6) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outComps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractConstantPlusDeps2(threadData_t *threadData, modelica_metatype _inComps, modelica_metatype _ocr, modelica_metatype _inAllComps, modelica_string _className, modelica_metatype _inExisting)
{
modelica_metatype _outComps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;
tmp4_1 = _inComps;
tmp4_2 = _ocr;
tmp4_3 = _inAllComps;
tmp4_4 = _inExisting;
{
modelica_metatype _compMod = NULL;
modelica_metatype _recDeps = NULL;
modelica_metatype _selem = NULL;
modelica_string _name = NULL;
modelica_string _name2 = NULL;
modelica_metatype _scmod = NULL;
modelica_metatype _crefs = NULL;
modelica_metatype _comps = NULL;
modelica_metatype _allComps = NULL;
modelica_metatype _existing = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmp4 += 7;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 1: {
if (!optionNone(tmp4_2)) goto tmp3_end;
tmp4 += 6;
tmpMeta1 = _inComps;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,8) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,3) == 0) goto tmp3_end;
_selem = tmpMeta8;
_name2 = tmpMeta10;
_comps = tmpMeta9;
_allComps = tmp4_3;
_existing = tmp4_4;
tmp4 += 5;
tmpMeta12 = mmc_mk_cons(_selem, _allComps);
_allComps = tmpMeta12;
tmpMeta13 = mmc_mk_cons(_name2, _existing);
_existing = tmpMeta13;
_outComps = omc_InstUtil_extractConstantPlusDeps2(threadData, _comps, _ocr, _allComps, _className, _existing);
tmpMeta14 = mmc_mk_cons(_selem, _outComps);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_boolean tmp21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_1);
tmpMeta16 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,3,8) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 6));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
_selem = tmpMeta15;
_name2 = tmpMeta17;
_scmod = tmpMeta18;
_comps = tmpMeta16;
_name = tmpMeta20;
_allComps = tmp4_3;
_existing = tmp4_4;
tmp21 = (stringEqual(_name, _name2));
if (1 != tmp21) goto goto_2;
_crefs = omc_InstUtil_getCrefFromMod(threadData, _scmod);
_allComps = listAppend(_comps, _allComps);
tmpMeta22 = mmc_mk_cons(_name2, _existing);
_existing = tmpMeta22;
_recDeps = omc_InstUtil_extractConstantPlusDeps3(threadData, _crefs, _allComps, _className, _existing);
tmpMeta23 = mmc_mk_cons(_selem, _recDeps);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_boolean tmp29;
modelica_metatype tmpMeta30;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmp4_1);
tmpMeta25 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,3,8) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,1,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 2));
_selem = tmpMeta24;
_name2 = tmpMeta26;
_comps = tmpMeta25;
_name = tmpMeta28;
_allComps = tmp4_3;
_existing = tmp4_4;
tmp4 += 3;
tmp29 = (stringEqual(_name, _name2));
if (0 != tmp29) goto goto_2;
tmpMeta30 = mmc_mk_cons(_selem, _allComps);
_allComps = tmpMeta30;
tmpMeta1 = omc_InstUtil_extractConstantPlusDeps2(threadData, _comps, _ocr, _allComps, _className, _existing);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta31 = MMC_CAR(tmp4_1);
tmpMeta32 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta31,1,5) == 0) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,1,3) == 0) goto tmp3_end;
_compMod = tmpMeta31;
_comps = tmpMeta32;
_allComps = tmp4_3;
_existing = tmp4_4;
tmp4 += 2;
tmpMeta34 = mmc_mk_cons(_compMod, _allComps);
_allComps = tmpMeta34;
_recDeps = omc_InstUtil_extractConstantPlusDeps2(threadData, _comps, _ocr, _allComps, _className, _existing);
tmpMeta35 = mmc_mk_cons(_compMod, _recDeps);
tmpMeta1 = tmpMeta35;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta36 = MMC_CAR(tmp4_1);
tmpMeta37 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,0,3) == 0) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,1,3) == 0) goto tmp3_end;
_compMod = tmpMeta36;
_comps = tmpMeta37;
_allComps = tmp4_3;
_existing = tmp4_4;
tmp4 += 1;
tmpMeta39 = mmc_mk_cons(_compMod, _allComps);
_allComps = tmpMeta39;
_recDeps = omc_InstUtil_extractConstantPlusDeps2(threadData, _comps, _ocr, _allComps, _className, _existing);
tmpMeta40 = mmc_mk_cons(_compMod, _recDeps);
tmpMeta1 = tmpMeta40;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta41 = MMC_CAR(tmp4_1);
tmpMeta42 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta41,4,5) == 0) goto tmp3_end;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,1,3) == 0) goto tmp3_end;
_compMod = tmpMeta41;
_comps = tmpMeta42;
_allComps = tmp4_3;
_existing = tmp4_4;
tmpMeta44 = mmc_mk_cons(_compMod, _allComps);
_allComps = tmpMeta44;
_recDeps = omc_InstUtil_extractConstantPlusDeps2(threadData, _comps, _ocr, _allComps, _className, _existing);
tmpMeta45 = mmc_mk_cons(_compMod, _recDeps);
tmpMeta1 = tmpMeta45;
goto tmp3_done;
}
case 8: {
fputs(MMC_STRINGDATA(_OMC_LIT370),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 < 9) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outComps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComps;
}
DLLExport
modelica_metatype omc_InstUtil_extractConstantPlusDeps(threadData_t *threadData, modelica_metatype _inComps, modelica_metatype _ocr, modelica_metatype _allComps, modelica_string _className)
{
modelica_metatype _outComps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _ocr;
{
modelica_metatype _cr = NULL;
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 (!optionNone(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta1 = _inComps;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
_outComps = omc_InstUtil_extractConstantPlusDeps2(threadData, _inComps, _ocr, _allComps, _className, tmpMeta7);
tmp8 = listEmpty(_outComps);
if (0 != tmp8) goto goto_2;
tmpMeta1 = listReverse(_outComps);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_cr = tmpMeta9;
tmp10 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp10) goto goto_2;
tmpMeta11 = stringAppend(_OMC_LIT371,omc_ComponentReference_printComponentRefStr(threadData, _cr));
tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT372);
omc_Debug_trace(threadData, tmpMeta12);
tmpMeta13 = stringAppend(_OMC_LIT373,intString(listLength(_inComps)));
tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT107);
omc_Debug_trace(threadData, tmpMeta14);
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:;
}
}
_outComps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComps;
}
DLLExport
modelica_metatype omc_InstUtil_extractConstantPlusDepsTpl(threadData_t *threadData, modelica_metatype _inComps, modelica_metatype _ocr, modelica_metatype _allComps, modelica_string _className, modelica_metatype _ieql, modelica_metatype _iieql, modelica_metatype _ialgs, modelica_metatype _iialgs, modelica_metatype *out_oeql, modelica_metatype *out_oieql, modelica_metatype *out_oalgs, modelica_metatype *out_oialgs)
{
modelica_metatype _oel = NULL;
modelica_metatype _oeql = NULL;
modelica_metatype _oieql = NULL;
modelica_metatype _oalgs = NULL;
modelica_metatype _oialgs = NULL;
modelica_metatype tmpMeta[5] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inComps;
tmp4_2 = _ocr;
{
modelica_metatype _cr = NULL;
modelica_metatype _lst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = _ieql;
tmpMeta[0+2] = _iieql;
tmpMeta[0+3] = _ialgs;
tmpMeta[0+4] = _iialgs;
goto tmp3_done;
}
case 1: {
if (!optionNone(tmp4_2)) goto tmp3_end;
tmp4 += 2;
tmpMeta[0+0] = _inComps;
tmpMeta[0+1] = _ieql;
tmpMeta[0+2] = _iieql;
tmpMeta[0+3] = _ialgs;
tmpMeta[0+4] = _iialgs;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_lst = omc_List_map(threadData, _inComps, boxvar_Util_tuple21);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
_lst = omc_InstUtil_extractConstantPlusDeps2(threadData, _lst, _ocr, _allComps, _className, tmpMeta8);
tmp9 = listEmpty(_lst);
if (0 != tmp9) goto goto_2;
_lst = listReverse(_lst);
_oel = omc_List_filter1OnTrue(threadData, _inComps, boxvar_InstUtil_elementNameMember, _lst);
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _oel;
tmpMeta[0+1] = tmpMeta10;
tmpMeta[0+2] = tmpMeta11;
tmpMeta[0+3] = tmpMeta12;
tmpMeta[0+4] = tmpMeta13;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_cr = tmpMeta14;
tmp15 = omc_Flags_isSet(threadData, _OMC_LIT215);
if (1 != tmp15) goto goto_2;
tmpMeta16 = stringAppend(_OMC_LIT371,omc_ComponentReference_printComponentRefStr(threadData, _cr));
tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT372);
omc_Debug_trace(threadData, tmpMeta17);
tmpMeta18 = stringAppend(_OMC_LIT373,intString(listLength(_inComps)));
tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT107);
omc_Debug_trace(threadData, tmpMeta19);
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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oel = tmpMeta[0+0];
_oeql = tmpMeta[0+1];
_oieql = tmpMeta[0+2];
_oalgs = tmpMeta[0+3];
_oialgs = tmpMeta[0+4];
_return: OMC_LABEL_UNUSED
if (out_oeql) { *out_oeql = _oeql; }
if (out_oieql) { *out_oieql = _oieql; }
if (out_oalgs) { *out_oalgs = _oalgs; }
if (out_oialgs) { *out_oialgs = _oialgs; }
return _oel;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_elementNameMember(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _els)
{
modelica_boolean _isNamed;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_isNamed = listMember(omc_Util_tuple21(threadData, _inElement), _els);
_return: OMC_LABEL_UNUSED
return _isNamed;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_elementNameMember(threadData_t *threadData, modelica_metatype _inElement, modelica_metatype _els)
{
modelica_boolean _isNamed;
modelica_metatype out_isNamed;
_isNamed = omc_InstUtil_elementNameMember(threadData, _inElement, _els);
out_isNamed = mmc_mk_icon(_isNamed);
return out_isNamed;
}
DLLExport
void omc_InstUtil_matchModificationToComponents(threadData_t *threadData, modelica_metatype _inElems, modelica_metatype _inmod, modelica_string _callingScope)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;
tmp3_1 = _inElems;
tmp3_2 = _inmod;
{
modelica_string _cn = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_metatype _elems = NULL;
modelica_metatype _mod = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 8; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,5) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 4));
if (!listEmpty(tmpMeta5)) goto tmp2_end;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (!listEmpty(tmp3_1)) goto tmp2_end;
_s1 = omc_Mod_prettyPrintMod(threadData, _inmod, ((modelica_integer) 0));
tmpMeta6 = stringAppend(_s1,_OMC_LIT374);
tmpMeta7 = stringAppend(tmpMeta6,_callingScope);
tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT375);
_s2 = tmpMeta8;
tmpMeta9 = mmc_mk_cons(_s2, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT378, tmpMeta9);
goto goto_1;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta10 = MMC_CAR(tmp3_1);
tmpMeta11 = MMC_CDR(tmp3_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,3,8) == 0) goto tmp2_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_cn = tmpMeta12;
_elems = tmpMeta11;
_mod = tmp3_2;
_mod = omc_Mod_removeMod(threadData, _mod, _cn);
_inElems = _elems;
_inmod = _mod;
goto _tailrecursive;
;
goto tmp2_done;
}
case 4: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta13 = MMC_CAR(tmp3_1);
tmpMeta14 = MMC_CDR(tmp3_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,5) == 0) goto tmp2_end;
_elems = tmpMeta14;
_inElems = _elems;
goto _tailrecursive;
;
goto tmp2_done;
}
case 5: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta15 = MMC_CAR(tmp3_1);
tmpMeta16 = MMC_CDR(tmp3_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,2,8) == 0) goto tmp2_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
_cn = tmpMeta17;
_elems = tmpMeta16;
_mod = tmp3_2;
_mod = omc_Mod_removeMod(threadData, _mod, _cn);
_inElems = _elems;
_inmod = _mod;
goto _tailrecursive;
;
goto tmp2_done;
}
case 6: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta19 = MMC_CAR(tmp3_1);
tmpMeta20 = MMC_CDR(tmp3_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,3) == 0) goto tmp2_end;
_elems = tmpMeta20;
_inElems = _elems;
goto _tailrecursive;
;
goto tmp2_done;
}
case 7: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta21 = MMC_CAR(tmp3_1);
tmpMeta22 = MMC_CDR(tmp3_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,2,8) == 0) goto tmp2_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 3));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,1,0) == 0) goto tmp2_end;
_elems = tmpMeta22;
_inElems = _elems;
goto _tailrecursive;
;
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;
}
DLLExport
modelica_boolean omc_InstUtil_checkDerivedRestriction(threadData_t *threadData, modelica_metatype _parentRestriction, modelica_metatype _childRestriction, modelica_string _childName)
{
modelica_boolean _b;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_boolean _b3;
modelica_boolean _b4;
modelica_metatype _strLst = NULL;
modelica_metatype _rstLst = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_strLst = (omc_Config_synchronousFeaturesAllowed(threadData)?_OMC_LIT382:_OMC_LIT386);
_b1 = listMember(_childName, _strLst);
_rstLst = (omc_Config_synchronousFeaturesAllowed(threadData)?_OMC_LIT398:_OMC_LIT403);
_b2 = listMember(_childRestriction, _rstLst);
_b3 = valueEq(_parentRestriction, _OMC_LIT387);
_b4 = (valueEq(_parentRestriction, _OMC_LIT404) || valueEq(_parentRestriction, _OMC_LIT405));
_b = (_b1 || (_b2 || (_b3 || ((_b1 || _b2) && _b4))));
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_InstUtil_checkDerivedRestriction(threadData_t *threadData, modelica_metatype _parentRestriction, modelica_metatype _childRestriction, modelica_metatype _childName)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_InstUtil_checkDerivedRestriction(threadData, _parentRestriction, _childRestriction, _childName);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkExtendsForTypeRestiction(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inIH, modelica_metatype _inRestriction, modelica_metatype _inSCodeElementLst)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;volatile modelica_metatype tmp3_2;
tmp3_1 = _inRestriction;
tmp3_2 = _inSCodeElementLst;
{
modelica_metatype _p = NULL;
modelica_metatype _r1 = NULL;
modelica_metatype _r2 = NULL;
modelica_metatype _r = NULL;
modelica_string _id = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 5; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_boolean tmp10;
if (listEmpty(tmp3_2)) goto tmp2_end;
tmpMeta5 = MMC_CAR(tmp3_2);
tmpMeta6 = MMC_CDR(tmp3_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,1,5) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (!listEmpty(tmpMeta6)) goto tmp2_end;
_id = tmpMeta8;
_r = tmp3_1;
tmp9 = listMember(_r, _OMC_LIT408);
if (1 != tmp9) goto goto_1;
tmp10 = listMember(_id, _OMC_LIT102);
if (1 != tmp10) goto goto_1;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_boolean tmp16;
modelica_boolean tmp17;
if (listEmpty(tmp3_2)) goto tmp2_end;
tmpMeta11 = MMC_CAR(tmp3_2);
tmpMeta12 = MMC_CDR(tmp3_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,5) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,1) == 0) goto tmp2_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (!listEmpty(tmpMeta12)) goto tmp2_end;
_id = tmpMeta14;
_r = tmp3_1;
tmp15 = omc_Config_synchronousFeaturesAllowed(threadData);
if (1 != tmp15) goto goto_1;
tmp16 = listMember(_r, _OMC_LIT408);
if (1 != tmp16) goto goto_1;
tmp17 = listMember(_id, _OMC_LIT98);
if (1 != tmp17) goto goto_1;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_boolean tmp21;
if (listEmpty(tmp3_2)) goto tmp2_end;
tmpMeta18 = MMC_CAR(tmp3_2);
tmpMeta19 = MMC_CDR(tmp3_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,1,5) == 0) goto tmp2_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
if (!listEmpty(tmpMeta19)) goto tmp2_end;
_p = tmpMeta20;
tmp21 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupClass(threadData, _inCache, _inEnv, _p, mmc_mk_none(), NULL, NULL);
tmp21 = 1;
goto goto_22;
goto_22:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp21) {goto goto_1;}
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (listEmpty(tmp3_2)) goto tmp2_end;
tmpMeta23 = MMC_CAR(tmp3_2);
tmpMeta24 = MMC_CDR(tmp3_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,1,5) == 0) goto tmp2_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
if (!listEmpty(tmpMeta24)) goto tmp2_end;
_p = tmpMeta25;
_r1 = tmp3_1;
omc_Lookup_lookupClass(threadData, _inCache, _inEnv, _p, mmc_mk_none(), &tmpMeta26, NULL);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,2,8) == 0) goto goto_1;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 6));
_r2 = tmpMeta27;
omc_InstUtil_checkExtendsRestrictionMatch(threadData, _r1, _r2);
goto tmp2_done;
}
case 4: {
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;
if (listEmpty(tmp3_2)) goto tmp2_end;
tmpMeta28 = MMC_CAR(tmp3_2);
tmpMeta29 = MMC_CDR(tmp3_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,1,5) == 0) goto tmp2_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
if (!listEmpty(tmpMeta29)) goto tmp2_end;
_p = tmpMeta30;
_r1 = tmp3_1;
omc_Lookup_lookupClass(threadData, _inCache, _inEnv, _p, mmc_mk_none(), &tmpMeta31, NULL);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta31,2,8) == 0) goto goto_1;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta31), 6));
_r2 = tmpMeta32;
tmpMeta33 = stringAppend(_OMC_LIT409,omc_SCodeDump_restrString(threadData, _r1));
tmpMeta34 = stringAppend(tmpMeta33,_OMC_LIT276);
tmpMeta35 = stringAppend(tmpMeta34,omc_FGraph_printGraphPathStr(threadData, _inEnv));
tmpMeta36 = stringAppend(tmpMeta35,_OMC_LIT410);
tmpMeta37 = stringAppend(tmpMeta36,omc_SCodeDump_restrString(threadData, _r2));
tmpMeta38 = stringAppend(tmpMeta37,_OMC_LIT276);
tmpMeta39 = stringAppend(tmpMeta38,omc_AbsynUtil_pathString(threadData, _p, _OMC_LIT63, 1, 0));
tmpMeta40 = stringAppend(tmpMeta39,_OMC_LIT411);
fputs(MMC_STRINGDATA(tmpMeta40),stdout);
goto goto_1;
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 < 5) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC void omc_InstUtil_checkExtendsRestrictionMatch(threadData_t *threadData, modelica_metatype _r1, modelica_metatype _r2)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_metatype tmp3_2;
tmp3_1 = _r1;
tmp3_2 = _r2;
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 21; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,8,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,8,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,9,1) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,0,1) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,9,1) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,9,1) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,9,1) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,9,1) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,9,1) == 0) goto tmp2_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 4: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,9,1) == 0) goto tmp2_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,2,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,9,1) == 0) goto tmp2_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,7,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,7,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,1) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,3,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 7: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,1) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,7,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 8: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,1) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,3,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 9: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,1) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,5,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 10: {
modelica_metatype tmpMeta13;
modelica_integer tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,3,1) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
if (0 != tmp14) goto tmp2_end;
goto tmp2_done;
}
case 11: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,4,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,4,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 12: {
modelica_metatype tmpMeta15;
modelica_integer tmp16;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,3,1) == 0) goto tmp2_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
tmp16 = mmc_unbox_integer(tmpMeta15);
if (0 != tmp16) goto tmp2_end;
goto tmp2_done;
}
case 13: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,4,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 14: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 15: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 16: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,2,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 17: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,3,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 18: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,4,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 19: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 20: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,6,0) == 0) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,6,0) == 0) goto tmp2_end;
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;
}
DLLExport
modelica_metatype omc_InstUtil_handleUnitChecking(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _inStore, modelica_metatype _pre, modelica_metatype _compDAE, modelica_metatype _daes, modelica_string _className, modelica_metatype *out_outEnv, modelica_metatype *out_outStore)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outEnv = NULL;
modelica_metatype _outStore = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inStore;
{
modelica_metatype _daetemp = NULL;
modelica_metatype _ut = NULL;
modelica_metatype _store = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_store = tmp4_1;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env;
tmpMeta[0+2] = _store;
goto tmp3_done;
}
case 1: {
_store = tmp4_1;
_daetemp = omc_DAEUtil_joinDaeLst(threadData, _daes);
_store = omc_UnitAbsynBuilder_instBuildUnitTerms(threadData, _env, _daetemp, _compDAE, _store ,&_ut);
omc_UnitAbsynBuilder_registerUnitWeights(threadData, _cache, _env, _compDAE);
_store = omc_UnitChecker_check(threadData, _ut, _store);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env;
tmpMeta[0+2] = _store;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_outEnv = tmpMeta[0+1];
_outStore = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outEnv) { *out_outEnv = _outEnv; }
if (out_outStore) { *out_outStore = _outStore; }
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_equalityConstraint(threadData_t *threadData, modelica_metatype _inEnv, modelica_metatype _inCdefelts, modelica_metatype _info)
{
jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
modelica_metatype _outResult = NULL;
modelica_metatype _els = NULL;
modelica_metatype _path = NULL;
modelica_integer _dimension;
modelica_metatype _inlineType = NULL;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta18;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outResult = mmc_mk_none();
{
{
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;
tmpMeta5 = omc_FGraph_getScopePath(threadData, _inEnv);
if (optionNone(tmpMeta5)) goto goto_1;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
_path = tmpMeta6;
_path = omc_AbsynUtil_joinPaths(threadData, _path, _OMC_LIT413);
_path = omc_AbsynUtil_makeFullyQualified(threadData, _path);
goto tmp2_done;
}
case 1: {
goto _return;
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:;
}
}
;
{
modelica_metatype _el;
for (tmpMeta7 = _inCdefelts; !listEmpty(tmpMeta7); tmpMeta7=MMC_CDR(tmpMeta7))
{
_el = MMC_CAR(tmpMeta7);
{
{
volatile mmc_switch_type tmp10;
int tmp11;
tmp10 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp9_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp10 < 2; tmp10++) {
switch (MMC_SWITCH_CAST(tmp10)) {
case 0: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
tmpMeta12 = _el;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,8) == 0) goto goto_8;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (18 != MMC_STRLEN(tmpMeta13) || strcmp("equalityConstraint", MMC_STRINGDATA(tmpMeta13)) != 0) goto goto_8;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,9,1) == 0) goto goto_8;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,0,8) == 0) goto goto_8;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
_els = tmpMeta16;
_dimension = omc_InstUtil_equalityConstraintOutputDimension(threadData, _els);
_inlineType = omc_InstUtil_classIsInlineFunc(threadData, _el);
tmpMeta17 = mmc_mk_box3(0, _path, mmc_mk_integer(_dimension), _inlineType);
_outResult = mmc_mk_some(tmpMeta17);
goto _return;
goto tmp9_done;
}
case 1: {
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 < 2) {
goto tmp9_top;
}
MMC_THROW_INTERNAL();
tmp9_done2:;
}
}
;
}
}
_return: OMC_LABEL_UNUSED
threadData->mmc_jumper = old_mmc_jumper;
return _outResult;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_InstUtil_equalityConstraintOutputDimension(threadData_t *threadData, modelica_metatype _inElements)
{
modelica_integer _outDimension;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElements;
{
modelica_metatype _tail = NULL;
modelica_integer _dim;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 1: {
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_integer tmp14;
modelica_metatype tmpMeta15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,8) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,0) == 0) goto tmp3_end;
_dim = tmp14;
tmp1 = _dim;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmp4_1);
tmpMeta17 = MMC_CDR(tmp4_1);
_tail = tmpMeta17;
_inElements = _tail;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDimension = tmp1;
_return: OMC_LABEL_UNUSED
return _outDimension;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_equalityConstraintOutputDimension(threadData_t *threadData, modelica_metatype _inElements)
{
modelica_integer _outDimension;
modelica_metatype out_outDimension;
_outDimension = omc_InstUtil_equalityConstraintOutputDimension(threadData, _inElements);
out_outDimension = mmc_mk_icon(_outDimension);
return out_outDimension;
}
DLLExport
modelica_boolean omc_InstUtil_isBuiltInClass(threadData_t *threadData, modelica_string _className)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_string tmp4_1;
tmp4_1 = _className;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (4 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT89), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (7 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT90), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (6 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT92), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (7 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT91), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
if (5 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT93), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = omc_Config_synchronousFeaturesAllowed(threadData);
goto tmp3_done;
}
case 5: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_InstUtil_isBuiltInClass(threadData_t *threadData, modelica_metatype _className)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_InstUtil_isBuiltInClass(threadData, _className);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
void omc_InstUtil_prefixEqualUnlessBasicType(threadData_t *threadData, modelica_metatype _pre1, modelica_metatype _pre2, modelica_metatype _cls)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;
tmp3_1 = _cls;
{
modelica_string _idn = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 10; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,10,0) == 0) goto tmp2_end;
tmp3 += 6;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,15,0) == 0) goto tmp2_end;
tmp3 += 5;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,11,0) == 0) goto tmp2_end;
tmp3 += 4;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,12,0) == 0) goto tmp2_end;
tmp3 += 3;
goto tmp2_done;
}
case 4: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,13,0) == 0) goto tmp2_end;
tmp3 += 2;
goto tmp2_done;
}
case 5: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,14,0) == 0) goto tmp2_end;
tmp3 += 1;
goto tmp2_done;
}
case 6: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,16,0) == 0) goto tmp2_end;
goto tmp2_done;
}
case 7: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_idn = tmpMeta12;
if (!((((stringEqual(_idn, _OMC_LIT89)) || (stringEqual(_idn, _OMC_LIT90))) || (stringEqual(_idn, _OMC_LIT92))) || (stringEqual(_idn, _OMC_LIT91)))) goto tmp2_end;
goto tmp2_done;
}
case 8: {
modelica_metatype tmpMeta13;
modelica_boolean tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,8) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (5 != MMC_STRLEN(tmpMeta13) || strcmp(MMC_STRINGDATA(_OMC_LIT93), MMC_STRINGDATA(tmpMeta13)) != 0) goto tmp2_end;
tmp14 = omc_Config_synchronousFeaturesAllowed(threadData);
if (1 != tmp14) goto goto_1;
goto tmp2_done;
}
case 9: {
equality(_pre1, _pre2);
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 < 10) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_checkClassEqual(threadData_t *threadData, modelica_metatype _c1, modelica_metatype _c2)
{
modelica_boolean _areEqual;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _c1;
tmp4_2 = _c2;
{
modelica_metatype _r = NULL;
modelica_metatype _normalAlgorithmLst1 = NULL;
modelica_metatype _normalAlgorithmLst2 = NULL;
modelica_metatype _initialAlgorithmLst1 = NULL;
modelica_metatype _initialAlgorithmLst2 = NULL;
modelica_metatype _cd1 = NULL;
modelica_metatype _cd2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
modelica_boolean tmp7;
tmp6 = omc_Config_acceptMetaModelicaGrammar(threadData);
if (1 != tmp6) goto goto_2;
tmp7 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
equality(_c1, _c2);
tmp7 = 1;
goto goto_8;
goto_8:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp7) {goto goto_2;}
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,7,0) == 0) goto tmp3_end;
tmp10 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
equality(_c1, _c2);
tmp10 = 1;
goto goto_11;
goto_11:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp10) {goto goto_2;}
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_r = tmpMeta12;
tmp13 = omc_SCodeUtil_isFunctionRestriction(threadData, _r);
if (0 != tmp13) goto goto_2;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_boolean tmp21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,0,8) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 5));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,8) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,8) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 5));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 6));
_normalAlgorithmLst1 = tmpMeta15;
_initialAlgorithmLst1 = tmpMeta16;
_normalAlgorithmLst2 = tmpMeta18;
_initialAlgorithmLst2 = tmpMeta19;
tmp4 += 1;
tmp20 = (listLength(_normalAlgorithmLst1) == listLength(_normalAlgorithmLst2));
if (1 != tmp20) goto goto_2;
tmp21 = (listLength(_initialAlgorithmLst1) == listLength(_initialAlgorithmLst2));
if (1 != tmp21) goto goto_2;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,8) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,2,3) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,8) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,2,3) == 0) goto tmp3_end;
_cd1 = tmpMeta22;
_cd2 = tmpMeta23;
equality(_cd1, _cd2);
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 0;
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 < 6) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_areEqual = tmp1;
_return: OMC_LABEL_UNUSED
return _areEqual;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_checkClassEqual(threadData_t *threadData, modelica_metatype _c1, modelica_metatype _c2)
{
modelica_boolean _areEqual;
modelica_metatype out_areEqual;
_areEqual = omc_InstUtil_checkClassEqual(threadData, _c1, _c2);
out_areEqual = mmc_mk_icon(_areEqual);
return out_areEqual;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_updateCrefTypesWithConnectorPrefix(threadData_t *threadData, modelica_metatype _cr1, modelica_metatype _cr2)
{
modelica_metatype _outCref = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _cr1;
tmp4_2 = _cr2;
{
modelica_string _name = NULL;
modelica_string _name2 = NULL;
modelica_metatype _child = NULL;
modelica_metatype _child2 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _subs = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_boolean tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,4) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_name = tmpMeta6;
_ty = tmpMeta7;
_subs = tmpMeta8;
_name2 = tmpMeta9;
_child2 = tmpMeta10;
tmp4 += 1;
tmp11 = (stringEqual(_name, _name2));
if (1 != tmp11) goto goto_2;
tmpMeta1 = omc_ComponentReference_makeCrefQual(threadData, _name, _ty, _subs, _child2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_boolean tmp18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,4) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_name = tmpMeta12;
_ty = tmpMeta13;
_subs = tmpMeta14;
_child = tmpMeta15;
_name2 = tmpMeta16;
_child2 = tmpMeta17;
tmp18 = (stringEqual(_name, _name2));
if (1 != tmp18) goto goto_2;
_outCref = omc_InstUtil_updateCrefTypesWithConnectorPrefix(threadData, _child, _child2);
tmpMeta1 = omc_ComponentReference_makeCrefQual(threadData, _name, _ty, _subs, _outCref);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
tmpMeta19 = stringAppend(_OMC_LIT414,omc_ComponentReference_printComponentRefStr(threadData, _cr1));
tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT415);
tmpMeta21 = stringAppend(tmpMeta20,omc_ComponentReference_printComponentRefStr(threadData, _cr2));
tmpMeta22 = stringAppend(tmpMeta21,_OMC_LIT107);
fputs(MMC_STRINGDATA(tmpMeta22),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:;
}
}
_outCref = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCref;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_extractConnectorPrefix(threadData_t *threadData, modelica_metatype _connectorRef)
{
modelica_metatype _prefixCon = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _connectorRef;
{
modelica_metatype _child = NULL;
modelica_string _name = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _ty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,9,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,5,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta6;
_ty = tmpMeta7;
_subs = tmpMeta9;
tmpMeta1 = omc_ComponentReference_makeCrefIdent(threadData, _name, _ty, _subs);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta10;
_ty = tmpMeta11;
_subs = tmpMeta12;
_child = tmpMeta13;
_child = omc_InstUtil_extractConnectorPrefix(threadData, _child);
tmpMeta1 = omc_ComponentReference_makeCrefQual(threadData, _name, _ty, _subs, _child);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_prefixCon = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _prefixCon;
}
DLLExport
void omc_InstUtil_reportUnitConsistency(threadData_t *threadData, modelica_boolean _topScope, modelica_metatype _store)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_boolean tmp3_1;volatile modelica_metatype tmp3_2;
tmp3_1 = _topScope;
tmp3_2 = _store;
{
modelica_boolean _complete;
modelica_metatype _st = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 3; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (1 != tmp3_1) goto tmp2_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_2,0,3) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_2), 4));
if (optionNone(tmpMeta6)) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,0) == 0) goto tmp2_end;
_st = tmpMeta5;
_complete = omc_UnitChecker_isComplete(threadData, _st, NULL);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Error_addMessage(threadData, (_complete?_OMC_LIT418:_OMC_LIT421), tmpMeta8);
goto tmp2_done;
}
case 2: {
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 < 3) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
void boxptr_InstUtil_reportUnitConsistency(threadData_t *threadData, modelica_metatype _topScope, modelica_metatype _store)
{
modelica_integer tmp1;
tmp1 = mmc_unbox_integer(_topScope);
omc_InstUtil_reportUnitConsistency(threadData, tmp1, _store);
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_updateDeducedUnits2(threadData_t *threadData, modelica_metatype _elt, modelica_metatype _vec, modelica_metatype _ht)
{
modelica_metatype _oelt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _elt;
{
modelica_integer _indx;
modelica_string _unitStr = NULL;
modelica_metatype _unit = NULL;
modelica_metatype _varOpt = NULL;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
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;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 12));
if (optionNone(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,15) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
if (!optionNone(tmpMeta9)) goto tmp3_end;
_cr = tmpMeta6;
_varOpt = tmpMeta7;
_indx = mmc_unbox_integer(omc_BaseHashTable_get(threadData, _cr, _ht));
tmpMeta10 = arrayGet(_vec,_indx);
if (optionNone(tmpMeta10)) goto goto_2;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
_unit = tmpMeta11;
_unitStr = omc_UnitAbsynBuilder_unit2str(threadData, _unit);
tmpMeta12 = mmc_mk_box2(5, &DAE_Exp_SCONST__desc, _unitStr);
_varOpt = omc_DAEUtil_setUnitAttr(threadData, _varOpt, tmpMeta12);
tmpMeta1 = omc_DAEUtil_setVariableAttributes(threadData, _elt, _varOpt);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _elt;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oelt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oelt;
}
DLLExport
modelica_metatype omc_InstUtil_updateDeducedUnits(threadData_t *threadData, modelica_boolean _callScope, modelica_metatype _store, modelica_metatype _dae)
{
modelica_metatype _outDae = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_boolean tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _callScope;
tmp4_2 = _store;
tmp4_3 = _dae;
{
modelica_metatype _ht = NULL;
modelica_metatype _vec = NULL;
modelica_metatype _elts = NULL;
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;
if (1 != tmp4_1) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_vec = tmpMeta7;
_ht = tmpMeta8;
_elts = tmpMeta9;
_elts = omc_List_map2(threadData, _elts, boxvar_InstUtil_updateDeducedUnits2, _vec, _ht);
tmpMeta10 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _dae;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDae = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDae;
}
modelica_metatype boxptr_InstUtil_updateDeducedUnits(threadData_t *threadData, modelica_metatype _callScope, modelica_metatype _store, modelica_metatype _dae)
{
modelica_integer tmp1;
modelica_metatype _outDae = NULL;
tmp1 = mmc_unbox_integer(_callScope);
_outDae = omc_InstUtil_updateDeducedUnits(threadData, tmp1, _store, _dae);
return _outDae;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_updateEnumerationEnvironment1(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_string _inName, modelica_metatype _inNames, modelica_metatype _inVars, modelica_metatype _inPath, modelica_metatype *out_outEnv)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outEnv = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inNames;
tmp4_4 = _inVars;
tmp4_5 = _inPath;
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _env_1 = NULL;
modelica_metatype _compenv = NULL;
modelica_string _nn = NULL;
modelica_metatype _names = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _var = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _p = NULL;
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 (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_3);
tmpMeta7 = MMC_CDR(tmp4_3);
if (listEmpty(tmp4_4)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_4);
tmpMeta9 = MMC_CDR(tmp4_4);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
_nn = tmpMeta6;
_names = tmpMeta7;
_ty = tmpMeta10;
_vars = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
_p = tmp4_5;
_cache = omc_Lookup_lookupIdentLocal(threadData, _cache, _env, _nn ,&_var ,NULL ,NULL ,NULL ,&_compenv);
tmpMeta11 = MMC_TAGPTR(mmc_alloc_words(8));
memcpy(MMC_UNTAGPTR(tmpMeta11), MMC_UNTAGPTR(_var), 8*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta11))[4] = _ty;
_var = tmpMeta11;
_env_1 = omc_FGraph_updateComp(threadData, _env, _var, _OMC_LIT422, _compenv);
_inCache = _cache;
_inEnv = _env_1;
_inName = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_var), 2)));
_inNames = _names;
_inVars = _vars;
_inPath = _p;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_3)) goto tmp3_end;
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCache = tmpMeta[0+0];
_outEnv = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outEnv) { *out_outEnv = _outEnv; }
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_updateEnumerationEnvironment(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inType, modelica_metatype _inClass, modelica_metatype _inCi_State, modelica_metatype *out_outEnv)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outEnv = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _inType;
tmp4_4 = _inCi_State;
{
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _names = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _p = NULL;
modelica_metatype _pname = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,5,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,9,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 2));
_p = tmpMeta6;
_names = tmpMeta7;
_vars = tmpMeta8;
_pname = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta[0+0] = omc_InstUtil_updateEnumerationEnvironment1(threadData, _cache, _env, omc_AbsynUtil_pathString(threadData, _pname, _OMC_LIT63, 1, 0), _names, _vars, _p, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _env;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outEnv = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outEnv) { *out_outEnv = _outEnv; }
return _outCache;
}
DLLExport
modelica_metatype omc_InstUtil_fixInstClassType(threadData_t *threadData, modelica_metatype _ty, modelica_boolean _isPartialFn)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_boolean tmp4_2;
tmp4_1 = _ty;
tmp4_2 = _isPartialFn;
{
modelica_string _name = NULL;
modelica_metatype _path1 = NULL;
modelica_metatype _path2 = NULL;
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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_string tmp8;
modelica_string tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_path1 = tmpMeta7;
_name = omc_AbsynUtil_pathLastIdent(threadData, _path1);
_path2 = omc_AbsynUtil_stripLast(threadData, _path1);
tmp8 = omc_AbsynUtil_pathLastIdent(threadData, _path2);
if (5 != MMC_STRLEN(tmp8) || strcmp("$Code", MMC_STRINGDATA(tmp8)) != 0) goto goto_2;
_path2 = omc_AbsynUtil_stripLast(threadData, _path2);
tmp9 = omc_AbsynUtil_pathLastIdent(threadData, _path2);
if (12 != MMC_STRLEN(tmp9) || strcmp("OpenModelica", MMC_STRINGDATA(tmp9)) != 0) goto goto_2;
tmpMeta1 = omc_Util_assoc(threadData, _name, _OMC_LIT447);
goto tmp3_done;
}
case 1: {
if (0 != tmp4_2) goto tmp3_end;
tmp4 += 1;
tmpMeta1 = _ty;
goto tmp3_done;
}
case 2: {
if (1 != tmp4_2) goto tmp3_end;
tmpMeta1 = omc_Types_makeFunctionPolymorphicReference(threadData, _ty);
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:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
modelica_metatype boxptr_InstUtil_fixInstClassType(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _isPartialFn)
{
modelica_integer tmp1;
modelica_metatype _outType = NULL;
tmp1 = mmc_unbox_integer(_isPartialFn);
_outType = omc_InstUtil_fixInstClassType(threadData, _ty, tmp1);
return _outType;
}
DLLExport
modelica_metatype omc_InstUtil_lookupTopLevelClass(threadData_t *threadData, modelica_string _inName, modelica_metatype _inProgram, modelica_boolean _inPrintError)
{
modelica_metatype _outClass = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_boolean tmp4_1;
tmp4_1 = _inPrintError;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
tmpMeta1 = omc_List_getMemberOnTrue(threadData, _inName, _inProgram, boxvar_SCodeUtil_isClassNamed);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (1 != tmp4_1) goto tmp3_end;
tmpMeta6 = mmc_mk_cons(_inName, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT450, tmpMeta6);
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outClass = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outClass;
}
modelica_metatype boxptr_InstUtil_lookupTopLevelClass(threadData_t *threadData, modelica_metatype _inName, modelica_metatype _inProgram, modelica_metatype _inPrintError)
{
modelica_integer tmp1;
modelica_metatype _outClass = NULL;
tmp1 = mmc_unbox_integer(_inPrintError);
_outClass = omc_InstUtil_lookupTopLevelClass(threadData, _inName, _inProgram, tmp1);
return _outClass;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_makeDAEElementInitial(threadData_t *threadData, modelica_metatype _inElems)
{
modelica_metatype _outElems = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElems;
{
modelica_metatype _elem = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _s = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _tbs = NULL;
modelica_metatype _fb = NULL;
modelica_metatype _al = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _elems = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_1);
tmpMeta8 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
_cr = tmpMeta9;
_e1 = tmpMeta10;
_s = tmpMeta11;
_elems = tmpMeta8;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta13 = mmc_mk_box4(5, &DAE_Element_INITIALDEFINE__desc, _cr, _e1, _s);
tmpMeta12 = mmc_mk_cons(tmpMeta13, _outElems);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 2: {
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 (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,5,4) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 3));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 4));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 5));
_dims = tmpMeta16;
_e1 = tmpMeta17;
_e2 = tmpMeta18;
_s = tmpMeta19;
_elems = tmpMeta15;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta21 = mmc_mk_box5(9, &DAE_Element_INITIAL__ARRAY__EQUATION__desc, _dims, _e1, _e2, _s);
tmpMeta20 = mmc_mk_cons(tmpMeta21, _outElems);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta22 = MMC_CAR(tmp4_1);
tmpMeta23 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,3,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 3));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 4));
_e1 = tmpMeta24;
_e2 = tmpMeta25;
_s = tmpMeta26;
_elems = tmpMeta23;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta28 = mmc_mk_box4(18, &DAE_Element_INITIALEQUATION__desc, _e1, _e2, _s);
tmpMeta27 = mmc_mk_cons(tmpMeta28, _outElems);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta29 = MMC_CAR(tmp4_1);
tmpMeta30 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,13,4) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 3));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 4));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 5));
_expl = tmpMeta31;
_tbs = tmpMeta32;
_fb = tmpMeta33;
_s = tmpMeta34;
_elems = tmpMeta30;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta36 = mmc_mk_box5(17, &DAE_Element_INITIAL__IF__EQUATION__desc, _expl, _tbs, _fb, _s);
tmpMeta35 = mmc_mk_cons(tmpMeta36, _outElems);
tmpMeta1 = tmpMeta35;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta37 = MMC_CAR(tmp4_1);
tmpMeta38 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,16,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 3));
_al = tmpMeta39;
_s = tmpMeta40;
_elems = tmpMeta38;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta42 = mmc_mk_box3(20, &DAE_Element_INITIALALGORITHM__desc, _al, _s);
tmpMeta41 = mmc_mk_cons(tmpMeta42, _outElems);
tmpMeta1 = tmpMeta41;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta43 = MMC_CAR(tmp4_1);
tmpMeta44 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,8,3) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 2));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 3));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 4));
_e1 = tmpMeta45;
_e2 = tmpMeta46;
_s = tmpMeta47;
_elems = tmpMeta44;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta49 = mmc_mk_box4(12, &DAE_Element_INITIAL__COMPLEX__EQUATION__desc, _e1, _e2, _s);
tmpMeta48 = mmc_mk_cons(tmpMeta49, _outElems);
tmpMeta1 = tmpMeta48;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta50 = MMC_CAR(tmp4_1);
tmpMeta51 = MMC_CDR(tmp4_1);
_elem = tmpMeta50;
_elems = tmpMeta51;
_outElems = omc_InstUtil_makeDAEElementInitial(threadData, _elems);
tmpMeta52 = mmc_mk_cons(_elem, _outElems);
tmpMeta1 = tmpMeta52;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outElems = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outElems;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_reEvaluateInitialIfEqns2(threadData_t *threadData, modelica_metatype _acc, modelica_metatype _elem, modelica_metatype _inCache, modelica_metatype _env)
{
modelica_metatype _oelems = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _elem;
tmp4_2 = _inCache;
{
modelica_metatype _conds = NULL;
modelica_metatype _valList = NULL;
modelica_metatype _tbs = NULL;
modelica_metatype _fb = NULL;
modelica_metatype _selectedBranch = NULL;
modelica_metatype _blist = NULL;
modelica_metatype _cache = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_conds = tmpMeta6;
_tbs = tmpMeta7;
_fb = tmpMeta8;
_cache = tmp4_2;
omc_Ceval_cevalList(threadData, _cache, _env, _conds, 1, _OMC_LIT451, ((modelica_integer) 0) ,&_valList);
_blist = omc_List_map(threadData, _valList, boxvar_ValuesUtil_valueBool);
_selectedBranch = omc_List_findBoolList(threadData, _blist, _tbs, _fb);
_selectedBranch = omc_InstUtil_makeDAEElementInitial(threadData, _selectedBranch);
tmpMeta1 = listAppend(_selectedBranch, _acc);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
tmpMeta9 = mmc_mk_cons(_elem, _acc);
tmpMeta1 = tmpMeta9;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oelems = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oelems;
}
DLLExport
modelica_metatype omc_InstUtil_reEvaluateInitialIfEqns(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _dae, modelica_boolean _isTopCall)
{
modelica_metatype _odae = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _dae;
tmp4_2 = _isTopCall;
{
modelica_metatype _elems = NULL;
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;
if (1 != tmp4_2) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_elems = tmpMeta6;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
_elems = listReverse(omc_List_fold2r(threadData, _elems, boxvar_InstUtil_reEvaluateInitialIfEqns2, _cache, _env, tmpMeta7));
tmpMeta8 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elems);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
if (0 != tmp4_2) goto tmp3_end;
tmpMeta1 = _dae;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_odae = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _odae;
}
modelica_metatype boxptr_InstUtil_reEvaluateInitialIfEqns(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _dae, modelica_metatype _isTopCall)
{
modelica_integer tmp1;
modelica_metatype _odae = NULL;
tmp1 = mmc_unbox_integer(_isTopCall);
_odae = omc_InstUtil_reEvaluateInitialIfEqns(threadData, _cache, _env, _dae, tmp1);
return _odae;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_InstUtil_scodeFlattenProgram(threadData_t *threadData, modelica_metatype _inProgram)
{
modelica_metatype _outProgram = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT452);
_outProgram = omc_NFSCodeFlatten_flattenCompleteProgram(threadData, _inProgram);
omc_ErrorExt_delCheckpoint(threadData, _OMC_LIT452);
tmpMeta1 = _outProgram;
goto tmp3_done;
}
case 1: {
omc_ErrorExt_rollBack(threadData, _OMC_LIT452);
tmpMeta1 = _inProgram;
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outProgram = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outProgram;
}
DLLExport
modelica_metatype omc_InstUtil_scodeFlatten(threadData_t *threadData, modelica_metatype _inProgram, modelica_metatype _inPath)
{
modelica_metatype _outProgram = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inPath;
{
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: {
modelica_boolean tmp6;
tmp6 = omc_Flags_isSet(threadData, _OMC_LIT456);
if (0 != tmp6) goto goto_2;
tmpMeta1 = _inProgram;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (0 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT103), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta1 = omc_InstUtil_scodeFlattenProgram(threadData, _inProgram);
goto tmp3_done;
}
case 2: {
tmpMeta1 = omc_NFSCodeFlatten_flattenClassInProgram(threadData, _inPath, _inProgram, NULL);
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:;
}
}
_outProgram = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outProgram;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_InstUtil_isNotFunction(threadData_t *threadData, modelica_metatype _cls)
{
modelica_boolean _res;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = omc_SCodeUtil_isFunction(threadData, _cls);
_res = (!_res);
_return: OMC_LABEL_UNUSED
return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_InstUtil_isNotFunction(threadData_t *threadData, modelica_metatype _cls)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_InstUtil_isNotFunction(threadData, _cls);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_metatype omc_InstUtil_newIdent(threadData_t *threadData)
{
modelica_metatype _outComponentRef = NULL;
modelica_integer _i;
modelica_string _is = NULL;
modelica_string _s = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_i = tick();
_is = intString(_i);
tmpMeta1 = stringAppend(_OMC_LIT457,_is);
_s = tmpMeta1;
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_outComponentRef = omc_ComponentReference_makeCrefIdent(threadData, _s, _OMC_LIT306, tmpMeta2);
_return: OMC_LABEL_UNUSED
return _outComponentRef;
}
