#ifdef OMC_BASE_FILE
#define OMC_FILE OMC_BASE_FILE
#else
#define OMC_FILE "Patternm.c"
#endif
#include "omc_simulation_settings.h"
#include "Patternm.h"
#define _OMC_LIT0_data "patternmAllInfo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,15,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data "Adds notifications of all pattern-matching optimizations that are performed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,76,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT2,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT1}};
#define _OMC_LIT2 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT2)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT3,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(22)),_OMC_LIT0,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT2}};
#define _OMC_LIT3 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT3)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT4,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT4 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT4)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT5,1,6) {&ErrorTypes_Severity_NOTIFICATION__desc,}};
#define _OMC_LIT5 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT5)
#define _OMC_LIT6_data "Dead code elimination: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,26,_OMC_LIT6_data);
#define _OMC_LIT6 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT7,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT6}};
#define _OMC_LIT7 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT7)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT8,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5026)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT7}};
#define _OMC_LIT8 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "Statement optimised away"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,24,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT10,2,1) {_OMC_LIT9,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT10 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT10)
#define _OMC_LIT11_data "Patternm.statementFindDeadStore"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT11,31,_OMC_LIT11_data);
#define _OMC_LIT11 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT11)
#define _OMC_LIT12_data "fail"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT12,4,_OMC_LIT12_data);
#define _OMC_LIT12 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT12)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT13,1,6) {&DAE_ConnectorType_NON__CONNECTOR__desc,}};
#define _OMC_LIT13 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT13)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT14,1,5) {&SCode_Parallelism_NON__PARALLEL__desc,}};
#define _OMC_LIT14 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT14)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT15,1,3) {&SCode_Variability_VAR__desc,}};
#define _OMC_LIT15 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT15)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT16,1,3) {&Absyn_Direction_INPUT__desc,}};
#define _OMC_LIT16 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT16)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT17,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc,}};
#define _OMC_LIT17 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT17)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT18,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT18 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT18)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT19,7,3) {&DAE_Attributes_ATTR__desc,_OMC_LIT13,_OMC_LIT14,_OMC_LIT15,_OMC_LIT16,_OMC_LIT17,_OMC_LIT18}};
#define _OMC_LIT19 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT19)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT20,1,3) {&DAE_Binding_UNBOUND__desc,}};
#define _OMC_LIT20 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT20)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT21,1,4) {&SCode_Redeclare_NOT__REDECLARE__desc,}};
#define _OMC_LIT21 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT21)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT22,1,4) {&SCode_Final_NOT__FINAL__desc,}};
#define _OMC_LIT22 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT22)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT23,1,4) {&SCode_Replaceable_NOT__REPLACEABLE__desc,}};
#define _OMC_LIT23 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT23)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24,6,3) {&SCode_Prefixes_PREFIXES__desc,_OMC_LIT18,_OMC_LIT21,_OMC_LIT22,_OMC_LIT17,_OMC_LIT23}};
#define _OMC_LIT24 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT25,1,3) {&SCode_ConnectorType_POTENTIAL__desc,}};
#define _OMC_LIT25 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT25)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT26,1,5) {&Absyn_Direction_BIDIR__desc,}};
#define _OMC_LIT26 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT26)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT27,1,3) {&Absyn_IsField_NONFIELD__desc,}};
#define _OMC_LIT27 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT27)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT28,7,3) {&SCode_Attributes_ATTR__desc,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT25,_OMC_LIT14,_OMC_LIT15,_OMC_LIT26,_OMC_LIT27}};
#define _OMC_LIT28 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data "$dummy"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,6,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT30,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT29}};
#define _OMC_LIT30 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT30)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT31,3,3) {&Absyn_TypeSpec_TPATH__desc,_OMC_LIT30,MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT31 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT31)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT32,1,5) {&SCode_Mod_NOMOD__desc,}};
#define _OMC_LIT32 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT32)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT33,3,3) {&SCode_Comment_COMMENT__desc,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT33 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT33)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT34,1,5) {&DAE_Mod_NOMOD__desc,}};
#define _OMC_LIT34 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT34)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT35,1,5) {&FCore_Status_VAR__DAE__desc,}};
#define _OMC_LIT35 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT35)
#define _OMC_LIT36_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT36,0,_OMC_LIT36_data);
#define _OMC_LIT36 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT36)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT37,0.0);
#define _OMC_LIT37 MMC_REFREALLIT(_OMC_LIT_STRUCT37)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT38,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT36,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_LIT37}};
#define _OMC_LIT38 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT38)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT39,1,3) {&InstTypes_SearchStrategy_SEARCH__LOCAL__ONLY__desc,}};
#define _OMC_LIT39 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT39)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT40,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT40 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT40)
#define _OMC_LIT41_data "Local variable '%s' shadows another variable."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT41,45,_OMC_LIT41_data);
#define _OMC_LIT41 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT41}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT43,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5001)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT42}};
#define _OMC_LIT43 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT43)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT44,2,3) {&DAE_DAElist_DAE__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT44 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT44)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT45,1,4) {&SCode_Encapsulated_NOT__ENCAPSULATED__desc,}};
#define _OMC_LIT45 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT45)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT46,1,4) {&SCode_Visibility_PROTECTED__desc,}};
#define _OMC_LIT46 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT46)
#define _OMC_LIT47_data "dummieFunc"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT47,10,_OMC_LIT47_data);
#define _OMC_LIT47 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT47)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT48,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT47}};
#define _OMC_LIT48 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT48)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT49,3,11) {&ClassInf_State_FUNCTION__desc,_OMC_LIT48,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT49 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT49)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT50,1,3) {&DAE_Prefix_NOPRE__desc,}};
#define _OMC_LIT50 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT50)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT51,1,4) {&UnitAbsyn_InstStore_NOSTORE__desc,}};
#define _OMC_LIT51 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT51)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT52,1,4) {&InstTypes_CallingScope_INNER__CALL__desc,}};
#define _OMC_LIT52 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT52)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT53,7,3) {&ConnectionGraph_ConnectionGraph_GRAPH__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT53 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT53)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT54,1,6) {&DAE_ComponentRef_WILD__desc,}};
#define _OMC_LIT54 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT54)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT55,5,3) {&DAE_Connect_SetTrieNode_SET__TRIE__NODE__desc,_OMC_LIT36,_OMC_LIT54,MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT55 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT55)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT56,5,3) {&DAE_Connect_Sets_SETS__desc,_OMC_LIT55,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT56 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT56)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT57,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_LIT57 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT57)
#define _OMC_LIT58_data ", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT58,2,_OMC_LIT58_data);
#define _OMC_LIT58 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data "Only components without direction are allowed in local declarations, got: %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,76,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT60,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT59}};
#define _OMC_LIT60 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT60)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT61,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5019)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT60}};
#define _OMC_LIT61 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT61)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT62,1,4) {&Absyn_Direction_OUTPUT__desc,}};
#define _OMC_LIT62 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data "Internal error %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,17,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT64,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT63}};
#define _OMC_LIT64 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT64)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT65,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(63)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT64}};
#define _OMC_LIT65 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT65)
#define _OMC_LIT66_data "Patternm.addLocalDecls failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT66,29,_OMC_LIT66_data);
#define _OMC_LIT66 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT66)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT67,2,1) {_OMC_LIT66,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT67 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT67)
#define _OMC_LIT68_data "Patternm.fixCaseReturnTypes2 failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT68,35,_OMC_LIT68_data);
#define _OMC_LIT68 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT68)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT69,2,1) {_OMC_LIT68,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT69 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT69)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT70,1,10) {&DAE_Type_T__NORETCALL__desc,}};
#define _OMC_LIT70 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT70)
#define _OMC_LIT71_data "\n  "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT71,3,_OMC_LIT71_data);
#define _OMC_LIT71 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT71)
#define _OMC_LIT72_data "Match expression has mismatched result types:%s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT72,47,_OMC_LIT72_data);
#define _OMC_LIT72 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT72)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT73,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT72}};
#define _OMC_LIT73 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT73)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT74,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5024)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT73}};
#define _OMC_LIT74 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT74)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT75,2,6) {&DAE_Type_T__BOOL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT75 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT75)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT76,1,4) {&ErrorTypes_MessageType_GRAMMAR__desc,}};
#define _OMC_LIT76 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "Guard expressions need to be Boolean, got expression of type %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,64,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT78,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT77}};
#define _OMC_LIT78 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT78)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT79,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(242)),_OMC_LIT76,_OMC_LIT40,_OMC_LIT78}};
#define _OMC_LIT79 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT79)
#define _OMC_LIT80_data "patternmMoveLastExp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT80,19,_OMC_LIT80_data);
#define _OMC_LIT80 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT80)
#define _OMC_LIT81_data "Optimization that moves the last assignment(s) into the result of a match-expression. For example: equation c = fn(b); then c; => then fn(b);"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT81,141,_OMC_LIT81_data);
#define _OMC_LIT81 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT81)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT82,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT81}};
#define _OMC_LIT82 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT82)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT83,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(24)),_OMC_LIT80,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT82}};
#define _OMC_LIT83 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT83)
#define _OMC_LIT84_data "$case scope$"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT84,12,_OMC_LIT84_data);
#define _OMC_LIT84 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT84)
#define _OMC_LIT85_data "$pattern type scope$"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT85,20,_OMC_LIT85_data);
#define _OMC_LIT85 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT85)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT86,1,1) {_OMC_LIT85}};
#define _OMC_LIT86 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT86)
#define _OMC_LIT87_data "match"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT87,5,_OMC_LIT87_data);
#define _OMC_LIT87 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT87)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT88,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT87}};
#define _OMC_LIT88 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT88)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT89,3,11) {&ClassInf_State_FUNCTION__desc,_OMC_LIT88,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT89 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT89)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT90,1,4) {&DAE_ComponentPrefix_NOCOMPPRE__desc,}};
#define _OMC_LIT90 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT90)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT91,8,3) {&DAE_ElementSource_SOURCE__desc,_OMC_LIT38,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT90,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT91 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT91)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT92,1,4) {&SCode_Initial_NON__INITIAL__desc,}};
#define _OMC_LIT92 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT92)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT93,1,6) {&Absyn_ComponentRef_WILD__desc,}};
#define _OMC_LIT93 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT93)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT94,2,5) {&Absyn_Exp_CREF__desc,_OMC_LIT93}};
#define _OMC_LIT94 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT94)
#define _OMC_LIT95_data "This matchcontinue expression has no overlapping patterns and should be using match instead of matchcontinue."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT95,109,_OMC_LIT95_data);
#define _OMC_LIT95 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT95)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT96,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT95}};
#define _OMC_LIT96 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT96)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT97,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5025)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT96}};
#define _OMC_LIT97 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT97)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT98,1,3) {&Absyn_MatchType_MATCH__desc,}};
#define _OMC_LIT98 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT98)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT99,1,4) {&Absyn_MatchType_MATCHCONTINUE__desc,}};
#define _OMC_LIT99 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT99)
#define _OMC_LIT100_data "Last pattern is empty"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT100,21,_OMC_LIT100_data);
#define _OMC_LIT100 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT100)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT101,2,1) {_OMC_LIT100,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT101 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT101)
#define _OMC_LIT102_data "patternmDeadCodeElimination"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT102,27,_OMC_LIT102_data);
#define _OMC_LIT102 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data "Performs dead code elimination in match-expressions."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,52,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT104,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT103}};
#define _OMC_LIT104 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT104)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT105,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(23)),_OMC_LIT102,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT104}};
#define _OMC_LIT105 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT105)
#define _OMC_LIT106_data "Empty matchcontinue case"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT106,24,_OMC_LIT106_data);
#define _OMC_LIT106 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT106)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT107,2,1) {_OMC_LIT106,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT107 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT107)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT108,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT36}};
#define _OMC_LIT108 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT108)
#define _OMC_LIT109_data "Unused local variable: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT109,26,_OMC_LIT109_data);
#define _OMC_LIT109 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT109)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT110,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT109}};
#define _OMC_LIT110 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT110)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT111,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5027)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT110}};
#define _OMC_LIT111 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT111)
#define _OMC_LIT112_data "Patternm.traversePattern failed: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT112,33,_OMC_LIT112_data);
#define _OMC_LIT112 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT112)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT113,1,3) {&DAE_Pattern_PAT__WILD__desc,}};
#define _OMC_LIT113 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT113)
#define _OMC_LIT114_data "Removing unused as-binding: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT114,31,_OMC_LIT114_data);
#define _OMC_LIT114 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT114)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT115,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT114}};
#define _OMC_LIT115 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT115)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT116,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5028)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT115}};
#define _OMC_LIT116 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT116)
#define _OMC_LIT117_data "Removing unused assignment to: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT117,34,_OMC_LIT117_data);
#define _OMC_LIT117 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT117}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT119,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5034)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT118}};
#define _OMC_LIT119 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,2,5) {&DAE_Type_T__STRING__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,1,11) {&DAE_Type_T__UNKNOWN__desc,}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT122,2,28) {&DAE_Type_T__METATYPE__desc,_OMC_LIT121}};
#define _OMC_LIT122 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,2,3) {&DAE_Type_T__INTEGER__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,1,3) {&DAE_MatchType_MATCHCONTINUE__desc,}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
#define _OMC_LIT125_data "Converted match expression to switch of type %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT125,48,_OMC_LIT125_data);
#define _OMC_LIT125 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT125}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT127,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5029)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT126}};
#define _OMC_LIT127 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT127)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT128,2,5) {&DAE_MatchType_MATCH__desc,MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT128 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT128)
#define _OMC_LIT129_data "Match input %s is a constant value."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT129,35,_OMC_LIT129_data);
#define _OMC_LIT129 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT129)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT130,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT129}};
#define _OMC_LIT130 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT130)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT131,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5047)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT130}};
#define _OMC_LIT131 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT131)
#define _OMC_LIT132_data "$match scope$"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT132,13,_OMC_LIT132_data);
#define _OMC_LIT132 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT132)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT133,1,5) {&DAE_Const_C__VAR__desc,}};
#define _OMC_LIT133 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT133)
#define _OMC_LIT134_data "patternmSkipFilterUnusedBindings"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT134,32,_OMC_LIT134_data);
#define _OMC_LIT134 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,2,4) {&Gettext_TranslatableContent_notrans__desc,_OMC_LIT36}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT136,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(21)),_OMC_LIT134,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT135}};
#define _OMC_LIT136 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT136)
#define _OMC_LIT137_data "Failed to elaborate match expression %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT137,39,_OMC_LIT137_data);
#define _OMC_LIT137 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT137)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT138,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT137}};
#define _OMC_LIT138 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT138)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT139,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5014)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT138}};
#define _OMC_LIT139 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT139)
#define _OMC_LIT140_data "_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT140,1,_OMC_LIT140_data);
#define _OMC_LIT140 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT140)
#define _OMC_LIT141_data "SOME("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT141,5,_OMC_LIT141_data);
#define _OMC_LIT141 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT141)
#define _OMC_LIT142_data ")"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT142,1,_OMC_LIT142_data);
#define _OMC_LIT142 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT142)
#define _OMC_LIT143_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT143,1,_OMC_LIT143_data);
#define _OMC_LIT143 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT143)
#define _OMC_LIT144_data "("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT144,1,_OMC_LIT144_data);
#define _OMC_LIT144 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,1,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
#define _OMC_LIT146_data "="
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT146,1,_OMC_LIT146_data);
#define _OMC_LIT146 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT146)
#define _OMC_LIT147_data "::"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT147,2,_OMC_LIT147_data);
#define _OMC_LIT147 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT147)
#define _OMC_LIT148_data " as "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT148,4,_OMC_LIT148_data);
#define _OMC_LIT148 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT148)
#define _OMC_LIT149_data "Patternm.patternStr not implemented correctly"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT149,45,_OMC_LIT149_data);
#define _OMC_LIT149 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT149)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT150,2,1) {_OMC_LIT149,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT150 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT150)
#define _OMC_LIT151_data "*PATTERN*"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT151,9,_OMC_LIT151_data);
#define _OMC_LIT151 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "In pattern %s: %s is not part of uniontype %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,45,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT152}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT154,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5021)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT153}};
#define _OMC_LIT154 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT154)
#define _OMC_LIT155_data "#DUMMY#"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT155,7,_OMC_LIT155_data);
#define _OMC_LIT155 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT155)
#define _OMC_LIT156_data "Type mismatch in pattern %s\nexpression type:\n  %s\npattern type:\n  %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT156,68,_OMC_LIT156_data);
#define _OMC_LIT156 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT156)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT157,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT156}};
#define _OMC_LIT157 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT157)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT158,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5022)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT157}};
#define _OMC_LIT158 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT158)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT159,1,5) {&ErrorTypes_Severity_WARNING__desc,}};
#define _OMC_LIT159 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT159)
#define _OMC_LIT160_data "Call to %s contains mixed positional and named arguments."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT160,57,_OMC_LIT160_data);
#define _OMC_LIT160 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT160)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT161,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT160}};
#define _OMC_LIT161 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT161)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT162,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(598)),_OMC_LIT4,_OMC_LIT159,_OMC_LIT161}};
#define _OMC_LIT162 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT162)
#define _OMC_LIT163_data "Removing empty call named pattern argument: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT163,47,_OMC_LIT163_data);
#define _OMC_LIT163 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT163)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT164,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT163}};
#define _OMC_LIT164 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5035)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT164}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
#define _OMC_LIT166_data "All patterns in call were empty: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT166,36,_OMC_LIT166_data);
#define _OMC_LIT166 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT166)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT167,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT166}};
#define _OMC_LIT167 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT167)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT168,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5036)),_OMC_LIT4,_OMC_LIT5,_OMC_LIT167}};
#define _OMC_LIT168 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT168)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT169,1,3) {&Util_Status_SUCCESS__desc,}};
#define _OMC_LIT169 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT169)
#define _OMC_LIT170_data "Call pattern is not a record constructor %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT170,43,_OMC_LIT170_data);
#define _OMC_LIT170 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT170)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT171,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT170}};
#define _OMC_LIT171 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5023)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT171}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
#define _OMC_LIT173_data "pattern "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT173,8,_OMC_LIT173_data);
#define _OMC_LIT173 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT173)
#define _OMC_LIT174_data "Wrong number of arguments to %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT174,32,_OMC_LIT174_data);
#define _OMC_LIT174 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT174)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT175,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT174}};
#define _OMC_LIT175 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT175)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT176,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(146)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT175}};
#define _OMC_LIT176 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT176)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT177,2,4) {&DAE_Type_T__REAL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT177 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT177)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT178,2,20) {&DAE_Type_T__METALIST__desc,_OMC_LIT121}};
#define _OMC_LIT178 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,2,31) {&DAE_Exp_LIST__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT180,2,16) {&Absyn_Exp_ARRAY__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT180 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT180)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT181,2,22) {&DAE_Type_T__METAOPTION__desc,_OMC_LIT121}};
#define _OMC_LIT181 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT181)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT182,2,34) {&DAE_Exp_META__OPTION__desc,MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,3,4) {&DAE_Pattern_PAT__CONSTANT__desc,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT182}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
#define _OMC_LIT184_data "Identifiers need to point to local or output variables. Variable %s is %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT184,74,_OMC_LIT184_data);
#define _OMC_LIT184 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT184)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT185,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT184}};
#define _OMC_LIT185 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5038)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT185}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
#define _OMC_LIT187_data "Variable %s not found in scope %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT187,34,_OMC_LIT187_data);
#define _OMC_LIT187 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT187)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT188,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT187}};
#define _OMC_LIT188 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT188)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT189,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT188}};
#define _OMC_LIT189 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT189)
#define _OMC_LIT190_data "NONE"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT190,4,_OMC_LIT190_data);
#define _OMC_LIT190 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT190)
#define _OMC_LIT191_data "NONE is not acceptable syntax. Use NONE() instead."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT191,50,_OMC_LIT191_data);
#define _OMC_LIT191 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT191)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT192,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT191}};
#define _OMC_LIT192 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT192)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT193,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5017)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT192}};
#define _OMC_LIT193 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT193)
#define _OMC_LIT194_data " of type "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT194,9,_OMC_LIT194_data);
#define _OMC_LIT194 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT194)
#define _OMC_LIT195_data "Invalid pattern: %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT195,19,_OMC_LIT195_data);
#define _OMC_LIT195 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT195)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT196,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT195}};
#define _OMC_LIT196 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT196)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT197,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5012)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT196}};
#define _OMC_LIT197 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT197)
#define _OMC_LIT198_data "SOME"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT198,4,_OMC_LIT198_data);
#define _OMC_LIT198 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT198)
#define _OMC_LIT199_data "The same variable is being defined twice: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT199,45,_OMC_LIT199_data);
#define _OMC_LIT199 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT199}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT201,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5037)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT200}};
#define _OMC_LIT201 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT201)
#define _OMC_LIT202_data "Invalid named fields: %s. Valid field names: %s."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT202,48,_OMC_LIT202_data);
#define _OMC_LIT202 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT202)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT203,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT202}};
#define _OMC_LIT203 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT203)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT204,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5018)),_OMC_LIT4,_OMC_LIT40,_OMC_LIT203}};
#define _OMC_LIT204 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT204)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT205,1,4) {&Util_Status_FAILURE__desc,}};
#define _OMC_LIT205 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT205)
#include "util/modelica.h"
#include "Patternm_includes.h"
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_convertExpToPatterns(threadData_t *threadData, modelica_metatype _inExp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_convertExpToPatterns,2,0) {(void*) boxptr_Patternm_convertExpToPatterns,0}};
#define boxvar_Patternm_convertExpToPatterns MMC_REFSTRUCTLIT(boxvar_lit_Patternm_convertExpToPatterns)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_makeTupleFromMetaTuple(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inType, modelica_metatype *out_ty);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_makeTupleFromMetaTuple,2,0) {(void*) boxptr_Patternm_makeTupleFromMetaTuple,0}};
#define boxvar_Patternm_makeTupleFromMetaTuple MMC_REFSTRUCTLIT(boxvar_lit_Patternm_makeTupleFromMetaTuple)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_isNotDummyStatement(threadData_t *threadData, modelica_metatype _statement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_isNotDummyStatement(threadData_t *threadData, modelica_metatype _statement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_isNotDummyStatement,2,0) {(void*) boxptr_Patternm_isNotDummyStatement,0}};
#define boxvar_Patternm_isNotDummyStatement MMC_REFSTRUCTLIT(boxvar_lit_Patternm_isNotDummyStatement)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elseFindDeadStore(threadData_t *threadData, modelica_metatype _inElse, modelica_metatype _localsTree, modelica_metatype _inUseTree, modelica_metatype *out_useTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elseFindDeadStore,2,0) {(void*) boxptr_Patternm_elseFindDeadStore,0}};
#define boxvar_Patternm_elseFindDeadStore MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elseFindDeadStore)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_statementFindDeadStore(threadData_t *threadData, modelica_metatype _inStatement, modelica_metatype _localsTree, modelica_metatype _inUseTree, modelica_metatype *out_useTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_statementFindDeadStore,2,0) {(void*) boxptr_Patternm_statementFindDeadStore,0}};
#define boxvar_Patternm_statementFindDeadStore MMC_REFSTRUCTLIT(boxvar_lit_Patternm_statementFindDeadStore)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData_t *threadData, modelica_metatype _inBody, modelica_metatype _localsTree, modelica_metatype _inUseTree, modelica_metatype *out_useTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_statementListFindDeadStoreRemoveEmptyStatements,2,0) {(void*) boxptr_Patternm_statementListFindDeadStoreRemoveEmptyStatements,0}};
#define boxvar_Patternm_statementListFindDeadStoreRemoveEmptyStatements MMC_REFSTRUCTLIT(boxvar_lit_Patternm_statementListFindDeadStoreRemoveEmptyStatements)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addAliasesToEnv(threadData_t *threadData, modelica_metatype _inEnv, modelica_metatype _inTypes, modelica_metatype _inAliases, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addAliasesToEnv,2,0) {(void*) boxptr_Patternm_addAliasesToEnv,0}};
#define boxvar_Patternm_addAliasesToEnv MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addAliasesToEnv)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addPatternAliases(threadData_t *threadData, modelica_metatype _inPattern, modelica_metatype _inAliases, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype *out_outCache);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addPatternAliases,2,0) {(void*) boxptr_Patternm_addPatternAliases,0}};
#define boxvar_Patternm_addPatternAliases MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addPatternAliases)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addPatternAliasesList(threadData_t *threadData, modelica_metatype _inPatterns, modelica_metatype _inAliases, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype *out_outCache);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addPatternAliasesList,2,0) {(void*) boxptr_Patternm_addPatternAliasesList,0}};
#define boxvar_Patternm_addPatternAliasesList MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addPatternAliasesList)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_getInputAsBinding(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype *out_aliases, modelica_metatype *out_aliasesAndCrefs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_getInputAsBinding,2,0) {(void*) boxptr_Patternm_getInputAsBinding,0}};
#define boxvar_Patternm_getInputAsBinding MMC_REFSTRUCTLIT(boxvar_lit_Patternm_getInputAsBinding)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findFirstNonAsPattern(threadData_t *threadData, modelica_metatype _inPattern);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_findFirstNonAsPattern,2,0) {(void*) boxptr_Patternm_findFirstNonAsPattern,0}};
#define boxvar_Patternm_findFirstNonAsPattern MMC_REFSTRUCTLIT(boxvar_lit_Patternm_findFirstNonAsPattern)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addEnvKnownAsBindings2(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inEnv, modelica_metatype _firstPattern);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addEnvKnownAsBindings2,2,0) {(void*) boxptr_Patternm_addEnvKnownAsBindings2,0}};
#define boxvar_Patternm_addEnvKnownAsBindings2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addEnvKnownAsBindings2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addEnvKnownAsBindings(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inEnv, modelica_metatype *out_env);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addEnvKnownAsBindings,2,0) {(void*) boxptr_Patternm_addEnvKnownAsBindings,0}};
#define boxvar_Patternm_addEnvKnownAsBindings MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addEnvKnownAsBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_constantComplexity(threadData_t *threadData, modelica_metatype _inExp, modelica_integer _ii, modelica_integer *out_oi);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_constantComplexity(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _ii, modelica_metatype *out_oi);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_constantComplexity,2,0) {(void*) boxptr_Patternm_constantComplexity,0}};
#define boxvar_Patternm_constantComplexity MMC_REFSTRUCTLIT(boxvar_lit_Patternm_constantComplexity)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_patternComplexity(threadData_t *threadData, modelica_metatype _inPat, modelica_integer _inComplexity, modelica_integer *out_i);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_patternComplexity(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inComplexity, modelica_metatype *out_i);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_patternComplexity,2,0) {(void*) boxptr_Patternm_patternComplexity,0}};
#define boxvar_Patternm_patternComplexity MMC_REFSTRUCTLIT(boxvar_lit_Patternm_patternComplexity)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_sortPatternsByComplexityWork(threadData_t *threadData, modelica_metatype _tpl1, modelica_metatype _tpl2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_sortPatternsByComplexityWork(threadData_t *threadData, modelica_metatype _tpl1, modelica_metatype _tpl2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_sortPatternsByComplexityWork,2,0) {(void*) boxptr_Patternm_sortPatternsByComplexityWork,0}};
#define boxvar_Patternm_sortPatternsByComplexityWork MMC_REFSTRUCTLIT(boxvar_lit_Patternm_sortPatternsByComplexityWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_setCasePatterns(threadData_t *threadData, modelica_metatype _case1, modelica_metatype _pats);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_setCasePatterns,2,0) {(void*) boxptr_Patternm_setCasePatterns,0}};
#define boxvar_Patternm_setCasePatterns MMC_REFSTRUCTLIT(boxvar_lit_Patternm_setCasePatterns)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_getCasePatterns(threadData_t *threadData, modelica_metatype _case_);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_getCasePatterns,2,0) {(void*) boxptr_Patternm_getCasePatterns,0}};
#define boxvar_Patternm_getCasePatterns MMC_REFSTRUCTLIT(boxvar_lit_Patternm_getCasePatterns)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_allPatternsAlwaysMatch(threadData_t *threadData, modelica_metatype _ipats);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_allPatternsAlwaysMatch(threadData_t *threadData, modelica_metatype _ipats);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_allPatternsAlwaysMatch,2,0) {(void*) boxptr_Patternm_allPatternsAlwaysMatch,0}};
#define boxvar_Patternm_allPatternsAlwaysMatch MMC_REFSTRUCTLIT(boxvar_lit_Patternm_allPatternsAlwaysMatch)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_allPatternsWild(threadData_t *threadData, modelica_metatype _ipats);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_allPatternsWild(threadData_t *threadData, modelica_metatype _ipats);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_allPatternsWild,2,0) {(void*) boxptr_Patternm_allPatternsWild,0}};
#define boxvar_Patternm_allPatternsWild MMC_REFSTRUCTLIT(boxvar_lit_Patternm_allPatternsWild)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkLocalShadowing(threadData_t *threadData, modelica_metatype _elt, modelica_metatype _env, modelica_metatype _inTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkLocalShadowing,2,0) {(void*) boxptr_Patternm_checkLocalShadowing,0}};
#define boxvar_Patternm_checkLocalShadowing MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkLocalShadowing)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalDecls(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _els, modelica_string _scopeName, modelica_boolean _impl, modelica_metatype _info, modelica_metatype *out_res);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_addLocalDecls(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _els, modelica_metatype _scopeName, modelica_metatype _impl, modelica_metatype _info, modelica_metatype *out_res);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addLocalDecls,2,0) {(void*) boxptr_Patternm_addLocalDecls,0}};
#define boxvar_Patternm_addLocalDecls MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addLocalDecls)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_filterEmptyPattern(threadData_t *threadData, modelica_metatype _tpl);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_filterEmptyPattern(threadData_t *threadData, modelica_metatype _tpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_filterEmptyPattern,2,0) {(void*) boxptr_Patternm_filterEmptyPattern,0}};
#define boxvar_Patternm_filterEmptyPattern MMC_REFSTRUCTLIT(boxvar_lit_Patternm_filterEmptyPattern)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_fixCaseReturnTypes(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _iexps, modelica_metatype _itys, modelica_metatype _info, modelica_metatype *out_ty);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_fixCaseReturnTypes,2,0) {(void*) boxptr_Patternm_fixCaseReturnTypes,0}};
#define boxvar_Patternm_fixCaseReturnTypes MMC_REFSTRUCTLIT(boxvar_lit_Patternm_fixCaseReturnTypes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabResultExp2(threadData_t *threadData, modelica_boolean _skipPhase, modelica_metatype _body, modelica_metatype _elabExp, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outInfo);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabResultExp2(threadData_t *threadData, modelica_metatype _skipPhase, modelica_metatype _body, modelica_metatype _elabExp, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabResultExp2,2,0) {(void*) boxptr_Patternm_elabResultExp2,0}};
#define boxvar_Patternm_elabResultExp2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabResultExp2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPatternGuard(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _patternGuard, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outPatternGuard);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabPatternGuard(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _patternGuard, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outPatternGuard);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabPatternGuard,2,0) {(void*) boxptr_Patternm_elabPatternGuard,0}};
#define boxvar_Patternm_elabPatternGuard MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabPatternGuard)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabResultExp(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inBody, modelica_metatype _exp, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outBody, modelica_metatype *out_resExp, modelica_metatype *out_resultInfo, modelica_metatype *out_resType);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabResultExp(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inBody, modelica_metatype _exp, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outBody, modelica_metatype *out_resExp, modelica_metatype *out_resultInfo, modelica_metatype *out_resType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabResultExp,2,0) {(void*) boxptr_Patternm_elabResultExp,0}};
#define boxvar_Patternm_elabResultExp MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabResultExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabMatchCase(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _acase, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype *out_elabCase, modelica_metatype *out_resExp, modelica_metatype *out_resType);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabMatchCase(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _acase, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype *out_elabCase, modelica_metatype *out_resExp, modelica_metatype *out_resType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabMatchCase,2,0) {(void*) boxptr_Patternm_elabMatchCase,0}};
#define boxvar_Patternm_elabMatchCase MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabMatchCase)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabMatchCases2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _inAccCases, modelica_metatype _inAccExps, modelica_metatype _inAccTypes, modelica_metatype *out_elabCases, modelica_metatype *out_resExps, modelica_metatype *out_resTypes);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabMatchCases2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _inAccCases, modelica_metatype _inAccExps, modelica_metatype _inAccTypes, modelica_metatype *out_elabCases, modelica_metatype *out_resExps, modelica_metatype *out_resTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabMatchCases2,2,0) {(void*) boxptr_Patternm_elabMatchCases2,0}};
#define boxvar_Patternm_elabMatchCases2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabMatchCases2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabMatchCases(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _info, modelica_metatype *out_elabCases, modelica_metatype *out_resType);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabMatchCases(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _info, modelica_metatype *out_elabCases, modelica_metatype *out_resType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabMatchCases,2,0) {(void*) boxptr_Patternm_elabMatchCases,0}};
#define boxvar_Patternm_elabMatchCases MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabMatchCases)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_patternsDoNotOverlap(threadData_t *threadData, modelica_metatype _ip1, modelica_metatype _ip2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_patternsDoNotOverlap(threadData_t *threadData, modelica_metatype _ip1, modelica_metatype _ip2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_patternsDoNotOverlap,2,0) {(void*) boxptr_Patternm_patternsDoNotOverlap,0}};
#define boxvar_Patternm_patternsDoNotOverlap MMC_REFSTRUCTLIT(boxvar_lit_Patternm_patternsDoNotOverlap)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_patternListsDoNotOverlap(threadData_t *threadData, modelica_metatype _ips1, modelica_metatype _ips2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_patternListsDoNotOverlap(threadData_t *threadData, modelica_metatype _ips1, modelica_metatype _ips2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_patternListsDoNotOverlap,2,0) {(void*) boxptr_Patternm_patternListsDoNotOverlap,0}};
#define boxvar_Patternm_patternListsDoNotOverlap MMC_REFSTRUCTLIT(boxvar_lit_Patternm_patternListsDoNotOverlap)
PROTECTED_FUNCTION_STATIC void omc_Patternm_assertAllPatternListsDoNotOverlap(threadData_t *threadData, modelica_metatype _ipss1, modelica_metatype _ps2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_assertAllPatternListsDoNotOverlap,2,0) {(void*) boxptr_Patternm_assertAllPatternListsDoNotOverlap,0}};
#define boxvar_Patternm_assertAllPatternListsDoNotOverlap MMC_REFSTRUCTLIT(boxvar_lit_Patternm_assertAllPatternListsDoNotOverlap)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueToMatch2(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _prevPatterns, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueToMatch2,2,0) {(void*) boxptr_Patternm_optimizeContinueToMatch2,0}};
#define boxvar_Patternm_optimizeContinueToMatch2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueToMatch2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueToMatch(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueToMatch,2,0) {(void*) boxptr_Patternm_optimizeContinueToMatch,0}};
#define boxvar_Patternm_optimizeContinueToMatch MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueToMatch)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_updateMatchCaseJump(threadData_t *threadData, modelica_metatype _case_, modelica_integer _jump);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_updateMatchCaseJump(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _jump);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_updateMatchCaseJump,2,0) {(void*) boxptr_Patternm_updateMatchCaseJump,0}};
#define boxvar_Patternm_updateMatchCaseJump MMC_REFSTRUCTLIT(boxvar_lit_Patternm_updateMatchCaseJump)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueJump(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _icases, modelica_integer _jump);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_optimizeContinueJump(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _icases, modelica_metatype _jump);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueJump,2,0) {(void*) boxptr_Patternm_optimizeContinueJump,0}};
#define boxvar_Patternm_optimizeContinueJump MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueJump)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueJumps2(threadData_t *threadData, modelica_metatype _icases);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueJumps2,2,0) {(void*) boxptr_Patternm_optimizeContinueJumps2,0}};
#define boxvar_Patternm_optimizeContinueJumps2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueJumps2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueJumps(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueJumps,2,0) {(void*) boxptr_Patternm_optimizeContinueJumps,0}};
#define boxvar_Patternm_optimizeContinueJumps MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeContinueJumps)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_caseDeadCodeElimination(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases, modelica_metatype _prevPatterns, modelica_metatype _iacc, modelica_boolean _iter);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_caseDeadCodeElimination(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases, modelica_metatype _prevPatterns, modelica_metatype _iacc, modelica_metatype _iter);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_caseDeadCodeElimination,2,0) {(void*) boxptr_Patternm_caseDeadCodeElimination,0}};
#define boxvar_Patternm_caseDeadCodeElimination MMC_REFSTRUCTLIT(boxvar_lit_Patternm_caseDeadCodeElimination)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_filterUnusedDecls(threadData_t *threadData, modelica_metatype _matchDecls, modelica_metatype _ht, modelica_metatype _iacc, modelica_metatype _iunusedHt, modelica_metatype *out_outUnusedHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedDecls,2,0) {(void*) boxptr_Patternm_filterUnusedDecls,0}};
#define boxvar_Patternm_filterUnusedDecls MMC_REFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedDecls)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addPatternAsBindings(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inHt, modelica_metatype *out_ht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addPatternAsBindings,2,0) {(void*) boxptr_Patternm_addPatternAsBindings,0}};
#define boxvar_Patternm_addPatternAsBindings MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addPatternAsBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_simplifyPattern(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _extra, modelica_metatype *out_outExtra);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_simplifyPattern,2,0) {(void*) boxptr_Patternm_simplifyPattern,0}};
#define boxvar_Patternm_simplifyPattern MMC_REFSTRUCTLIT(boxvar_lit_Patternm_simplifyPattern)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addCasesLocalCref(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _iht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addCasesLocalCref,2,0) {(void*) boxptr_Patternm_addCasesLocalCref,0}};
#define boxvar_Patternm_addCasesLocalCref MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addCasesLocalCref)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useCasesLocalCref(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _inTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_useCasesLocalCref,2,0) {(void*) boxptr_Patternm_useCasesLocalCref,0}};
#define boxvar_Patternm_useCasesLocalCref MMC_REFSTRUCTLIT(boxvar_lit_Patternm_useCasesLocalCref)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_usePatternAsBindings(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inTree, modelica_metatype *out_outTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_usePatternAsBindings,2,0) {(void*) boxptr_Patternm_usePatternAsBindings,0}};
#define boxvar_Patternm_usePatternAsBindings MMC_REFSTRUCTLIT(boxvar_lit_Patternm_usePatternAsBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useLocalCrefSubs(threadData_t *threadData, modelica_metatype _isubs, modelica_metatype _inTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_useLocalCrefSubs,2,0) {(void*) boxptr_Patternm_useLocalCrefSubs,0}};
#define boxvar_Patternm_useLocalCrefSubs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_useLocalCrefSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useLocalCrefHelper(threadData_t *threadData, modelica_metatype _cr, modelica_metatype _inTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_useLocalCrefHelper,2,0) {(void*) boxptr_Patternm_useLocalCrefHelper,0}};
#define boxvar_Patternm_useLocalCrefHelper MMC_REFSTRUCTLIT(boxvar_lit_Patternm_useLocalCrefHelper)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useLocalCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTree, modelica_metatype *out_outTree);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_useLocalCref,2,0) {(void*) boxptr_Patternm_useLocalCref,0}};
#define boxvar_Patternm_useLocalCref MMC_REFSTRUCTLIT(boxvar_lit_Patternm_useLocalCref)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkDefUsePattern(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inTpl, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkDefUsePattern,2,0) {(void*) boxptr_Patternm_checkDefUsePattern,0}};
#define boxvar_Patternm_checkDefUsePattern MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkDefUsePattern)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkDefUse(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkDefUse,2,0) {(void*) boxptr_Patternm_checkDefUse,0}};
#define boxvar_Patternm_checkDefUse MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkDefUse)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalCrefSubs(threadData_t *threadData, modelica_metatype _isubs, modelica_metatype _iht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addLocalCrefSubs,2,0) {(void*) boxptr_Patternm_addLocalCrefSubs,0}};
#define boxvar_Patternm_addLocalCrefSubs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addLocalCrefSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalCrefHelper(threadData_t *threadData, modelica_metatype _cr, modelica_metatype _iht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addLocalCrefHelper,2,0) {(void*) boxptr_Patternm_addLocalCrefHelper,0}};
#define boxvar_Patternm_addLocalCrefHelper MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addLocalCrefHelper)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHt, modelica_metatype *out_outHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_addLocalCref,2,0) {(void*) boxptr_Patternm_addLocalCref,0}};
#define boxvar_Patternm_addLocalCref MMC_REFSTRUCTLIT(boxvar_lit_Patternm_addLocalCref)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_removePatternAsBinding(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inTpl, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_removePatternAsBinding,2,0) {(void*) boxptr_Patternm_removePatternAsBinding,0}};
#define boxvar_Patternm_removePatternAsBinding MMC_REFSTRUCTLIT(boxvar_lit_Patternm_removePatternAsBinding)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_filterUnusedAsBindings(threadData_t *threadData, modelica_metatype _inCases, modelica_metatype _ht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedAsBindings,2,0) {(void*) boxptr_Patternm_filterUnusedAsBindings,0}};
#define boxvar_Patternm_filterUnusedAsBindings MMC_REFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedAsBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_getUsedLocalCrefs(threadData_t *threadData, modelica_boolean _skipFilterUnusedAsBindings, modelica_metatype _exp, modelica_integer _hashSize);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_getUsedLocalCrefs(threadData_t *threadData, modelica_metatype _skipFilterUnusedAsBindings, modelica_metatype _exp, modelica_metatype _hashSize);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_getUsedLocalCrefs,2,0) {(void*) boxptr_Patternm_getUsedLocalCrefs,0}};
#define boxvar_Patternm_getUsedLocalCrefs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_getUsedLocalCrefs)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_filterUnusedPatterns2(threadData_t *threadData, modelica_metatype _inInputs, modelica_metatype _inAliases, modelica_metatype _inPatternMatrix, modelica_boolean _change, modelica_metatype _inputsAcc, modelica_metatype _aliasesAcc, modelica_metatype _patternMatrixAcc, modelica_metatype *out_outInputs, modelica_metatype *out_outAliases, modelica_metatype *out_outPatternMatrix);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_filterUnusedPatterns2(threadData_t *threadData, modelica_metatype _inInputs, modelica_metatype _inAliases, modelica_metatype _inPatternMatrix, modelica_metatype _change, modelica_metatype _inputsAcc, modelica_metatype _aliasesAcc, modelica_metatype _patternMatrixAcc, modelica_metatype *out_outInputs, modelica_metatype *out_outAliases, modelica_metatype *out_outPatternMatrix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedPatterns2,2,0) {(void*) boxptr_Patternm_filterUnusedPatterns2,0}};
#define boxvar_Patternm_filterUnusedPatterns2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedPatterns2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_setCasePatternsCheckZero(threadData_t *threadData, modelica_metatype _inCases, modelica_metatype _patternMatrix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_setCasePatternsCheckZero,2,0) {(void*) boxptr_Patternm_setCasePatternsCheckZero,0}};
#define boxvar_Patternm_setCasePatternsCheckZero MMC_REFSTRUCTLIT(boxvar_lit_Patternm_setCasePatternsCheckZero)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_filterUnusedPatterns(threadData_t *threadData, modelica_metatype _inputs, modelica_metatype _inAliases, modelica_metatype _inCases, modelica_metatype *out_outAliases, modelica_metatype *out_outCases);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedPatterns,2,0) {(void*) boxptr_Patternm_filterUnusedPatterns,0}};
#define boxvar_Patternm_filterUnusedPatterns MMC_REFSTRUCTLIT(boxvar_lit_Patternm_filterUnusedPatterns)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Patternm_findMinMod(threadData_t *threadData, modelica_metatype _inIxs, modelica_integer _inMod);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_findMinMod(threadData_t *threadData, modelica_metatype _inIxs, modelica_metatype _inMod);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_findMinMod,2,0) {(void*) boxptr_Patternm_findMinMod,0}};
#define boxvar_Patternm_findMinMod MMC_REFSTRUCTLIT(boxvar_lit_Patternm_findMinMod)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findPatternToConvertToSwitch2(threadData_t *threadData, modelica_metatype _ipats, modelica_metatype _ixs, modelica_metatype _ity, modelica_boolean _allSubPatternsMatch, modelica_integer _numPatternsInMatrix, modelica_integer *out_extraarg);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_findPatternToConvertToSwitch2(threadData_t *threadData, modelica_metatype _ipats, modelica_metatype _ixs, modelica_metatype _ity, modelica_metatype _allSubPatternsMatch, modelica_metatype _numPatternsInMatrix, modelica_metatype *out_extraarg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_findPatternToConvertToSwitch2,2,0) {(void*) boxptr_Patternm_findPatternToConvertToSwitch2,0}};
#define boxvar_Patternm_findPatternToConvertToSwitch2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_findPatternToConvertToSwitch2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findPatternToConvertToSwitch(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_integer _index, modelica_integer _numPatternsInMatrix, modelica_metatype _info);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_findPatternToConvertToSwitch(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_metatype _index, modelica_metatype _numPatternsInMatrix, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_findPatternToConvertToSwitch,2,0) {(void*) boxptr_Patternm_findPatternToConvertToSwitch,0}};
#define boxvar_Patternm_findPatternToConvertToSwitch MMC_REFSTRUCTLIT(boxvar_lit_Patternm_findPatternToConvertToSwitch)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_removeWildPatternColumnsFromMatrix(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_metatype _inAcc, modelica_integer _inNumAcc, modelica_integer *out_numNonEmptyColumns);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_removeWildPatternColumnsFromMatrix(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_metatype _inAcc, modelica_metatype _inNumAcc, modelica_metatype *out_numNonEmptyColumns);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_removeWildPatternColumnsFromMatrix,2,0) {(void*) boxptr_Patternm_removeWildPatternColumnsFromMatrix,0}};
#define boxvar_Patternm_removeWildPatternColumnsFromMatrix MMC_REFSTRUCTLIT(boxvar_lit_Patternm_removeWildPatternColumnsFromMatrix)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeSwitchedMatchCases(threadData_t *threadData, modelica_metatype _inMatchType, modelica_metatype _inCases);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeSwitchedMatchCases,2,0) {(void*) boxptr_Patternm_optimizeSwitchedMatchCases,0}};
#define boxvar_Patternm_optimizeSwitchedMatchCases MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeSwitchedMatchCases)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeMatchToSwitch(threadData_t *threadData, modelica_metatype _matchTy, modelica_metatype _cases, modelica_metatype _info, modelica_metatype *out_outCases);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_optimizeMatchToSwitch,2,0) {(void*) boxptr_Patternm_optimizeMatchToSwitch,0}};
#define boxvar_Patternm_optimizeMatchToSwitch MMC_REFSTRUCTLIT(boxvar_lit_Patternm_optimizeMatchToSwitch)
PROTECTED_FUNCTION_STATIC void omc_Patternm_checkConstantMatchInputs(threadData_t *threadData, modelica_metatype _inputs, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkConstantMatchInputs,2,0) {(void*) boxptr_Patternm_checkConstantMatchInputs,0}};
#define boxvar_Patternm_checkConstantMatchInputs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkConstantMatchInputs)
PROTECTED_FUNCTION_STATIC void omc_Patternm_validUniontype(threadData_t *threadData, modelica_metatype _path1, modelica_metatype _path2, modelica_metatype _info, modelica_metatype _lhs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_validUniontype,2,0) {(void*) boxptr_Patternm_validUniontype,0}};
#define boxvar_Patternm_validUniontype MMC_REFSTRUCTLIT(boxvar_lit_Patternm_validUniontype)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_validPatternType(threadData_t *threadData, modelica_metatype _inTy1, modelica_metatype _inTy2, modelica_metatype _lhs, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_validPatternType,2,0) {(void*) boxptr_Patternm_validPatternType,0}};
#define boxvar_Patternm_validPatternType MMC_REFSTRUCTLIT(boxvar_lit_Patternm_validPatternType)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkForAllWildCall(threadData_t *threadData, modelica_metatype _args, modelica_metatype _named, modelica_integer _numFields, modelica_metatype *out_outNamed);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_checkForAllWildCall(threadData_t *threadData, modelica_metatype _args, modelica_metatype _named, modelica_metatype _numFields, modelica_metatype *out_outNamed);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkForAllWildCall,2,0) {(void*) boxptr_Patternm_checkForAllWildCall,0}};
#define boxvar_Patternm_checkForAllWildCall MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkForAllWildCall)
PROTECTED_FUNCTION_STATIC void omc_Patternm_checkMissingArgs(threadData_t *threadData, modelica_metatype _path, modelica_integer _numPosArgs, modelica_metatype _missingFieldNames, modelica_integer _numNamedArgs, modelica_metatype _info);
PROTECTED_FUNCTION_STATIC void boxptr_Patternm_checkMissingArgs(threadData_t *threadData, modelica_metatype _path, modelica_metatype _numPosArgs, modelica_metatype _missingFieldNames, modelica_metatype _numNamedArgs, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkMissingArgs,2,0) {(void*) boxptr_Patternm_checkMissingArgs,0}};
#define boxvar_Patternm_checkMissingArgs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkMissingArgs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPatternCall(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _callPath, modelica_metatype _fargs, modelica_metatype _utPath, modelica_metatype _info, modelica_metatype _lhs, modelica_metatype *out_pattern);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabPatternCall,2,0) {(void*) boxptr_Patternm_elabPatternCall,0}};
#define boxvar_Patternm_elabPatternCall MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabPatternCall)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPatternTuple(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inExps, modelica_metatype _inTys, modelica_metatype _info, modelica_metatype _lhs, modelica_metatype *out_patterns);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabPatternTuple,2,0) {(void*) boxptr_Patternm_elabPatternTuple,0}};
#define boxvar_Patternm_elabPatternTuple MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabPatternTuple)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPattern2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inLhs, modelica_metatype _ty, modelica_metatype _info, modelica_integer _numError, modelica_metatype *out_pattern);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabPattern2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inLhs, modelica_metatype _ty, modelica_metatype _info, modelica_metatype _numError, modelica_metatype *out_pattern);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabPattern2,2,0) {(void*) boxptr_Patternm_elabPattern2,0}};
#define boxvar_Patternm_elabPattern2 MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabPattern2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findBoundVariables(threadData_t *threadData, modelica_metatype _pat, modelica_metatype _boundVars, modelica_metatype *out_outBoundVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_findBoundVariables,2,0) {(void*) boxptr_Patternm_findBoundVariables,0}};
#define boxvar_Patternm_findBoundVariables MMC_REFSTRUCTLIT(boxvar_lit_Patternm_findBoundVariables)
PROTECTED_FUNCTION_STATIC void omc_Patternm_checkPatternsDuplicateAsBindings(threadData_t *threadData, modelica_metatype _patterns, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkPatternsDuplicateAsBindings,2,0) {(void*) boxptr_Patternm_checkPatternsDuplicateAsBindings,0}};
#define boxvar_Patternm_checkPatternsDuplicateAsBindings MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkPatternsDuplicateAsBindings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPattern(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _lhs, modelica_metatype _ty, modelica_metatype _info, modelica_metatype *out_pattern);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_elabPattern,2,0) {(void*) boxptr_Patternm_elabPattern,0}};
#define boxvar_Patternm_elabPattern MMC_REFSTRUCTLIT(boxvar_lit_Patternm_elabPattern)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkInvalidPatternNamedArgs(threadData_t *threadData, modelica_metatype _args, modelica_metatype _fieldNameList, modelica_metatype _status, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_checkInvalidPatternNamedArgs,2,0) {(void*) boxptr_Patternm_checkInvalidPatternNamedArgs,0}};
#define boxvar_Patternm_checkInvalidPatternNamedArgs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_checkInvalidPatternNamedArgs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findFieldExpInList(threadData_t *threadData, modelica_string _firstFieldName, modelica_metatype _namedArgList, modelica_metatype *out_outNamedArgList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_findFieldExpInList,2,0) {(void*) boxptr_Patternm_findFieldExpInList,0}};
#define boxvar_Patternm_findFieldExpInList MMC_REFSTRUCTLIT(boxvar_lit_Patternm_findFieldExpInList)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_generatePositionalArgs(threadData_t *threadData, modelica_metatype _fieldNameList, modelica_metatype _namedArgList, modelica_metatype _accList, modelica_metatype *out_outInvalidNames);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Patternm_generatePositionalArgs,2,0) {(void*) boxptr_Patternm_generatePositionalArgs,0}};
#define boxvar_Patternm_generatePositionalArgs MMC_REFSTRUCTLIT(boxvar_lit_Patternm_generatePositionalArgs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_convertExpToPatterns(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outInputs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _exp = 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 (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp = tmpMeta6;
_inExp = _exp;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (!listEmpty(tmpMeta9)) goto tmp3_end;
_exp = tmpMeta8;
_inExp = _exp;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
tmpMeta1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2)));
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
tmpMeta10 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outInputs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outInputs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_makeTupleFromMetaTuple(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inType, modelica_metatype *out_ty)
{
modelica_metatype _exp = NULL;
modelica_metatype _ty = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inType;
{
modelica_metatype _exps = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _tys2 = 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,30,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,18,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_exps = tmpMeta6;
_tys = tmpMeta7;
_tys2 = omc_List_map(threadData, _tys, boxvar_Types_unboxedType);
_exps = omc_Types_matchTypeTuple(threadData, _exps, _tys, _tys2, 0 ,&_tys2);
tmpMeta8 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _exps);
tmpMeta9 = mmc_mk_box3(17, &DAE_Type_T__TUPLE__desc, _tys2, mmc_mk_none());
tmpMeta[0+0] = tmpMeta8;
tmpMeta[0+1] = tmpMeta9;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inType;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exp = tmpMeta[0+0];
_ty = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_ty) { *out_ty = _ty; }
return _exp;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_isNotDummyStatement(threadData_t *threadData, modelica_metatype _statement)
{
modelica_boolean _b;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = omc_Algorithm_isNotDummyStatement(threadData, _statement);
omc_Error_assertionOrAddSourceMessage(threadData, (_b || (!omc_Flags_isSet(threadData, _OMC_LIT3))), _OMC_LIT8, _OMC_LIT10, omc_ElementSource_getElementSourceFileInfo(threadData, omc_Algorithm_getStatementSource(threadData, _statement)));
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_isNotDummyStatement(threadData_t *threadData, modelica_metatype _statement)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Patternm_isNotDummyStatement(threadData, _statement);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elseFindDeadStore(threadData_t *threadData, modelica_metatype _inElse, modelica_metatype _localsTree, modelica_metatype _inUseTree, modelica_metatype *out_useTree)
{
modelica_metatype _outElse = NULL;
modelica_metatype _useTree = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElse;
{
modelica_metatype _exp = NULL;
modelica_metatype _body = NULL;
modelica_metatype _else_ = NULL;
modelica_metatype _elseTree = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta[0+0] = _inElse;
tmpMeta[0+1] = _inUseTree;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_exp = tmpMeta5;
_body = tmpMeta6;
_else_ = tmpMeta7;
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _inUseTree ,&_useTree);
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
_else_ = omc_Patternm_elseFindDeadStore(threadData, _else_, _localsTree, _inUseTree ,&_elseTree);
_useTree = omc_AvlSetString_join(threadData, _useTree, _elseTree);
tmpMeta8 = mmc_mk_box4(4, &DAE_Else_ELSEIF__desc, _exp, _body, _else_);
_else_ = tmpMeta8;
tmpMeta[0+0] = _else_;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_body = tmpMeta9;
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _inUseTree ,&_useTree);
tmpMeta10 = mmc_mk_box2(5, &DAE_Else_ELSE__desc, _body);
_else_ = tmpMeta10;
tmpMeta[0+0] = _else_;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outElse = tmpMeta[0+0];
_useTree = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_useTree) { *out_useTree = _useTree; }
return _outElse;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_statementFindDeadStore(threadData_t *threadData, modelica_metatype _inStatement, modelica_metatype _localsTree, modelica_metatype _inUseTree, modelica_metatype *out_useTree)
{
modelica_metatype _outStatement = NULL;
modelica_metatype _useTree = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inStatement;
{
modelica_metatype _elseTree = NULL;
modelica_metatype _body = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _lhs = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _msg = NULL;
modelica_metatype _level = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _else_ = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _info = NULL;
modelica_boolean _b;
modelica_string _id = NULL;
modelica_metatype _source = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 18; 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,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));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_ty = tmpMeta6;
_lhs = tmpMeta7;
_exp = tmpMeta8;
_source = tmpMeta9;
_info = tmpMeta10;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _inUseTree ,&_useTree);
tmpMeta11 = mmc_mk_box3(0, _localsTree, _useTree, _info);
_lhs = omc_Expression_traverseExpBottomUp(threadData, _lhs, boxvar_Patternm_checkDefUse, tmpMeta11, NULL);
_outStatement = omc_Algorithm_makeAssignmentNoTypeCheck(threadData, _ty, _lhs, _exp, _source);
tmpMeta[0+0] = _outStatement;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 1: {
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,1,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));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
_ty = tmpMeta12;
_exps = tmpMeta13;
_exp = tmpMeta14;
_source = tmpMeta15;
_info = tmpMeta16;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _inUseTree ,&_useTree);
tmpMeta17 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _exps);
tmpMeta18 = mmc_mk_box3(0, _localsTree, _useTree, _info);
tmpMeta19 = omc_Expression_traverseExpBottomUp(threadData, tmpMeta17, boxvar_Patternm_checkDefUse, tmpMeta18, NULL);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,19,1) == 0) goto goto_2;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
_exps = tmpMeta20;
_outStatement = omc_Algorithm_makeTupleAssignmentNoTypeCheck(threadData, _ty, _exps, _exp, _source);
tmpMeta[0+0] = _outStatement;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 2: {
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,2,4) == 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));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
_ty = tmpMeta21;
_lhs = tmpMeta22;
_exp = tmpMeta23;
_source = tmpMeta24;
_info = tmpMeta25;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _inUseTree ,&_useTree);
tmpMeta26 = mmc_mk_box3(0, _localsTree, _useTree, _info);
_lhs = omc_Expression_traverseExpBottomUp(threadData, _lhs, boxvar_Patternm_checkDefUse, tmpMeta26, NULL);
_outStatement = omc_Algorithm_makeArrayAssignmentNoTypeCheck(threadData, _ty, _lhs, _exp, _source);
tmpMeta[0+0] = _outStatement;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,4) == 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));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_exp = tmpMeta27;
_body = tmpMeta28;
_else_ = tmpMeta29;
_source = tmpMeta30;
_else_ = omc_Patternm_elseFindDeadStore(threadData, _else_, _localsTree, _inUseTree ,&_elseTree);
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _inUseTree ,&_useTree);
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
_useTree = omc_AvlSetString_join(threadData, _useTree, _elseTree);
tmpMeta31 = mmc_mk_box5(6, &DAE_Statement_STMT__IF__desc, _exp, _body, _else_, _source);
tmpMeta[0+0] = tmpMeta31;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_integer tmp34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,6) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp34 = mmc_unbox_integer(tmpMeta33);
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
_ty = tmpMeta32;
_b = tmp34;
_id = tmpMeta35;
_exp = tmpMeta36;
_body = tmpMeta37;
_source = tmpMeta38;
omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT11);
omc_List_map1Fold(threadData, _body, boxvar_Patternm_statementFindDeadStore, _localsTree, _inUseTree ,&_useTree);
omc_ErrorExt_rollBack(threadData, _OMC_LIT11);
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _useTree ,&_useTree);
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
_useTree = omc_AvlSetString_join(threadData, _useTree, _inUseTree);
tmpMeta39 = mmc_mk_box7(7, &DAE_Statement_STMT__FOR__desc, _ty, mmc_mk_boolean(_b), _id, _exp, _body, _source);
tmpMeta[0+0] = tmpMeta39;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,3) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_exp = tmpMeta40;
_body = tmpMeta41;
_source = tmpMeta42;
omc_ErrorExt_setCheckpoint(threadData, _OMC_LIT11);
omc_List_map1Fold(threadData, _body, boxvar_Patternm_statementFindDeadStore, _localsTree, _inUseTree ,&_useTree);
omc_ErrorExt_rollBack(threadData, _OMC_LIT11);
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _useTree ,&_useTree);
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
_useTree = omc_AvlSetString_join(threadData, _useTree, _inUseTree);
tmpMeta43 = mmc_mk_box4(9, &DAE_Statement_STMT__WHILE__desc, _exp, _body, _source);
tmpMeta[0+0] = tmpMeta43;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,7) == 0) goto tmp3_end;
goto goto_2;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,4) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_cond = tmpMeta44;
_msg = tmpMeta45;
_level = tmpMeta46;
omc_Expression_traverseExpBottomUp(threadData, _cond, boxvar_Patternm_useLocalCref, _inUseTree ,&_useTree);
omc_Expression_traverseExpBottomUp(threadData, _msg, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
omc_Expression_traverseExpBottomUp(threadData, _level, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta47;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,2) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmpMeta47;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, omc_AvlSetString_new(threadData) ,&_useTree);
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 9: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
goto goto_2;
goto tmp3_done;
}
case 10: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,3) == 0) goto tmp3_end;
goto goto_2;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,2) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta48,13,3) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta49,1,1) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 2));
if (4 != MMC_STRLEN(tmpMeta50) || strcmp(MMC_STRINGDATA(_OMC_LIT12), MMC_STRINGDATA(tmpMeta50)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = omc_AvlSetString_new(threadData);
goto tmp3_done;
}
case 12: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = omc_AvlSetString_new(threadData);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,2) == 0) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmpMeta51;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _inUseTree ,&_useTree);
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
case 14: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = _inUseTree;
goto tmp3_done;
}
case 15: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = _inUseTree;
goto tmp3_done;
}
case 16: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,3) == 0) goto tmp3_end;
tmpMeta[0+0] = _inStatement;
tmpMeta[0+1] = _inUseTree;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,2) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_body = tmpMeta52;
_source = tmpMeta53;
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _inUseTree ,&_useTree);
tmpMeta54 = mmc_mk_box3(19, &DAE_Statement_STMT__FAILURE__desc, _body, _source);
tmpMeta[0+0] = tmpMeta54;
tmpMeta[0+1] = _useTree;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outStatement = tmpMeta[0+0];
_useTree = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_useTree) { *out_useTree = _useTree; }
return _outStatement;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData_t *threadData, modelica_metatype _inBody, modelica_metatype _localsTree, modelica_metatype _inUseTree, modelica_metatype *out_useTree)
{
modelica_metatype _body = NULL;
modelica_metatype _useTree = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_body = omc_List_map1Fold(threadData, listReverse(_inBody), boxvar_Patternm_statementFindDeadStore, _localsTree, _inUseTree ,&_useTree);
_body = omc_List_select(threadData, _body, boxvar_Patternm_isNotDummyStatement);
_body = listReverse(_body);
_return: OMC_LABEL_UNUSED
if (out_useTree) { *out_useTree = _useTree; }
return _body;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addAliasesToEnv(threadData_t *threadData, modelica_metatype _inEnv, modelica_metatype _inTypes, modelica_metatype _inAliases, modelica_metatype _info)
{
modelica_metatype _outEnv = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inEnv;
tmp4_2 = _inTypes;
tmp4_3 = _inAliases;
{
modelica_metatype _tys = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _rest = NULL;
modelica_string _id = NULL;
modelica_metatype _env = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _attr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
if (!listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta1 = _inEnv;
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);
if (!listEmpty(tmpMeta8)) goto tmp3_end;
_tys = tmpMeta7;
_aliases = tmpMeta9;
_inTypes = _tys;
_inAliases = _aliases;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
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 (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_2);
tmpMeta11 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_3);
tmpMeta13 = MMC_CDR(tmp4_3);
if (listEmpty(tmpMeta12)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmpMeta12);
tmpMeta15 = MMC_CDR(tmpMeta12);
_ty = tmpMeta10;
_id = tmpMeta14;
_rest = tmpMeta15;
_aliases = tmpMeta13;
_env = tmp4_1;
_attr = _OMC_LIT19;
tmpMeta16 = mmc_mk_box7(3, &DAE_Var_TYPES__VAR__desc, _id, _attr, _ty, _OMC_LIT20, mmc_mk_boolean(0), mmc_mk_none());
tmpMeta17 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, _id, _OMC_LIT24, _OMC_LIT28, _OMC_LIT31, _OMC_LIT32, _OMC_LIT33, mmc_mk_none(), _info);
_env = omc_FGraph_mkComponentNode(threadData, _env, tmpMeta16, tmpMeta17, _OMC_LIT34, _OMC_LIT35, omc_FGraph_empty(threadData));
tmpMeta18 = mmc_mk_cons(_rest, _aliases);
_inEnv = _env;
_inAliases = tmpMeta18;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outEnv = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outEnv;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addPatternAliases(threadData_t *threadData, modelica_metatype _inPattern, modelica_metatype _inAliases, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype *out_outCache)
{
modelica_metatype _pat = NULL;
modelica_metatype _outCache = NULL;
modelica_metatype _attr = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_pat = _inPattern;
_outCache = _inCache;
{
modelica_metatype _alias;
for (tmpMeta1 = _inAliases; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_alias = MMC_CAR(tmpMeta1);
tmpMeta4 = omc_Lookup_lookupIdent(threadData, _outCache, _inEnv, _alias, &tmpMeta2, NULL, NULL, NULL, NULL);
_outCache = tmpMeta4;
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 3));
_attr = tmpMeta3;
tmpMeta5 = mmc_mk_box5(5, &DAE_Pattern_PAT__AS__desc, _alias, mmc_mk_none(), _attr, _pat);
_pat = tmpMeta5;
}
}
_return: OMC_LABEL_UNUSED
if (out_outCache) { *out_outCache = _outCache; }
return _pat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addPatternAliasesList(threadData_t *threadData, modelica_metatype _inPatterns, modelica_metatype _inAliases, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype *out_outCache)
{
modelica_metatype _outPatterns = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _outCache = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _rest_aliases = NULL;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outPatterns = tmpMeta1;
_outCache = _inCache;
_rest_aliases = _inAliases;
{
modelica_metatype _pat;
for (tmpMeta2 = _inPatterns; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_pat = MMC_CAR(tmpMeta2);
tmpMeta3 = _rest_aliases;
if (listEmpty(tmpMeta3)) MMC_THROW_INTERNAL();
tmpMeta4 = MMC_CAR(tmpMeta3);
tmpMeta5 = MMC_CDR(tmpMeta3);
_aliases = tmpMeta4;
_rest_aliases = tmpMeta5;
_pat = omc_Patternm_addPatternAliases(threadData, _pat, _aliases, _outCache, _inEnv ,&_outCache);
tmpMeta6 = mmc_mk_cons(_pat, _outPatterns);
_outPatterns = tmpMeta6;
}
}
_outPatterns = listReverse(_outPatterns);
_return: OMC_LABEL_UNUSED
if (out_outCache) { *out_outCache = _outCache; }
return _outPatterns;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_getInputAsBinding(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype *out_aliases, modelica_metatype *out_aliasesAndCrefs)
{
modelica_metatype _exp = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _aliasesAndCrefs = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_string _id = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 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));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (!listEmpty(tmpMeta8)) goto tmp3_end;
_id = tmpMeta7;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta10 = mmc_mk_cons(_id, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta9;
tmpMeta[0+2] = tmpMeta10;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_id = tmpMeta11;
_exp = tmpMeta12;
_exp = omc_Patternm_getInputAsBinding(threadData, _exp ,&_aliases ,&_aliasesAndCrefs);
tmpMeta13 = mmc_mk_cons(_id, _aliases);
tmpMeta14 = mmc_mk_cons(_id, _aliasesAndCrefs);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = tmpMeta13;
tmpMeta[0+2] = tmpMeta14;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta15;
tmpMeta[0+2] = tmpMeta16;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exp = tmpMeta[0+0];
_aliases = tmpMeta[0+1];
_aliasesAndCrefs = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_aliases) { *out_aliases = _aliases; }
if (out_aliasesAndCrefs) { *out_aliasesAndCrefs = _aliasesAndCrefs; }
return _exp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findFirstNonAsPattern(threadData_t *threadData, modelica_metatype _inPattern)
{
modelica_metatype _outPattern = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inPattern;
{
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,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_outPattern = tmpMeta6;
_inPattern = _outPattern;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inPattern;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPattern = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outPattern;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addEnvKnownAsBindings2(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inEnv, modelica_metatype _firstPattern)
{
modelica_metatype _env = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_env = _inEnv;
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inPat;
tmp4_2 = _firstPattern;
{
modelica_metatype _name = NULL;
modelica_metatype _path = NULL;
modelica_string _id = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _fields = NULL;
modelica_integer _index;
modelica_boolean _knownSingleton;
modelica_metatype _attr = NULL;
modelica_metatype _typeVars = 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_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,6) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmp10 = mmc_unbox_integer(tmpMeta9);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
tmp14 = mmc_unbox_integer(tmpMeta13);
_id = tmpMeta6;
_attr = tmpMeta7;
_name = tmpMeta8;
_index = tmp10;
_fields = tmpMeta11;
_typeVars = tmpMeta12;
_knownSingleton = tmp14;
_path = omc_AbsynUtil_stripLast(threadData, _name);
tmpMeta15 = mmc_mk_box7(24, &DAE_Type_T__METARECORD__desc, _name, _path, _typeVars, mmc_mk_integer(_index), _fields, mmc_mk_boolean(_knownSingleton));
_ty = tmpMeta15;
tmpMeta16 = mmc_mk_box7(3, &DAE_Var_TYPES__VAR__desc, _id, _attr, _ty, _OMC_LIT20, mmc_mk_boolean(0), mmc_mk_none());
tmpMeta17 = mmc_mk_box3(3, &Absyn_TypeSpec_TPATH__desc, _name, mmc_mk_none());
tmpMeta18 = mmc_mk_box9(6, &SCode_Element_COMPONENT__desc, _id, _OMC_LIT24, _OMC_LIT28, tmpMeta17, _OMC_LIT32, _OMC_LIT33, mmc_mk_none(), _OMC_LIT38);
tmpMeta1 = omc_FGraph_mkComponentNode(threadData, _env, tmpMeta16, tmpMeta18, _OMC_LIT34, _OMC_LIT35, omc_FGraph_empty(threadData));
goto tmp3_done;
}
case 1: {
tmpMeta1 = _env;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_env = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _env;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addEnvKnownAsBindings(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inEnv, modelica_metatype *out_env)
{
modelica_metatype _pat = NULL;
modelica_metatype _env = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_pat = _inPat;
_env = _inEnv;
{
modelica_metatype tmp4_1;
tmp4_1 = _pat;
{
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,4) == 0) goto tmp3_end;
tmpMeta1 = omc_Patternm_addEnvKnownAsBindings2(threadData, _pat, _env, omc_Patternm_findFirstNonAsPattern(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_pat), 5)))));
goto tmp3_done;
}
case 1: {
tmpMeta1 = _env;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_env = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_env) { *out_env = _env; }
return _pat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_constantComplexity(threadData_t *threadData, modelica_metatype _inExp, modelica_integer _ii, modelica_integer *out_oi)
{
modelica_metatype _outExp = NULL;
modelica_integer _oi;
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 = _inExp;
tmp4_2 = _ii;
{
modelica_metatype _e = NULL;
modelica_string _str = NULL;
modelica_integer _i;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
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 = tmp4_1;
_str = tmpMeta6;
_i = tmp4_2;
tmpMeta[0+0] = _e;
tmp1_c1 = ((modelica_integer) 5) + _i + stringLength(_str);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
_e = tmp4_1;
_i = tmp4_2;
tmpMeta[0+0] = _e;
tmp1_c1 = ((modelica_integer) 1) + _i;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
_e = tmp4_1;
_i = tmp4_2;
tmpMeta[0+0] = _e;
tmp1_c1 = ((modelica_integer) 1) + _i;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
_e = tmp4_1;
_i = tmp4_2;
tmpMeta[0+0] = _e;
tmp1_c1 = ((modelica_integer) 2) + _i;
goto tmp3_done;
}
case 4: {
_e = tmp4_1;
_i = tmp4_2;
tmpMeta[0+0] = _e;
tmp1_c1 = ((modelica_integer) 5) + _i;
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];
_oi = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_oi) { *out_oi = _oi; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_constantComplexity(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _ii, modelica_metatype *out_oi)
{
modelica_integer tmp1;
modelica_integer _oi;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_ii);
_outExp = omc_Patternm_constantComplexity(threadData, _inExp, tmp1, &_oi);
if (out_oi) { *out_oi = mmc_mk_icon(_oi); }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_patternComplexity(threadData_t *threadData, modelica_metatype _inPat, modelica_integer _inComplexity, modelica_integer *out_i)
{
modelica_metatype _outPat = NULL;
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outPat = _inPat;
_i = _inComplexity;
{
modelica_metatype tmp4_1;
tmp4_1 = _inPat;
{
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;
modelica_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp = tmpMeta6;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_constantComplexity, mmc_mk_integer(_i), &tmpMeta7);
tmp8 = mmc_unbox_integer(tmpMeta7);
_i = tmp8;
tmp1 = _i;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 5) + _i;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_integer tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmp10 = mmc_unbox_integer(tmpMeta9);
if (0 != tmp10) goto tmp3_end;
tmp1 = ((modelica_integer) 5) + _i;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 5) + _i;
goto tmp3_done;
}
case 4: {
tmp1 = _i;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_i = tmp1;
_return: OMC_LABEL_UNUSED
if (out_i) { *out_i = _i; }
return _outPat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_patternComplexity(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inComplexity, modelica_metatype *out_i)
{
modelica_integer tmp1;
modelica_integer _i;
modelica_metatype _outPat = NULL;
tmp1 = mmc_unbox_integer(_inComplexity);
_outPat = omc_Patternm_patternComplexity(threadData, _inPat, tmp1, &_i);
if (out_i) { *out_i = mmc_mk_icon(_i); }
return _outPat;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_sortPatternsByComplexityWork(threadData_t *threadData, modelica_metatype _tpl1, modelica_metatype _tpl2)
{
modelica_boolean _greater;
modelica_metatype _pat1 = NULL;
modelica_metatype _pat2 = NULL;
modelica_integer _i1;
modelica_integer _i2;
modelica_integer _c1;
modelica_integer _c2;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_integer tmp4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _tpl1;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp4 = mmc_unbox_integer(tmpMeta3);
_pat1 = tmpMeta2;
_i1 = tmp4;
tmpMeta5 = _tpl2;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
_pat2 = tmpMeta6;
_i2 = tmp8;
omc_Patternm_traversePattern(threadData, _pat1, boxvar_Patternm_patternComplexity, mmc_mk_integer(((modelica_integer) 0)), &tmpMeta9);
tmp10 = mmc_unbox_integer(tmpMeta9);
_c1 = tmp10;
omc_Patternm_traversePattern(threadData, _pat2, boxvar_Patternm_patternComplexity, mmc_mk_integer(((modelica_integer) 0)), &tmpMeta11);
tmp12 = mmc_unbox_integer(tmpMeta11);
_c2 = tmp12;
_greater = ((_c1 == _c2)?(_i1 > _i2):((_c2 == ((modelica_integer) 0))?0:((_c1 == ((modelica_integer) 0))?1:(_c1 > _c2))));
_return: OMC_LABEL_UNUSED
return _greater;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_sortPatternsByComplexityWork(threadData_t *threadData, modelica_metatype _tpl1, modelica_metatype _tpl2)
{
modelica_boolean _greater;
modelica_metatype out_greater;
_greater = omc_Patternm_sortPatternsByComplexityWork(threadData, _tpl1, _tpl2);
out_greater = mmc_mk_icon(_greater);
return out_greater;
}
DLLExport
modelica_metatype omc_Patternm_sortPatternsByComplexity(threadData_t *threadData, modelica_metatype _inPatterns)
{
modelica_metatype _outPatterns = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outPatterns = omc_List_toListWithPositions(threadData, _inPatterns);
_outPatterns = omc_List_sort(threadData, _outPatterns, boxvar_Patternm_sortPatternsByComplexityWork);
_return: OMC_LABEL_UNUSED
return _outPatterns;
}
DLLExport
modelica_integer omc_Patternm_getValueCtor(threadData_t *threadData, modelica_integer _ix)
{
modelica_integer _ctor;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ctor = ((modelica_integer) 3) + _ix;
_return: OMC_LABEL_UNUSED
return _ctor;
}
modelica_metatype boxptr_Patternm_getValueCtor(threadData_t *threadData, modelica_metatype _ix)
{
modelica_integer tmp1;
modelica_integer _ctor;
modelica_metatype out_ctor;
tmp1 = mmc_unbox_integer(_ix);
_ctor = omc_Patternm_getValueCtor(threadData, tmp1);
out_ctor = mmc_mk_icon(_ctor);
return out_ctor;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_setCasePatterns(threadData_t *threadData, modelica_metatype _case1, modelica_metatype _pats)
{
modelica_metatype _case2 = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _case1;
{
modelica_metatype _localDecls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _result = NULL;
modelica_integer _jump;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = 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_integer tmp12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
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), 8));
tmp12 = mmc_unbox_integer(tmpMeta11);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_patternGuard = tmpMeta6;
_localDecls = tmpMeta7;
_body = tmpMeta8;
_result = tmpMeta9;
_resultInfo = tmpMeta10;
_jump = tmp12;
_info = tmpMeta13;
tmpMeta14 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _pats, _patternGuard, _localDecls, _body, _result, _resultInfo, mmc_mk_integer(_jump), _info);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_case2 = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _case2;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_getCasePatterns(threadData_t *threadData, modelica_metatype _case_)
{
modelica_metatype _pats = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _case_;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_pats = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _pats;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_allPatternsAlwaysMatch(threadData_t *threadData, modelica_metatype _ipats)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ipats;
{
modelica_metatype _pat = NULL;
modelica_metatype _pats = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
_pats = tmpMeta7;
_ipats = _pats;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
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,4) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 5));
_pat = tmpMeta10;
_pats = tmpMeta9;
tmpMeta11 = mmc_mk_cons(_pat, _pats);
_ipats = tmpMeta11;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,3,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
_pat = tmpMeta14;
_pats = tmpMeta13;
tmpMeta15 = mmc_mk_cons(_pat, _pats);
_ipats = tmpMeta15;
goto _tailrecursive;
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_Patternm_allPatternsAlwaysMatch(threadData_t *threadData, modelica_metatype _ipats)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Patternm_allPatternsAlwaysMatch(threadData, _ipats);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_allPatternsWild(threadData_t *threadData, modelica_metatype _ipats)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ipats;
{
modelica_metatype _pats = 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 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
_pats = tmpMeta7;
_ipats = _pats;
goto _tailrecursive;
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:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_allPatternsWild(threadData_t *threadData, modelica_metatype _ipats)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Patternm_allPatternsWild(threadData, _ipats);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_metatype omc_Patternm_resultExps(threadData_t *threadData, modelica_metatype _inCases)
{
modelica_metatype _exps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCases;
{
modelica_metatype _exp = NULL;
modelica_metatype _cases = 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;
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), 6));
if (optionNone(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
_exp = tmpMeta10;
_cases = tmpMeta8;
_exps = omc_Patternm_resultExps(threadData, _cases);
tmpMeta11 = mmc_mk_cons(_exp, _exps);
tmpMeta1 = tmpMeta11;
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);
_cases = tmpMeta13;
_inCases = _cases;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _exps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkLocalShadowing(threadData_t *threadData, modelica_metatype _elt, modelica_metatype _env, modelica_metatype _inTpl)
{
modelica_metatype _outTpl = NULL;
modelica_string _name = NULL;
modelica_metatype _cache = NULL;
modelica_boolean _b;
modelica_metatype _info = NULL;
modelica_metatype _var = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outTpl = _inTpl;
tmpMeta1 = _elt;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,3,8) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
_name = tmpMeta2;
_info = tmpMeta3;
tmpMeta4 = _inTpl;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 1));
_cache = tmpMeta5;
{
{
volatile mmc_switch_type tmp8;
int tmp9;
tmp8 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp7_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp8 < 2; tmp8++) {
switch (MMC_SWITCH_CAST(tmp8)) {
case 0: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_boolean tmp14 = 0;
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta13 = omc_Lookup_lookupVarInternalIdent(threadData, _cache, _env, _name, tmpMeta12, _OMC_LIT39, &tmpMeta10, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
_cache = tmpMeta13;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 4));
_var = tmpMeta11;
{
modelica_metatype tmp17_1;
tmp17_1 = _var;
{
volatile mmc_switch_type tmp17;
int tmp18;
tmp17 = 0;
for (; tmp17 < 2; tmp17++) {
switch (MMC_SWITCH_CAST(tmp17)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp17_1,3,0) == 0) goto tmp16_end;
tmp14 = 1;
goto tmp16_done;
}
case 1: {
tmp14 = 0;
goto tmp16_done;
}
}
goto tmp16_end;
tmp16_end: ;
}
goto goto_15;
goto_15:;
goto goto_6;
goto tmp16_done;
tmp16_done:;
}
}
_b = tmp14;
goto tmp7_done;
}
case 1: {
_b = 1;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
tmp7_done:
(void)tmp8;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp7_done2;
goto_6:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp8 < 2) {
goto tmp7_top;
}
MMC_THROW_INTERNAL();
tmp7_done2:;
}
}
;
if((!_b))
{
tmpMeta19 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT43, tmpMeta19, _info);
tmpMeta20 = mmc_mk_box2(0, _cache, mmc_mk_boolean(1));
_outTpl = tmpMeta20;
}
_return: OMC_LABEL_UNUSED
return _outTpl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalDecls(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _els, modelica_string _scopeName, modelica_boolean _impl, modelica_metatype _info, modelica_metatype *out_res)
{
modelica_metatype _outCache = NULL;
modelica_metatype _res = 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 = _els;
{
modelica_metatype _ld = NULL;
modelica_metatype _ld2 = NULL;
modelica_metatype _ld3 = NULL;
modelica_metatype _ld4 = NULL;
modelica_metatype _ld_mod = NULL;
modelica_metatype _dae1 = NULL;
modelica_metatype _env2 = NULL;
modelica_metatype _dummyFunc = NULL;
modelica_string _str = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_boolean _b;
modelica_metatype _declsTree = NULL;
modelica_metatype _names = 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_3)) goto tmp3_end;
_cache = tmp4_1;
_env = tmp4_2;
_declsTree = omc_AvlSetString_new(threadData);
tmpMeta6 = mmc_mk_box3(0, _env, _OMC_LIT44, _declsTree);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(tmpMeta6);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_integer tmp13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_boolean tmp21;
modelica_metatype tmpMeta22;
_cache = tmp4_1;
_env = tmp4_2;
_ld = tmp4_3;
_env2 = omc_FGraph_openScope(threadData, _env, _OMC_LIT45, _scopeName, mmc_mk_none());
_ld2 = omc_AbsynToSCode_translateEitemlist(threadData, _ld, _OMC_LIT46);
tmpMeta7 = omc_List_applyAndFold1(threadData, _ld2, boxvar_boolAnd, boxvar_SCodeUtil_isComponentWithDirection, _OMC_LIT26, mmc_mk_boolean(1));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (1 != tmp8) goto goto_2;
tmpMeta9 = mmc_mk_box2(0, _cache, mmc_mk_boolean(0));
tmpMeta10 = omc_List_fold1(threadData, _ld2, boxvar_Patternm_checkLocalShadowing, _env, tmpMeta9);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmp13 = mmc_unbox_integer(tmpMeta12);
_cache = tmpMeta11;
_b = tmp13;
tmp15 = (modelica_boolean)_b;
if(tmp15)
{
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = tmpMeta14;
}
else
{
tmpMeta16 = _ld2;
}
_ld2 = tmpMeta16;
_ld_mod = omc_InstUtil_addNomod(threadData, _ld2);
_dummyFunc = _OMC_LIT49;
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
_cache = omc_InstUtil_addComponentsToEnv(threadData, _cache, _env2, tmpMeta17, _OMC_LIT34, _OMC_LIT50, _dummyFunc, _ld_mod, _impl ,&_env2 ,NULL);
tmpMeta18 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
_cache = omc_Inst_instElementList(threadData, _cache, _env2, tmpMeta18, _OMC_LIT51, _OMC_LIT34, _OMC_LIT50, _dummyFunc, _ld_mod, tmpMeta19, _impl, _OMC_LIT52, _OMC_LIT53, _OMC_LIT56, 1 ,&_env2 ,NULL ,NULL ,&_dae1 ,NULL ,NULL ,NULL ,NULL ,NULL);
_names = omc_List_map(threadData, _ld2, boxvar_SCodeUtil_elementName);
_declsTree = omc_AvlSetString_addList(threadData, omc_AvlSetString_new(threadData), _names);
tmp21 = (modelica_boolean)_b;
if(tmp21)
{
tmpMeta22 = mmc_mk_none();
}
else
{
tmpMeta20 = mmc_mk_box3(0, _env2, _dae1, _declsTree);
tmpMeta22 = mmc_mk_some(tmpMeta20);
}
_res = tmpMeta22;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
_cache = tmp4_1;
_ld = tmp4_3;
_ld2 = omc_AbsynToSCode_translateEitemlist(threadData, _ld, _OMC_LIT46);
tmpMeta23 = omc_List_filterOnTrue(threadData, _ld2, boxvar_SCodeUtil_isNotComponent);
if (listEmpty(tmpMeta23)) goto goto_2;
tmpMeta24 = MMC_CAR(tmpMeta23);
tmpMeta25 = MMC_CDR(tmpMeta23);
_ld2 = tmpMeta23;
_str = stringDelimitList(omc_List_map1(threadData, _ld2, boxvar_SCodeDump_unparseElementStr, _OMC_LIT57), _OMC_LIT58);
tmpMeta26 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT61, tmpMeta26, _info);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_none();
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
_cache = tmp4_1;
_ld = tmp4_3;
_ld2 = omc_AbsynToSCode_translateEitemlist(threadData, _ld, _OMC_LIT46);
_ld3 = omc_List_select1(threadData, _ld2, boxvar_SCodeUtil_isComponentWithDirection, _OMC_LIT16);
_ld4 = omc_List_select1(threadData, _ld2, boxvar_SCodeUtil_isComponentWithDirection, _OMC_LIT62);
tmpMeta27 = listAppend(_ld3, _ld4);
if (listEmpty(tmpMeta27)) goto goto_2;
tmpMeta28 = MMC_CAR(tmpMeta27);
tmpMeta29 = MMC_CDR(tmpMeta27);
_ld2 = tmpMeta27;
_str = stringDelimitList(omc_List_map1(threadData, _ld2, boxvar_SCodeDump_unparseElementStr, _OMC_LIT57), _OMC_LIT58);
tmpMeta30 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT61, tmpMeta30, _info);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_none();
goto tmp3_done;
}
case 4: {
omc_Error_addSourceMessage(threadData, _OMC_LIT65, _OMC_LIT67, _info);
tmpMeta[0+0] = _inCache;
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 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_res = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_res) { *out_res = _res; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_addLocalDecls(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _els, modelica_metatype _scopeName, modelica_metatype _impl, modelica_metatype _info, modelica_metatype *out_res)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
_outCache = omc_Patternm_addLocalDecls(threadData, _inCache, _inEnv, _els, _scopeName, tmp1, _info, out_res);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_filterEmptyPattern(threadData_t *threadData, modelica_metatype _tpl)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _tpl;
{
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));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
tmp1 = 0;
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:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_filterEmptyPattern(threadData_t *threadData, modelica_metatype _tpl)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Patternm_filterEmptyPattern(threadData, _tpl);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_metatype omc_Patternm_traverseCasesTopDown(threadData_t *threadData, modelica_metatype _inCases, modelica_fnptr _func, modelica_metatype _inA, modelica_metatype *out_a)
{
modelica_metatype _cases = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _a = NULL;
modelica_metatype _patterns = NULL;
modelica_metatype _decls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _body1 = NULL;
modelica_metatype _result = NULL;
modelica_metatype _result1 = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _patternGuard1 = NULL;
modelica_integer _jump;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = NULL;
modelica_metatype _tpl = NULL;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_integer tmp11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_cases = tmpMeta1;
_a = _inA;
{
modelica_metatype _c;
for (tmpMeta2 = _inCases; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_c = MMC_CAR(tmpMeta2);
tmpMeta3 = _c;
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 3));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 5));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 6));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 7));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 8));
tmp11 = mmc_unbox_integer(tmpMeta10);
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 9));
_patterns = tmpMeta4;
_patternGuard = tmpMeta5;
_decls = tmpMeta6;
_body = tmpMeta7;
_result = tmpMeta8;
_resultInfo = tmpMeta9;
_jump = tmp11;
_info = tmpMeta12;
tmpMeta13 = mmc_mk_box2(0, ((modelica_fnptr) _func), _a);
_tpl = tmpMeta13;
tmpMeta16 = omc_DAEUtil_traverseDAEEquationsStmts(threadData, _body, boxvar_Expression_traverseSubexpressionsTopDownHelper, _tpl, &tmpMeta14);
_body1 = tmpMeta16;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
_a = tmpMeta15;
_patternGuard1 = omc_Expression_traverseExpOptTopDown(threadData, _patternGuard, ((modelica_fnptr) _func), _a ,&_a);
_result1 = omc_Expression_traverseExpOptTopDown(threadData, _result, ((modelica_fnptr) _func), _a ,&_a);
tmpMeta18 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _patternGuard1, _decls, _body1, _result1, _resultInfo, mmc_mk_integer(_jump), _info);
tmpMeta17 = mmc_mk_cons(tmpMeta18, _cases);
_cases = tmpMeta17;
}
}
_cases = listReverse(_cases);
_return: OMC_LABEL_UNUSED
if (out_a) { *out_a = _a; }
return _cases;
}
DLLExport
modelica_metatype omc_Patternm_traverseCases(threadData_t *threadData, modelica_metatype _inCases, modelica_fnptr _func, modelica_metatype _inA, modelica_metatype *out_oa)
{
modelica_metatype _outCases = NULL;
modelica_metatype _oa = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCases;
tmp4_2 = _inA;
{
modelica_metatype _patterns = NULL;
modelica_metatype _decls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _body1 = NULL;
modelica_metatype _result = NULL;
modelica_metatype _result1 = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _patternGuard1 = NULL;
modelica_integer _jump;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _cases1 = NULL;
modelica_metatype _a = 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;
_a = tmp4_2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = _a;
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_integer tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_boolean tmp24;
modelica_metatype tmpMeta25;
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));
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), 6));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 7));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 8));
tmp16 = mmc_unbox_integer(tmpMeta15);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 9));
_patterns = tmpMeta9;
_patternGuard = tmpMeta10;
_decls = tmpMeta11;
_body = tmpMeta12;
_result = tmpMeta13;
_resultInfo = tmpMeta14;
_jump = tmp16;
_info = tmpMeta17;
_cases = tmpMeta8;
_a = tmp4_2;
tmpMeta20 = mmc_mk_box2(0, ((modelica_fnptr) _func), _a);
tmpMeta21 = omc_DAEUtil_traverseDAEEquationsStmts(threadData, _body, boxvar_Expression_traverseSubexpressionsHelper, tmpMeta20, &tmpMeta18);
_body1 = tmpMeta21;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
_a = tmpMeta19;
_patternGuard1 = omc_Expression_traverseExpOpt(threadData, _patternGuard, ((modelica_fnptr) _func), _a ,&_a);
_result1 = omc_Expression_traverseExpOpt(threadData, _result, ((modelica_fnptr) _func), _a ,&_a);
_cases1 = omc_Patternm_traverseCases(threadData, _cases, ((modelica_fnptr) _func), _a ,&_a);
tmp24 = (modelica_boolean)(((referenceEq(_cases, _cases1) && referenceEq(_patternGuard, _patternGuard1)) && referenceEq(_result, _result1)) && referenceEq(_body, _body1));
if(tmp24)
{
tmpMeta25 = _inCases;
}
else
{
tmpMeta23 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _patternGuard1, _decls, _body1, _result1, _resultInfo, mmc_mk_integer(_jump), _info);
tmpMeta22 = mmc_mk_cons(tmpMeta23, _cases1);
tmpMeta25 = tmpMeta22;
}
_cases = tmpMeta25;
tmpMeta[0+0] = _cases;
tmpMeta[0+1] = _a;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCases = tmpMeta[0+0];
_oa = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_oa) { *out_oa = _oa; }
return _outCases;
}
DLLExport
modelica_metatype omc_Patternm_traverseConstantPatternsHelper2(threadData_t *threadData, modelica_metatype _inPattern, modelica_metatype _inExtra, modelica_fnptr _func, modelica_metatype *out_extra)
{
modelica_metatype _outPattern = NULL;
modelica_metatype _extra = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_extra = _inExtra;
{
modelica_metatype tmp4_1;
tmp4_1 = _inPattern;
{
modelica_metatype _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,1,2) == 0) goto tmp3_end;
_outPattern = tmp4_1;
_exp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_outPattern), 3))), _extra ,&_extra) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_outPattern), 3))), _extra ,&_extra);
if((!referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_outPattern), 3))), _exp)))
{
tmpMeta6 = MMC_TAGPTR(mmc_alloc_words(4));
memcpy(MMC_UNTAGPTR(tmpMeta6), MMC_UNTAGPTR(_outPattern), 4*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta6))[3] = _exp;
_outPattern = tmpMeta6;
}
tmpMeta1 = _outPattern;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inPattern;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPattern = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_extra) { *out_extra = _extra; }
return _outPattern;
}
static modelica_metatype closure0_Patternm_traverseConstantPatternsHelper2(threadData_t *thData, modelica_metatype closure, modelica_metatype inPattern, modelica_metatype inExtra, modelica_metatype tmp14)
{
modelica_fnptr func = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
return boxptr_Patternm_traverseConstantPatternsHelper2(thData, inPattern, inExtra, func, tmp14);
}
DLLExport
modelica_metatype omc_Patternm_traverseConstantPatternsHelper(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inT, modelica_fnptr _func, modelica_metatype *out_outT)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outT = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outT = _inT;
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cases = NULL;
modelica_metatype _cases2 = NULL;
modelica_metatype _case_ = NULL;
modelica_metatype _patterns = 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 tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_outExp = tmp4_1;
_cases = tmpMeta6;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
_cases2 = tmpMeta7;
{
modelica_metatype _c;
for (tmpMeta8 = _cases; !listEmpty(tmpMeta8); tmpMeta8=MMC_CDR(tmpMeta8))
{
_c = MMC_CAR(tmpMeta8);
_case_ = _c;
{
modelica_metatype tmp12_1;
tmp12_1 = _case_;
{
volatile mmc_switch_type tmp12;
int tmp13;
tmp12 = 0;
for (; tmp12 < 1; tmp12++) {
switch (MMC_SWITCH_CAST(tmp12)) {
case 0: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
tmpMeta15 = mmc_mk_box1(0, ((modelica_fnptr) _func));
_patterns = omc_Patternm_traversePatternList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_case_), 2))), (modelica_fnptr) mmc_mk_box2(0,closure0_Patternm_traverseConstantPatternsHelper2,tmpMeta15), _outT ,&_outT);
if((!valueEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_case_), 2))), _patterns)))
{
tmpMeta16 = MMC_TAGPTR(mmc_alloc_words(10));
memcpy(MMC_UNTAGPTR(tmpMeta16), MMC_UNTAGPTR(_case_), 10*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta16))[2] = _patterns;
_case_ = tmpMeta16;
}
tmpMeta9 = _case_;
goto tmp11_done;
}
}
goto tmp11_end;
tmp11_end: ;
}
goto goto_10;
goto_10:;
goto goto_2;
goto tmp11_done;
tmp11_done:;
}
}
_case_ = tmpMeta9;
tmpMeta17 = mmc_mk_cons(_case_, _cases2);
_cases2 = tmpMeta17;
}
}
_cases2 = listReverseInPlace(_cases2);
if((!valueEq(_cases, _cases2)))
{
tmpMeta19 = MMC_TAGPTR(mmc_alloc_words(8));
memcpy(MMC_UNTAGPTR(tmpMeta19), MMC_UNTAGPTR(_outExp), 8*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta19))[6] = _cases2;
_outExp = tmpMeta19;
}
_outExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _outExp, _outT ,&_outT) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _outExp, _outT ,&_outT);
tmpMeta1 = _outExp;
goto tmp3_done;
}
case 1: {
_outExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _inExp, _outT ,&_outT) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _inExp, _outT ,&_outT);
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_outT) { *out_outT = _outT; }
return _outExp;
}
DLLExport
modelica_metatype omc_Patternm_fixCaseReturnTypes2(threadData_t *threadData, modelica_metatype _inCases, modelica_metatype _inExps, modelica_metatype _inInfo)
{
modelica_metatype _outCases = 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 = _inCases;
tmp4_2 = _inExps;
tmp4_3 = _inInfo;
{
modelica_metatype _patterns = NULL;
modelica_metatype _decls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _case_ = NULL;
modelica_integer _jump;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info2 = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _exps = 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 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (!listEmpty(tmp4_2)) 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;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_integer tmp19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_2);
tmpMeta8 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_1);
tmpMeta10 = MMC_CDR(tmp4_1);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 5));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 6));
if (optionNone(tmpMeta15)) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 1));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 7));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 8));
tmp19 = mmc_unbox_integer(tmpMeta18);
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 9));
_exp = tmpMeta7;
_exps = tmpMeta8;
_patterns = tmpMeta11;
_patternGuard = tmpMeta12;
_decls = tmpMeta13;
_body = tmpMeta14;
_resultInfo = tmpMeta17;
_jump = tmp19;
_info2 = tmpMeta20;
_cases = tmpMeta10;
_info = tmp4_3;
tmp4 += 1;
_cases = omc_Patternm_fixCaseReturnTypes2(threadData, _cases, _exps, _info);
tmpMeta22 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _patternGuard, _decls, _body, mmc_mk_some(_exp), _resultInfo, mmc_mk_integer(_jump), _info2);
tmpMeta21 = mmc_mk_cons(tmpMeta22, _cases);
tmpMeta1 = tmpMeta21;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta23 = MMC_CAR(tmp4_1);
tmpMeta24 = MMC_CDR(tmp4_1);
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 6));
if (!optionNone(tmpMeta25)) goto tmp3_end;
_case_ = tmpMeta23;
_cases = tmpMeta24;
_exps = tmp4_2;
_info = tmp4_3;
_cases = omc_Patternm_fixCaseReturnTypes2(threadData, _cases, _exps, _info);
tmpMeta26 = mmc_mk_cons(_case_, _cases);
tmpMeta1 = tmpMeta26;
goto tmp3_done;
}
case 3: {
omc_Error_addSourceMessage(threadData, _OMC_LIT65, _OMC_LIT69, _inInfo);
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:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_fixCaseReturnTypes(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _iexps, modelica_metatype _itys, modelica_metatype _info, modelica_metatype *out_ty)
{
modelica_metatype _outCases = NULL;
modelica_metatype _ty = 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 = _icases;
tmp4_2 = _iexps;
tmp4_3 = _itys;
{
modelica_string _str = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _tys = 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;
if (!listEmpty(tmp4_3)) goto tmp3_end;
_cases = tmp4_1;
tmpMeta[0+0] = _cases;
tmpMeta[0+1] = _OMC_LIT70;
goto tmp3_done;
}
case 1: {
_cases = tmp4_1;
_exps = tmp4_2;
_tys = tmp4_3;
_ty = omc_List_reduce(threadData, omc_List_map(threadData, _tys, boxvar_Types_boxIfUnboxedType), boxvar_Types_superType);
_ty = omc_Types_superType(threadData, _ty, _ty);
_ty = omc_Types_unboxedType(threadData, _ty);
_ty = omc_Types_makeRegularTupleFromMetaTupleOnTrue(threadData, omc_Types_allTuple(threadData, _tys), _ty);
_ty = omc_Types_getUniontypeIfMetarecordReplaceAllSubtypes(threadData, _ty);
_exps = omc_Types_matchTypes(threadData, _exps, _tys, _ty, 1, NULL);
_cases = omc_Patternm_fixCaseReturnTypes2(threadData, _cases, _exps, _info);
tmpMeta[0+0] = _cases;
tmpMeta[0+1] = _ty;
goto tmp3_done;
}
case 2: {
_cases = tmp4_1;
_exps = tmp4_2;
_tys = tmp4_3;
_ty = omc_List_reduce(threadData, _tys, boxvar_Types_superType);
_ty = omc_Types_superType(threadData, _ty, _ty);
_ty = omc_Types_unboxedType(threadData, _ty);
_ty = omc_Types_makeRegularTupleFromMetaTupleOnTrue(threadData, omc_Types_allTuple(threadData, _tys), _ty);
_ty = omc_Types_getUniontypeIfMetarecordReplaceAllSubtypes(threadData, _ty);
_exps = omc_Types_matchTypes(threadData, _exps, _tys, _ty, 1, NULL);
_cases = omc_Patternm_fixCaseReturnTypes2(threadData, _cases, _exps, _info);
tmpMeta[0+0] = _cases;
tmpMeta[0+1] = _ty;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
_tys = omc_List_unionOnTrue(threadData, _itys, tmpMeta6, boxvar_Types_equivtypes);
_str = stringAppendList(omc_List_map1r(threadData, omc_List_map(threadData, _tys, boxvar_Types_unparseType), boxvar_stringAppend, _OMC_LIT71));
tmpMeta7 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT74, tmpMeta7, _info);
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:;
}
}
_outCases = tmpMeta[0+0];
_ty = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_ty) { *out_ty = _ty; }
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabResultExp2(threadData_t *threadData, modelica_boolean _skipPhase, modelica_metatype _body, modelica_metatype _elabExp, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outInfo)
{
modelica_metatype _outBody = NULL;
modelica_metatype _outExp = NULL;
modelica_metatype _outInfo = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_boolean tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;
tmp4_1 = _skipPhase;
tmp4_2 = _body;
tmp4_3 = _elabExp;
tmp4_4 = _info;
{
modelica_metatype _elabCr1 = NULL;
modelica_metatype _elabCr2 = NULL;
modelica_metatype _elabCrs1 = NULL;
modelica_metatype _elabCrs2 = NULL;
modelica_metatype _b = NULL;
modelica_metatype _e = NULL;
modelica_metatype _i = 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_1) goto tmp3_end;
_b = tmp4_2;
_e = tmp4_3;
_i = tmp4_4;
tmpMeta[0+0] = _b;
tmpMeta[0+1] = _e;
tmpMeta[0+2] = _i;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,6,2) == 0) goto tmp3_end;
_elabCr2 = tmp4_3;
_b = tmp4_2;
tmp4 += 1;
tmpMeta7 = omc_List_splitLast(threadData, _b, &tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,4) == 0) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
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(tmpMeta10), 2));
_elabCr1 = tmpMeta8;
_e = tmpMeta9;
_i = tmpMeta11;
_b = tmpMeta6;
tmp12 = omc_Expression_expEqual(threadData, _elabCr1, _elabCr2);
if (1 != tmp12) goto goto_2;
tmpMeta[0+0] = omc_Patternm_elabResultExp2(threadData, 0, _b, _e, _i, &tmpMeta[0+1], &tmpMeta[0+2]);
goto tmp3_done;
}
case 2: {
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_3,19,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_elabCrs2 = tmpMeta13;
_b = tmp4_2;
tmpMeta15 = omc_List_splitLast(threadData, _b, &tmpMeta14);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,4) == 0) goto goto_2;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 4));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 5));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
_elabCrs1 = tmpMeta16;
_e = tmpMeta17;
_i = tmpMeta19;
_b = tmpMeta14;
omc_List_threadMapAllValue(threadData, _elabCrs1, _elabCrs2, boxvar_Expression_expEqual, mmc_mk_boolean(1));
tmpMeta[0+0] = omc_Patternm_elabResultExp2(threadData, 0, _b, _e, _i, &tmpMeta[0+1], &tmpMeta[0+2]);
goto tmp3_done;
}
case 3: {
tmpMeta[0+0] = _body;
tmpMeta[0+1] = _elabExp;
tmpMeta[0+2] = _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 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outBody = tmpMeta[0+0];
_outExp = tmpMeta[0+1];
_outInfo = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outExp) { *out_outExp = _outExp; }
if (out_outInfo) { *out_outInfo = _outInfo; }
return _outBody;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabResultExp2(threadData_t *threadData, modelica_metatype _skipPhase, modelica_metatype _body, modelica_metatype _elabExp, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outInfo)
{
modelica_integer tmp1;
modelica_metatype _outBody = NULL;
tmp1 = mmc_unbox_integer(_skipPhase);
_outBody = omc_Patternm_elabResultExp2(threadData, tmp1, _body, _elabExp, _info, out_outExp, out_outInfo);
return _outBody;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPatternGuard(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _patternGuard, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outPatternGuard)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outPatternGuard = 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 = _patternGuard;
tmp4_4 = _inInfo;
{
modelica_metatype _exp = NULL;
modelica_metatype _elabExp = NULL;
modelica_metatype _prop = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _info = 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 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_3)) goto tmp3_end;
_cache = tmp4_1;
tmp4 += 2;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_none();
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_3)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
_exp = tmpMeta6;
_cache = tmp4_1;
_env = tmp4_2;
_info = tmp4_4;
_cache = omc_Static_elabExp(threadData, _cache, _env, _exp, _impl, _performVectorization, _pre, _info ,&_elabExp ,&_prop);
_elabExp = omc_Types_matchType(threadData, _elabExp, omc_Types_getPropType(threadData, _prop), _OMC_LIT75, 1, NULL);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = mmc_mk_some(_elabExp);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (optionNone(tmp4_3)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
_exp = tmpMeta7;
_cache = tmp4_1;
_env = tmp4_2;
_info = tmp4_4;
omc_Static_elabExp(threadData, _cache, _env, _exp, _impl, _performVectorization, _pre, _info ,NULL ,&_prop);
_str = omc_Types_unparseType(threadData, omc_Types_getPropType(threadData, _prop));
tmpMeta8 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT79, tmpMeta8, _info);
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];
_outPatternGuard = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outPatternGuard) { *out_outPatternGuard = _outPatternGuard; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabPatternGuard(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _patternGuard, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outPatternGuard)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_Patternm_elabPatternGuard(threadData, _inCache, _inEnv, _patternGuard, tmp1, tmp2, _pre, _inInfo, out_outPatternGuard);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabResultExp(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inBody, modelica_metatype _exp, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outBody, modelica_metatype *out_resExp, modelica_metatype *out_resultInfo, modelica_metatype *out_resType)
{
modelica_metatype _outCache = NULL;
modelica_metatype _outBody = NULL;
modelica_metatype _resExp = NULL;
modelica_metatype _resultInfo = NULL;
modelica_metatype _resType = NULL;
modelica_metatype tmpMeta[5] __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 = _inBody;
tmp4_4 = omc_AbsynUtil_stripCommentExpressions(threadData, _exp);
{
modelica_metatype _elabExp = NULL;
modelica_metatype _prop = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _body = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_4,11,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_4), 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_LIT12), 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_4), 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_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_cache = tmp4_1;
_body = tmp4_3;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _body;
tmpMeta[0+2] = mmc_mk_none();
tmpMeta[0+3] = _inInfo;
tmpMeta[0+4] = mmc_mk_none();
goto tmp3_done;
}
case 1: {
_cache = tmp4_1;
_env = tmp4_2;
_body = tmp4_3;
_cache = omc_Static_elabExp(threadData, _cache, _env, _exp, _impl, _performVectorization, _pre, _inInfo ,&_elabExp ,&_prop);
_ty = omc_Types_getPropType(threadData, _prop);
_elabExp = omc_Patternm_makeTupleFromMetaTuple(threadData, _elabExp, _ty ,&_ty);
_body = omc_Patternm_elabResultExp2(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT83)), _body, _elabExp, _inInfo ,&_elabExp ,&_info);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _body;
tmpMeta[0+2] = mmc_mk_some(_elabExp);
tmpMeta[0+3] = _info;
tmpMeta[0+4] = mmc_mk_some(_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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_outBody = tmpMeta[0+1];
_resExp = tmpMeta[0+2];
_resultInfo = tmpMeta[0+3];
_resType = tmpMeta[0+4];
_return: OMC_LABEL_UNUSED
if (out_outBody) { *out_outBody = _outBody; }
if (out_resExp) { *out_resExp = _resExp; }
if (out_resultInfo) { *out_resultInfo = _resultInfo; }
if (out_resType) { *out_resType = _resType; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabResultExp(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _inBody, modelica_metatype _exp, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _inInfo, modelica_metatype *out_outBody, modelica_metatype *out_resExp, modelica_metatype *out_resultInfo, modelica_metatype *out_resType)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_Patternm_elabResultExp(threadData, _inCache, _inEnv, _inBody, _exp, tmp1, tmp2, _pre, _inInfo, out_outBody, out_resExp, out_resultInfo, out_resType);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabMatchCase(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _acase, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype *out_elabCase, modelica_metatype *out_resExp, modelica_metatype *out_resType)
{
modelica_metatype _outCache = NULL;
modelica_metatype _elabCase = NULL;
modelica_metatype _resExp = NULL;
modelica_metatype _resType = 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;
tmp4_1 = _inCache;
tmp4_2 = _inEnv;
tmp4_3 = _acase;
{
modelica_metatype _result = NULL;
modelica_metatype _pattern = NULL;
modelica_metatype _patterns = NULL;
modelica_metatype _elabPatterns = NULL;
modelica_metatype _elabPatterns2 = NULL;
modelica_metatype _patternGuard = NULL;
modelica_metatype _elabResult = NULL;
modelica_metatype _dPatternGuard = NULL;
modelica_metatype _caseDecls = NULL;
modelica_metatype _cp = NULL;
modelica_metatype _eqAlgs = NULL;
modelica_metatype _algs = NULL;
modelica_metatype _body = NULL;
modelica_metatype _decls = NULL;
modelica_metatype _patternInfo = NULL;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = NULL;
modelica_integer _len;
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _caseLocalTree = NULL;
modelica_metatype _localsTree = NULL;
modelica_metatype _useTree = 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;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_boolean tmp22;
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_3,0,9) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 6));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 7));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 8));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 10));
_pattern = tmpMeta6;
_patternGuard = tmpMeta7;
_patternInfo = tmpMeta8;
_decls = tmpMeta9;
_cp = tmpMeta10;
_result = tmpMeta11;
_resultInfo = tmpMeta12;
_info = tmpMeta13;
_cache = tmp4_1;
_env = tmp4_2;
tmpMeta20 = omc_Patternm_addLocalDecls(threadData, _cache, _env, _decls, _OMC_LIT84, _impl, _info, &tmpMeta14);
_cache = tmpMeta20;
if (optionNone(tmpMeta14)) goto goto_2;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 1));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 1));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
_env = tmpMeta16;
_caseDecls = tmpMeta18;
_caseLocalTree = tmpMeta19;
_patterns = omc_Patternm_convertExpToPatterns(threadData, _pattern);
tmp22 = (modelica_boolean)(listLength(_tys) == ((modelica_integer) 1));
if(tmp22)
{
tmpMeta21 = mmc_mk_cons(_pattern, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta23 = tmpMeta21;
}
else
{
tmpMeta23 = _patterns;
}
_patterns = tmpMeta23;
_cache = omc_Patternm_elabPatternTuple(threadData, _cache, _env, _patterns, _tys, _patternInfo, _pattern ,&_elabPatterns);
omc_Patternm_checkPatternsDuplicateAsBindings(threadData, _elabPatterns, _patternInfo);
_env = omc_FGraph_openNewScope(threadData, _env, _OMC_LIT45, _OMC_LIT86, mmc_mk_none());
_elabPatterns2 = omc_Patternm_addPatternAliasesList(threadData, _elabPatterns, _inputAliases, _cache, _inEnv ,&_cache);
omc_Patternm_traversePatternList(threadData, _elabPatterns2, boxvar_Patternm_addEnvKnownAsBindings, _env ,&_env);
_eqAlgs = omc_Static_fromEquationsToAlgAssignments(threadData, _cp);
_algs = omc_AbsynToSCode_translateClassdefAlgorithmitems(threadData, _eqAlgs);
tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
_cache = omc_InstSection_instStatements(threadData, _cache, _env, tmpMeta24, _pre, _OMC_LIT89, _algs, omc_ElementSource_addElementSourceFileInfo(threadData, _OMC_LIT91, _patternInfo), _OMC_LIT92, 1, 0 ,&_body);
_cache = omc_Patternm_elabResultExp(threadData, _cache, _env, _body, _result, _impl, _performVectorization, _pre, _resultInfo ,&_body ,&_elabResult ,&_resultInfo ,&_resType);
_cache = omc_Patternm_elabPatternGuard(threadData, _cache, _env, _patternGuard, _impl, _performVectorization, _pre, _patternInfo ,&_dPatternGuard);
_localsTree = omc_AvlSetString_join(threadData, _matchExpLocalTree, _caseLocalTree);
_useTree = omc_AvlSetString_new(threadData);
tmpMeta25 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _elabResult);
omc_Expression_traverseExpBottomUp(threadData, tmpMeta25, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _useTree ,&_useTree);
tmpMeta26 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _dPatternGuard);
omc_Expression_traverseExpBottomUp(threadData, tmpMeta26, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
tmpMeta27 = mmc_mk_box3(0, _localsTree, _useTree, _patternInfo);
_elabPatterns = omc_Patternm_traversePatternList(threadData, _elabPatterns, boxvar_Patternm_checkDefUsePattern, tmpMeta27, NULL);
_useTree = omc_AvlSetString_new(threadData);
tmpMeta28 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _elabResult);
omc_Expression_traverseExpBottomUp(threadData, tmpMeta28, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
_body = omc_Patternm_statementListFindDeadStoreRemoveEmptyStatements(threadData, _body, _localsTree, _useTree ,&_useTree);
tmpMeta29 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _dPatternGuard);
omc_Expression_traverseExpBottomUp(threadData, tmpMeta29, boxvar_Patternm_useLocalCref, _useTree ,&_useTree);
tmpMeta30 = mmc_mk_box3(0, _localsTree, _useTree, _patternInfo);
_elabPatterns = omc_Patternm_traversePatternList(threadData, _elabPatterns, boxvar_Patternm_checkDefUsePattern, tmpMeta30, NULL);
tmpMeta31 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _elabPatterns, _dPatternGuard, _caseDecls, _body, _elabResult, _resultInfo, mmc_mk_integer(((modelica_integer) 0)), _info);
_elabCase = tmpMeta31;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _elabCase;
tmpMeta[0+2] = _elabResult;
tmpMeta[0+3] = _resType;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_boolean tmp38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,1,6) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 7));
_decls = tmpMeta32;
_cp = tmpMeta33;
_result = tmpMeta34;
_resultInfo = tmpMeta35;
_info = tmpMeta36;
_cache = tmp4_1;
_env = tmp4_2;
_len = listLength(_tys);
_patterns = omc_List_fill(threadData, _OMC_LIT94, listLength(_tys));
tmp38 = (modelica_boolean)(_len == ((modelica_integer) 1));
if(tmp38)
{
tmpMeta39 = _OMC_LIT94;
}
else
{
tmpMeta37 = mmc_mk_box2(19, &Absyn_Exp_TUPLE__desc, _patterns);
tmpMeta39 = tmpMeta37;
}
_pattern = tmpMeta39;
tmpMeta40 = mmc_mk_box10(3, &Absyn_Case_CASE__desc, _pattern, mmc_mk_none(), _info, _decls, _cp, _result, _resultInfo, mmc_mk_none(), _info);
_inCache = _cache;
_inEnv = _env;
_acase = tmpMeta40;
goto _tailrecursive;
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];
_elabCase = tmpMeta[0+1];
_resExp = tmpMeta[0+2];
_resType = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_elabCase) { *out_elabCase = _elabCase; }
if (out_resExp) { *out_resExp = _resExp; }
if (out_resType) { *out_resType = _resType; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabMatchCase(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _acase, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype *out_elabCase, modelica_metatype *out_resExp, modelica_metatype *out_resType)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_Patternm_elabMatchCase(threadData, _inCache, _inEnv, _acase, _tys, _inputAliases, _matchExpLocalTree, tmp1, tmp2, _pre, out_elabCase, out_resExp, out_resType);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabMatchCases2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _inAccCases, modelica_metatype _inAccExps, modelica_metatype _inAccTypes, modelica_metatype *out_elabCases, modelica_metatype *out_resExps, modelica_metatype *out_resTypes)
{
modelica_metatype _outCache = NULL;
modelica_metatype _elabCases = NULL;
modelica_metatype _resExps = NULL;
modelica_metatype _resTypes = 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 = _inEnv;
tmp4_3 = _cases;
tmp4_4 = _inAccExps;
tmp4_5 = _inAccTypes;
{
modelica_metatype _case_ = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _elabCase = NULL;
modelica_metatype _optType = NULL;
modelica_metatype _optExp = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_metatype _accExps = NULL;
modelica_metatype _accTypes = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_3)) goto tmp3_end;
_cache = tmp4_1;
_accExps = tmp4_4;
_accTypes = tmp4_5;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = listReverse(_inAccCases);
tmpMeta[0+2] = listReverse(_accExps);
tmpMeta[0+3] = listReverse(_accTypes);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_3);
tmpMeta7 = MMC_CDR(tmp4_3);
_case_ = tmpMeta6;
_rest = tmpMeta7;
_cache = tmp4_1;
_env = tmp4_2;
_accExps = tmp4_4;
_accTypes = tmp4_5;
_cache = omc_Patternm_elabMatchCase(threadData, _cache, _env, _case_, _tys, _inputAliases, _matchExpLocalTree, _impl, _performVectorization, _pre ,&_elabCase ,&_optExp ,&_optType);
tmpMeta8 = mmc_mk_cons(_elabCase, _inAccCases);
_inCache = _cache;
_inEnv = _env;
_cases = _rest;
_inAccCases = tmpMeta8;
_inAccExps = omc_List_consOption(threadData, _optExp, _accExps);
_inAccTypes = omc_List_consOption(threadData, _optType, _accTypes);
goto _tailrecursive;
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];
_elabCases = tmpMeta[0+1];
_resExps = tmpMeta[0+2];
_resTypes = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_elabCases) { *out_elabCases = _elabCases; }
if (out_resExps) { *out_resExps = _resExps; }
if (out_resTypes) { *out_resTypes = _resTypes; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabMatchCases2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _inAccCases, modelica_metatype _inAccExps, modelica_metatype _inAccTypes, modelica_metatype *out_elabCases, modelica_metatype *out_resExps, modelica_metatype *out_resTypes)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_Patternm_elabMatchCases2(threadData, _inCache, _inEnv, _cases, _tys, _inputAliases, _matchExpLocalTree, tmp1, tmp2, _pre, _inAccCases, _inAccExps, _inAccTypes, out_elabCases, out_resExps, out_resTypes);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabMatchCases(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_boolean _impl, modelica_boolean _performVectorization, modelica_metatype _pre, modelica_metatype _info, modelica_metatype *out_elabCases, modelica_metatype *out_resType)
{
modelica_metatype _outCache = NULL;
modelica_metatype _elabCases = NULL;
modelica_metatype _resType = NULL;
modelica_metatype _resExps = NULL;
modelica_metatype _resTypes = NULL;
modelica_metatype _tysFixed = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_tysFixed = omc_List_map(threadData, _tys, boxvar_Types_getUniontypeIfMetarecordReplaceAllSubtypes);
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
_outCache = omc_Patternm_elabMatchCases2(threadData, _cache, _env, _cases, _tysFixed, _inputAliases, _matchExpLocalTree, _impl, _performVectorization, _pre, tmpMeta1, tmpMeta2, tmpMeta3 ,&_elabCases ,&_resExps ,&_resTypes);
_elabCases = omc_Patternm_fixCaseReturnTypes(threadData, _elabCases, _resExps, _resTypes, _info ,&_resType);
_return: OMC_LABEL_UNUSED
if (out_elabCases) { *out_elabCases = _elabCases; }
if (out_resType) { *out_resType = _resType; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabMatchCases(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _cases, modelica_metatype _tys, modelica_metatype _inputAliases, modelica_metatype _matchExpLocalTree, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _pre, modelica_metatype _info, modelica_metatype *out_elabCases, modelica_metatype *out_resType)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_Patternm_elabMatchCases(threadData, _cache, _env, _cases, _tys, _inputAliases, _matchExpLocalTree, tmp1, tmp2, _pre, _info, out_elabCases, out_resType);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_patternsDoNotOverlap(threadData_t *threadData, modelica_metatype _ip1, modelica_metatype _ip2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _ip1;
tmp4_2 = _ip2;
{
modelica_metatype _head1 = NULL;
modelica_metatype _tail1 = NULL;
modelica_metatype _head2 = NULL;
modelica_metatype _tail2 = NULL;
modelica_metatype _p1 = NULL;
modelica_metatype _p2 = NULL;
modelica_metatype _ps1 = NULL;
modelica_metatype _ps2 = NULL;
modelica_boolean _res;
modelica_metatype _name1 = NULL;
modelica_metatype _name2 = NULL;
modelica_integer _ix1;
modelica_integer _ix2;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 15; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_p1 = tmpMeta6;
_p2 = tmp4_2;
_ip1 = _p1;
_ip2 = _p2;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_p2 = tmpMeta7;
_p1 = tmp4_1;
_ip1 = _p1;
_ip2 = _p2;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
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 (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_head1 = tmpMeta8;
_tail1 = tmpMeta9;
_head2 = tmpMeta10;
_tail2 = tmpMeta11;
tmp1 = (omc_Patternm_patternsDoNotOverlap(threadData, _head1, _head2) || omc_Patternm_patternsDoNotOverlap(threadData, _tail1, _tail2));
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_p1 = tmpMeta12;
_p2 = tmpMeta13;
_ip1 = _p1;
_ip2 = _p2;
goto _tailrecursive;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_ps1 = tmpMeta14;
_ps2 = tmpMeta15;
tmp1 = omc_Patternm_patternListsDoNotOverlap(threadData, _ps1, _ps2);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,5,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_ps1 = tmpMeta16;
_ps2 = tmpMeta17;
tmp1 = omc_Patternm_patternListsDoNotOverlap(threadData, _ps1, _ps2);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_integer tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_integer tmp24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp20 = mmc_unbox_integer(tmpMeta19);
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!listEmpty(tmpMeta21)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,6) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmp24 = mmc_unbox_integer(tmpMeta23);
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (!listEmpty(tmpMeta25)) goto tmp3_end;
_name1 = tmpMeta18;
_ix1 = tmp20;
_name2 = tmpMeta22;
_ix2 = tmp24;
_res = (_ix1 == _ix2);
_res = (_res?omc_AbsynUtil_pathEqual(threadData, _name1, _name2):_res);
tmp1 = (!_res);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_integer tmp28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_integer tmp32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp28 = mmc_unbox_integer(tmpMeta27);
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,6) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmp32 = mmc_unbox_integer(tmpMeta31);
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_name1 = tmpMeta26;
_ix1 = tmp28;
_ps1 = tmpMeta29;
_name2 = tmpMeta30;
_ix2 = tmp32;
_ps2 = tmpMeta33;
_res = (_ix1 == _ix2);
_res = (_res?omc_AbsynUtil_pathEqual(threadData, _name1, _name2):_res);
tmp1 = (_res?omc_Patternm_patternListsDoNotOverlap(threadData, _ps1, _ps2):(!_res));
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,2) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e1 = tmpMeta34;
_e2 = tmpMeta35;
tmp1 = (!omc_Expression_expEqual(threadData, _e1, _e2));
goto tmp3_done;
}
case 12: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 13: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 14: {
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_Patternm_patternsDoNotOverlap(threadData_t *threadData, modelica_metatype _ip1, modelica_metatype _ip2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Patternm_patternsDoNotOverlap(threadData, _ip1, _ip2);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_patternListsDoNotOverlap(threadData_t *threadData, modelica_metatype _ips1, modelica_metatype _ips2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _ips1;
tmp4_2 = _ips2;
{
modelica_boolean _res;
modelica_metatype _p1 = NULL;
modelica_metatype _p2 = NULL;
modelica_metatype _ps1 = NULL;
modelica_metatype _ps2 = 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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_boolean tmp11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
_p1 = tmpMeta6;
_ps1 = tmpMeta7;
_p2 = tmpMeta8;
_ps2 = tmpMeta9;
_res = omc_Patternm_patternsDoNotOverlap(threadData, _p1, _p2);
tmp10 = (modelica_boolean)(!_res);
if(tmp10)
{
_ips1 = _ps1;
_ips2 = _ps2;
goto _tailrecursive;
}
else
{
tmp11 = _res;
}
tmp1 = tmp11;
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_Patternm_patternListsDoNotOverlap(threadData_t *threadData, modelica_metatype _ips1, modelica_metatype _ips2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Patternm_patternListsDoNotOverlap(threadData, _ips1, _ips2);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC void omc_Patternm_assertAllPatternListsDoNotOverlap(threadData_t *threadData, modelica_metatype _ipss1, modelica_metatype _ps2)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _ipss1;
{
modelica_metatype _ps1 = NULL;
modelica_metatype _pss1 = 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_boolean tmp7;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_CAR(tmp3_1);
tmpMeta6 = MMC_CDR(tmp3_1);
_ps1 = tmpMeta5;
_pss1 = tmpMeta6;
tmp7 = omc_Patternm_patternListsDoNotOverlap(threadData, _ps1, _ps2);
if (1 != tmp7) goto goto_1;
_ipss1 = _pss1;
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;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueToMatch2(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _prevPatterns, modelica_metatype _info)
{
modelica_metatype _outMatchType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _icases;
{
modelica_metatype _patterns = NULL;
modelica_metatype _cases = 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 += 1;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT97, tmpMeta6, _info);
tmpMeta1 = _OMC_LIT98;
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);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_patterns = tmpMeta9;
_cases = tmpMeta8;
omc_Patternm_assertAllPatternListsDoNotOverlap(threadData, _prevPatterns, _patterns);
tmpMeta10 = mmc_mk_cons(_patterns, _prevPatterns);
tmpMeta1 = omc_Patternm_optimizeContinueToMatch2(threadData, _cases, tmpMeta10, _info);
goto tmp3_done;
}
case 2: {
tmpMeta1 = _OMC_LIT99;
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:;
}
}
_outMatchType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outMatchType;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueToMatch(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases, modelica_metatype _info)
{
modelica_metatype _outMatchType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _matchType;
{
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_LIT98;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_Patternm_optimizeContinueToMatch2(threadData, _cases, tmpMeta6, _info);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outMatchType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outMatchType;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_updateMatchCaseJump(threadData_t *threadData, modelica_metatype _case_, modelica_integer _jump)
{
modelica_metatype _outCase = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_integer tmp4_2;
tmp4_1 = _case_;
tmp4_2 = _jump;
{
modelica_metatype _patterns = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _result = NULL;
modelica_metatype _guardPattern = NULL;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (0 != tmp4_2) goto tmp3_end;
tmpMeta1 = _case_;
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;
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));
_patterns = tmpMeta6;
_guardPattern = tmpMeta7;
_localDecls = tmpMeta8;
_body = tmpMeta9;
_result = tmpMeta10;
_resultInfo = tmpMeta11;
_info = tmpMeta12;
tmpMeta13 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _guardPattern, _localDecls, _body, _result, _resultInfo, mmc_mk_integer(_jump), _info);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCase = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCase;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_updateMatchCaseJump(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _jump)
{
modelica_integer tmp1;
modelica_metatype _outCase = NULL;
tmp1 = mmc_unbox_integer(_jump);
_outCase = omc_Patternm_updateMatchCaseJump(threadData, _case_, tmp1);
return _outCase;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueJump(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _icases, modelica_integer _jump)
{
modelica_metatype _outCase = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _case_;
tmp4_2 = _icases;
{
modelica_metatype _case1 = NULL;
modelica_metatype _ps1 = NULL;
modelica_metatype _ps2 = NULL;
modelica_metatype _cases = 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_2)) goto tmp3_end;
_case1 = tmp4_1;
tmp4 += 1;
tmpMeta1 = omc_Patternm_updateMatchCaseJump(threadData, _case1, _jump);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
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), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_ps2 = tmpMeta8;
_cases = tmpMeta7;
_case1 = tmp4_1;
_ps1 = tmpMeta9;
tmp10 = omc_Patternm_patternListsDoNotOverlap(threadData, _ps1, _ps2);
if (1 != tmp10) goto goto_2;
tmpMeta1 = omc_Patternm_optimizeContinueJump(threadData, _case1, _cases, ((modelica_integer) 1) + _jump);
goto tmp3_done;
}
case 2: {
_case1 = tmp4_1;
tmpMeta1 = omc_Patternm_updateMatchCaseJump(threadData, _case1, _jump);
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:;
}
}
_outCase = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCase;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_optimizeContinueJump(threadData_t *threadData, modelica_metatype _case_, modelica_metatype _icases, modelica_metatype _jump)
{
modelica_integer tmp1;
modelica_metatype _outCase = NULL;
tmp1 = mmc_unbox_integer(_jump);
_outCase = omc_Patternm_optimizeContinueJump(threadData, _case_, _icases, tmp1);
return _outCase;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueJumps2(threadData_t *threadData, modelica_metatype _icases)
{
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _icases;
{
modelica_metatype _case_ = NULL;
modelica_metatype _cases = 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);
_case_ = tmpMeta7;
_cases = tmpMeta8;
_case_ = omc_Patternm_optimizeContinueJump(threadData, _case_, _cases, ((modelica_integer) 0));
_cases = omc_Patternm_optimizeContinueJumps2(threadData, _cases);
tmpMeta9 = mmc_mk_cons(_case_, _cases);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeContinueJumps(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases)
{
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _matchType;
{
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 = _cases;
goto tmp3_done;
}
case 1: {
tmpMeta1 = omc_Patternm_optimizeContinueJumps2(threadData, _cases);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_caseDeadCodeElimination(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases, modelica_metatype _prevPatterns, modelica_metatype _iacc, modelica_boolean _iter)
{
modelica_metatype _outCases = 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_boolean tmp4_4;
tmp4_1 = _matchType;
tmp4_2 = _cases;
tmp4_3 = _iacc;
tmp4_4 = _iter;
{
modelica_metatype _rest = NULL;
modelica_metatype _pats = NULL;
modelica_metatype _case_ = NULL;
modelica_metatype _info = NULL;
modelica_metatype _acc = 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: {
if (0 != tmp4_4) goto tmp3_end;
if (!listEmpty(tmp4_2)) goto tmp3_end;
_acc = tmp4_3;
tmp4 += 4;
tmpMeta1 = listReverse(_acc);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (1 != tmp4_4) goto tmp3_end;
if (!listEmpty(tmp4_2)) goto tmp3_end;
_acc = tmp4_3;
tmp4 += 3;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_Patternm_caseDeadCodeElimination(threadData, _matchType, listReverse(_acc), tmpMeta6, tmpMeta7, 0);
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_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 5));
if (!listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
if (!optionNone(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 9));
if (!listEmpty(tmpMeta9)) goto tmp3_end;
_info = tmpMeta12;
_acc = tmp4_3;
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT8, _OMC_LIT101, _info);
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_Patternm_caseDeadCodeElimination(threadData, _matchType, listReverse(_acc), tmpMeta13, tmpMeta14, 0);
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_2);
tmpMeta16 = MMC_CDR(tmp4_2);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 5));
if (!listEmpty(tmpMeta18)) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 6));
if (!optionNone(tmpMeta19)) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 9));
_pats = tmpMeta17;
_info = tmpMeta20;
_rest = tmpMeta16;
_acc = tmp4_3;
tmp21 = omc_Flags_isSet(threadData, _OMC_LIT105);
if (1 != tmp21) goto goto_2;
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT8, _OMC_LIT107, _info);
tmpMeta22 = mmc_mk_cons(_pats, _prevPatterns);
tmpMeta1 = omc_Patternm_caseDeadCodeElimination(threadData, _matchType, _rest, tmpMeta22, _acc, 1);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta23 = MMC_CAR(tmp4_2);
tmpMeta24 = MMC_CDR(tmp4_2);
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
_case_ = tmpMeta23;
_pats = tmpMeta25;
_rest = tmpMeta24;
_acc = tmp4_3;
tmpMeta26 = mmc_mk_cons(_pats, _prevPatterns);
tmpMeta27 = mmc_mk_cons(_case_, _acc);
tmpMeta1 = omc_Patternm_caseDeadCodeElimination(threadData, _matchType, _rest, tmpMeta26, tmpMeta27, _iter);
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:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_caseDeadCodeElimination(threadData_t *threadData, modelica_metatype _matchType, modelica_metatype _cases, modelica_metatype _prevPatterns, modelica_metatype _iacc, modelica_metatype _iter)
{
modelica_integer tmp1;
modelica_metatype _outCases = NULL;
tmp1 = mmc_unbox_integer(_iter);
_outCases = omc_Patternm_caseDeadCodeElimination(threadData, _matchType, _cases, _prevPatterns, _iacc, tmp1);
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_filterUnusedDecls(threadData_t *threadData, modelica_metatype _matchDecls, modelica_metatype _ht, modelica_metatype _iacc, modelica_metatype _iunusedHt, modelica_metatype *out_outUnusedHt)
{
modelica_metatype _outDecls = NULL;
modelica_metatype _outUnusedHt = 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 = _matchDecls;
tmp4_2 = _iacc;
tmp4_3 = _iunusedHt;
{
modelica_metatype _el = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _info = NULL;
modelica_string _name = NULL;
modelica_metatype _acc = NULL;
modelica_metatype _unusedHt = 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;
_acc = tmp4_2;
_unusedHt = tmp4_3;
tmp4 += 2;
tmpMeta[0+0] = listReverse(_acc);
tmpMeta[0+1] = _unusedHt;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,13) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 11));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_name = tmpMeta9;
_info = tmpMeta11;
_rest = tmpMeta7;
_acc = tmp4_2;
_unusedHt = tmp4_3;
tmp12 = omc_BaseHashTable_hasKey(threadData, _name, _ht);
if (0 != tmp12) goto goto_2;
tmpMeta13 = mmc_mk_box2(0, _name, _OMC_LIT108);
_unusedHt = omc_BaseHashTable_add(threadData, tmpMeta13, _unusedHt);
tmpMeta14 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT111, tmpMeta14, _info);
tmpMeta[0+0] = omc_Patternm_filterUnusedDecls(threadData, _rest, _ht, _acc, _unusedHt, &tmpMeta[0+1]);
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);
_el = tmpMeta15;
_rest = tmpMeta16;
_acc = tmp4_2;
_unusedHt = tmp4_3;
tmpMeta17 = mmc_mk_cons(_el, _acc);
tmpMeta[0+0] = omc_Patternm_filterUnusedDecls(threadData, _rest, _ht, tmpMeta17, _unusedHt, &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 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outDecls = tmpMeta[0+0];
_outUnusedHt = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outUnusedHt) { *out_outUnusedHt = _outUnusedHt; }
return _outDecls;
}
DLLExport
modelica_metatype omc_Patternm_traversePattern(threadData_t *threadData, modelica_metatype _inPattern, modelica_fnptr _func, modelica_metatype _inExtra, modelica_metatype *out_extra)
{
modelica_metatype _outPattern = NULL;
modelica_metatype _extra = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_extra = _inExtra;
{
modelica_metatype tmp4_1;
tmp4_1 = _inPattern;
{
modelica_metatype _pat = NULL;
modelica_metatype _pat1 = NULL;
modelica_metatype _pat2 = NULL;
modelica_metatype _pats = NULL;
modelica_metatype _fields = NULL;
modelica_metatype _types = NULL;
modelica_metatype _typeVars = NULL;
modelica_string _id = NULL;
modelica_string _str = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _name = NULL;
modelica_integer _index;
modelica_metatype _namedpats = NULL;
modelica_boolean _knownSingleton;
modelica_metatype _fieldVars = NULL;
modelica_metatype _attr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 11; 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,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));
_id = tmpMeta6;
_ty = tmpMeta7;
_attr = tmpMeta8;
_pat2 = tmpMeta9;
_pat2 = omc_Patternm_traversePattern(threadData, _pat2, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta10 = mmc_mk_box5(5, &DAE_Pattern_PAT__AS__desc, _id, _ty, _attr, _pat2);
_pat = tmpMeta10;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_id = tmpMeta11;
_pat2 = tmpMeta12;
_pat2 = omc_Patternm_traversePattern(threadData, _pat2, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta13 = mmc_mk_box3(6, &DAE_Pattern_PAT__AS__FUNC__PTR__desc, _id, _pat2);
_pat = tmpMeta13;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_integer tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp16 = mmc_unbox_integer(tmpMeta15);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmp21 = mmc_unbox_integer(tmpMeta20);
_name = tmpMeta14;
_index = tmp16;
_pats = tmpMeta17;
_fieldVars = tmpMeta18;
_typeVars = tmpMeta19;
_knownSingleton = tmp21;
_pats = omc_Patternm_traversePatternList(threadData, _pats, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta22 = mmc_mk_box7(10, &DAE_Pattern_PAT__CALL__desc, _name, mmc_mk_integer(_index), _pats, _fieldVars, _typeVars, mmc_mk_boolean(_knownSingleton));
_pat = tmpMeta22;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_name = tmpMeta23;
_namedpats = tmpMeta24;
_pats = omc_List_unzip3(threadData, _namedpats ,&_fields ,&_types);
_pats = omc_Patternm_traversePatternList(threadData, _pats, ((modelica_fnptr) _func), _extra ,&_extra);
_namedpats = omc_List_zip3(threadData, _pats, _fields, _types);
tmpMeta25 = mmc_mk_box3(11, &DAE_Pattern_PAT__CALL__NAMED__desc, _name, _namedpats);
_pat = tmpMeta25;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pats = tmpMeta26;
_pats = omc_Patternm_traversePatternList(threadData, _pats, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta27 = mmc_mk_box2(8, &DAE_Pattern_PAT__CALL__TUPLE__desc, _pats);
_pat = tmpMeta27;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pats = tmpMeta28;
_pats = omc_Patternm_traversePatternList(threadData, _pats, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta29 = mmc_mk_box2(7, &DAE_Pattern_PAT__META__TUPLE__desc, _pats);
_pat = tmpMeta29;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_pat1 = tmpMeta30;
_pat2 = tmpMeta31;
_pat1 = omc_Patternm_traversePattern(threadData, _pat1, ((modelica_fnptr) _func), _extra ,&_extra);
_pat2 = omc_Patternm_traversePattern(threadData, _pat2, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta32 = mmc_mk_box3(9, &DAE_Pattern_PAT__CONS__desc, _pat1, _pat2);
_pat = tmpMeta32;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 7: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
_pat = tmp4_1;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,1) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pat1 = tmpMeta33;
_pat1 = omc_Patternm_traversePattern(threadData, _pat1, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta34 = mmc_mk_box2(12, &DAE_Pattern_PAT__SOME__desc, _pat1);
_pat = tmpMeta34;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 9: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
_pat = tmp4_1;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _pat, _extra, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _pat, _extra, &tmpMeta[0+1]);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
_pat = tmp4_1;
tmpMeta35 = stringAppend(_OMC_LIT112,omc_Patternm_patternStr(threadData, _pat));
_str = tmpMeta35;
tmpMeta36 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT65, tmpMeta36);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPattern = tmpMeta[0+0];
_extra = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_extra) { *out_extra = _extra; }
return _outPattern;
}
DLLExport
modelica_metatype omc_Patternm_traversePatternList(threadData_t *threadData, modelica_metatype _inPatterns, modelica_fnptr _func, modelica_metatype _inExtra, modelica_metatype *out_extra)
{
modelica_metatype _outPatterns = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _extra = NULL;
modelica_metatype _p = NULL;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outPatterns = tmpMeta1;
_extra = _inExtra;
{
modelica_metatype _pat;
for (tmpMeta2 = _inPatterns; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_pat = MMC_CAR(tmpMeta2);
_p = omc_Patternm_traversePattern(threadData, _pat, ((modelica_fnptr) _func), _extra ,&_extra);
tmpMeta3 = mmc_mk_cons(_p, _outPatterns);
_outPatterns = tmpMeta3;
}
}
_outPatterns = listReverseInPlace(_outPatterns);
_return: OMC_LABEL_UNUSED
if (out_extra) { *out_extra = _extra; }
return _outPatterns;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addPatternAsBindings(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inHt, modelica_metatype *out_ht)
{
modelica_metatype _pat = NULL;
modelica_metatype _ht = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_pat = _inPat;
_ht = _inHt;
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inPat;
{
modelica_string _id = 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,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_id = tmpMeta6;
tmp4 += 1;
tmpMeta7 = mmc_mk_box2(0, _id, _OMC_LIT108);
tmpMeta1 = omc_BaseHashTable_add(threadData, tmpMeta7, _ht);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_id = tmpMeta8;
tmpMeta9 = mmc_mk_box2(0, _id, _OMC_LIT108);
tmpMeta1 = omc_BaseHashTable_add(threadData, tmpMeta9, _ht);
goto tmp3_done;
}
case 2: {
tmpMeta1 = _ht;
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:;
}
}
_ht = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_ht) { *out_ht = _ht; }
return _pat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_simplifyPattern(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _extra, modelica_metatype *out_outExtra)
{
modelica_metatype _outPat = NULL;
modelica_metatype _outExtra = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExtra = _extra;
{
modelica_metatype tmp4_1;
tmp4_1 = _inPat;
{
modelica_metatype _name = NULL;
modelica_metatype _namedPatterns = NULL;
modelica_metatype _patterns = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 11: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_name = tmpMeta5;
_namedPatterns = tmpMeta6;
_namedPatterns = omc_List_filterOnTrue(threadData, _namedPatterns, boxvar_Patternm_filterEmptyPattern);
tmp8 = (modelica_boolean)listEmpty(_namedPatterns);
if(tmp8)
{
tmpMeta9 = _OMC_LIT113;
}
else
{
tmpMeta7 = mmc_mk_box3(11, &DAE_Pattern_PAT__CALL__NAMED__desc, _name, _namedPatterns);
tmpMeta9 = tmpMeta7;
}
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_patterns = tmpMeta10;
tmpMeta1 = (omc_Patternm_allPatternsWild(threadData, _patterns)?_OMC_LIT113:_inPat);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_patterns = tmpMeta11;
tmpMeta1 = (omc_Patternm_allPatternsWild(threadData, _patterns)?_OMC_LIT113:_inPat);
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _inPat;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPat = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outExtra) { *out_outExtra = _outExtra; }
return _outPat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addCasesLocalCref(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _iht)
{
modelica_metatype _outHt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _icases;
tmp4_2 = _iht;
{
modelica_metatype _pats = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _ht = 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;
_ht = tmp4_2;
tmpMeta1 = _ht;
goto tmp3_done;
}
case 1: {
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);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_pats = tmpMeta8;
_cases = tmpMeta7;
_ht = tmp4_2;
omc_Patternm_traversePatternList(threadData, _pats, boxvar_Patternm_addPatternAsBindings, _ht ,&_ht);
_icases = _cases;
_iht = _ht;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outHt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outHt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useCasesLocalCref(threadData_t *threadData, modelica_metatype _icases, modelica_metatype _inTree)
{
modelica_metatype _tree = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _icases;
{
modelica_metatype _pats = NULL;
modelica_metatype _cases = 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 = _inTree;
goto tmp3_done;
}
case 1: {
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);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_pats = tmpMeta8;
_cases = tmpMeta7;
omc_Patternm_traversePatternList(threadData, _pats, boxvar_Patternm_usePatternAsBindings, _inTree ,&_tree);
_icases = _cases;
_inTree = _tree;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_tree = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _tree;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_usePatternAsBindings(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inTree, modelica_metatype *out_outTree)
{
modelica_metatype _outPat = NULL;
modelica_metatype _outTree = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outPat = _inPat;
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inPat;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmp4 += 1;
tmpMeta1 = omc_AvlSetString_add(threadData, _inTree, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inPat), 2))));
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmpMeta1 = omc_AvlSetString_add(threadData, _inTree, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inPat), 2))));
goto tmp3_done;
}
case 2: {
tmpMeta1 = _inTree;
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:;
}
}
_outTree = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outTree) { *out_outTree = _outTree; }
return _outPat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useLocalCrefSubs(threadData_t *threadData, modelica_metatype _isubs, modelica_metatype _inTree)
{
modelica_metatype _tree = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _isubs;
{
modelica_metatype _exp = 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: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta1 = _inTree;
goto tmp3_done;
}
case 1: {
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;
_subs = tmpMeta7;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _inTree ,&_tree);
_isubs = _subs;
_inTree = _tree;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
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);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_exp = tmpMeta11;
_subs = tmpMeta10;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_useLocalCref, _inTree ,&_tree);
_isubs = _subs;
_inTree = _tree;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
tmpMeta1 = _inTree;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_tree = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _tree;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useLocalCrefHelper(threadData_t *threadData, modelica_metatype _cr, modelica_metatype _inTree)
{
modelica_metatype _tree = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _cr;
{
modelica_string _name = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _cr2 = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta5;
_subs = tmpMeta6;
_tree = omc_Patternm_useLocalCrefSubs(threadData, _subs, _inTree);
tmpMeta1 = omc_AvlSetString_add(threadData, _tree, _name);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta7;
_subs = tmpMeta8;
_cr2 = tmpMeta9;
_tree = omc_Patternm_useLocalCrefSubs(threadData, _subs, _inTree);
_tree = omc_AvlSetString_add(threadData, _tree, _name);
_cr = _cr2;
_inTree = _tree;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _inTree;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_tree = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _tree;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_useLocalCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTree, modelica_metatype *out_outTree)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTree = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTree;
{
modelica_metatype _exp = NULL;
modelica_metatype _tree = NULL;
modelica_string _name = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _pat = NULL;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; 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;
_tree = tmp4_2;
_tree = omc_Patternm_useLocalCrefHelper(threadData, _cr, _tree);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _tree;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_integer tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmp11 = mmc_unbox_integer(tmpMeta10);
if (0 != tmp11) goto tmp3_end;
_exp = tmp4_1;
_name = tmpMeta8;
_tree = tmp4_2;
_tree = omc_AvlSetString_add(threadData, _tree, _name);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _tree;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmp4_1;
_pat = tmpMeta12;
_tree = tmp4_2;
omc_Patternm_traversePattern(threadData, _pat, boxvar_Patternm_usePatternAsBindings, _tree ,&_tree);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _tree;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_exp = tmp4_1;
_cases = tmpMeta13;
_tree = tmp4_2;
_tree = omc_Patternm_useCasesLocalCref(threadData, _cases, _tree);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _tree;
goto tmp3_done;
}
case 4: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTree;
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];
_outTree = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTree) { *out_outTree = _outTree; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkDefUsePattern(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inTpl, modelica_metatype *out_outTpl)
{
modelica_metatype _outPat = NULL;
modelica_metatype _outTpl = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outTpl = _inTpl;
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inPat;
tmp4_2 = _inTpl;
{
modelica_metatype _localsTree = NULL;
modelica_metatype _useTree = NULL;
modelica_string _name = NULL;
modelica_metatype _pat = 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;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_name = tmpMeta6;
_pat = tmpMeta7;
_localsTree = tmpMeta8;
_useTree = tmpMeta9;
_info = tmpMeta10;
if((omc_AvlSetString_hasKey(threadData, _localsTree, _name) && (!omc_AvlSetString_hasKey(threadData, _useTree, _name))))
{
tmpMeta11 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT116, tmpMeta11, _info);
}
else
{
_pat = _inPat;
}
tmpMeta1 = _pat;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,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));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_name = tmpMeta12;
_pat = tmpMeta13;
_localsTree = tmpMeta14;
_useTree = tmpMeta15;
_info = tmpMeta16;
if((omc_AvlSetString_hasKey(threadData, _localsTree, _name) && (!omc_AvlSetString_hasKey(threadData, _useTree, _name))))
{
tmpMeta17 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT116, tmpMeta17, _info);
}
else
{
_pat = _inPat;
}
tmpMeta1 = _pat;
goto tmp3_done;
}
case 2: {
tmpMeta1 = omc_Patternm_simplifyPattern(threadData, _inPat, mmc_mk_integer(((modelica_integer) 1)), NULL);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPat = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outPat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkDefUse(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTpl = 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 = _inTpl;
{
modelica_metatype _localsTree = NULL;
modelica_metatype _useTree = NULL;
modelica_string _name = NULL;
modelica_metatype _pat = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _info = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _extra = 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;
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));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_cr = tmpMeta6;
_ty = tmpMeta7;
_extra = tmp4_2;
_localsTree = tmpMeta8;
_useTree = tmpMeta9;
_info = tmpMeta10;
tmp4 += 1;
_name = omc_ComponentReference_crefFirstIdent(threadData, _cr);
if((omc_AvlSetString_hasKey(threadData, _localsTree, _name) && (!omc_AvlSetString_hasKey(threadData, _useTree, _name))))
{
tmpMeta11 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT119, tmpMeta11, _info);
tmpMeta12 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _OMC_LIT54, _ty);
_outExp = tmpMeta12;
}
else
{
_outExp = _inExp;
}
tmpMeta[0+0] = _outExp;
tmpMeta[0+1] = _extra;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pat = tmpMeta13;
_extra = tmp4_2;
_pat = omc_Patternm_traversePattern(threadData, _pat, boxvar_Patternm_checkDefUsePattern, _extra ,&_extra);
tmpMeta14 = mmc_mk_box2(40, &DAE_Exp_PATTERN__desc, _pat);
tmpMeta[0+0] = tmpMeta14;
tmpMeta[0+1] = _extra;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTpl;
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:;
}
}
_outExp = tmpMeta[0+0];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalCrefSubs(threadData_t *threadData, modelica_metatype _isubs, modelica_metatype _iht)
{
modelica_metatype _outHt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _isubs;
tmp4_2 = _iht;
{
modelica_metatype _exp = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _ht = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_ht = tmp4_2;
tmpMeta1 = _ht;
goto tmp3_done;
}
case 1: {
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;
_subs = tmpMeta7;
_ht = tmp4_2;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_addLocalCref, _ht ,&_ht);
_isubs = _subs;
_iht = _ht;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
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);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_exp = tmpMeta11;
_subs = tmpMeta10;
_ht = tmp4_2;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_addLocalCref, _ht ,&_ht);
_isubs = _subs;
_iht = _ht;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
tmpMeta1 = _iht;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outHt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outHt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalCrefHelper(threadData_t *threadData, modelica_metatype _cr, modelica_metatype _iht)
{
modelica_metatype _ht = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _cr;
tmp4_2 = _iht;
{
modelica_string _name = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _cr2 = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta5;
_subs = tmpMeta6;
_ht = tmp4_2;
_ht = omc_Patternm_addLocalCrefSubs(threadData, _subs, _ht);
tmpMeta7 = mmc_mk_box2(0, _name, _OMC_LIT108);
tmpMeta1 = omc_BaseHashTable_add(threadData, tmpMeta7, _ht);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta8;
_subs = tmpMeta9;
_cr2 = tmpMeta10;
_ht = tmp4_2;
_ht = omc_Patternm_addLocalCrefSubs(threadData, _subs, _ht);
tmpMeta11 = mmc_mk_box2(0, _name, _OMC_LIT108);
_ht = omc_BaseHashTable_add(threadData, tmpMeta11, _ht);
_cr = _cr2;
_iht = _ht;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _iht;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ht = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ht;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_addLocalCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHt, modelica_metatype *out_outHt)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outHt = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inHt;
{
modelica_metatype _exp = NULL;
modelica_metatype _ht = NULL;
modelica_string _name = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _pat = NULL;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; 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;
_ht = tmp4_2;
_ht = omc_Patternm_addLocalCrefHelper(threadData, _cr, _ht);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _ht;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_integer tmp11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmp11 = mmc_unbox_integer(tmpMeta10);
if (0 != tmp11) goto tmp3_end;
_exp = tmp4_1;
_name = tmpMeta8;
_ht = tmp4_2;
tmpMeta12 = mmc_mk_box2(0, _name, _OMC_LIT108);
_ht = omc_BaseHashTable_add(threadData, tmpMeta12, _ht);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _ht;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmp4_1;
_pat = tmpMeta13;
_ht = tmp4_2;
omc_Patternm_traversePattern(threadData, _pat, boxvar_Patternm_addPatternAsBindings, _ht ,&_ht);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _ht;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_exp = tmp4_1;
_cases = tmpMeta14;
_ht = tmp4_2;
_ht = omc_Patternm_addCasesLocalCref(threadData, _cases, _ht);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _ht;
goto tmp3_done;
}
case 4: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inHt;
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];
_outHt = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outHt) { *out_outHt = _outHt; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_removePatternAsBinding(threadData_t *threadData, modelica_metatype _inPat, modelica_metatype _inTpl, modelica_metatype *out_outTpl)
{
modelica_metatype _pat = NULL;
modelica_metatype _outTpl = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_pat = _inPat;
_outTpl = _inTpl;
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _pat;
tmp4_2 = _inTpl;
{
modelica_metatype _ht = NULL;
modelica_string _id = 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 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_id = tmpMeta6;
_pat = tmpMeta7;
_ht = tmpMeta8;
_info = tmpMeta9;
tmp4 += 1;
tmp10 = omc_BaseHashTable_hasKey(threadData, _id, _ht);
if (1 != tmp10) goto goto_2;
tmpMeta11 = mmc_mk_cons(_id, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT116, tmpMeta11, _info);
tmpMeta1 = _pat;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,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));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_id = tmpMeta12;
_pat = tmpMeta13;
_ht = tmpMeta14;
tmp15 = omc_BaseHashTable_hasKey(threadData, _id, _ht);
if (1 != tmp15) goto goto_2;
tmpMeta1 = _pat;
goto tmp3_done;
}
case 2: {
tmpMeta1 = omc_Patternm_simplifyPattern(threadData, _inPat, mmc_mk_integer(((modelica_integer) 1)), 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:;
}
}
_pat = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _pat;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_filterUnusedAsBindings(threadData_t *threadData, modelica_metatype _inCases, modelica_metatype _ht)
{
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCases;
{
modelica_metatype _patterns = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _body = NULL;
modelica_metatype _guardPattern = NULL;
modelica_metatype _result = NULL;
modelica_integer _jump;
modelica_metatype _resultInfo = NULL;
modelica_metatype _info = NULL;
modelica_metatype _cases = 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;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_integer tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
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));
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), 6));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 7));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 8));
tmp16 = mmc_unbox_integer(tmpMeta15);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 9));
_patterns = tmpMeta9;
_guardPattern = tmpMeta10;
_localDecls = tmpMeta11;
_body = tmpMeta12;
_result = tmpMeta13;
_resultInfo = tmpMeta14;
_jump = tmp16;
_info = tmpMeta17;
_cases = tmpMeta8;
tmpMeta18 = mmc_mk_box2(0, _ht, _info);
_patterns = omc_Patternm_traversePatternList(threadData, _patterns, boxvar_Patternm_removePatternAsBinding, tmpMeta18, NULL);
_cases = omc_Patternm_filterUnusedAsBindings(threadData, _cases, _ht);
tmpMeta20 = mmc_mk_box9(3, &DAE_MatchCase_CASE__desc, _patterns, _guardPattern, _localDecls, _body, _result, _resultInfo, mmc_mk_integer(_jump), _info);
tmpMeta19 = mmc_mk_cons(tmpMeta20, _cases);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_getUsedLocalCrefs(threadData_t *threadData, modelica_boolean _skipFilterUnusedAsBindings, modelica_metatype _exp, modelica_integer _hashSize)
{
modelica_metatype _ht = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_boolean tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _skipFilterUnusedAsBindings;
tmp4_2 = _exp;
{
modelica_metatype _cases = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_1) goto tmp3_end;
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Patternm_addLocalCref, omc_HashTableStringToPath_emptyHashTableSized(threadData, _hashSize) ,&_ht);
tmpMeta1 = _ht;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (0 != tmp4_1) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,33,6) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
_cases = tmpMeta6;
omc_Patternm_traverseCases(threadData, _cases, boxvar_Patternm_addLocalCref, omc_HashTableStringToPath_emptyHashTableSized(threadData, _hashSize) ,&_ht);
tmpMeta1 = _ht;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ht = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ht;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_getUsedLocalCrefs(threadData_t *threadData, modelica_metatype _skipFilterUnusedAsBindings, modelica_metatype _exp, modelica_metatype _hashSize)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _ht = NULL;
tmp1 = mmc_unbox_integer(_skipFilterUnusedAsBindings);
tmp2 = mmc_unbox_integer(_hashSize);
_ht = omc_Patternm_getUsedLocalCrefs(threadData, tmp1, _exp, tmp2);
return _ht;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Patternm_filterUnusedPatterns2(threadData_t *threadData, modelica_metatype _inInputs, modelica_metatype _inAliases, modelica_metatype _inPatternMatrix, modelica_boolean _change, modelica_metatype _inputsAcc, modelica_metatype _aliasesAcc, modelica_metatype _patternMatrixAcc, modelica_metatype *out_outInputs, modelica_metatype *out_outAliases, modelica_metatype *out_outPatternMatrix)
{
modelica_boolean _outChange;
modelica_metatype _outInputs = NULL;
modelica_metatype _outAliases = NULL;
modelica_metatype _outPatternMatrix = NULL;
modelica_boolean tmp1_c0 __attribute__((unused)) = 0;
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_boolean tmp4_4;
tmp4_1 = _inInputs;
tmp4_2 = _inAliases;
tmp4_3 = _inPatternMatrix;
tmp4_4 = _change;
{
modelica_metatype _e = NULL;
modelica_metatype _pats = NULL;
modelica_metatype _inputs = NULL;
modelica_metatype _patternMatrix = NULL;
modelica_metatype _alias = NULL;
modelica_metatype _aliases = 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_4) goto tmp3_end;
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (!listEmpty(tmp4_2)) goto tmp3_end;
if (!listEmpty(tmp4_3)) goto tmp3_end;
tmp4 += 2;
tmp1_c0 = 1;
tmpMeta[0+1] = listReverse(_inputsAcc);
tmpMeta[0+2] = listReverse(_aliasesAcc);
tmpMeta[0+3] = listReverse(_patternMatrixAcc);
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;
modelica_boolean tmp14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_3);
tmpMeta11 = MMC_CDR(tmp4_3);
_e = tmpMeta6;
_inputs = tmpMeta7;
_aliases = tmpMeta9;
_pats = tmpMeta10;
_patternMatrix = tmpMeta11;
omc_Expression_traverseExpBottomUp(threadData, _e, boxvar_Expression_hasNoSideEffects, mmc_mk_boolean(1), &tmpMeta12);
tmp13 = mmc_unbox_integer(tmpMeta12);
if (1 != tmp13) goto goto_2;
tmp14 = omc_Patternm_allPatternsWild(threadData, _pats);
if (1 != tmp14) goto goto_2;
tmp1_c0 = omc_Patternm_filterUnusedPatterns2(threadData, _inputs, _aliases, _patternMatrix, 1, _inputsAcc, _aliasesAcc, _patternMatrixAcc, &tmpMeta[0+1], &tmpMeta[0+2], &tmpMeta[0+3]);
goto tmp3_done;
}
case 2: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_1);
tmpMeta16 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta17 = MMC_CAR(tmp4_2);
tmpMeta18 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_3);
tmpMeta20 = MMC_CDR(tmp4_3);
_e = tmpMeta15;
_inputs = tmpMeta16;
_alias = tmpMeta17;
_aliases = tmpMeta18;
_pats = tmpMeta19;
_patternMatrix = tmpMeta20;
tmpMeta21 = mmc_mk_cons(_e, _inputsAcc);
tmpMeta22 = mmc_mk_cons(_alias, _aliasesAcc);
tmpMeta23 = mmc_mk_cons(_pats, _patternMatrixAcc);
tmp1_c0 = omc_Patternm_filterUnusedPatterns2(threadData, _inputs, _aliases, _patternMatrix, _change, tmpMeta21, tmpMeta22, tmpMeta23, &tmpMeta[0+1], &tmpMeta[0+2], &tmpMeta[0+3]);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
tmp1_c0 = 0;
tmpMeta[0+1] = tmpMeta24;
tmpMeta[0+2] = tmpMeta25;
tmpMeta[0+3] = tmpMeta26;
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:;
}
}
_outChange = tmp1_c0;
_outInputs = tmpMeta[0+1];
_outAliases = tmpMeta[0+2];
_outPatternMatrix = tmpMeta[0+3];
_return: OMC_LABEL_UNUSED
if (out_outInputs) { *out_outInputs = _outInputs; }
if (out_outAliases) { *out_outAliases = _outAliases; }
if (out_outPatternMatrix) { *out_outPatternMatrix = _outPatternMatrix; }
return _outChange;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_filterUnusedPatterns2(threadData_t *threadData, modelica_metatype _inInputs, modelica_metatype _inAliases, modelica_metatype _inPatternMatrix, modelica_metatype _change, modelica_metatype _inputsAcc, modelica_metatype _aliasesAcc, modelica_metatype _patternMatrixAcc, modelica_metatype *out_outInputs, modelica_metatype *out_outAliases, modelica_metatype *out_outPatternMatrix)
{
modelica_integer tmp1;
modelica_boolean _outChange;
modelica_metatype out_outChange;
tmp1 = mmc_unbox_integer(_change);
_outChange = omc_Patternm_filterUnusedPatterns2(threadData, _inInputs, _inAliases, _inPatternMatrix, tmp1, _inputsAcc, _aliasesAcc, _patternMatrixAcc, out_outInputs, out_outAliases, out_outPatternMatrix);
out_outChange = mmc_mk_icon(_outChange);
return out_outChange;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_setCasePatternsCheckZero(threadData_t *threadData, modelica_metatype _inCases, modelica_metatype _patternMatrix)
{
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCases;
tmp4_2 = _patternMatrix;
{
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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta1 = _inCases;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_List_map1(threadData, _inCases, boxvar_Patternm_setCasePatterns, tmpMeta6);
goto tmp3_done;
}
case 2: {
tmpMeta1 = omc_List_threadMap(threadData, _inCases, _patternMatrix, boxvar_Patternm_setCasePatterns);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_filterUnusedPatterns(threadData_t *threadData, modelica_metatype _inputs, modelica_metatype _inAliases, modelica_metatype _inCases, modelica_metatype *out_outAliases, modelica_metatype *out_outCases)
{
modelica_metatype _outInputs = NULL;
modelica_metatype _outAliases = NULL;
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inCases;
{
modelica_metatype _patternMatrix = NULL;
modelica_metatype _cases = 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_boolean tmp12;
_cases = tmp4_1;
_patternMatrix = omc_List_transposeList(threadData, omc_List_map(threadData, _cases, boxvar_Patternm_getCasePatterns));
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmp12 = omc_Patternm_filterUnusedPatterns2(threadData, _inputs, _inAliases, _patternMatrix, 0, tmpMeta9, tmpMeta10, tmpMeta11, &tmpMeta6, &tmpMeta7, &tmpMeta8);
if (1 != tmp12) goto goto_2;
_outInputs = tmpMeta6;
_outAliases = tmpMeta7;
_patternMatrix = tmpMeta8;
_patternMatrix = omc_List_transposeList(threadData, _patternMatrix);
_cases = omc_Patternm_setCasePatternsCheckZero(threadData, _cases, _patternMatrix);
tmpMeta[0+0] = _outInputs;
tmpMeta[0+1] = _outAliases;
tmpMeta[0+2] = _cases;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inputs;
tmpMeta[0+1] = _inAliases;
tmpMeta[0+2] = _inCases;
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:;
}
}
_outInputs = tmpMeta[0+0];
_outAliases = tmpMeta[0+1];
_outCases = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_outAliases) { *out_outAliases = _outAliases; }
if (out_outCases) { *out_outCases = _outCases; }
return _outInputs;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Patternm_findMinMod(threadData_t *threadData, modelica_metatype _inIxs, modelica_integer _inMod)
{
modelica_integer _outMod;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_integer tmp4_2;
tmp4_1 = _inIxs;
tmp4_2 = _inMod;
{
modelica_metatype _ixs = NULL;
modelica_integer _mod;
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;
_ixs = tmp4_1;
_mod = tmp4_2;
_ixs = omc_List_map1(threadData, _ixs, boxvar_intMod, mmc_mk_integer(_mod));
_ixs = omc_List_sort(threadData, _ixs, boxvar_intLt);
tmpMeta6 = omc_List_sortedDuplicates(threadData, _ixs, boxvar_intEq);
if (!listEmpty(tmpMeta6)) goto goto_2;
tmp1 = _mod;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp7;
tmp7 = (_inMod < ((modelica_integer) 65536));
if (1 != tmp7) goto goto_2;
tmp1 = omc_Patternm_findMinMod(threadData, _inIxs, (((modelica_integer) 2)) * (_inMod));
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:;
}
}
_outMod = tmp1;
_return: OMC_LABEL_UNUSED
return _outMod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_findMinMod(threadData_t *threadData, modelica_metatype _inIxs, modelica_metatype _inMod)
{
modelica_integer tmp1;
modelica_integer _outMod;
modelica_metatype out_outMod;
tmp1 = mmc_unbox_integer(_inMod);
_outMod = omc_Patternm_findMinMod(threadData, _inIxs, tmp1);
out_outMod = mmc_mk_icon(_outMod);
return out_outMod;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findPatternToConvertToSwitch2(threadData_t *threadData, modelica_metatype _ipats, modelica_metatype _ixs, modelica_metatype _ity, modelica_boolean _allSubPatternsMatch, modelica_integer _numPatternsInMatrix, modelica_integer *out_extraarg)
{
modelica_metatype _outTy = NULL;
modelica_integer _extraarg;
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_metatype tmp4_2;modelica_boolean tmp4_3;modelica_integer tmp4_4;
tmp4_1 = _ipats;
tmp4_2 = _ity;
tmp4_3 = _allSubPatternsMatch;
tmp4_4 = _numPatternsInMatrix;
{
modelica_integer _ix;
modelica_string _str = NULL;
modelica_metatype _pats = NULL;
modelica_metatype _subpats = NULL;
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;
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);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_str = tmpMeta9;
_pats = tmpMeta7;
_ix = stringHashDjb2Mod(_str, ((modelica_integer) 65536));
tmp10 = listMember(mmc_mk_integer(_ix), _ixs);
if (0 != tmp10) goto goto_2;
tmpMeta11 = mmc_mk_cons(mmc_mk_integer(_ix), _ixs);
_ipats = _pats;
_ixs = tmpMeta11;
_ity = _OMC_LIT120;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_integer tmp15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_metatype tmpMeta18;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,7,6) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
tmp15 = mmc_unbox_integer(tmpMeta14);
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 4));
_ix = tmp15;
_subpats = tmpMeta16;
_pats = tmpMeta13;
tmp17 = listMember(mmc_mk_integer(_ix), _ixs);
if (0 != tmp17) goto goto_2;
tmpMeta18 = mmc_mk_cons(mmc_mk_integer(_ix), _ixs);
_ipats = _pats;
_ixs = tmpMeta18;
_ity = _OMC_LIT122;
_allSubPatternsMatch = (_allSubPatternsMatch && omc_Patternm_allPatternsAlwaysMatch(threadData, _subpats));
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_integer tmp23;
modelica_boolean tmp24;
modelica_metatype tmpMeta25;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_1);
tmpMeta20 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,0,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
tmp23 = mmc_unbox_integer(tmpMeta22);
_ix = tmp23;
_pats = tmpMeta20;
tmp24 = listMember(mmc_mk_integer(_ix), _ixs);
if (0 != tmp24) goto goto_2;
tmpMeta25 = mmc_mk_cons(mmc_mk_integer(_ix), _ixs);
_ipats = _pats;
_ixs = tmpMeta25;
_ity = _OMC_LIT123;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_boolean tmp26;
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmp26 = (listLength(_ixs) > ((modelica_integer) 11));
if (1 != tmp26) goto goto_2;
_ix = omc_Patternm_findMinMod(threadData, _ixs, ((modelica_integer) 1));
tmpMeta[0+0] = _OMC_LIT120;
tmp1_c1 = _ix;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_boolean tmp29;
if (1 != tmp4_4) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta27 = MMC_CAR(tmp4_1);
tmpMeta28 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta28)) goto tmp3_end;
tmp29 = (listLength(_ixs) > ((modelica_integer) 11));
if (1 != tmp29) goto goto_2;
_ix = omc_Patternm_findMinMod(threadData, _ixs, ((modelica_integer) 1));
tmpMeta[0+0] = _OMC_LIT120;
tmp1_c1 = _ix;
goto tmp3_done;
}
case 5: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta[0+0] = _ity;
tmp1_c1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
if (1 != tmp4_3) goto tmp3_end;
if (1 != tmp4_4) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta30 = MMC_CAR(tmp4_1);
tmpMeta31 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta31)) goto tmp3_end;
tmpMeta[0+0] = _ity;
tmp1_c1 = ((modelica_integer) 0);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outTy = tmpMeta[0+0];
_extraarg = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_extraarg) { *out_extraarg = _extraarg; }
return _outTy;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_findPatternToConvertToSwitch2(threadData_t *threadData, modelica_metatype _ipats, modelica_metatype _ixs, modelica_metatype _ity, modelica_metatype _allSubPatternsMatch, modelica_metatype _numPatternsInMatrix, modelica_metatype *out_extraarg)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer _extraarg;
modelica_metatype _outTy = NULL;
tmp1 = mmc_unbox_integer(_allSubPatternsMatch);
tmp2 = mmc_unbox_integer(_numPatternsInMatrix);
_outTy = omc_Patternm_findPatternToConvertToSwitch2(threadData, _ipats, _ixs, _ity, tmp1, tmp2, &_extraarg);
if (out_extraarg) { *out_extraarg = mmc_mk_icon(_extraarg); }
return _outTy;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findPatternToConvertToSwitch(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_integer _index, modelica_integer _numPatternsInMatrix, modelica_metatype _info)
{
modelica_metatype _tpl = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inPatternMatrix;
{
modelica_metatype _pats = NULL;
modelica_metatype _ty = NULL;
modelica_integer _extraarg;
modelica_metatype _patternMatrix = 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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_pats = tmpMeta8;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_ty = omc_Patternm_findPatternToConvertToSwitch2(threadData, _pats, tmpMeta9, _OMC_LIT121, 1, _numPatternsInMatrix ,&_extraarg);
tmpMeta10 = mmc_mk_box3(0, mmc_mk_integer(_index), _ty, mmc_mk_integer(_extraarg));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
_patternMatrix = tmpMeta12;
tmpMeta1 = omc_Patternm_findPatternToConvertToSwitch(threadData, _patternMatrix, ((modelica_integer) 1) + _index, _numPatternsInMatrix, _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:;
}
}
_tpl = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _tpl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_findPatternToConvertToSwitch(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_metatype _index, modelica_metatype _numPatternsInMatrix, modelica_metatype _info)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _tpl = NULL;
tmp1 = mmc_unbox_integer(_index);
tmp2 = mmc_unbox_integer(_numPatternsInMatrix);
_tpl = omc_Patternm_findPatternToConvertToSwitch(threadData, _inPatternMatrix, tmp1, tmp2, _info);
return _tpl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_removeWildPatternColumnsFromMatrix(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_metatype _inAcc, modelica_integer _inNumAcc, modelica_integer *out_numNonEmptyColumns)
{
modelica_metatype _optPatternMatrix = NULL;
modelica_integer _numNonEmptyColumns;
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_metatype tmp4_2;modelica_integer tmp4_3;
tmp4_1 = _inPatternMatrix;
tmp4_2 = _inAcc;
tmp4_3 = _inNumAcc;
{
modelica_boolean _alwaysMatch;
modelica_metatype _pats = NULL;
modelica_metatype _optPats = NULL;
modelica_metatype _patternMatrix = NULL;
modelica_metatype _acc = NULL;
modelica_integer _numAcc;
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;
_acc = tmp4_2;
_numAcc = tmp4_3;
tmpMeta[0+0] = listReverse(_acc);
tmp1_c1 = _numAcc;
goto tmp3_done;
}
case 1: {
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);
_pats = tmpMeta6;
_patternMatrix = tmpMeta7;
_acc = tmp4_2;
_numAcc = tmp4_3;
_alwaysMatch = omc_Patternm_allPatternsAlwaysMatch(threadData, omc_List_stripLast(threadData, _pats));
_optPats = (_alwaysMatch?mmc_mk_none():mmc_mk_some(_pats));
_numAcc = (_alwaysMatch?_numAcc:((modelica_integer) 1) + _numAcc);
tmpMeta8 = mmc_mk_cons(_optPats, _acc);
_inPatternMatrix = _patternMatrix;
_inAcc = tmpMeta8;
_inNumAcc = _numAcc;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_optPatternMatrix = tmpMeta[0+0];
_numNonEmptyColumns = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_numNonEmptyColumns) { *out_numNonEmptyColumns = _numNonEmptyColumns; }
return _optPatternMatrix;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_removeWildPatternColumnsFromMatrix(threadData_t *threadData, modelica_metatype _inPatternMatrix, modelica_metatype _inAcc, modelica_metatype _inNumAcc, modelica_metatype *out_numNonEmptyColumns)
{
modelica_integer tmp1;
modelica_integer _numNonEmptyColumns;
modelica_metatype _optPatternMatrix = NULL;
tmp1 = mmc_unbox_integer(_inNumAcc);
_optPatternMatrix = omc_Patternm_removeWildPatternColumnsFromMatrix(threadData, _inPatternMatrix, _inAcc, tmp1, &_numNonEmptyColumns);
if (out_numNonEmptyColumns) { *out_numNonEmptyColumns = mmc_mk_icon(_numNonEmptyColumns); }
return _optPatternMatrix;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeSwitchedMatchCases(threadData_t *threadData, modelica_metatype _inMatchType, modelica_metatype _inCases)
{
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inMatchType;
{
modelica_metatype _pat = NULL;
modelica_metatype _patl = 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,2,1) == 0) goto tmp3_end;
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,25,1) == 0) goto tmp3_end;
{
modelica_metatype __omcQ_24tmpVar1;
modelica_metatype* tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype __omcQ_24tmpVar0;
modelica_integer tmp24;
modelica_metatype _c_loopVar = 0;
modelica_metatype _c;
_c_loopVar = _inCases;
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar1 = tmpMeta11;
tmp10 = &__omcQ_24tmpVar1;
while(1) {
tmp24 = 1;
if (!listEmpty(_c_loopVar)) {
_c = MMC_CAR(_c_loopVar);
_c_loopVar = MMC_CDR(_c_loopVar);
tmp24--;
}
if (tmp24 == 0) {
{
modelica_metatype tmp15_1;
tmp15_1 = _c;
{
volatile mmc_switch_type tmp15;
int tmp16;
tmp15 = 0;
for (; tmp15 < 2; tmp15++) {
switch (MMC_SWITCH_CAST(tmp15)) {
case 0: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp15_1), 2));
if (listEmpty(tmpMeta17)) goto tmp14_end;
tmpMeta18 = MMC_CAR(tmpMeta17);
tmpMeta19 = MMC_CDR(tmpMeta17);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,7,6) == 0) goto tmp14_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 4));
if (!listEmpty(tmpMeta19)) goto tmp14_end;
_pat = tmpMeta18;
_patl = tmpMeta20;
if(omc_Patternm_allPatternsWild(threadData, _patl))
{
tmpMeta21 = MMC_TAGPTR(mmc_alloc_words(8));
memcpy(MMC_UNTAGPTR(tmpMeta21), MMC_UNTAGPTR(_pat), 8*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta21))[7] = mmc_mk_boolean(1);
_pat = tmpMeta21;
tmpMeta23 = mmc_mk_cons(_pat, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta22 = MMC_TAGPTR(mmc_alloc_words(10));
memcpy(MMC_UNTAGPTR(tmpMeta22), MMC_UNTAGPTR(_c), 10*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta22))[2] = tmpMeta23;
_c = tmpMeta22;
}
tmpMeta12 = _c;
goto tmp14_done;
}
case 1: {
tmpMeta12 = _c;
goto tmp14_done;
}
}
goto tmp14_end;
tmp14_end: ;
}
goto goto_13;
goto_13:;
goto goto_2;
goto tmp14_done;
tmp14_done:;
}
}__omcQ_24tmpVar0 = tmpMeta12;
*tmp10 = mmc_mk_cons(__omcQ_24tmpVar0,0);
tmp10 = &MMC_CDR(*tmp10);
} else if (tmp24 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp10 = mmc_mk_nil();
tmpMeta9 = __omcQ_24tmpVar1;
}
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inCases;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCases = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCases;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_optimizeMatchToSwitch(threadData_t *threadData, modelica_metatype _matchTy, modelica_metatype _cases, modelica_metatype _info, modelica_metatype *out_outCases)
{
modelica_metatype _outType = NULL;
modelica_metatype _outCases = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _matchTy;
{
modelica_metatype _tpl = NULL;
modelica_metatype _patternMatrix = NULL;
modelica_metatype _optPatternMatrix = NULL;
modelica_integer _numNonEmptyColumns;
modelica_string _str = 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 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
tmpMeta[0+0] = _OMC_LIT124;
tmpMeta[0+1] = _cases;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
tmp6 = (listLength(_cases) > ((modelica_integer) 2));
if (1 != tmp6) goto goto_2;
{
modelica_metatype _c;
for (tmpMeta7 = _cases; !listEmpty(tmpMeta7); tmpMeta7=MMC_CDR(tmpMeta7))
{
_c = MMC_CAR(tmpMeta7);
tmpMeta8 = _c;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
if (!optionNone(tmpMeta9)) goto goto_2;
}
}
_patternMatrix = omc_List_transposeList(threadData, omc_List_map(threadData, _cases, boxvar_Patternm_getCasePatterns));
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
_optPatternMatrix = omc_Patternm_removeWildPatternColumnsFromMatrix(threadData, _patternMatrix, tmpMeta11, ((modelica_integer) 0) ,&_numNonEmptyColumns);
_tpl = omc_Patternm_findPatternToConvertToSwitch(threadData, _optPatternMatrix, ((modelica_integer) 1), _numNonEmptyColumns, _info);
tmpMeta12 = _tpl;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_ty = tmpMeta13;
_str = omc_Types_unparseType(threadData, _ty);
tmpMeta14 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_assertionOrAddSourceMessage(threadData, (!omc_Flags_isSet(threadData, _OMC_LIT3)), _OMC_LIT127, tmpMeta14, _info);
tmpMeta15 = mmc_mk_box2(5, &DAE_MatchType_MATCH__desc, mmc_mk_some(_tpl));
_outType = tmpMeta15;
_outCases = omc_Patternm_optimizeSwitchedMatchCases(threadData, _outType, _cases);
tmpMeta[0+0] = _outType;
tmpMeta[0+1] = _outCases;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _OMC_LIT128;
tmpMeta[0+1] = _cases;
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 = tmpMeta[0+0];
_outCases = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outCases) { *out_outCases = _outCases; }
return _outType;
}
PROTECTED_FUNCTION_STATIC void omc_Patternm_checkConstantMatchInputs(threadData_t *threadData, modelica_metatype _inputs, modelica_metatype _info)
{
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype _i;
for (tmpMeta1 = _inputs; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_i = MMC_CAR(tmpMeta1);
if(omc_Expression_isConstValue(threadData, _i))
{
tmpMeta2 = mmc_mk_cons(omc_ExpressionDump_printExpStr(threadData, _i), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT131, tmpMeta2, _info);
}
}
}
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
modelica_metatype omc_Patternm_elabMatchExpression(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _matchExp, modelica_boolean _impl, modelica_boolean _performVectorization, 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_integer _numError;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_numError = omc_Error_getNumErrorMessages(threadData);
{
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 = _matchExp;
tmp4_4 = _inPrefix;
{
modelica_metatype _matchTy = NULL;
modelica_metatype _inExp = NULL;
modelica_metatype _inExps = NULL;
modelica_metatype _decls = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _matchDecls = NULL;
modelica_metatype _pre = NULL;
modelica_metatype _elabExps = NULL;
modelica_metatype _elabCases = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _prop = NULL;
modelica_metatype _elabProps = NULL;
modelica_metatype _resType = NULL;
modelica_metatype _et = NULL;
modelica_string _str = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _ht = NULL;
modelica_metatype _elabMatchTy = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _env = NULL;
modelica_integer _hashSize;
modelica_metatype _inputAliases = NULL;
modelica_metatype _inputAliasesAndCrefs = NULL;
modelica_metatype _declsTree = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,21,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 5));
_matchTy = tmpMeta6;
_inExp = tmpMeta7;
_decls = tmpMeta8;
_cases = tmpMeta9;
_cache = tmp4_1;
_env = tmp4_2;
_pre = tmp4_4;
_inExps = omc_Patternm_convertExpToPatterns(threadData, _inExp);
_inExps = omc_List_map__3(threadData, _inExps, boxvar_Patternm_getInputAsBinding ,&_inputAliases ,&_inputAliasesAndCrefs);
_cache = omc_Static_elabExpList(threadData, _cache, _env, _inExps, _impl, _performVectorization, _pre, _info, _OMC_LIT121 ,&_elabExps ,&_elabProps);
tmpMeta16 = omc_Patternm_addLocalDecls(threadData, _cache, _env, _decls, _OMC_LIT132, _impl, _info, &tmpMeta10);
_cache = tmpMeta16;
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));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 3));
_env = tmpMeta12;
_matchDecls = tmpMeta14;
_declsTree = tmpMeta15;
_tys = omc_List_map(threadData, _elabProps, boxvar_Types_getPropType);
_env = omc_Patternm_addAliasesToEnv(threadData, _env, _tys, _inputAliases, _info);
_cache = omc_Patternm_elabMatchCases(threadData, _cache, _env, _cases, _tys, _inputAliasesAndCrefs, _declsTree, _impl, _performVectorization, _pre, _info ,&_elabCases ,&_resType);
tmpMeta17 = mmc_mk_box3(3, &DAE_Properties_PROP__desc, _resType, _OMC_LIT133);
_prop = tmpMeta17;
_et = omc_Types_simplifyType(threadData, _resType);
_elabExps = omc_Patternm_filterUnusedPatterns(threadData, _elabExps, _inputAliases, _elabCases ,&_inputAliases ,&_elabCases);
tmpMeta18 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
_elabCases = omc_Patternm_caseDeadCodeElimination(threadData, _matchTy, _elabCases, tmpMeta18, tmpMeta19, 0);
_matchTy = omc_Patternm_optimizeContinueToMatch(threadData, _matchTy, _elabCases, _info);
_elabCases = omc_Patternm_optimizeContinueJumps(threadData, _matchTy, _elabCases);
_hashSize = omc_Util_nextPrime(threadData, listLength(_matchDecls));
tmpMeta20 = mmc_mk_box7(36, &DAE_Exp_MATCHEXPRESSION__desc, _OMC_LIT124, _elabExps, _inputAliases, _matchDecls, _elabCases, _et);
_ht = omc_Patternm_getUsedLocalCrefs(threadData, omc_Flags_isSet(threadData, _OMC_LIT136), tmpMeta20, _hashSize);
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
_matchDecls = omc_Patternm_filterUnusedDecls(threadData, _matchDecls, _ht, tmpMeta21, omc_HashTableStringToPath_emptyHashTableSized(threadData, _hashSize) ,&_ht);
_elabExps = omc_Patternm_filterUnusedPatterns(threadData, _elabExps, _inputAliases, _elabCases ,&_inputAliases ,&_elabCases);
_elabMatchTy = omc_Patternm_optimizeMatchToSwitch(threadData, _matchTy, _elabCases, _info ,&_elabCases);
omc_Patternm_checkConstantMatchInputs(threadData, _elabExps, _info);
tmpMeta22 = mmc_mk_box7(36, &DAE_Exp_MATCHEXPRESSION__desc, _elabMatchTy, _elabExps, _inputAliases, _matchDecls, _elabCases, _et);
_exp = tmpMeta22;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _exp;
tmpMeta[0+2] = _prop;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
tmp23 = (_numError == omc_Error_getNumErrorMessages(threadData));
if (1 != tmp23) goto goto_2;
_str = omc_Dump_printExpStr(threadData, _matchExp);
tmpMeta24 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT139, tmpMeta24, _info);
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];
_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;
}
modelica_metatype boxptr_Patternm_elabMatchExpression(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _inEnv, modelica_metatype _matchExp, modelica_metatype _impl, modelica_metatype _performVectorization, modelica_metatype _inPrefix, modelica_metatype _info, modelica_metatype *out_outExp, modelica_metatype *out_outProperties)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_impl);
tmp2 = mmc_unbox_integer(_performVectorization);
_outCache = omc_Patternm_elabMatchExpression(threadData, _inCache, _inEnv, _matchExp, tmp1, tmp2, _inPrefix, _info, out_outExp, out_outProperties);
return _outCache;
}
DLLExport
modelica_string omc_Patternm_patternStr(threadData_t *threadData, modelica_metatype _pattern)
{
modelica_string _str = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _pattern;
{
modelica_metatype _pats = NULL;
modelica_metatype _fields = NULL;
modelica_metatype _patsStr = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _pat = NULL;
modelica_metatype _head = NULL;
modelica_metatype _tail = NULL;
modelica_string _id = NULL;
modelica_metatype _namedpats = NULL;
modelica_metatype _name = 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 < 13; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmp4 += 11;
tmp1 = _OMC_LIT140;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,0) == 0) goto tmp3_end;
_id = tmpMeta6;
tmp4 += 8;
tmp1 = _id;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,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 (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,0) == 0) goto tmp3_end;
_id = tmpMeta8;
tmp4 += 8;
tmp1 = _id;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pat = tmpMeta10;
tmp4 += 8;
_str = omc_Patternm_patternStr(threadData, _pat);
tmpMeta11 = stringAppend(_OMC_LIT141,_str);
tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT142);
tmp1 = tmpMeta12;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pats = tmpMeta13;
tmp4 += 7;
_str = stringDelimitList(omc_List_map(threadData, _pats, boxvar_Patternm_patternStr), _OMC_LIT143);
tmpMeta14 = stringAppend(_OMC_LIT144,_str);
tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT142);
tmp1 = tmpMeta15;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_pats = tmpMeta16;
tmp4 += 6;
_str = stringDelimitList(omc_List_map(threadData, _pats, boxvar_Patternm_patternStr), _OMC_LIT143);
tmpMeta17 = stringAppend(_OMC_LIT144,_str);
tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT142);
tmp1 = tmpMeta18;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta19;
_pats = tmpMeta20;
tmp4 += 5;
_id = omc_AbsynUtil_pathString(threadData, _name, _OMC_LIT145, 1, 0);
_str = stringDelimitList(omc_List_map(threadData, _pats, boxvar_Patternm_patternStr), _OMC_LIT143);
tmpMeta21 = mmc_mk_cons(_id, mmc_mk_cons(_OMC_LIT144, mmc_mk_cons(_str, mmc_mk_cons(_OMC_LIT142, MMC_REFSTRUCTLIT(mmc_nil)))));
tmp1 = stringAppendList(tmpMeta21);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_name = tmpMeta22;
_namedpats = tmpMeta23;
tmp4 += 4;
_id = omc_AbsynUtil_pathString(threadData, _name, _OMC_LIT145, 1, 0);
_fields = omc_List_map(threadData, _namedpats, boxvar_Util_tuple32);
_patsStr = omc_List_map1r(threadData, omc_List_mapMap(threadData, _namedpats, boxvar_Util_tuple31, boxvar_Patternm_patternStr), boxvar_stringAppend, _OMC_LIT146);
_str = stringDelimitList(omc_List_threadMap(threadData, _fields, _patsStr, boxvar_stringAppend), _OMC_LIT143);
tmpMeta24 = mmc_mk_cons(_id, mmc_mk_cons(_OMC_LIT144, mmc_mk_cons(_str, mmc_mk_cons(_OMC_LIT142, MMC_REFSTRUCTLIT(mmc_nil)))));
tmp1 = stringAppendList(tmpMeta24);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_head = tmpMeta25;
_tail = tmpMeta26;
tmp4 += 3;
tmpMeta27 = stringAppend(omc_Patternm_patternStr(threadData, _head),_OMC_LIT147);
tmpMeta28 = stringAppend(tmpMeta27,omc_Patternm_patternStr(threadData, _tail));
tmp1 = tmpMeta28;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp = tmpMeta29;
tmp4 += 2;
tmp1 = omc_ExpressionDump_printExpStr(threadData, _exp);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_id = tmpMeta30;
_pat = tmpMeta31;
tmp4 += 1;
tmpMeta32 = stringAppend(_id,_OMC_LIT148);
tmpMeta33 = stringAppend(tmpMeta32,omc_Patternm_patternStr(threadData, _pat));
tmp1 = tmpMeta33;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_id = tmpMeta34;
_pat = tmpMeta35;
tmpMeta36 = stringAppend(_id,_OMC_LIT148);
tmpMeta37 = stringAppend(tmpMeta36,omc_Patternm_patternStr(threadData, _pat));
tmp1 = tmpMeta37;
goto tmp3_done;
}
case 12: {
omc_Error_addMessage(threadData, _OMC_LIT65, _OMC_LIT150);
tmp1 = _OMC_LIT151;
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 < 13) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_str = tmp1;
_return: OMC_LABEL_UNUSED
return _str;
}
PROTECTED_FUNCTION_STATIC void omc_Patternm_validUniontype(threadData_t *threadData, modelica_metatype _path1, modelica_metatype _path2, modelica_metatype _info, modelica_metatype _lhs)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _s = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = 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_AbsynUtil_pathEqual(threadData, _path1, _path2);
if (1 != tmp5) goto goto_1;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta6;
_s = omc_Dump_printExpStr(threadData, _lhs);
_s1 = omc_AbsynUtil_pathString(threadData, _path1, _OMC_LIT145, 1, 0);
_s2 = omc_AbsynUtil_pathString(threadData, _path2, _OMC_LIT145, 1, 0);
tmpMeta6 = mmc_mk_cons(_s, mmc_mk_cons(_s1, mmc_mk_cons(_s2, MMC_REFSTRUCTLIT(mmc_nil))));
omc_Error_addSourceMessage(threadData, _OMC_LIT154, tmpMeta6, _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 < 2) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_validPatternType(threadData_t *threadData, modelica_metatype _inTy1, modelica_metatype _inTy2, modelica_metatype _lhs, modelica_metatype _info)
{
modelica_metatype _ty = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inTy1;
tmp4_2 = _inTy2;
{
modelica_metatype _et = NULL;
modelica_string _s = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _crefExp = NULL;
modelica_metatype _ty1 = NULL;
modelica_metatype _ty2 = 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,23,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_ty1 = tmpMeta6;
_ty2 = tmp4_2;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
_cr = omc_ComponentReference_makeCrefIdent(threadData, _OMC_LIT155, _OMC_LIT121, tmpMeta7);
_crefExp = omc_Expression_crefExp(threadData, _cr);
omc_Types_matchType(threadData, _crefExp, _ty1, _ty2, 1 ,&_ty1);
_et = omc_Types_simplifyType(threadData, _ty1);
tmpMeta1 = mmc_mk_some(_et);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
_ty1 = tmp4_1;
_ty2 = tmp4_2;
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
_cr = omc_ComponentReference_makeCrefIdent(threadData, _OMC_LIT155, _OMC_LIT121, tmpMeta8);
_crefExp = omc_Expression_crefExp(threadData, _cr);
omc_Types_matchType(threadData, _crefExp, _ty1, _ty2, 1, NULL);
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
_ty1 = tmp4_1;
_ty2 = tmp4_2;
_s = omc_Dump_printExpStr(threadData, _lhs);
_s1 = omc_Types_unparseType(threadData, _ty1);
_s2 = omc_Types_unparseType(threadData, _ty2);
tmpMeta9 = mmc_mk_cons(_s, mmc_mk_cons(_s1, mmc_mk_cons(_s2, MMC_REFSTRUCTLIT(mmc_nil))));
omc_Error_addSourceMessage(threadData, _OMC_LIT158, tmpMeta9, _info);
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:;
}
}
_ty = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ty;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkForAllWildCall(threadData_t *threadData, modelica_metatype _args, modelica_metatype _named, modelica_integer _numFields, modelica_metatype *out_outNamed)
{
modelica_metatype _outArgs = NULL;
modelica_metatype _outNamed = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _args;
tmp4_2 = _named;
{
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 (!listEmpty(tmp4_2)) goto tmp3_end;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,4,0) == 0) goto tmp3_end;
if (!listEmpty(tmpMeta7)) 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 1: {
tmpMeta[0+0] = _args;
tmpMeta[0+1] = _named;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArgs = tmpMeta[0+0];
_outNamed = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outNamed) { *out_outNamed = _outNamed; }
return _outArgs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_checkForAllWildCall(threadData_t *threadData, modelica_metatype _args, modelica_metatype _named, modelica_metatype _numFields, modelica_metatype *out_outNamed)
{
modelica_integer tmp1;
modelica_metatype _outArgs = NULL;
tmp1 = mmc_unbox_integer(_numFields);
_outArgs = omc_Patternm_checkForAllWildCall(threadData, _args, _named, tmp1, out_outNamed);
return _outArgs;
}
PROTECTED_FUNCTION_STATIC void omc_Patternm_checkMissingArgs(threadData_t *threadData, modelica_metatype _path, modelica_integer _numPosArgs, modelica_metatype _missingFieldNames, modelica_integer _numNamedArgs, modelica_metatype _info)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;modelica_integer tmp3_2;
tmp3_1 = _missingFieldNames;
tmp3_2 = _numNamedArgs;
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 2; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (0 != tmp3_2) goto tmp2_end;
if (!listEmpty(tmp3_1)) goto tmp2_end;
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 void boxptr_Patternm_checkMissingArgs(threadData_t *threadData, modelica_metatype _path, modelica_metatype _numPosArgs, modelica_metatype _missingFieldNames, modelica_metatype _numNamedArgs, modelica_metatype _info)
{
modelica_integer tmp1;
modelica_integer tmp2;
tmp1 = mmc_unbox_integer(_numPosArgs);
tmp2 = mmc_unbox_integer(_numNamedArgs);
omc_Patternm_checkMissingArgs(threadData, _path, tmp1, _missingFieldNames, tmp2, _info);
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPatternCall(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _callPath, modelica_metatype _fargs, modelica_metatype _utPath, modelica_metatype _info, modelica_metatype _lhs, modelica_metatype *out_pattern)
{
modelica_metatype _outCache = NULL;
modelica_metatype _pattern = 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 = _fargs;
tmp4_3 = _utPath;
{
modelica_string _s = NULL;
modelica_metatype _utPath1 = NULL;
modelica_metatype _utPath2 = NULL;
modelica_metatype _fqPath = NULL;
modelica_integer _index;
modelica_integer _numPosArgs;
modelica_metatype _namedArgList = NULL;
modelica_metatype _invalidArgs = NULL;
modelica_metatype _funcArgsNamedFixed = NULL;
modelica_metatype _funcArgs = NULL;
modelica_metatype _funcArgs2 = NULL;
modelica_metatype _fieldNameList = NULL;
modelica_metatype _fieldNamesNamed = NULL;
modelica_metatype _fieldTypeList = NULL;
modelica_metatype _typeVars = NULL;
modelica_metatype _fieldVarList = NULL;
modelica_metatype _patterns = NULL;
modelica_metatype _namedPatterns = NULL;
modelica_boolean _knownSingleton;
modelica_metatype _cache = NULL;
modelica_boolean _allWild;
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;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (listEmpty(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmpMeta6);
tmpMeta8 = MMC_CDR(tmpMeta6);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
tmpMeta12 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _callPath, _OMC_LIT145, 1, 0), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT162, tmpMeta12, _info);
goto goto_2;
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_integer tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_integer tmp23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_boolean tmp35 = 0;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_funcArgs = tmpMeta13;
_namedArgList = tmpMeta14;
_cache = tmp4_1;
_utPath2 = tmp4_3;
_cache = omc_Lookup_lookupType(threadData, _cache, _env, _callPath, mmc_mk_none(), NULL, NULL);
tmpMeta24 = omc_Lookup_lookupType(threadData, _cache, _env, _callPath, mmc_mk_none(), &tmpMeta15, NULL);
_cache = tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,21,6) == 0) goto goto_2;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 4));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 5));
tmp20 = mmc_unbox_integer(tmpMeta19);
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 6));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 7));
tmp23 = mmc_unbox_integer(tmpMeta22);
_fqPath = tmpMeta16;
_utPath1 = tmpMeta17;
_typeVars = tmpMeta18;
_index = tmp20;
_fieldVarList = tmpMeta21;
_knownSingleton = tmp23;
omc_Patternm_validUniontype(threadData, _utPath1, _utPath2, _info, _lhs);
_fieldTypeList = omc_List_map(threadData, _fieldVarList, boxvar_Types_getVarType);
_fieldNameList = omc_List_map(threadData, _fieldVarList, boxvar_Types_getVarName);
if(omc_Flags_isSet(threadData, _OMC_LIT3))
{
{
modelica_metatype _namedArg;
for (tmpMeta25 = _namedArgList; !listEmpty(tmpMeta25); tmpMeta25=MMC_CDR(tmpMeta25))
{
_namedArg = MMC_CAR(tmpMeta25);
{
modelica_metatype tmp28_1;
tmp28_1 = _namedArg;
{
volatile mmc_switch_type tmp28;
int tmp29;
tmp28 = 0;
for (; tmp28 < 2; tmp28++) {
switch (MMC_SWITCH_CAST(tmp28)) {
case 0: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp28_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,2,1) == 0) goto tmp27_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta31,3,0) == 0) goto tmp27_end;
tmpMeta32 = mmc_mk_cons((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_namedArg), 2))), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT165, tmpMeta32, _info);
goto tmp27_done;
}
case 1: {
goto tmp27_done;
}
}
goto tmp27_end;
tmp27_end: ;
}
goto goto_26;
goto_26:;
goto goto_2;
goto tmp27_done;
tmp27_done:;
}
}
;
}
}
if((listEmpty(_namedArgList) && (!listEmpty(_funcArgs))))
{
_allWild = 1;
{
modelica_metatype _arg;
for (tmpMeta34 = _funcArgs; !listEmpty(tmpMeta34); tmpMeta34=MMC_CDR(tmpMeta34))
{
_arg = MMC_CAR(tmpMeta34);
{
modelica_metatype tmp38_1;
tmp38_1 = _arg;
{
volatile mmc_switch_type tmp38;
int tmp39;
tmp38 = 0;
for (; tmp38 < 2; tmp38++) {
switch (MMC_SWITCH_CAST(tmp38)) {
case 0: {
modelica_metatype tmpMeta40;
if (mmc__uniontype__metarecord__typedef__equal(tmp38_1,2,1) == 0) goto tmp37_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp38_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta40,3,0) == 0) goto tmp37_end;
tmp35 = 1;
goto tmp37_done;
}
case 1: {
tmp35 = 0;
goto tmp37_done;
}
}
goto tmp37_end;
tmp37_end: ;
}
goto goto_36;
goto_36:;
goto goto_2;
goto tmp37_done;
tmp37_done:;
}
}
_allWild = tmp35;
if((!_allWild))
{
break;
}
}
}
if(_allWild)
{
tmpMeta42 = mmc_mk_cons(omc_AbsynUtil_pathString(threadData, _callPath, _OMC_LIT145, 1, 0), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT168, tmpMeta42, _info);
}
}
}
_funcArgs = omc_Patternm_checkForAllWildCall(threadData, _funcArgs, _namedArgList, listLength(_fieldNameList) ,&_namedArgList);
_numPosArgs = listLength(_funcArgs);
omc_List_split(threadData, _fieldNameList, _numPosArgs ,&_fieldNamesNamed);
omc_Patternm_checkMissingArgs(threadData, _fqPath, _numPosArgs, _fieldNamesNamed, listLength(_namedArgList), _info);
tmpMeta43 = MMC_REFSTRUCTLIT(mmc_nil);
_funcArgsNamedFixed = omc_Patternm_generatePositionalArgs(threadData, _fieldNamesNamed, _namedArgList, tmpMeta43 ,&_invalidArgs);
_funcArgs2 = listAppend(_funcArgs, _funcArgsNamedFixed);
tmpMeta44 = omc_Patternm_checkInvalidPatternNamedArgs(threadData, _invalidArgs, _fieldNameList, _OMC_LIT169, _info);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,0,0) == 0) goto goto_2;
_cache = omc_Patternm_elabPatternTuple(threadData, _cache, _env, _funcArgs2, _fieldTypeList, _info, _lhs ,&_patterns);
tmpMeta45 = mmc_mk_box7(10, &DAE_Pattern_PAT__CALL__desc, _fqPath, mmc_mk_integer(_index), _patterns, _fieldVarList, _typeVars, mmc_mk_boolean(_knownSingleton));
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta45;
goto tmp3_done;
}
case 2: {
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_boolean tmp54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,2) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_funcArgs = tmpMeta46;
_namedArgList = tmpMeta47;
_cache = tmp4_1;
_utPath2 = tmp4_3;
tmpMeta53 = omc_Lookup_lookupType(threadData, _cache, _env, _callPath, mmc_mk_none(), &tmpMeta48, NULL);
_cache = tmpMeta53;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta48,11,4) == 0) goto goto_2;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta49,9,3) == 0) goto goto_2;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta50,3,1) == 0) goto goto_2;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 3));
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 5));
_fieldVarList = tmpMeta51;
_fqPath = tmpMeta52;
tmp54 = omc_AbsynUtil_pathEqual(threadData, _fqPath, _utPath2);
if (1 != tmp54) goto goto_2;
_fieldTypeList = omc_List_map(threadData, _fieldVarList, boxvar_Types_getVarType);
_fieldNameList = omc_List_map(threadData, _fieldVarList, boxvar_Types_getVarName);
_funcArgs = omc_Patternm_checkForAllWildCall(threadData, _funcArgs, _namedArgList, listLength(_fieldNameList) ,&_namedArgList);
_numPosArgs = listLength(_funcArgs);
omc_List_split(threadData, _fieldNameList, _numPosArgs ,&_fieldNamesNamed);
omc_Patternm_checkMissingArgs(threadData, _fqPath, _numPosArgs, _fieldNamesNamed, listLength(_namedArgList), _info);
tmpMeta55 = MMC_REFSTRUCTLIT(mmc_nil);
_funcArgsNamedFixed = omc_Patternm_generatePositionalArgs(threadData, _fieldNamesNamed, _namedArgList, tmpMeta55 ,&_invalidArgs);
_funcArgs2 = listAppend(_funcArgs, _funcArgsNamedFixed);
tmpMeta56 = omc_Patternm_checkInvalidPatternNamedArgs(threadData, _invalidArgs, _fieldNameList, _OMC_LIT169, _info);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta56,0,0) == 0) goto goto_2;
_cache = omc_Patternm_elabPatternTuple(threadData, _cache, _env, _funcArgs2, _fieldTypeList, _info, _lhs ,&_patterns);
_namedPatterns = omc_List_zip3(threadData, _patterns, _fieldNameList, omc_List_map(threadData, _fieldTypeList, boxvar_Types_simplifyType));
_namedPatterns = omc_List_filterOnTrue(threadData, _namedPatterns, boxvar_Patternm_filterEmptyPattern);
tmpMeta57 = mmc_mk_box3(11, &DAE_Pattern_PAT__CALL__NAMED__desc, _fqPath, _namedPatterns);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta57;
goto tmp3_done;
}
case 3: {
modelica_boolean tmp58;
modelica_metatype tmpMeta60;
_cache = tmp4_1;
tmp58 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupType(threadData, _cache, _env, _callPath, mmc_mk_none(), NULL, NULL);
tmp58 = 1;
goto goto_59;
goto_59:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp58) {goto goto_2;}
_s = omc_AbsynUtil_pathString(threadData, _callPath, _OMC_LIT145, 1, 0);
tmpMeta60 = mmc_mk_cons(_s, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT172, tmpMeta60, _info);
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:;
}
}
_outCache = tmpMeta[0+0];
_pattern = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_pattern) { *out_pattern = _pattern; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPatternTuple(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inExps, modelica_metatype _inTys, modelica_metatype _info, modelica_metatype _lhs, modelica_metatype *out_patterns)
{
modelica_metatype _outCache = NULL;
modelica_metatype _patterns = 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;
tmp4_1 = _inCache;
tmp4_2 = _inExps;
tmp4_3 = _inTys;
{
modelica_metatype _exp = NULL;
modelica_string _s = NULL;
modelica_metatype _pattern = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _tys = 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_2)) goto tmp3_end;
if (!listEmpty(tmp4_3)) 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;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_2);
tmpMeta8 = MMC_CDR(tmp4_2);
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_3);
tmpMeta10 = MMC_CDR(tmp4_3);
_exp = tmpMeta7;
_exps = tmpMeta8;
_ty = tmpMeta9;
_tys = tmpMeta10;
_cache = tmp4_1;
_cache = omc_Patternm_elabPattern(threadData, _cache, _env, _exp, _ty, _info ,&_pattern);
_cache = omc_Patternm_elabPatternTuple(threadData, _cache, _env, _exps, _tys, _info, _lhs ,&_patterns);
tmpMeta11 = mmc_mk_cons(_pattern, _patterns);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
_s = omc_Dump_printExpStr(threadData, _lhs);
tmpMeta12 = stringAppend(_OMC_LIT173,_s);
_s = tmpMeta12;
tmpMeta13 = mmc_mk_cons(_s, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT176, tmpMeta13, _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:;
}
}
_outCache = tmpMeta[0+0];
_patterns = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_patterns) { *out_patterns = _patterns; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPattern2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inLhs, modelica_metatype _ty, modelica_metatype _info, modelica_integer _numError, modelica_metatype *out_pattern)
{
modelica_metatype _outCache = NULL;
modelica_metatype _pattern = 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 = _inLhs;
tmp4_3 = _ty;
{
modelica_metatype _exps = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _patterns = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _head = NULL;
modelica_metatype _tail = NULL;
modelica_string _id = NULL;
modelica_string _s = NULL;
modelica_string _str = NULL;
modelica_integer _i;
modelica_real _r;
modelica_boolean _b;
modelica_metatype _ty1 = NULL;
modelica_metatype _ty2 = NULL;
modelica_metatype _tyHead = NULL;
modelica_metatype _tyTail = NULL;
modelica_metatype _et = NULL;
modelica_metatype _patternHead = NULL;
modelica_metatype _patternTail = NULL;
modelica_metatype _fcr = NULL;
modelica_metatype _fargs = NULL;
modelica_metatype _utPath = NULL;
modelica_metatype _cache = NULL;
modelica_metatype _lhs = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _elabExp = NULL;
modelica_metatype _const = NULL;
modelica_metatype _val = NULL;
modelica_metatype _variability = 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 < 26; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
_cache = tmp4_1;
tmp4 += 24;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT123, _inLhs, _info);
tmpMeta8 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta9 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, tmpMeta8);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta9;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_str = tmpMeta10;
_cache = tmp4_1;
tmp4 += 23;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT177, _inLhs, _info);
_r = stringReal(_str);
tmpMeta11 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r));
tmpMeta12 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, tmpMeta11);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta12;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_integer tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,6,0) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,0,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
tmp16 = mmc_unbox_integer(tmpMeta15);
_i = tmp16;
_cache = tmp4_1;
tmp4 += 22;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT123, _inLhs, _info);
_i = (-_i);
tmpMeta17 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta18 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, tmpMeta17);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta18;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,6,0) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,1,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
_str = tmpMeta21;
_cache = tmp4_1;
tmp4 += 21;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT177, _inLhs, _info);
_r = stringReal(_str);
_r = (-_r);
tmpMeta22 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r));
tmpMeta23 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, tmpMeta22);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta23;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_s = tmpMeta24;
_cache = tmp4_1;
tmp4 += 20;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT120, _inLhs, _info);
_s = omc_System_unescapedString(threadData, _s);
tmpMeta25 = mmc_mk_box2(5, &DAE_Exp_SCONST__desc, _s);
tmpMeta26 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, tmpMeta25);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta26;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta27;
modelica_integer tmp28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp28 = mmc_unbox_integer(tmpMeta27);
_b = tmp28;
_cache = tmp4_1;
tmp4 += 19;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT75, _inLhs, _info);
tmpMeta29 = mmc_mk_box2(6, &DAE_Exp_BCONST__desc, mmc_mk_boolean(_b));
tmpMeta30 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, tmpMeta29);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta30;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (!listEmpty(tmpMeta31)) goto tmp3_end;
_cache = tmp4_1;
tmp4 += 18;
_et = omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT178, _inLhs, _info);
tmpMeta32 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, _OMC_LIT179);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta32;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,1) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (listEmpty(tmpMeta33)) goto tmp3_end;
tmpMeta34 = MMC_CAR(tmpMeta33);
tmpMeta35 = MMC_CDR(tmpMeta33);
_exps = tmpMeta33;
_cache = tmp4_1;
tmp4 += 17;
_lhs = omc_List_fold(threadData, listReverse(_exps), boxvar_AbsynUtil_makeCons, _OMC_LIT180);
tmpMeta[0+0] = omc_Patternm_elabPattern(threadData, _cache, _env, _lhs, _ty, _info, &tmpMeta[0+1]);
goto tmp3_done;
}
case 8: {
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_2,11,3) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,2,2) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 2));
if (4 != MMC_STRLEN(tmpMeta37) || strcmp(MMC_STRINGDATA(_OMC_LIT190), MMC_STRINGDATA(tmpMeta37)) != 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 3));
if (!listEmpty(tmpMeta38)) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,0,2) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
if (!listEmpty(tmpMeta40)) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 3));
if (!listEmpty(tmpMeta41)) goto tmp3_end;
_cache = tmp4_1;
tmp4 += 5;
omc_Patternm_validPatternType(threadData, _ty, _OMC_LIT181, _inLhs, _info);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _OMC_LIT183;
goto tmp3_done;
}
case 9: {
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,19,1) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,3) == 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,2,2) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 2));
if (4 != MMC_STRLEN(tmpMeta44) || strcmp(MMC_STRINGDATA(_OMC_LIT198), MMC_STRINGDATA(tmpMeta44)) != 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 3));
if (!listEmpty(tmpMeta45)) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,0,2) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
if (listEmpty(tmpMeta47)) goto tmp3_end;
tmpMeta48 = MMC_CAR(tmpMeta47);
tmpMeta49 = MMC_CDR(tmpMeta47);
if (!listEmpty(tmpMeta49)) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 3));
if (!listEmpty(tmpMeta50)) goto tmp3_end;
_ty2 = tmpMeta42;
_exp = tmpMeta48;
_cache = tmp4_1;
tmp4 += 15;
_cache = omc_Patternm_elabPattern(threadData, _cache, _env, _exp, _ty2, _info ,&_pattern);
tmpMeta51 = mmc_mk_box2(12, &DAE_Pattern_PAT__SOME__desc, _pattern);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta51;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,20,2) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,17,1) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_head = tmpMeta52;
_tail = tmpMeta53;
_tyTail = tmp4_3;
_tyHead = tmpMeta54;
_cache = tmp4_1;
tmp4 += 14;
_tyHead = omc_Types_boxIfUnboxedType(threadData, _tyHead);
_cache = omc_Patternm_elabPattern(threadData, _cache, _env, _head, _tyHead, _info ,&_patternHead);
_cache = omc_Patternm_elabPattern(threadData, _cache, _env, _tail, _tyTail, _info ,&_patternTail);
tmpMeta55 = mmc_mk_box3(9, &DAE_Pattern_PAT__CONS__desc, _patternHead, _patternTail);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta55;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,1) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (listEmpty(tmpMeta56)) goto tmp3_end;
tmpMeta57 = MMC_CAR(tmpMeta56);
tmpMeta58 = MMC_CDR(tmpMeta56);
if (!listEmpty(tmpMeta58)) goto tmp3_end;
_exp = tmpMeta57;
_cache = tmp4_1;
tmpMeta[0+0] = omc_Patternm_elabPattern2(threadData, _cache, _env, _exp, _ty, _info, _numError, &tmpMeta[0+1]);
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,1) == 0) goto tmp3_end;
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,18,1) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_exps = tmpMeta59;
_tys = tmpMeta60;
_cache = tmp4_1;
tmp4 += 12;
_tys = omc_List_map(threadData, _tys, boxvar_Types_boxIfUnboxedType);
_cache = omc_Patternm_elabPatternTuple(threadData, _cache, _env, _exps, _tys, _info, _inLhs ,&_patterns);
tmpMeta61 = mmc_mk_box2(7, &DAE_Pattern_PAT__META__TUPLE__desc, _patterns);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta61;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,1) == 0) goto tmp3_end;
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,14,2) == 0) goto tmp3_end;
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
_exps = tmpMeta62;
_tys = tmpMeta63;
_cache = tmp4_1;
tmp4 += 11;
_cache = omc_Patternm_elabPatternTuple(threadData, _cache, _env, _exps, _tys, _info, _inLhs ,&_patterns);
tmpMeta64 = mmc_mk_box2(8, &DAE_Pattern_PAT__CALL__TUPLE__desc, _patterns);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta64;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,3) == 0) goto tmp3_end;
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,9,3) == 0) goto tmp3_end;
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta67,3,1) == 0) goto tmp3_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta67), 2));
_lhs = tmp4_2;
_fcr = tmpMeta65;
_fargs = tmpMeta66;
_utPath = tmpMeta68;
_cache = tmp4_1;
tmp4 += 10;
tmpMeta[0+0] = omc_Patternm_elabPatternCall(threadData, _cache, _env, omc_AbsynUtil_crefToPath(threadData, _fcr), _fargs, _utPath, _info, _lhs, &tmpMeta[0+1]);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,3) == 0) goto tmp3_end;
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,20,5) == 0) goto tmp3_end;
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 6));
_lhs = tmp4_2;
_fcr = tmpMeta69;
_fargs = tmpMeta70;
_utPath = tmpMeta71;
_cache = tmp4_1;
tmp4 += 9;
tmpMeta[0+0] = omc_Patternm_elabPatternCall(threadData, _cache, _env, omc_AbsynUtil_crefToPath(threadData, _fcr), _fargs, _utPath, _info, _lhs, &tmpMeta[0+1]);
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_metatype tmpMeta74;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,3) == 0) goto tmp3_end;
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta73 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_3,21,6) == 0) goto tmp3_end;
tmpMeta74 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
_lhs = tmp4_2;
_fcr = tmpMeta72;
_fargs = tmpMeta73;
_utPath = tmpMeta74;
_cache = tmp4_1;
tmp4 += 8;
tmpMeta[0+0] = omc_Patternm_elabPatternCall(threadData, _cache, _env, omc_AbsynUtil_crefToPath(threadData, _fcr), _fargs, _utPath, _info, _lhs, &tmpMeta[0+1]);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_boolean tmp80;
modelica_metatype tmpMeta81;
modelica_boolean tmp82 = 0;
modelica_metatype tmpMeta86;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
_cache = tmp4_1;
_ty1 = tmp4_3;
{
modelica_metatype tmp85_1;
tmp85_1 = omc_Types_unboxedType(threadData, _ty1);
{
int tmp85;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp85_1))) {
case 8: {
tmp82 = 1;
goto tmp84_done;
}
case 3: {
tmp82 = 1;
goto tmp84_done;
}
case 4: {
tmp82 = 1;
goto tmp84_done;
}
case 5: {
tmp82 = 1;
goto tmp84_done;
}
case 6: {
tmp82 = 1;
goto tmp84_done;
}
default:
tmp84_default: OMC_LABEL_UNUSED; {
tmp82 = 0;
goto tmp84_done;
}
}
goto tmp84_end;
tmp84_end: ;
}
goto goto_83;
goto_83:;
goto goto_2;
goto tmp84_done;
tmp84_done:;
}
}
tmp4 += 1;
if (!(omc_Types_isBoxedType(threadData, _ty1) || tmp82)) goto tmp3_end;
tmpMeta79 = omc_Static_elabExp(threadData, _cache, _env, _inLhs, 0, 0, _OMC_LIT50, _info, &tmpMeta75, &tmpMeta76);
_cache = tmpMeta79;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta76,0,2) == 0) goto goto_2;
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta76), 2));
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta76), 3));
_elabExp = tmpMeta75;
_ty2 = tmpMeta77;
_const = tmpMeta78;
_et = omc_Patternm_validPatternType(threadData, _ty1, _ty2, _inLhs, _info);
tmp80 = omc_Types_isConstant(threadData, _const);
if (1 != tmp80) goto goto_2;
tmpMeta81 = mmc_mk_box2(3, &Absyn_Msg_MSG__desc, _info);
_cache = omc_Ceval_ceval(threadData, _cache, _env, _elabExp, 0, tmpMeta81, ((modelica_integer) 0) ,&_val);
_elabExp = omc_ValuesUtil_valueExp(threadData, _val, mmc_mk_none());
tmpMeta86 = mmc_mk_box3(4, &DAE_Pattern_PAT__CONSTANT__desc, _et, _elabExp);
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = tmpMeta86;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta87;
modelica_metatype tmpMeta88;
modelica_metatype tmpMeta89;
modelica_metatype tmpMeta90;
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
modelica_boolean tmp98;
modelica_metatype tmpMeta99;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,2) == 0) goto tmp3_end;
tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta88 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_id = tmpMeta87;
_exp = tmpMeta88;
_cache = tmp4_1;
_ty2 = tmp4_3;
tmp4 += 1;
tmpMeta92 = omc_Lookup_lookupIdent(threadData, _cache, _env, _id, &tmpMeta89, NULL, NULL, NULL, NULL);
_cache = tmpMeta92;
tmpMeta90 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta89), 3));
tmpMeta91 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta89), 4));
_attr = tmpMeta90;
_ty1 = tmpMeta91;
tmpMeta93 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta94 = mmc_mk_box3(5, &Absyn_ComponentRef_CREF__IDENT__desc, _id, tmpMeta93);
tmpMeta95 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, tmpMeta94);
_lhs = tmpMeta95;
omc_Static_checkAssignmentToInput(threadData, _lhs, _attr, _env, 0, _info);
_et = omc_Patternm_validPatternType(threadData, _ty2, _ty1, _inLhs, _info);
_cache = omc_Patternm_elabPattern(threadData, _cache, _env, _exp, _ty2, _info ,&_pattern);
tmp98 = (modelica_boolean)omc_Types_isFunctionType(threadData, _ty2);
if(tmp98)
{
tmpMeta96 = mmc_mk_box3(6, &DAE_Pattern_PAT__AS__FUNC__PTR__desc, _id, _pattern);
tmpMeta99 = tmpMeta96;
}
else
{
tmpMeta97 = mmc_mk_box5(5, &DAE_Pattern_PAT__AS__desc, _id, _et, _attr, _pattern);
tmpMeta99 = tmpMeta97;
}
_pattern = tmpMeta99;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _pattern;
goto tmp3_done;
}
case 19: {
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_boolean tmp111;
modelica_metatype tmpMeta112;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmpMeta100 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta100,2,2) == 0) goto tmp3_end;
tmpMeta101 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta100), 2));
tmpMeta102 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta100), 3));
if (!listEmpty(tmpMeta102)) goto tmp3_end;
_id = tmpMeta101;
_cache = tmp4_1;
_ty2 = tmp4_3;
tmp4 += 1;
tmpMeta107 = omc_Lookup_lookupIdent(threadData, _cache, _env, _id, &tmpMeta103, NULL, NULL, NULL, NULL);
_cache = tmpMeta107;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta103), 3));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta104), 4));
tmpMeta106 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta103), 4));
_attr = tmpMeta104;
_variability = tmpMeta105;
_ty1 = tmpMeta106;
if(omc_SCodeUtil_isParameterOrConst(threadData, _variability))
{
tmpMeta108 = mmc_mk_cons(_id, mmc_mk_cons(omc_SCodeDump_unparseVariability(threadData, _variability), MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT186, tmpMeta108, _info);
goto goto_2;
}
omc_Static_checkAssignmentToInput(threadData, _inLhs, _attr, _env, 0, _info);
_et = omc_Patternm_validPatternType(threadData, _ty2, _ty1, _inLhs, _info);
tmp111 = (modelica_boolean)omc_Types_isFunctionType(threadData, _ty2);
if(tmp111)
{
tmpMeta109 = mmc_mk_box3(6, &DAE_Pattern_PAT__AS__FUNC__PTR__desc, _id, _OMC_LIT113);
tmpMeta112 = tmpMeta109;
}
else
{
tmpMeta110 = mmc_mk_box5(5, &DAE_Pattern_PAT__AS__desc, _id, _et, _attr, _OMC_LIT113);
tmpMeta112 = tmpMeta110;
}
_pattern = tmpMeta112;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _pattern;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta113;
modelica_boolean tmp114;
modelica_metatype tmpMeta116;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,2) == 0) goto tmp3_end;
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_id = tmpMeta113;
_cache = tmp4_1;
tmp4 += 4;
tmp114 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupIdent(threadData, _cache, _env, _id, NULL, NULL, NULL, NULL, NULL);
tmp114 = 1;
goto goto_115;
goto_115:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp114) {goto goto_2;}
tmpMeta116 = mmc_mk_cons(_id, mmc_mk_cons(_OMC_LIT36, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT189, tmpMeta116, _info);
goto goto_2;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
modelica_metatype tmpMeta119;
modelica_boolean tmp120;
modelica_metatype tmpMeta122;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmpMeta117 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta117,2,2) == 0) goto tmp3_end;
tmpMeta118 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta117), 2));
if (4 != MMC_STRLEN(tmpMeta118) || strcmp(MMC_STRINGDATA(_OMC_LIT190), MMC_STRINGDATA(tmpMeta118)) != 0) goto tmp3_end;
tmpMeta119 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta117), 3));
if (!listEmpty(tmpMeta119)) goto tmp3_end;
_cache = tmp4_1;
tmp120 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupIdent(threadData, _cache, _env, _OMC_LIT190, NULL, NULL, NULL, NULL, NULL);
tmp120 = 1;
goto goto_121;
goto_121:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp120) {goto goto_2;}
tmpMeta122 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Error_addSourceMessage(threadData, _OMC_LIT193, tmpMeta122, _info);
goto goto_2;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta123;
modelica_metatype tmpMeta124;
modelica_metatype tmpMeta125;
modelica_boolean tmp126;
modelica_boolean tmp128;
modelica_metatype tmpMeta129;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmpMeta123 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta123,2,2) == 0) goto tmp3_end;
tmpMeta124 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta123), 2));
tmpMeta125 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta123), 3));
if (!listEmpty(tmpMeta125)) goto tmp3_end;
_id = tmpMeta124;
_cache = tmp4_1;
tmp4 += 2;
tmp126 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_Lookup_lookupIdent(threadData, _cache, _env, _id, NULL, NULL, NULL, NULL, NULL);
tmp126 = 1;
goto goto_127;
goto_127:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp126) {goto goto_2;}
tmp128 = (stringEqual(_OMC_LIT190, _id));
if (0 != tmp128) goto goto_2;
tmpMeta129 = mmc_mk_cons(_id, mmc_mk_cons(_OMC_LIT36, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT189, tmpMeta129, _info);
goto goto_2;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta130;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmpMeta130 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta130,3,0) == 0) goto tmp3_end;
_cache = tmp4_1;
tmp4 += 1;
tmpMeta[0+0] = _cache;
tmpMeta[0+1] = _OMC_LIT113;
goto tmp3_done;
}
case 24: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,24,3) == 0) goto tmp3_end;
_cache = tmp4_1;
tmpMeta[0+0] = omc_Patternm_elabPattern2(threadData, _cache, _env, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inLhs), 3))), _ty, _info, _numError, &tmpMeta[0+1]);
goto tmp3_done;
}
case 25: {
modelica_boolean tmp131;
modelica_metatype tmpMeta132;
modelica_metatype tmpMeta133;
modelica_metatype tmpMeta134;
_lhs = tmp4_2;
tmp131 = (_numError == omc_Error_getNumErrorMessages(threadData));
if (1 != tmp131) goto goto_2;
tmpMeta132 = stringAppend(omc_Dump_printExpStr(threadData, _lhs),_OMC_LIT194);
tmpMeta133 = stringAppend(tmpMeta132,omc_Types_unparseType(threadData, _ty));
_str = tmpMeta133;
tmpMeta134 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT197, tmpMeta134, _info);
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 < 26) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outCache = tmpMeta[0+0];
_pattern = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_pattern) { *out_pattern = _pattern; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Patternm_elabPattern2(threadData_t *threadData, modelica_metatype _inCache, modelica_metatype _env, modelica_metatype _inLhs, modelica_metatype _ty, modelica_metatype _info, modelica_metatype _numError, modelica_metatype *out_pattern)
{
modelica_integer tmp1;
modelica_metatype _outCache = NULL;
tmp1 = mmc_unbox_integer(_numError);
_outCache = omc_Patternm_elabPattern2(threadData, _inCache, _env, _inLhs, _ty, _info, tmp1, out_pattern);
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findBoundVariables(threadData_t *threadData, modelica_metatype _pat, modelica_metatype _boundVars, modelica_metatype *out_outBoundVars)
{
modelica_metatype _outPat = NULL;
modelica_metatype _outBoundVars = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outPat = _pat;
{
modelica_metatype tmp4_1;
tmp4_1 = _pat;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
modelica_metatype tmpMeta5;
tmpMeta5 = mmc_mk_cons((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_pat), 2))), _boundVars);
tmpMeta1 = tmpMeta5;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_cons((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_pat), 2))), _boundVars);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _boundVars;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoundVars = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outBoundVars) { *out_outBoundVars = _outBoundVars; }
return _outPat;
}
PROTECTED_FUNCTION_STATIC void omc_Patternm_checkPatternsDuplicateAsBindings(threadData_t *threadData, modelica_metatype _patterns, modelica_metatype _info)
{
modelica_metatype _usedVariables = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Patternm_traversePatternList(threadData, _patterns, boxvar_Patternm_findBoundVariables, tmpMeta1 ,&_usedVariables);
_usedVariables = omc_List_sortedUniqueOnlyDuplicates(threadData, omc_List_sort(threadData, _usedVariables, boxvar_Util_strcmpBool), boxvar_stringEq);
if((!listEmpty(_usedVariables)))
{
tmpMeta2 = mmc_mk_cons(stringDelimitList(_usedVariables, _OMC_LIT58), MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT201, tmpMeta2, _info);
MMC_THROW_INTERNAL();
}
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_elabPattern(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _lhs, modelica_metatype _ty, modelica_metatype _info, modelica_metatype *out_pattern)
{
modelica_metatype _outCache = NULL;
modelica_metatype _pattern = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outCache = omc_Patternm_elabPattern2(threadData, _cache, _env, _lhs, _ty, _info, omc_Error_getNumErrorMessages(threadData) ,&_pattern);
_return: OMC_LABEL_UNUSED
if (out_pattern) { *out_pattern = _pattern; }
return _outCache;
}
DLLExport
modelica_metatype omc_Patternm_elabPatternCheckDuplicateBindings(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _lhs, modelica_metatype _ty, modelica_metatype _info, modelica_metatype *out_pattern)
{
modelica_metatype _outCache = NULL;
modelica_metatype _pattern = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outCache = omc_Patternm_elabPattern2(threadData, _cache, _env, _lhs, _ty, _info, omc_Error_getNumErrorMessages(threadData) ,&_pattern);
tmpMeta1 = mmc_mk_cons(_pattern, MMC_REFSTRUCTLIT(mmc_nil));
omc_Patternm_checkPatternsDuplicateAsBindings(threadData, tmpMeta1, _info);
_return: OMC_LABEL_UNUSED
if (out_pattern) { *out_pattern = _pattern; }
return _outCache;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_checkInvalidPatternNamedArgs(threadData_t *threadData, modelica_metatype _args, modelica_metatype _fieldNameList, modelica_metatype _status, modelica_metatype _info)
{
modelica_metatype _outStatus = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _args;
{
modelica_metatype _argsNames = NULL;
modelica_string _str1 = NULL;
modelica_string _str2 = 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 = _status;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
_argsNames = omc_AbsynUtil_getNamedFuncArgNamesAndValues(threadData, _args, NULL);
_str1 = stringDelimitList(_argsNames, _OMC_LIT143);
_str2 = stringDelimitList(_fieldNameList, _OMC_LIT143);
tmpMeta6 = mmc_mk_cons(_str1, mmc_mk_cons(_str2, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT204, tmpMeta6, _info);
tmpMeta1 = _OMC_LIT205;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outStatus = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outStatus;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_findFieldExpInList(threadData_t *threadData, modelica_string _firstFieldName, modelica_metatype _namedArgList, modelica_metatype *out_outNamedArgList)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outNamedArgList = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_string tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _firstFieldName;
tmp4_2 = _namedArgList;
{
modelica_metatype _e = NULL;
modelica_string _localFieldName = NULL;
modelica_string _aName = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _first = 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_2)) goto tmp3_end;
tmp4 += 2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _OMC_LIT94;
tmpMeta[0+1] = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_boolean tmp11;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_2);
tmpMeta8 = MMC_CDR(tmp4_2);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
_aName = tmpMeta9;
_e = tmpMeta10;
_rest = tmpMeta8;
_localFieldName = tmp4_1;
tmp11 = (stringEqual(_localFieldName, _aName));
if (1 != tmp11) goto goto_2;
tmpMeta[0+0] = _e;
tmpMeta[0+1] = _rest;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_2);
tmpMeta13 = MMC_CDR(tmp4_2);
_first = tmpMeta12;
_rest = tmpMeta13;
_localFieldName = tmp4_1;
_e = omc_Patternm_findFieldExpInList(threadData, _localFieldName, _rest ,&_rest);
tmpMeta14 = mmc_mk_cons(_first, _rest);
tmpMeta[0+0] = _e;
tmpMeta[0+1] = 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:;
}
}
_outExp = tmpMeta[0+0];
_outNamedArgList = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outNamedArgList) { *out_outNamedArgList = _outNamedArgList; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Patternm_generatePositionalArgs(threadData_t *threadData, modelica_metatype _fieldNameList, modelica_metatype _namedArgList, modelica_metatype _accList, modelica_metatype *out_outInvalidNames)
{
modelica_metatype _outList = NULL;
modelica_metatype _outInvalidNames = 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;
tmp4_1 = _fieldNameList;
tmp4_2 = _namedArgList;
tmp4_3 = _accList;
{
modelica_metatype _localAccList = NULL;
modelica_metatype _restFieldNames = NULL;
modelica_string _firstFieldName = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _localNamedArgList = 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;
_localAccList = tmp4_3;
tmpMeta[0+0] = listReverse(_localAccList);
tmpMeta[0+1] = _namedArgList;
goto tmp3_done;
}
case 1: {
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);
_firstFieldName = tmpMeta6;
_restFieldNames = tmpMeta7;
_localNamedArgList = tmp4_2;
_localAccList = tmp4_3;
_exp = omc_Patternm_findFieldExpInList(threadData, _firstFieldName, _localNamedArgList ,&_localNamedArgList);
tmpMeta8 = mmc_mk_cons(_exp, _localAccList);
_fieldNameList = _restFieldNames;
_namedArgList = _localNamedArgList;
_accList = tmpMeta8;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outList = tmpMeta[0+0];
_outInvalidNames = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outInvalidNames) { *out_outInvalidNames = _outInvalidNames; }
return _outList;
}
