#ifdef OMC_BASE_FILE
#define OMC_FILE OMC_BASE_FILE
#else
#define OMC_FILE "Expression.c"
#endif
#include "omc_simulation_settings.h"
#include "Expression.h"
#define _OMC_LIT0_data "Expression.compare failed: ctor:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,32,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data " "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,1,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
#define _OMC_LIT2_data "Expression.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,13,_OMC_LIT2_data);
#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT3_6,0.0);
#define _OMC_LIT3_6 MMC_REFREALLIT(_OMC_LIT_STRUCT3_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT3,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT2,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(13258)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(13258)),MMC_IMMEDIATE(MMC_TAGFIXNUM(172)),_OMC_LIT3_6}};
#define _OMC_LIT3 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT3)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT4,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT4 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT4)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT5,1.0);
#define _OMC_LIT5 MMC_REFREALLIT(_OMC_LIT_STRUCT5)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT6,2,4) {&DAE_Exp_RCONST__desc,_OMC_LIT5}};
#define _OMC_LIT6 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT6)
#define _OMC_LIT7_data "sqrt"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,4,_OMC_LIT7_data);
#define _OMC_LIT7 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)
#define _OMC_LIT8_data "exp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT8,3,_OMC_LIT8_data);
#define _OMC_LIT8 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "log"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,3,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
#define _OMC_LIT10_data "log10"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT10,5,_OMC_LIT10_data);
#define _OMC_LIT10 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT10)
#define _OMC_LIT11_data "tanh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT11,4,_OMC_LIT11_data);
#define _OMC_LIT11 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT11)
#define _OMC_LIT12_data "sinh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT12,4,_OMC_LIT12_data);
#define _OMC_LIT12 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT12)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT13,2.0);
#define _OMC_LIT13 MMC_REFREALLIT(_OMC_LIT_STRUCT13)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT14,2,4) {&DAE_Exp_RCONST__desc,_OMC_LIT13}};
#define _OMC_LIT14 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT14)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT15,10.0);
#define _OMC_LIT15 MMC_REFREALLIT(_OMC_LIT_STRUCT15)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT16,2,4) {&DAE_Exp_RCONST__desc,_OMC_LIT15}};
#define _OMC_LIT16 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT16)
#define _OMC_LIT17_data "semiLinear"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT17,10,_OMC_LIT17_data);
#define _OMC_LIT17 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT17)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT18,2,6) {&DAE_Exp_BCONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT18 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT18)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT19,2,5) {&DAE_Subscript_INDEX__desc,_OMC_LIT18}};
#define _OMC_LIT19 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT19)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT20,2,6) {&DAE_Exp_BCONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT20 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT20)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT21,2,5) {&DAE_Subscript_INDEX__desc,_OMC_LIT20}};
#define _OMC_LIT21 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT21)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT22,2,1) {_OMC_LIT21,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT22 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT22)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT23,2,1) {_OMC_LIT19,_OMC_LIT22}};
#define _OMC_LIT23 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT23)
#define _OMC_LIT24_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT24,0,_OMC_LIT24_data);
#define _OMC_LIT24 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT24)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT25,0.0);
#define _OMC_LIT25 MMC_REFREALLIT(_OMC_LIT_STRUCT25)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT26,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT24,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_LIT25}};
#define _OMC_LIT26 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT26)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT27,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT27 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT27)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT28,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT28 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data "Internal error %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,17,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT30,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT29}};
#define _OMC_LIT30 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT30)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT31,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(63)),_OMC_LIT27,_OMC_LIT28,_OMC_LIT30}};
#define _OMC_LIT31 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT31)
#define _OMC_LIT32_data "Expression.makeMatrix failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT32,28,_OMC_LIT32_data);
#define _OMC_LIT32 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT32)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT33,2,1) {_OMC_LIT32,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT33 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT33)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT34_6,0.0);
#define _OMC_LIT34_6 MMC_REFREALLIT(_OMC_LIT_STRUCT34_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT34,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT2,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(12349)),MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),MMC_IMMEDIATE(MMC_TAGFIXNUM(12349)),MMC_IMMEDIATE(MMC_TAGFIXNUM(122)),_OMC_LIT34_6}};
#define _OMC_LIT34 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "- Expression.expandExpression failed for "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,41,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
#define _OMC_LIT36_data "vector"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT36,6,_OMC_LIT36_data);
#define _OMC_LIT36 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT36)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT37,1,6) {&DAE_ComponentRef_WILD__desc,}};
#define _OMC_LIT37 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT37)
#define _OMC_LIT38_data "der"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT38,3,_OMC_LIT38_data);
#define _OMC_LIT38 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT38)
#define _OMC_LIT39_data "Expression.fromAbsynOperator: Unhandled operator: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT39,50,_OMC_LIT39_data);
#define _OMC_LIT39 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,1,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
#define _OMC_LIT41_data "Expression.fargsToExps: Named arguments are not handled!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT41,57,_OMC_LIT41_data);
#define _OMC_LIT41 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,1,11) {&DAE_Type_T__UNKNOWN__desc,}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT43,1,7) {&DAE_InlineType_NO__INLINE__desc,}};
#define _OMC_LIT43 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT43)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT44,1,3) {&DAE_TailCall_NO__TAIL__desc,}};
#define _OMC_LIT44 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT44)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT45,8,3) {&DAE_CallAttributes_CALL__ATTR__desc,_OMC_LIT42,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT43,_OMC_LIT44}};
#define _OMC_LIT45 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT45)
#define _OMC_LIT46_data "Expression.fromAbsynExp: Unhandled expression: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT46,47,_OMC_LIT46_data);
#define _OMC_LIT46 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT46)
#define _OMC_LIT47_data "."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT47,1,_OMC_LIT47_data);
#define _OMC_LIT47 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT47)
#define _OMC_LIT48_data "true"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT48,4,_OMC_LIT48_data);
#define _OMC_LIT48 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT48)
#define _OMC_LIT49_data "false"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT49,5,_OMC_LIT49_data);
#define _OMC_LIT49 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT49)
#define _OMC_LIT50_data "promote"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT50,7,_OMC_LIT50_data);
#define _OMC_LIT50 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT50)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT51,2,3) {&DAE_Dimension_DIM__INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT51 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data "Expression.opWCET failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,24,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT53,2,1) {_OMC_LIT52,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT53 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT53)
#define _OMC_LIT54_data "identity"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT54,8,_OMC_LIT54_data);
#define _OMC_LIT54 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT54)
#define _OMC_LIT55_data "cross"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT55,5,_OMC_LIT55_data);
#define _OMC_LIT55 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT55)
#define _OMC_LIT56_data "Expression.complexityWork failed: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT56,34,_OMC_LIT56_data);
#define _OMC_LIT56 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT56)
#define _OMC_LIT57_data "failtrace"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,9,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
#define _OMC_LIT58_data "Sets whether to print a failtrace or not."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT58,41,_OMC_LIT58_data);
#define _OMC_LIT58 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT58)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT59,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT58}};
#define _OMC_LIT59 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT59)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT60,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT57,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT59}};
#define _OMC_LIT60 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT60)
#define _OMC_LIT61_data "- Expression.expContains failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT61,32,_OMC_LIT61_data);
#define _OMC_LIT61 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT61)
#define _OMC_LIT62_data "exp = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT62,6,_OMC_LIT62_data);
#define _OMC_LIT62 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data " subexp = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,10,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
#define _OMC_LIT64_data "pre"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT64,3,_OMC_LIT64_data);
#define _OMC_LIT64 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT64)
#define _OMC_LIT65_data "previous"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT65,8,_OMC_LIT65_data);
#define _OMC_LIT65 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT65)
#define _OMC_LIT66_data "exp_equal on CODE not impl.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT66,28,_OMC_LIT66_data);
#define _OMC_LIT66 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT66)
#define _OMC_LIT67_data "inStream"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT67,8,_OMC_LIT67_data);
#define _OMC_LIT67 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT67)
#define _OMC_LIT68_data "actualStream"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT68,12,_OMC_LIT68_data);
#define _OMC_LIT68 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT68)
#define _OMC_LIT69_data "div"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT69,3,_OMC_LIT69_data);
#define _OMC_LIT69 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT69)
#define _OMC_LIT70_data "mod"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT70,3,_OMC_LIT70_data);
#define _OMC_LIT70 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT70)
#define _OMC_LIT71_data "rem"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT71,3,_OMC_LIT71_data);
#define _OMC_LIT71 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT71)
#define _OMC_LIT72_data "ceil"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT72,4,_OMC_LIT72_data);
#define _OMC_LIT72 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT72)
#define _OMC_LIT73_data "floor"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT73,5,_OMC_LIT73_data);
#define _OMC_LIT73 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT73)
#define _OMC_LIT74_data "integer"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT74,7,_OMC_LIT74_data);
#define _OMC_LIT74 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT74)
#define _OMC_LIT75_data "initial"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT75,7,_OMC_LIT75_data);
#define _OMC_LIT75 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT75)
#define _OMC_LIT76_data "terminal"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT76,8,_OMC_LIT76_data);
#define _OMC_LIT76 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "sample"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,6,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT78,2,1) {_OMC_LIT77,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT78 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT78)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT79,2,1) {_OMC_LIT76,_OMC_LIT78}};
#define _OMC_LIT79 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT79)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT80,2,1) {_OMC_LIT75,_OMC_LIT79}};
#define _OMC_LIT80 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT80)
#define _OMC_LIT81_data "alarm"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT81,5,_OMC_LIT81_data);
#define _OMC_LIT81 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT81)
#define _OMC_LIT82_data "compareFilesAndMove"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT82,19,_OMC_LIT82_data);
#define _OMC_LIT82 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT82)
#define _OMC_LIT83_data "delay"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT83,5,_OMC_LIT83_data);
#define _OMC_LIT83 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT83)
#define _OMC_LIT84_data "print"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT84,5,_OMC_LIT84_data);
#define _OMC_LIT84 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT84)
#define _OMC_LIT85_data "readFile"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT85,8,_OMC_LIT85_data);
#define _OMC_LIT85 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT85)
#define _OMC_LIT86_data "system"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT86,6,_OMC_LIT86_data);
#define _OMC_LIT86 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT86)
#define _OMC_LIT87_data "system_parallel"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT87,15,_OMC_LIT87_data);
#define _OMC_LIT87 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT87)
#define _OMC_LIT88_data "writeFile"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT88,9,_OMC_LIT88_data);
#define _OMC_LIT88 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data "abs"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,3,_OMC_LIT89_data);
#define _OMC_LIT89 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT89)
#define _OMC_LIT90_data "cosh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT90,4,_OMC_LIT90_data);
#define _OMC_LIT90 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT90)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT91,1,3) {&DAE_Subscript_WHOLEDIM__desc,}};
#define _OMC_LIT91 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data "Expression.traverseExpCref: Unknown cref"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,40,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT93,2,1) {_OMC_LIT92,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT93 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT93)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT94,1,6) {&ErrorTypes_Severity_NOTIFICATION__desc,}};
#define _OMC_LIT94 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT94)
#define _OMC_LIT95_data "%s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT95,2,_OMC_LIT95_data);
#define _OMC_LIT95 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT95)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT96,2,4) {&Gettext_TranslatableContent_notrans__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(6001)),_OMC_LIT27,_OMC_LIT94,_OMC_LIT96}};
#define _OMC_LIT97 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "Expression.traverseExpBidirSubExps not yet implemented for match expressions. Called using: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,92,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT99_6,0.0);
#define _OMC_LIT99_6 MMC_REFREALLIT(_OMC_LIT_STRUCT99_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT99,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT2,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7219)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7219)),MMC_IMMEDIATE(MMC_TAGFIXNUM(221)),_OMC_LIT99_6}};
#define _OMC_LIT99 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT99)
#define _OMC_LIT100_data "Expression.traverseExpBidirSubExps - Unknown expression "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT100,56,_OMC_LIT100_data);
#define _OMC_LIT100 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT100)
#define _OMC_LIT101_data ". Called using: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT101,16,_OMC_LIT101_data);
#define _OMC_LIT101 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT101)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT102_6,0.0);
#define _OMC_LIT102_6 MMC_REFREALLIT(_OMC_LIT_STRUCT102_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT102,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT2,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7241)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7241)),MMC_IMMEDIATE(MMC_TAGFIXNUM(211)),_OMC_LIT102_6}};
#define _OMC_LIT102 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data "smooth"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,6,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
#define _OMC_LIT104_data "noEvent"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT104,7,_OMC_LIT104_data);
#define _OMC_LIT104 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT104)
#define _OMC_LIT105_data "sign"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT105,4,_OMC_LIT105_data);
#define _OMC_LIT105 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT105)
#define _OMC_LIT106_data "change"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT106,6,_OMC_LIT106_data);
#define _OMC_LIT106 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT106)
#define _OMC_LIT107_data "edge"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT107,4,_OMC_LIT107_data);
#define _OMC_LIT107 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT107)
#define _OMC_LIT108_data "$_round"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT108,7,_OMC_LIT108_data);
#define _OMC_LIT108 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT108)
#define _OMC_LIT109_data "$DERAlias"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT109,9,_OMC_LIT109_data);
#define _OMC_LIT109 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT109)
#define _OMC_LIT110_data "Expression.traversingComponentRefFinderDerPreStart - Found a start call expression "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT110,83,_OMC_LIT110_data);
#define _OMC_LIT110 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT110)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT111_6,0.0);
#define _OMC_LIT111_6 MMC_REFREALLIT(_OMC_LIT_STRUCT111_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT111,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT2,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6169)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6169)),MMC_IMMEDIATE(MMC_TAGFIXNUM(136)),_OMC_LIT111_6}};
#define _OMC_LIT111 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT111)
#define _OMC_LIT112_data "start"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT112,5,_OMC_LIT112_data);
#define _OMC_LIT112 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data "Expression.traverseExpTopDown1 or "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,34,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
#define _OMC_LIT114_data "not implemented correctly: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT114,27,_OMC_LIT114_data);
#define _OMC_LIT114 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT114)
#define _OMC_LIT115_data "Expression.traverseExpBottomUp or one of the user-defined functions using it is not implemented correctly: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT115,107,_OMC_LIT115_data);
#define _OMC_LIT115 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT115)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT116_6,0.0);
#define _OMC_LIT116_6 MMC_REFREALLIT(_OMC_LIT_STRUCT116_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT116,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT2,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(5269)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7)),MMC_IMMEDIATE(MMC_TAGFIXNUM(5269)),MMC_IMMEDIATE(MMC_TAGFIXNUM(48)),_OMC_LIT116_6}};
#define _OMC_LIT116 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT116)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT117,1,7) {&DAE_Dimension_DIM__UNKNOWN__desc,}};
#define _OMC_LIT117 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,1,6) {&DAE_ConnectorType_NON__CONNECTOR__desc,}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT119,1,5) {&SCode_Parallelism_NON__PARALLEL__desc,}};
#define _OMC_LIT119 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,1,3) {&SCode_Variability_VAR__desc,}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,1,5) {&Absyn_Direction_BIDIR__desc,}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT122,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc,}};
#define _OMC_LIT122 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,7,3) {&DAE_Attributes_ATTR__desc,_OMC_LIT118,_OMC_LIT119,_OMC_LIT120,_OMC_LIT121,_OMC_LIT122,_OMC_LIT123}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT125,1,3) {&DAE_Binding_UNBOUND__desc,}};
#define _OMC_LIT125 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT125)
#define _OMC_LIT126_data "Expression.listToArray3: Not enough elements left in list to fit dimension."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT126,75,_OMC_LIT126_data);
#define _OMC_LIT126 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT126)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT127,2,1) {_OMC_LIT126,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT127 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "Expression.listToArray2: Number of elements in the list does not match the dimension size."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,90,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT129,2,1) {_OMC_LIT128,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT129 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT129)
#define _OMC_LIT130_data "Expression.listToArray called with empty dimension list."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT130,56,_OMC_LIT130_data);
#define _OMC_LIT130 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT130)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT131,2,1) {_OMC_LIT130,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT131 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT131)
#define _OMC_LIT132_data "Expression.listToArray called with empty list."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT132,46,_OMC_LIT132_data);
#define _OMC_LIT132 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT132)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT133,2,1) {_OMC_LIT132,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT133 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT133)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT134,2,4) {&DAE_Type_T__REAL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT134 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,2,4) {&DAE_Exp_RCONST__desc,_OMC_LIT25}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT136,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT136 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT136)
#define _OMC_LIT137_data "-Expression.makeProductLst failed, DAE.Exp lst:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT137,47,_OMC_LIT137_data);
#define _OMC_LIT137 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT137)
#define _OMC_LIT138_data ", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT138,2,_OMC_LIT138_data);
#define _OMC_LIT138 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT138)
#define _OMC_LIT139_data "addVec fail.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT139,13,_OMC_LIT139_data);
#define _OMC_LIT139 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT139)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT140,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT7}};
#define _OMC_LIT140 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT140)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT141,8,3) {&DAE_CallAttributes_CALL__ATTR__desc,_OMC_LIT134,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT43,_OMC_LIT44}};
#define _OMC_LIT141 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT141)
#define _OMC_LIT142_data "makeScalarProduct faili.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT142,25,_OMC_LIT142_data);
#define _OMC_LIT142 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT142)
#define _OMC_LIT143_data "min"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT143,3,_OMC_LIT143_data);
#define _OMC_LIT143 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT143)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT144,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT143}};
#define _OMC_LIT144 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "max"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,3,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT146,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT145}};
#define _OMC_LIT146 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT146)
#define _OMC_LIT147_data "-Expression.makeSum failed, DAE.Exp lst:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT147,40,_OMC_LIT147_data);
#define _OMC_LIT147 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT147)
#define _OMC_LIT148_data "-Expression.makeSum1 failed, DAE.Exp lst:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT148,41,_OMC_LIT148_data);
#define _OMC_LIT148 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT148)
#define _OMC_LIT149_data "Expression.makeLBinary failed for operator "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT149,43,_OMC_LIT149_data);
#define _OMC_LIT149 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT149)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT150,2,3) {&DAE_Operator_ADD__desc,_OMC_LIT134}};
#define _OMC_LIT150 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT150)
#define _OMC_LIT151_data "Expression.generateCrefsExpLstFromExp: fail for "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT151,48,_OMC_LIT151_data);
#define _OMC_LIT151 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "Expression.generateCrefsExpFromExp: fail for"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,44,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
#define _OMC_LIT153_data "Warning: makeASUB: given expression: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT153,37,_OMC_LIT153_data);
#define _OMC_LIT153 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT153)
#define _OMC_LIT154_data " contains a component reference!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT154,33,_OMC_LIT154_data);
#define _OMC_LIT154 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT154)
#define _OMC_LIT155_data " Subscripts exps: ["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT155,19,_OMC_LIT155_data);
#define _OMC_LIT155 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT155)
#define _OMC_LIT156_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT156,1,_OMC_LIT156_data);
#define _OMC_LIT156 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT156)
#define _OMC_LIT157_data "]\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT157,2,_OMC_LIT157_data);
#define _OMC_LIT157 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT157)
#define _OMC_LIT158_data "DAE.ASUB should not be used for component references, instead the subscripts should be added directly to the component reference!"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT158,129,_OMC_LIT158_data);
#define _OMC_LIT158 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT158)
#define _OMC_LIT159_data "checkASUB"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT159,9,_OMC_LIT159_data);
#define _OMC_LIT159 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT159)
#define _OMC_LIT160_data "Prints out a warning if an ASUB is created from a CREF expression."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT160,66,_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) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(15)),_OMC_LIT159,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT161}};
#define _OMC_LIT162 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT162)
#define _OMC_LIT163_data "Warning: Expression.makeCrefExp: cref "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT163,38,_OMC_LIT163_data);
#define _OMC_LIT163 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT163)
#define _OMC_LIT164_data " was given type DAE.CREF.ty: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT164,29,_OMC_LIT164_data);
#define _OMC_LIT164 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT164)
#define _OMC_LIT165_data " is different from existing DAE.CREF.componentRef.ty: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT165,54,_OMC_LIT165_data);
#define _OMC_LIT165 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT165)
#define _OMC_LIT166_data "checkDAECrefType"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT166,16,_OMC_LIT166_data);
#define _OMC_LIT166 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT166)
#define _OMC_LIT167_data "Enables extra type checking for cref expressions."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT167,49,_OMC_LIT167_data);
#define _OMC_LIT167 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT167)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT168,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT167}};
#define _OMC_LIT168 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT168)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT169,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(14)),_OMC_LIT166,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT168}};
#define _OMC_LIT169 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT169)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT170,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT105}};
#define _OMC_LIT170 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT170)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT171,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT89}};
#define _OMC_LIT171 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT104}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT173,2,6) {&DAE_Type_T__BOOL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT173 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT173)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT174,8,3) {&DAE_CallAttributes_CALL__ATTR__desc,_OMC_LIT173,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT43,_OMC_LIT44}};
#define _OMC_LIT174 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT174)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT175,2,6) {&DAE_Operator_DIV__desc,_OMC_LIT134}};
#define _OMC_LIT175 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT175)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT176,2,3) {&DAE_Type_T__INTEGER__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT176 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT176)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT177,2,6) {&DAE_Operator_DIV__desc,_OMC_LIT176}};
#define _OMC_LIT177 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT177)
#define _OMC_LIT178_data "time"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT178,4,_OMC_LIT178_data);
#define _OMC_LIT178 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,4,4) {&DAE_ComponentRef_CREF__IDENT__desc,_OMC_LIT178,_OMC_LIT134,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT180,2,5) {&DAE_Type_T__STRING__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT180 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT180)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT181,2,7) {&DAE_Type_T__CLOCK__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT181 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT181)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT182,2,1) {_OMC_LIT117,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,3,9) {&DAE_Type_T__ARRAY__desc,_OMC_LIT176,_OMC_LIT182}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT184,2,20) {&DAE_Type_T__METALIST__desc,_OMC_LIT42}};
#define _OMC_LIT184 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT184)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT185,2,28) {&DAE_Type_T__METATYPE__desc,_OMC_LIT184}};
#define _OMC_LIT185 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,2,22) {&DAE_Type_T__METAOPTION__desc,_OMC_LIT42}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT187,2,28) {&DAE_Type_T__METATYPE__desc,_OMC_LIT186}};
#define _OMC_LIT187 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT187)
#define _OMC_LIT188_data "- Expression.typeof failed for "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT188,31,_OMC_LIT188_data);
#define _OMC_LIT188 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT188)
#define _OMC_LIT189_data "array"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT189,5,_OMC_LIT189_data);
#define _OMC_LIT189 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT189)
#define _OMC_LIT190_data "checkModel"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT190,10,_OMC_LIT190_data);
#define _OMC_LIT190 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT190)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT191,1,3) {&Flags_FlagVisibility_INTERNAL__desc,}};
#define _OMC_LIT191 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT191)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT192,2,4) {&Flags_FlagData_BOOL__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT192 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT192)
#define _OMC_LIT193_data "Set when checkModel is used to turn on specific features for checking."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT193,70,_OMC_LIT193_data);
#define _OMC_LIT193 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT193)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT194,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT193}};
#define _OMC_LIT194 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT194)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT195,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(31)),_OMC_LIT190,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT191,_OMC_LIT192,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT194}};
#define _OMC_LIT195 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT195)
#define _OMC_LIT196_data "- Expression.subscriptDimension failed on "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT196,42,_OMC_LIT196_data);
#define _OMC_LIT196 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT196)
#define _OMC_LIT197_data "- Expression.arrayAppend failed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT197,32,_OMC_LIT197_data);
#define _OMC_LIT197 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT197)
#define _OMC_LIT198_data "- Expression.setOpType failed on unknown operator"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT198,49,_OMC_LIT198_data);
#define _OMC_LIT198 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT198)
#define _OMC_LIT199_data "Expression.applyExpSubscripts failed applying subs: ["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT199,53,_OMC_LIT199_data);
#define _OMC_LIT199 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT199)
#define _OMC_LIT200_data "] on expression:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT200,16,_OMC_LIT200_data);
#define _OMC_LIT200 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT200)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT201,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT38}};
#define _OMC_LIT201 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT201)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT202,2,8) {&DAE_Operator_UMINUS__desc,_OMC_LIT134}};
#define _OMC_LIT202 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT202)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT203,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT203 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT203)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT204,2,5) {&DAE_Subscript_INDEX__desc,_OMC_LIT203}};
#define _OMC_LIT204 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT204)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT205,2,3) {&DAE_Exp_ICONST__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(-1))}};
#define _OMC_LIT205 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT205)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT206,1,3) {&DAE_Prefix_NOPRE__desc,}};
#define _OMC_LIT206 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT206)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT207,1,3) {&Absyn_Operator_ADD__desc,}};
#define _OMC_LIT207 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT207)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT208,1,4) {&Absyn_Operator_SUB__desc,}};
#define _OMC_LIT208 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT208)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209,1,5) {&Absyn_Operator_MUL__desc,}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT210,1,6) {&Absyn_Operator_DIV__desc,}};
#define _OMC_LIT210 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT210)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT211,1,7) {&Absyn_Operator_POW__desc,}};
#define _OMC_LIT211 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT211)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT212,1,9) {&Absyn_Operator_UMINUS__desc,}};
#define _OMC_LIT212 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT212)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT213,1,17) {&Absyn_Operator_AND__desc,}};
#define _OMC_LIT213 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,1,18) {&Absyn_Operator_OR__desc,}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,1,19) {&Absyn_Operator_NOT__desc,}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT216,1,20) {&Absyn_Operator_LESS__desc,}};
#define _OMC_LIT216 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT216)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT217,1,21) {&Absyn_Operator_LESSEQ__desc,}};
#define _OMC_LIT217 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT217)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT218,1,22) {&Absyn_Operator_GREATER__desc,}};
#define _OMC_LIT218 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT218)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT219,1,23) {&Absyn_Operator_GREATEREQ__desc,}};
#define _OMC_LIT219 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT219)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT220,1,24) {&Absyn_Operator_EQUAL__desc,}};
#define _OMC_LIT220 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT220)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT221,1,25) {&Absyn_Operator_NEQUAL__desc,}};
#define _OMC_LIT221 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT221)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT222,2,3) {&Absyn_Exp_INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT222 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT222)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT223,2,7) {&Absyn_Exp_BOOL__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT223 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT223)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT224,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT24}};
#define _OMC_LIT224 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT224)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT225,2,3) {&Absyn_Exp_INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT225 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT225)
#define _OMC_LIT226_data "0.0"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT226,3,_OMC_LIT226_data);
#define _OMC_LIT226 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT226)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT227,2,4) {&Absyn_Exp_REAL__desc,_OMC_LIT226}};
#define _OMC_LIT227 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT227)
#define _OMC_LIT228_data "Boolean"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT228,7,_OMC_LIT228_data);
#define _OMC_LIT228 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT228)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT229,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT228,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT229 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT229)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT230,2,5) {&Absyn_Exp_CREF__desc,_OMC_LIT229}};
#define _OMC_LIT230 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT230)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT231,2,4) {&Absyn_Subscript_SUBSCRIPT__desc,_OMC_LIT230}};
#define _OMC_LIT231 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,1,3) {&Absyn_Subscript_NOSUB__desc,}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
#define _OMC_LIT233_data "fill"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT233,4,_OMC_LIT233_data);
#define _OMC_LIT233 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT233)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT234,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT233,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT234 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT234)
#define _OMC_LIT235_data "Internal Error, can not unelab ASUB\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT235,36,_OMC_LIT235_data);
#define _OMC_LIT235 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT235)
#define _OMC_LIT236_data "size"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT236,4,_OMC_LIT236_data);
#define _OMC_LIT236 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT236)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT237,3,5) {&Absyn_ComponentRef_CREF__IDENT__desc,_OMC_LIT236,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT237 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT237)
#define _OMC_LIT238_data "Expression.unelabExp failed on: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT238,32,_OMC_LIT238_data);
#define _OMC_LIT238 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT238)
#include "util/modelica.h"
#include "Expression_includes.h"
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_consToListIgnoreSharedLiteralWork(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_metatype _acc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_consToListIgnoreSharedLiteralWork,2,0) {(void*) boxptr_Expression_consToListIgnoreSharedLiteralWork,0}};
#define boxvar_Expression_consToListIgnoreSharedLiteralWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_consToListIgnoreSharedLiteralWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_containsCallTo__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_outContinue, modelica_metatype *out_outTpl);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_containsCallTo__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outContinue, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_containsCallTo__traverser,2,0) {(void*) boxptr_Expression_containsCallTo__traverser,0}};
#define boxvar_Expression_containsCallTo__traverser MMC_REFSTRUCTLIT(boxvar_lit_Expression_containsCallTo__traverser)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_containsAnyCall__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inContainsCall, modelica_boolean *out_outContinue, modelica_boolean *out_outContainsCall);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_containsAnyCall__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inContainsCall, modelica_metatype *out_outContinue, modelica_metatype *out_outContainsCall);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_containsAnyCall__traverser,2,0) {(void*) boxptr_Expression_containsAnyCall__traverser,0}};
#define boxvar_Expression_containsAnyCall__traverser MMC_REFSTRUCTLIT(boxvar_lit_Expression_containsAnyCall__traverser)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_createResidualExp4(threadData_t *threadData, modelica_string _f);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_createResidualExp4(threadData_t *threadData, modelica_metatype _f);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_createResidualExp4,2,0) {(void*) boxptr_Expression_createResidualExp4,0}};
#define boxvar_Expression_createResidualExp4 MMC_REFSTRUCTLIT(boxvar_lit_Expression_createResidualExp4)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_createResidualExp2(threadData_t *threadData, modelica_metatype _iExp1, modelica_metatype _iExp2, modelica_metatype *out_oExp2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_createResidualExp2,2,0) {(void*) boxptr_Expression_createResidualExp2,0}};
#define boxvar_Expression_createResidualExp2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_createResidualExp2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_moveDivToMul(threadData_t *threadData, modelica_metatype _iExpLst, modelica_metatype _iExpLstAcc, modelica_metatype _iExpMuls, modelica_metatype *out_oExpMuls);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_moveDivToMul,2,0) {(void*) boxptr_Expression_moveDivToMul,0}};
#define boxvar_Expression_moveDivToMul MMC_REFSTRUCTLIT(boxvar_lit_Expression_moveDivToMul)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeMatrix(threadData_t *threadData, modelica_metatype _expl, modelica_integer _n);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_makeMatrix(threadData_t *threadData, modelica_metatype _expl, modelica_metatype _n);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_makeMatrix,2,0) {(void*) boxptr_Expression_makeMatrix,0}};
#define boxvar_Expression_makeMatrix MMC_REFSTRUCTLIT(boxvar_lit_Expression_makeMatrix)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_insertSubScripts(threadData_t *threadData, modelica_metatype _templSubScript, modelica_metatype _value, modelica_metatype _lstIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_insertSubScripts,2,0) {(void*) boxptr_Expression_insertSubScripts,0}};
#define boxvar_Expression_insertSubScripts MMC_REFSTRUCTLIT(boxvar_lit_Expression_insertSubScripts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingextendArrExp(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inExpanded, modelica_boolean *out_outExpanded);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingextendArrExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inExpanded, modelica_metatype *out_outExpanded);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traversingextendArrExp,2,0) {(void*) boxptr_Expression_traversingextendArrExp,0}};
#define boxvar_Expression_traversingextendArrExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_traversingextendArrExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_fromAbsynOperator(threadData_t *threadData, modelica_metatype _aop, modelica_metatype _ty);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_fromAbsynOperator,2,0) {(void*) boxptr_Expression_fromAbsynOperator,0}};
#define boxvar_Expression_fromAbsynOperator MMC_REFSTRUCTLIT(boxvar_lit_Expression_fromAbsynOperator)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_fromAbsynExpOpt(threadData_t *threadData, modelica_metatype _aoe);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_fromAbsynExpOpt,2,0) {(void*) boxptr_Expression_fromAbsynExpOpt,0}};
#define boxvar_Expression_fromAbsynExpOpt MMC_REFSTRUCTLIT(boxvar_lit_Expression_fromAbsynExpOpt)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_hashOp(threadData_t *threadData, modelica_metatype _op);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_hashOp(threadData_t *threadData, modelica_metatype _op);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_hashOp,2,0) {(void*) boxptr_Expression_hashOp,0}};
#define boxvar_Expression_hashOp MMC_REFSTRUCTLIT(boxvar_lit_Expression_hashOp)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_hashReductionIter(threadData_t *threadData, modelica_metatype _iter);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_hashReductionIter(threadData_t *threadData, modelica_metatype _iter);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_hashReductionIter,2,0) {(void*) boxptr_Expression_hashReductionIter,0}};
#define boxvar_Expression_hashReductionIter MMC_REFSTRUCTLIT(boxvar_lit_Expression_hashReductionIter)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_hashReductionInfo(threadData_t *threadData, modelica_metatype _info);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_hashReductionInfo(threadData_t *threadData, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_hashReductionInfo,2,0) {(void*) boxptr_Expression_hashReductionInfo,0}};
#define boxvar_Expression_hashReductionInfo MMC_REFSTRUCTLIT(boxvar_lit_Expression_hashReductionInfo)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_promoteExp3(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_promoteExp3,2,0) {(void*) boxptr_Expression_promoteExp3,0}};
#define boxvar_Expression_promoteExp3 MMC_REFSTRUCTLIT(boxvar_lit_Expression_promoteExp3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_promoteExp2(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inIsArray, modelica_integer _inDims, modelica_metatype _inTypes);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_promoteExp2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inIsArray, modelica_metatype _inDims, modelica_metatype _inTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_promoteExp2,2,0) {(void*) boxptr_Expression_promoteExp2,0}};
#define boxvar_Expression_promoteExp2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_promoteExp2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makePromotedTypes(threadData_t *threadData, modelica_metatype _inDimensions, modelica_metatype _inElementType, modelica_metatype _inAccumTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_makePromotedTypes,2,0) {(void*) boxptr_Expression_makePromotedTypes,0}};
#define boxvar_Expression_makePromotedTypes MMC_REFSTRUCTLIT(boxvar_lit_Expression_makePromotedTypes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_splitRecord2(threadData_t *threadData, modelica_metatype _var, modelica_metatype _cr);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_splitRecord2,2,0) {(void*) boxptr_Expression_splitRecord2,0}};
#define boxvar_Expression_splitRecord2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_splitRecord2)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_priorityLBinop(threadData_t *threadData, modelica_metatype _inOp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_priorityLBinop(threadData_t *threadData, modelica_metatype _inOp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_priorityLBinop,2,0) {(void*) boxptr_Expression_priorityLBinop,0}};
#define boxvar_Expression_priorityLBinop MMC_REFSTRUCTLIT(boxvar_lit_Expression_priorityLBinop)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_priorityBinopRhs(threadData_t *threadData, modelica_metatype _inOp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_priorityBinopRhs(threadData_t *threadData, modelica_metatype _inOp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_priorityBinopRhs,2,0) {(void*) boxptr_Expression_priorityBinopRhs,0}};
#define boxvar_Expression_priorityBinopRhs MMC_REFSTRUCTLIT(boxvar_lit_Expression_priorityBinopRhs)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_priorityBinopLhs(threadData_t *threadData, modelica_metatype _inOp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_priorityBinopLhs(threadData_t *threadData, modelica_metatype _inOp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_priorityBinopLhs,2,0) {(void*) boxptr_Expression_priorityBinopLhs,0}};
#define boxvar_Expression_priorityBinopLhs MMC_REFSTRUCTLIT(boxvar_lit_Expression_priorityBinopLhs)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isNonAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isNonAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isNonAssociativeOp,2,0) {(void*) boxptr_Expression_isNonAssociativeOp,0}};
#define boxvar_Expression_isNonAssociativeOp MMC_REFSTRUCTLIT(boxvar_lit_Expression_isNonAssociativeOp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isNonAssociativeExp(threadData_t *threadData, modelica_metatype _exp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isNonAssociativeExp(threadData_t *threadData, modelica_metatype _exp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isNonAssociativeExp,2,0) {(void*) boxptr_Expression_isNonAssociativeExp,0}};
#define boxvar_Expression_isNonAssociativeExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_isNonAssociativeExp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isAssociativeOp,2,0) {(void*) boxptr_Expression_isAssociativeOp,0}};
#define boxvar_Expression_isAssociativeOp MMC_REFSTRUCTLIT(boxvar_lit_Expression_isAssociativeOp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isAssociativeExp(threadData_t *threadData, modelica_metatype _inExp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isAssociativeExp(threadData_t *threadData, modelica_metatype _inExp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isAssociativeExp,2,0) {(void*) boxptr_Expression_isAssociativeExp,0}};
#define boxvar_Expression_isAssociativeExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_isAssociativeExp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_shouldParenthesize2(threadData_t *threadData, modelica_integer _inPrioDiff, modelica_metatype _inOperand, modelica_boolean _inLhs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_shouldParenthesize2(threadData_t *threadData, modelica_metatype _inPrioDiff, modelica_metatype _inOperand, modelica_metatype _inLhs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_shouldParenthesize2,2,0) {(void*) boxptr_Expression_shouldParenthesize2,0}};
#define boxvar_Expression_shouldParenthesize2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_shouldParenthesize2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeEnumLiteral(threadData_t *threadData, modelica_metatype _name, modelica_integer _index, modelica_integer *out_newIndex);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_makeEnumLiteral(threadData_t *threadData, modelica_metatype _name, modelica_metatype _index, modelica_metatype *out_newIndex);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_makeEnumLiteral,2,0) {(void*) boxptr_Expression_makeEnumLiteral,0}};
#define boxvar_Expression_makeEnumLiteral MMC_REFSTRUCTLIT(boxvar_lit_Expression_makeEnumLiteral)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_opComplexity(threadData_t *threadData, modelica_metatype _op);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_opComplexity(threadData_t *threadData, modelica_metatype _op);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_opComplexity,2,0) {(void*) boxptr_Expression_opComplexity,0}};
#define boxvar_Expression_opComplexity MMC_REFSTRUCTLIT(boxvar_lit_Expression_opComplexity)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_tpComplexity(threadData_t *threadData, modelica_metatype _tp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_tpComplexity(threadData_t *threadData, modelica_metatype _tp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_tpComplexity,2,0) {(void*) boxptr_Expression_tpComplexity,0}};
#define boxvar_Expression_tpComplexity MMC_REFSTRUCTLIT(boxvar_lit_Expression_tpComplexity)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_complexityBuiltin(threadData_t *threadData, modelica_string _name, modelica_metatype _tp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_complexityBuiltin(threadData_t *threadData, modelica_metatype _name, modelica_metatype _tp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_complexityBuiltin,2,0) {(void*) boxptr_Expression_complexityBuiltin,0}};
#define boxvar_Expression_complexityBuiltin MMC_REFSTRUCTLIT(boxvar_lit_Expression_complexityBuiltin)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_complexityTraverse2(threadData_t *threadData, modelica_metatype _exp, modelica_integer _complexity_, modelica_integer *out_outComplexity);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_complexityTraverse2(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _complexity_, modelica_metatype *out_outComplexity);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_complexityTraverse2,2,0) {(void*) boxptr_Expression_complexityTraverse2,0}};
#define boxvar_Expression_complexityTraverse2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_complexityTraverse2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIterators(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fiters, modelica_fnptr _func, modelica_metatype __omcQ_24in_5Farg, modelica_metatype *out_arg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIterators,2,0) {(void*) boxptr_Expression_traverseReductionIterators,0}};
#define boxvar_Expression_traverseReductionIterators MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIterators)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIterator(threadData_t *threadData, modelica_metatype _iter, modelica_fnptr _func, modelica_metatype _iarg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIterator,2,0) {(void*) boxptr_Expression_traverseReductionIterator,0}};
#define boxvar_Expression_traverseReductionIterator MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIterator)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIteratorsTopDown(threadData_t *threadData, modelica_metatype _inIters, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIteratorsTopDown,2,0) {(void*) boxptr_Expression_traverseReductionIteratorsTopDown,0}};
#define boxvar_Expression_traverseReductionIteratorsTopDown MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIteratorsTopDown)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIteratorTopDown(threadData_t *threadData, modelica_metatype _iter, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIteratorTopDown,2,0) {(void*) boxptr_Expression_traverseReductionIteratorTopDown,0}};
#define boxvar_Expression_traverseReductionIteratorTopDown MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIteratorTopDown)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIteratorBidir(threadData_t *threadData, modelica_metatype _inIter, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIteratorBidir,2,0) {(void*) boxptr_Expression_traverseReductionIteratorBidir,0}};
#define boxvar_Expression_traverseReductionIteratorBidir MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseReductionIteratorBidir)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_subscriptContain2(threadData_t *threadData, modelica_integer _inInt, modelica_metatype _inExp2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_subscriptContain2(threadData_t *threadData, modelica_metatype _inInt, modelica_metatype _inExp2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_subscriptContain2,2,0) {(void*) boxptr_Expression_subscriptContain2,0}};
#define boxvar_Expression_subscriptContain2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_subscriptContain2)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_expStructuralEqualListLst(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expStructuralEqualListLst(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_expStructuralEqualListLst,2,0) {(void*) boxptr_Expression_expStructuralEqualListLst,0}};
#define boxvar_Expression_expStructuralEqualListLst MMC_REFSTRUCTLIT(boxvar_lit_Expression_expStructuralEqualListLst)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_compareListList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_compareListList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_compareListList,2,0) {(void*) boxptr_Expression_compareListList,0}};
#define boxvar_Expression_compareListList MMC_REFSTRUCTLIT(boxvar_lit_Expression_compareListList)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_compareList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_compareList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_compareList,2,0) {(void*) boxptr_Expression_compareList,0}};
#define boxvar_Expression_compareList MMC_REFSTRUCTLIT(boxvar_lit_Expression_compareList)
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_compareOpt(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_compareOpt(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_compareOpt,2,0) {(void*) boxptr_Expression_compareOpt,0}};
#define boxvar_Expression_compareOpt MMC_REFSTRUCTLIT(boxvar_lit_Expression_compareOpt)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_equalTypesComplexVars(threadData_t *threadData, modelica_metatype _inVars1, modelica_metatype _inVars2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_equalTypesComplexVars(threadData_t *threadData, modelica_metatype _inVars1, modelica_metatype _inVars2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_equalTypesComplexVars,2,0) {(void*) boxptr_Expression_equalTypesComplexVars,0}};
#define boxvar_Expression_equalTypesComplexVars MMC_REFSTRUCTLIT(boxvar_lit_Expression_equalTypesComplexVars)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstValueWorkListList(threadData_t *threadData, modelica_metatype _inExps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstValueWorkListList(threadData_t *threadData, modelica_metatype _inExps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isConstValueWorkListList,2,0) {(void*) boxptr_Expression_isConstValueWorkListList,0}};
#define boxvar_Expression_isConstValueWorkListList MMC_REFSTRUCTLIT(boxvar_lit_Expression_isConstValueWorkListList)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstValueWorkList(threadData_t *threadData, modelica_metatype _inExps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstValueWorkList(threadData_t *threadData, modelica_metatype _inExps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isConstValueWorkList,2,0) {(void*) boxptr_Expression_isConstValueWorkList,0}};
#define boxvar_Expression_isConstValueWorkList MMC_REFSTRUCTLIT(boxvar_lit_Expression_isConstValueWorkList)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstWorkListList(threadData_t *threadData, modelica_metatype _inExps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstWorkListList(threadData_t *threadData, modelica_metatype _inExps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isConstWorkListList,2,0) {(void*) boxptr_Expression_isConstWorkListList,0}};
#define boxvar_Expression_isConstWorkListList MMC_REFSTRUCTLIT(boxvar_lit_Expression_isConstWorkListList)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstValueWork(threadData_t *threadData, modelica_metatype _inExp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstValueWork(threadData_t *threadData, modelica_metatype _inExp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isConstValueWork,2,0) {(void*) boxptr_Expression_isConstValueWork,0}};
#define boxvar_Expression_isConstValueWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_isConstValueWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_containsRecordTypeWork(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inRec, modelica_boolean *out_cont, modelica_boolean *out_outRec);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_containsRecordTypeWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inRec, modelica_metatype *out_cont, modelica_metatype *out_outRec);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_containsRecordTypeWork,2,0) {(void*) boxptr_Expression_containsRecordTypeWork,0}};
#define boxvar_Expression_containsRecordTypeWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_containsRecordTypeWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_isImpureWork(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _isImpure, modelica_boolean *out_cont, modelica_boolean *out_outImpure);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isImpureWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _isImpure, modelica_metatype *out_cont, modelica_metatype *out_outImpure);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_isImpureWork,2,0) {(void*) boxptr_Expression_isImpureWork,0}};
#define boxvar_Expression_isImpureWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_isImpureWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTopDownSubs(threadData_t *threadData, modelica_metatype _inSubscript, modelica_fnptr _rel, modelica_metatype _iarg, modelica_metatype *out_arg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpTopDownSubs,2,0) {(void*) boxptr_Expression_traverseExpTopDownSubs,0}};
#define boxvar_Expression_traverseExpTopDownSubs MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpTopDownSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpBidirSubs(threadData_t *threadData, modelica_metatype _inSubscript, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpBidirSubs,2,0) {(void*) boxptr_Expression_traverseExpBidirSubs,0}};
#define boxvar_Expression_traverseExpBidirSubs MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpBidirSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpSubs(threadData_t *threadData, modelica_metatype _inSubscript, modelica_fnptr _rel, modelica_metatype _iarg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpSubs,2,0) {(void*) boxptr_Expression_traverseExpSubs,0}};
#define boxvar_Expression_traverseExpSubs MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpSubs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpBidirSubExps(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpBidirSubExps,2,0) {(void*) boxptr_Expression_traverseExpBidirSubExps,0}};
#define boxvar_Expression_traverseExpBidirSubExps MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpBidirSubExps)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingDivExpFinder(threadData_t *threadData, modelica_metatype _e, modelica_metatype _exps, modelica_metatype *out_acc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traversingDivExpFinder,2,0) {(void*) boxptr_Expression_traversingDivExpFinder,0}};
#define boxvar_Expression_traversingDivExpFinder MMC_REFSTRUCTLIT(boxvar_lit_Expression_traversingDivExpFinder)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingCrefFinder(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traversingCrefFinder,2,0) {(void*) boxptr_Expression_traversingCrefFinder,0}};
#define boxvar_Expression_traversingCrefFinder MMC_REFSTRUCTLIT(boxvar_lit_Expression_traversingCrefFinder)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expHasCrefInSmoothZeroWork(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype __omcQ_24in_5Ftpl, modelica_metatype *out_tpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_expHasCrefInSmoothZeroWork,2,0) {(void*) boxptr_Expression_expHasCrefInSmoothZeroWork,0}};
#define boxvar_Expression_expHasCrefInSmoothZeroWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_expHasCrefInSmoothZeroWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingexpHasCrefNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingexpHasCrefNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traversingexpHasCrefNoPreOrStart,2,0) {(void*) boxptr_Expression_traversingexpHasCrefNoPreOrStart,0}};
#define boxvar_Expression_traversingexpHasCrefNoPreOrStart MMC_REFSTRUCTLIT(boxvar_lit_Expression_traversingexpHasCrefNoPreOrStart)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingexpHasPrevious(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inHasIt, modelica_boolean *out_cont, modelica_boolean *out_outHasIt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingexpHasPrevious(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHasIt, modelica_metatype *out_cont, modelica_metatype *out_outHasIt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traversingexpHasPrevious,2,0) {(void*) boxptr_Expression_traversingexpHasPrevious,0}};
#define boxvar_Expression_traversingexpHasPrevious MMC_REFSTRUCTLIT(boxvar_lit_Expression_traversingexpHasPrevious)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingexpHasPre(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inHasIt, modelica_boolean *out_cont, modelica_boolean *out_outHasIt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingexpHasPre(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHasIt, modelica_metatype *out_cont, modelica_metatype *out_outHasIt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traversingexpHasPre,2,0) {(void*) boxptr_Expression_traversingexpHasPre,0}};
#define boxvar_Expression_traversingexpHasPre MMC_REFSTRUCTLIT(boxvar_lit_Expression_traversingexpHasPre)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getLhsCrefsFromStatement(threadData_t *threadData, modelica_metatype _inStmt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_getLhsCrefsFromStatement,2,0) {(void*) boxptr_Expression_getLhsCrefsFromStatement,0}};
#define boxvar_Expression_getLhsCrefsFromStatement MMC_REFSTRUCTLIT(boxvar_lit_Expression_getLhsCrefsFromStatement)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTypeDims2(threadData_t *threadData, modelica_metatype _inDims, modelica_fnptr _inFunc, modelica_metatype _inArg, modelica_metatype *out_outArg, modelica_boolean *out_outChanged);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traverseExpTypeDims2(threadData_t *threadData, modelica_metatype _inDims, modelica_fnptr _inFunc, modelica_metatype _inArg, modelica_metatype *out_outArg, modelica_metatype *out_outChanged);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpTypeDims2,2,0) {(void*) boxptr_Expression_traverseExpTypeDims2,0}};
#define boxvar_Expression_traverseExpTypeDims2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpTypeDims2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpMatrixTopDown(threadData_t *threadData, modelica_metatype _inMatrix, modelica_fnptr _func, modelica_metatype _inTypeA, modelica_metatype *out_outTypeA);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpMatrixTopDown,2,0) {(void*) boxptr_Expression_traverseExpMatrixTopDown,0}};
#define boxvar_Expression_traverseExpMatrixTopDown MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpMatrixTopDown)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTopDown1(threadData_t *threadData, modelica_boolean _cont, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traverseExpTopDown1(threadData_t *threadData, modelica_metatype _cont, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpTopDown1,2,0) {(void*) boxptr_Expression_traverseExpTopDown1,0}};
#define boxvar_Expression_traverseExpTopDown1 MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpTopDown1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTopDownClockHelper(threadData_t *threadData, modelica_metatype _inClk, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpTopDownClockHelper,2,0) {(void*) boxptr_Expression_traverseExpTopDownClockHelper,0}};
#define boxvar_Expression_traverseExpTopDownClockHelper MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpTopDownClockHelper)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpClk(threadData_t *threadData, modelica_metatype _inClk, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpClk,2,0) {(void*) boxptr_Expression_traverseExpClk,0}};
#define boxvar_Expression_traverseExpClk MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpClk)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpMatrix(threadData_t *threadData, modelica_metatype _inMatrix, modelica_fnptr _func, modelica_metatype _inTypeA, modelica_metatype *out_outTypeA);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_traverseExpMatrix,2,0) {(void*) boxptr_Expression_traverseExpMatrix,0}};
#define boxvar_Expression_traverseExpMatrix MMC_REFSTRUCTLIT(boxvar_lit_Expression_traverseExpMatrix)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_replaceExpWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_otpl);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_replaceExpWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_otpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_replaceExpWork,2,0) {(void*) boxptr_Expression_replaceExpWork,0}};
#define boxvar_Expression_replaceExpWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_replaceExpWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_arrayFill2(threadData_t *threadData, modelica_metatype _iDims, modelica_metatype _inExp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_arrayFill2,2,0) {(void*) boxptr_Expression_arrayFill2,0}};
#define boxvar_Expression_arrayFill2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_arrayFill2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_listToArray3(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _iDim);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_listToArray3,2,0) {(void*) boxptr_Expression_listToArray3,0}};
#define boxvar_Expression_listToArray3 MMC_REFSTRUCTLIT(boxvar_lit_Expression_listToArray3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_listToArray2(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _iDims, modelica_metatype _inType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_listToArray2,2,0) {(void*) boxptr_Expression_listToArray2,0}};
#define boxvar_Expression_listToArray2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_listToArray2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_checkIfOther(threadData_t *threadData, modelica_metatype _inTp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_checkIfOther,2,0) {(void*) boxptr_Expression_checkIfOther,0}};
#define boxvar_Expression_checkIfOther MMC_REFSTRUCTLIT(boxvar_lit_Expression_checkIfOther)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeSumWork(threadData_t *threadData, modelica_metatype _inExpLst, modelica_boolean _simplify);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_makeSumWork(threadData_t *threadData, modelica_metatype _inExpLst, modelica_metatype _simplify);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_makeSumWork,2,0) {(void*) boxptr_Expression_makeSumWork,0}};
#define boxvar_Expression_makeSumWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_makeSumWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expandFactorsWork2(threadData_t *threadData, modelica_metatype _inAcc, modelica_boolean _doInverseFactors);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expandFactorsWork2(threadData_t *threadData, modelica_metatype _inAcc, modelica_metatype _doInverseFactors);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_expandFactorsWork2,2,0) {(void*) boxptr_Expression_expandFactorsWork2,0}};
#define boxvar_Expression_expandFactorsWork2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_expandFactorsWork2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expandFactorsWork3(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_boolean _doInverseFactors);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expandFactorsWork3(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_metatype _doInverseFactors);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_expandFactorsWork3,2,0) {(void*) boxptr_Expression_expandFactorsWork3,0}};
#define boxvar_Expression_expandFactorsWork3 MMC_REFSTRUCTLIT(boxvar_lit_Expression_expandFactorsWork3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expandFactorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_boolean _doInverseFactors);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expandFactorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_metatype _doInverseFactors);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_expandFactorsWork,2,0) {(void*) boxptr_Expression_expandFactorsWork,0}};
#define boxvar_Expression_expandFactorsWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_expandFactorsWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_factorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_boolean _doInverseFactors);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_factorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_metatype _doInverseFactors);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_factorsWork,2,0) {(void*) boxptr_Expression_factorsWork,0}};
#define boxvar_Expression_factorsWork MMC_REFSTRUCTLIT(boxvar_lit_Expression_factorsWork)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_terms2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inAcc, modelica_boolean _neg);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_terms2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inAcc, modelica_metatype _neg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_terms2,2,0) {(void*) boxptr_Expression_terms2,0}};
#define boxvar_Expression_terms2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_terms2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getAllCrefsExpanded2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefList, modelica_metatype *out_outCrefList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_getAllCrefsExpanded2,2,0) {(void*) boxptr_Expression_getAllCrefsExpanded2,0}};
#define boxvar_Expression_getAllCrefsExpanded2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_getAllCrefsExpanded2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getAllCrefs2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefList, modelica_metatype *out_outCrefList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_getAllCrefs2,2,0) {(void*) boxptr_Expression_getAllCrefs2,0}};
#define boxvar_Expression_getAllCrefs2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_getAllCrefs2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_typeofRelation(threadData_t *threadData, modelica_metatype _inType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_typeofRelation,2,0) {(void*) boxptr_Expression_typeofRelation,0}};
#define boxvar_Expression_typeofRelation MMC_REFSTRUCTLIT(boxvar_lit_Expression_typeofRelation)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getComplexContentsInCall(threadData_t *threadData, modelica_metatype _expIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_getComplexContentsInCall,2,0) {(void*) boxptr_Expression_getComplexContentsInCall,0}};
#define boxvar_Expression_getComplexContentsInCall MMC_REFSTRUCTLIT(boxvar_lit_Expression_getComplexContentsInCall)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeASUBsForDimension(threadData_t *threadData, modelica_metatype _eIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_makeASUBsForDimension,2,0) {(void*) boxptr_Expression_makeASUBsForDimension,0}};
#define boxvar_Expression_makeASUBsForDimension MMC_REFSTRUCTLIT(boxvar_lit_Expression_makeASUBsForDimension)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeScalarOpFromArrayOp(threadData_t *threadData, modelica_metatype _inOperator, modelica_metatype _inType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_makeScalarOpFromArrayOp,2,0) {(void*) boxptr_Expression_makeScalarOpFromArrayOp,0}};
#define boxvar_Expression_makeScalarOpFromArrayOp MMC_REFSTRUCTLIT(boxvar_lit_Expression_makeScalarOpFromArrayOp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unliftOperator2(threadData_t *threadData, modelica_metatype _inOperator, modelica_metatype _inType);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_unliftOperator2,2,0) {(void*) boxptr_Expression_unliftOperator2,0}};
#define boxvar_Expression_unliftOperator2 MMC_REFSTRUCTLIT(boxvar_lit_Expression_unliftOperator2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_addNoEventToEventTriggeringFunctionsExp(threadData_t *threadData, modelica_metatype _e);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_addNoEventToEventTriggeringFunctionsExp,2,0) {(void*) boxptr_Expression_addNoEventToEventTriggeringFunctionsExp,0}};
#define boxvar_Expression_addNoEventToEventTriggeringFunctionsExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_addNoEventToEventTriggeringFunctionsExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_addNoEventToRelationandCondExp(threadData_t *threadData, modelica_metatype _e);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_addNoEventToRelationandCondExp,2,0) {(void*) boxptr_Expression_addNoEventToRelationandCondExp,0}};
#define boxvar_Expression_addNoEventToRelationandCondExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_addNoEventToRelationandCondExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_addNoEventToRelationExp(threadData_t *threadData, modelica_metatype _e);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_addNoEventToRelationExp,2,0) {(void*) boxptr_Expression_addNoEventToRelationExp,0}};
#define boxvar_Expression_addNoEventToRelationExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_addNoEventToRelationExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_stripNoEventExp(threadData_t *threadData, modelica_metatype _e);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_stripNoEventExp,2,0) {(void*) boxptr_Expression_stripNoEventExp,0}};
#define boxvar_Expression_stripNoEventExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_stripNoEventExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unelabOperator(threadData_t *threadData, modelica_metatype _op);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_unelabOperator,2,0) {(void*) boxptr_Expression_unelabOperator,0}};
#define boxvar_Expression_unelabOperator MMC_REFSTRUCTLIT(boxvar_lit_Expression_unelabOperator)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unelabReductionIterator(threadData_t *threadData, modelica_metatype _riter);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_unelabReductionIterator,2,0) {(void*) boxptr_Expression_unelabReductionIterator,0}};
#define boxvar_Expression_unelabReductionIterator MMC_REFSTRUCTLIT(boxvar_lit_Expression_unelabReductionIterator)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unelabDimensionToFillExp(threadData_t *threadData, modelica_metatype _inDim);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_unelabDimensionToFillExp,2,0) {(void*) boxptr_Expression_unelabDimensionToFillExp,0}};
#define boxvar_Expression_unelabDimensionToFillExp MMC_REFSTRUCTLIT(boxvar_lit_Expression_unelabDimensionToFillExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unleabZeroExpFromType(threadData_t *threadData, modelica_metatype _ty);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Expression_unleabZeroExpFromType,2,0) {(void*) boxptr_Expression_unleabZeroExpFromType,0}};
#define boxvar_Expression_unleabZeroExpFromType MMC_REFSTRUCTLIT(boxvar_lit_Expression_unleabZeroExpFromType)
DLLExport
modelica_metatype omc_Expression_arrayFirstScalar(threadData_t *threadData, modelica_metatype _exp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
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,16,3) == 0) goto tmp3_end;
_exp = listHead((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exp), 4))));
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _exp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_consToListIgnoreSharedLiteralWork(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_metatype _acc)
{
modelica_metatype _e = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_e = __omcQ_24in_5Fe;
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _e;
tmp4_2 = _acc;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,36,2) == 0) goto tmp3_end;
__omcQ_24in_5Fe = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 3)));
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta1 = _e;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta6 = mmc_mk_box2(31, &DAE_Exp_LIST__desc, omc_List_append__reverse(threadData, _acc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 2)))));
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmpMeta7 = mmc_mk_cons((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 2))), _acc);
__omcQ_24in_5Fe = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 3)));
_acc = tmpMeta7;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_e = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _e;
}
DLLExport
modelica_metatype omc_Expression_consToListIgnoreSharedLiteral(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe)
{
modelica_metatype _e = NULL;
modelica_metatype _exp = NULL;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_e = __omcQ_24in_5Fe;
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 39: {
tmp1 = 1;
goto tmp3_done;
}
case 31: {
tmp1 = 1;
goto tmp3_done;
}
case 32: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
if(tmp1)
{
{
{
volatile mmc_switch_type tmp7;
int tmp8;
tmp7 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp6_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp7 < 2; tmp7++) {
switch (MMC_SWITCH_CAST(tmp7)) {
case 0: {
modelica_metatype tmpMeta9;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_e = omc_Expression_consToListIgnoreSharedLiteralWork(threadData, _e, tmpMeta9);
goto tmp6_done;
}
case 1: {
goto tmp6_done;
}
}
goto tmp6_end;
tmp6_end: ;
}
goto goto_5;
tmp6_done:
(void)tmp7;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp6_done2;
goto_5:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp7 < 2) {
goto tmp6_top;
}
MMC_THROW_INTERNAL();
tmp6_done2:;
}
}
;
}
_return: OMC_LABEL_UNUSED
return _e;
}
DLLExport
modelica_boolean omc_Expression_isSimpleLiteralValue(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 8: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isSimpleLiteralValue(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isSimpleLiteralValue(threadData, _exp);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_metatype omc_Expression_tupleHead(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _prop, modelica_metatype *out_outProp)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outProp = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _exp;
tmp4_2 = _prop;
{
modelica_metatype _ty = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (listEmpty(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmpMeta6);
tmpMeta8 = MMC_CDR(tmpMeta6);
tmpMeta[0+0] = listHead((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exp), 2))));
tmpMeta[0+1] = omc_Types_propTupleFirstProp(threadData, _prop);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,14,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmpMeta10);
tmpMeta12 = MMC_CDR(tmpMeta10);
_ty = tmpMeta11;
tmpMeta13 = mmc_mk_box4(25, &DAE_Exp_TSUB__desc, _exp, mmc_mk_integer(((modelica_integer) 1)), _ty);
tmpMeta[0+0] = tmpMeta13;
tmpMeta[0+1] = omc_Types_propTupleFirstProp(threadData, _prop);
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _prop;
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];
_outProp = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outProp) { *out_outProp = _outProp; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_findCallIsInlineAfterIndexReduction(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_boolean __omcQ_24in_5Fres, modelica_boolean *out_cont, modelica_boolean *out_res)
{
modelica_metatype _e = NULL;
modelica_boolean _cont;
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_e = __omcQ_24in_5Fe;
_res = __omcQ_24in_5Fres;
if((!_res))
{
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,5,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
}
_cont = (!_res);
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_res) { *out_res = _res; }
return _e;
}
modelica_metatype boxptr_Expression_findCallIsInlineAfterIndexReduction(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_metatype __omcQ_24in_5Fres, modelica_metatype *out_cont, modelica_metatype *out_res)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _res;
modelica_metatype _e = NULL;
tmp1 = mmc_unbox_integer(__omcQ_24in_5Fres);
_e = omc_Expression_findCallIsInlineAfterIndexReduction(threadData, __omcQ_24in_5Fe, tmp1, &_cont, &_res);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_res) { *out_res = mmc_mk_icon(_res); }
return _e;
}
DLLExport
modelica_metatype omc_Expression_isInvariantExpNoTraverse(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_boolean __omcQ_24in_5Fb, modelica_boolean *out_b)
{
modelica_metatype _e = NULL;
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_e = __omcQ_24in_5Fe;
_b = __omcQ_24in_5Fb;
if((!_b))
{
goto _return;
}
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 19; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 7: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 8: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 9: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 10: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,2,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 13: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 14: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 15: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 16: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 17: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 18: {
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
if (out_b) { *out_b = _b; }
return _e;
}
modelica_metatype boxptr_Expression_isInvariantExpNoTraverse(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_metatype __omcQ_24in_5Fb, modelica_metatype *out_b)
{
modelica_integer tmp1;
modelica_boolean _b;
modelica_metatype _e = NULL;
tmp1 = mmc_unbox_integer(__omcQ_24in_5Fb);
_e = omc_Expression_isInvariantExpNoTraverse(threadData, __omcQ_24in_5Fe, tmp1, &_b);
if (out_b) { *out_b = mmc_mk_icon(_b); }
return _e;
}
DLLExport
modelica_integer omc_Expression_compareSubscripts(threadData_t *threadData, modelica_metatype _sub1, modelica_metatype _sub2)
{
modelica_integer _res;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
if(referenceEq(_sub1, _sub2))
{
_res = ((modelica_integer) 0);
}
else
{
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _sub1;
tmp4_2 = _sub2;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,0) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmp1 = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub1), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub2), 2))));
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmp1 = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub1), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub2), 2))));
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmp1 = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub1), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub2), 2))));
goto tmp3_done;
}
case 4: {
tmp1 = omc_Util_intCompare(threadData, valueConstructor(_sub1), valueConstructor(_sub2));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
}
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_compareSubscripts(threadData_t *threadData, modelica_metatype _sub1, modelica_metatype _sub2)
{
modelica_integer _res;
modelica_metatype out_res;
_res = omc_Expression_compareSubscripts(threadData, _sub1, _sub2);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_integer omc_Expression_compare(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_integer _comp;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
if(referenceEq(_inExp1, _inExp2))
{
_comp = ((modelica_integer) 0);
goto _return;
}
_comp = omc_Util_intCompare(threadData, valueConstructor(_inExp1), valueConstructor(_inExp2));
if((_comp != ((modelica_integer) 0)))
{
goto _return;
}
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp1;
{
modelica_integer _i;
modelica_real _r;
modelica_string _s = NULL;
modelica_boolean _b;
modelica_metatype _p = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _oe = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _mexpl = NULL;
modelica_metatype _op = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _ty = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_integer tmp7;
tmpMeta5 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,0,1) == 0) goto goto_2;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmp1 = omc_Util_intCompare(threadData, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)))), _i);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_real tmp10;
tmpMeta8 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmp10 = mmc_unbox_real(tmpMeta9);
_r = tmp10;
tmp1 = omc_Util_realCompare(threadData, mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)))), _r);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
tmpMeta11 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,2,1) == 0) goto goto_2;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_s = tmpMeta12;
tmp1 = stringCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _s);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_integer tmp15;
tmpMeta13 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,3,1) == 0) goto goto_2;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmp15 = mmc_unbox_integer(tmpMeta14);
_b = tmp15;
tmp1 = omc_Util_boolCompare(threadData, mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)))), _b);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
tmpMeta16 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,5,2) == 0) goto goto_2;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
_p = tmpMeta17;
tmp1 = omc_AbsynUtil_pathCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _p);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
tmpMeta18 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,6,2) == 0) goto goto_2;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
_cr = tmpMeta19;
tmp1 = omc_ComponentReference_crefCompareGeneric(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _cr);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
tmpMeta20 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,16,3) == 0) goto goto_2;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 4));
_ty = tmpMeta21;
_expl = tmpMeta22;
_comp = valueCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _ty);
tmp1 = ((((modelica_integer) 0) == _comp)?omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4))), _expl):_comp);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
tmpMeta23 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,17,3) == 0) goto goto_2;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 4));
_ty = tmpMeta24;
_mexpl = tmpMeta25;
_comp = valueCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _ty);
tmp1 = ((((modelica_integer) 0) == _comp)?omc_Expression_compareListList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4))), _mexpl):_comp);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_boolean tmp30;
modelica_integer tmp31;
tmpMeta26 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,7,3) == 0) goto goto_2;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 3));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 4));
_e1 = tmpMeta27;
_op = tmpMeta28;
_e2 = tmpMeta29;
_comp = omc_Expression_operatorCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _op);
_comp = ((((modelica_integer) 0) == _comp)?omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e1):_comp);
tmp30 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp30)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4)));
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp31 = _comp;
}
tmp1 = tmp31;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_boolean tmp36;
modelica_integer tmp37;
tmpMeta32 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,9,3) == 0) goto goto_2;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 2));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 3));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 4));
_e1 = tmpMeta33;
_op = tmpMeta34;
_e2 = tmpMeta35;
_comp = omc_Expression_operatorCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _op);
_comp = ((((modelica_integer) 0) == _comp)?omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e1):_comp);
tmp36 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp36)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4)));
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp37 = _comp;
}
tmp1 = tmp37;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_boolean tmp41;
modelica_integer tmp42;
tmpMeta38 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,8,2) == 0) goto goto_2;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 3));
_op = tmpMeta39;
_e = tmpMeta40;
_comp = omc_Expression_operatorCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _op);
tmp41 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp41)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3)));
_inExp2 = _e;
goto _tailrecursive;
}
else
{
tmp42 = _comp;
}
tmp1 = tmp42;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_boolean tmp46;
modelica_integer tmp47;
tmpMeta43 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,10,2) == 0) goto goto_2;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 2));
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 3));
_op = tmpMeta44;
_e = tmpMeta45;
_comp = omc_Expression_operatorCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _op);
tmp46 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp46)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3)));
_inExp2 = _e;
goto _tailrecursive;
}
else
{
tmp47 = _comp;
}
tmp1 = tmp47;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_boolean tmp52;
modelica_integer tmp53;
tmpMeta48 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta48,11,5) == 0) goto goto_2;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 2));
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 3));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 4));
_e1 = tmpMeta49;
_op = tmpMeta50;
_e2 = tmpMeta51;
_comp = omc_Expression_operatorCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _op);
_comp = ((((modelica_integer) 0) == _comp)?omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e1):_comp);
tmp52 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp52)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4)));
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp53 = _comp;
}
tmp1 = tmp53;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_boolean tmp58;
modelica_integer tmp59;
tmpMeta54 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta54,12,3) == 0) goto goto_2;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 2));
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 3));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 4));
_e = tmpMeta55;
_e1 = tmpMeta56;
_e2 = tmpMeta57;
_comp = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e);
_comp = ((((modelica_integer) 0) == _comp)?omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _e1):_comp);
tmp58 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp58)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4)));
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp59 = _comp;
}
tmp1 = tmp59;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
tmpMeta60 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta60,13,3) == 0) goto goto_2;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 2));
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 3));
_p = tmpMeta61;
_expl = tmpMeta62;
_comp = omc_AbsynUtil_pathCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _p);
tmp1 = ((((modelica_integer) 0) == _comp)?omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _expl):_comp);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
tmpMeta63 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta63,14,4) == 0) goto goto_2;
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta63), 2));
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta63), 3));
_p = tmpMeta64;
_expl = tmpMeta65;
_comp = omc_AbsynUtil_pathCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _p);
tmp1 = ((((modelica_integer) 0) == _comp)?omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _expl):_comp);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
tmpMeta66 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta66,15,4) == 0) goto goto_2;
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta66), 2));
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta66), 3));
_p = tmpMeta67;
_expl = tmpMeta68;
_comp = omc_AbsynUtil_pathCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _p);
tmp1 = ((((modelica_integer) 0) == _comp)?omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _expl):_comp);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
tmpMeta69 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta69,18,4) == 0) goto goto_2;
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta69), 3));
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta69), 4));
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta69), 5));
_e1 = tmpMeta70;
_oe = tmpMeta71;
_e2 = tmpMeta72;
_comp = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _e1);
_comp = ((((modelica_integer) 0) == _comp)?omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 5))), _e2):_comp);
tmp1 = ((((modelica_integer) 0) == _comp)?omc_Expression_compareOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4))), _oe):_comp);
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta73;
modelica_metatype tmpMeta74;
tmpMeta73 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta73,19,1) == 0) goto goto_2;
tmpMeta74 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta73), 2));
_expl = tmpMeta74;
tmp1 = omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _expl);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_boolean tmp78;
modelica_integer tmp79;
tmpMeta75 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta75,20,2) == 0) goto goto_2;
tmpMeta76 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta75), 2));
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta75), 3));
_ty = tmpMeta76;
_e = tmpMeta77;
_comp = valueCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _ty);
tmp78 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp78)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3)));
_inExp2 = _e;
goto _tailrecursive;
}
else
{
tmp79 = _comp;
}
tmp1 = tmp79;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta80;
modelica_metatype tmpMeta81;
modelica_metatype tmpMeta82;
tmpMeta80 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta80,21,2) == 0) goto goto_2;
tmpMeta81 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta80), 2));
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta80), 3));
_e = tmpMeta81;
_expl = tmpMeta82;
_comp = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e);
tmp1 = ((_comp == ((modelica_integer) 0))?omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _expl):_comp);
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_integer tmp86;
modelica_metatype tmpMeta87;
modelica_metatype tmpMeta88;
modelica_boolean tmp89;
modelica_integer tmp90;
tmpMeta83 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta83,23,4) == 0) goto goto_2;
tmpMeta84 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta83), 2));
tmpMeta85 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta83), 3));
tmp86 = mmc_unbox_integer(tmpMeta85);
tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta83), 4));
tmpMeta88 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta83), 5));
_e = tmpMeta84;
_i = tmp86;
_s = tmpMeta87;
_ty = tmpMeta88;
_comp = omc_Util_intCompare(threadData, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3)))), _i);
_comp = ((_comp == ((modelica_integer) 0))?valueCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 5))), _ty):_comp);
_comp = ((_comp == ((modelica_integer) 0))?stringCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4))), _s):_comp);
tmp89 = (modelica_boolean)(_comp == ((modelica_integer) 0));
if(tmp89)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)));
_inExp2 = _e;
goto _tailrecursive;
}
else
{
tmp90 = _comp;
}
tmp1 = tmp90;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
modelica_metatype tmpMeta93;
modelica_integer tmp94;
modelica_metatype tmpMeta95;
modelica_boolean tmp96;
modelica_integer tmp97;
tmpMeta91 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta91,22,3) == 0) goto goto_2;
tmpMeta92 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta91), 2));
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta91), 3));
tmp94 = mmc_unbox_integer(tmpMeta93);
tmpMeta95 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta91), 4));
_e = tmpMeta92;
_i = tmp94;
_ty = tmpMeta95;
_comp = omc_Util_intCompare(threadData, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3)))), _i);
_comp = ((((modelica_integer) 0) == _comp)?valueCompare((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 4))), _ty):_comp);
tmp96 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp96)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)));
_inExp2 = _e;
goto _tailrecursive;
}
else
{
tmp97 = _comp;
}
tmp1 = tmp97;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_metatype tmpMeta100;
tmpMeta98 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta98,24,2) == 0) goto goto_2;
tmpMeta99 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta98), 2));
tmpMeta100 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta98), 3));
_e = tmpMeta99;
_oe = tmpMeta100;
_comp = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e);
tmp1 = ((_comp == ((modelica_integer) 0))?omc_Expression_compareOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _oe):_comp);
goto tmp3_done;
}
case 30: {
tmp1 = valueCompare(_inExp1, _inExp2);
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta101;
modelica_metatype tmpMeta102;
tmpMeta101 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta101,28,1) == 0) goto goto_2;
tmpMeta102 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta101), 2));
_expl = tmpMeta102;
tmp1 = omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _expl);
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta103;
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
modelica_boolean tmp106;
modelica_integer tmp107;
tmpMeta103 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta103,29,2) == 0) goto goto_2;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta103), 2));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta103), 3));
_e1 = tmpMeta104;
_e2 = tmpMeta105;
_comp = omc_Expression_compare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _e1);
tmp106 = (modelica_boolean)(((modelica_integer) 0) == _comp);
if(tmp106)
{
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3)));
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp107 = _comp;
}
tmp1 = tmp107;
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta108;
modelica_metatype tmpMeta109;
tmpMeta108 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta108,30,1) == 0) goto goto_2;
tmpMeta109 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta108), 2));
_expl = tmpMeta109;
tmp1 = omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _expl);
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta110;
modelica_metatype tmpMeta111;
tmpMeta110 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta110,31,1) == 0) goto goto_2;
tmpMeta111 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta110), 2));
_oe = tmpMeta111;
tmp1 = omc_Expression_compareOpt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _oe);
goto tmp3_done;
}
case 35: {
modelica_metatype tmpMeta112;
modelica_metatype tmpMeta113;
modelica_metatype tmpMeta114;
tmpMeta112 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta112,32,5) == 0) goto goto_2;
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta112), 2));
tmpMeta114 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta112), 3));
_p = tmpMeta113;
_expl = tmpMeta114;
_comp = omc_AbsynUtil_pathCompare(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2))), _p);
tmp1 = ((_comp == ((modelica_integer) 0))?omc_Expression_compareList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _expl):_comp);
goto tmp3_done;
}
case 36: {
tmp1 = valueCompare(_inExp1, _inExp2);
goto tmp3_done;
}
case 37: {
modelica_metatype tmpMeta115;
modelica_metatype tmpMeta116;
tmpMeta115 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta115,34,1) == 0) goto goto_2;
tmpMeta116 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta115), 2));
_e = tmpMeta116;
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)));
_inExp2 = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 38: {
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
tmpMeta117 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta117,35,2) == 0) goto goto_2;
tmpMeta118 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta117), 2));
_e = tmpMeta118;
_inExp1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)));
_inExp2 = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 39: {
modelica_metatype tmpMeta119;
modelica_metatype tmpMeta120;
modelica_integer tmp121;
tmpMeta119 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta119,36,2) == 0) goto goto_2;
tmpMeta120 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta119), 2));
tmp121 = mmc_unbox_integer(tmpMeta120);
_i = tmp121;
tmp1 = omc_Util_intCompare(threadData, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 2)))), _i);
goto tmp3_done;
}
case 29: {
modelica_metatype tmpMeta122;
modelica_metatype tmpMeta123;
tmpMeta122 = _inExp2;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta122,26,4) == 0) goto goto_2;
tmpMeta123 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta122), 3));
_cr = tmpMeta123;
tmp1 = omc_ComponentReference_crefCompareGeneric(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp1), 3))), _cr);
goto tmp3_done;
}
case 28: {
tmp1 = valueCompare(_inExp1, _inExp2);
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_string tmp124;
modelica_metatype tmpMeta125;
modelica_metatype tmpMeta126;
modelica_metatype tmpMeta127;
modelica_metatype tmpMeta128;
modelica_metatype tmpMeta129;
tmp124 = modelica_integer_to_modelica_string(valueConstructor(_inExp1), ((modelica_integer) 0), 1);
tmpMeta125 = stringAppend(_OMC_LIT0,tmp124);
tmpMeta126 = stringAppend(tmpMeta125,_OMC_LIT1);
tmpMeta127 = stringAppend(tmpMeta126,omc_ExpressionDump_printExpStr(threadData, _inExp1));
tmpMeta128 = stringAppend(tmpMeta127,_OMC_LIT1);
tmpMeta129 = stringAppend(tmpMeta128,omc_ExpressionDump_printExpStr(threadData, _inExp2));
omc_Error_addInternalError(threadData, tmpMeta129, _OMC_LIT3);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_comp = tmp1;
_return: OMC_LABEL_UNUSED
return _comp;
}
modelica_metatype boxptr_Expression_compare(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_integer _comp;
modelica_metatype out_comp;
_comp = omc_Expression_compare(threadData, _inExp1, _inExp2);
out_comp = mmc_mk_icon(_comp);
return out_comp;
}
DLLExport
modelica_integer omc_Expression_rangeSize(threadData_t *threadData, modelica_metatype _inRange)
{
modelica_integer _outSize;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inRange;
{
modelica_integer _start;
modelica_integer _step;
modelica_integer _stop;
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_integer tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmp11 = mmc_unbox_integer(tmpMeta10);
if (!listEmpty(tmpMeta9)) goto tmp3_end;
_outSize = tmp11;
tmp1 = _outSize;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta15)) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,0,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmp18 = mmc_unbox_integer(tmpMeta17);
_start = tmp14;
_stop = tmp18;
tmp1 = modelica_integer_max((modelica_integer)(_stop - _start),(modelica_integer)(((modelica_integer) 0)));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_integer tmp25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_integer tmp28;
modelica_real tmp29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp21 = mmc_unbox_integer(tmpMeta20);
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta22)) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,0,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
tmp25 = mmc_unbox_integer(tmpMeta24);
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,0,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
tmp28 = mmc_unbox_integer(tmpMeta27);
_start = tmp21;
_step = tmp25;
_stop = tmp28;
if((_step != ((modelica_integer) 0)))
{
tmp29 = ((modelica_real)_step);
if (tmp29 == 0) {goto goto_2;}
_outSize = modelica_integer_max((modelica_integer)(((modelica_integer) 1) + ((modelica_integer)floor(floor((((modelica_real)_stop - _start)) / tmp29)))),(modelica_integer)(((modelica_integer) 0)));
}
else
{
goto goto_2;
}
tmp1 = _outSize;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSize = tmp1;
_return: OMC_LABEL_UNUSED
return _outSize;
}
modelica_metatype boxptr_Expression_rangeSize(threadData_t *threadData, modelica_metatype _inRange)
{
modelica_integer _outSize;
modelica_metatype out_outSize;
_outSize = omc_Expression_rangeSize(threadData, _inRange);
out_outSize = mmc_mk_icon(_outSize);
return out_outSize;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_containsCallTo__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_outContinue, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _outContinue;
modelica_metatype _outTpl = NULL;
modelica_boolean _containsCall;
modelica_metatype _path = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_integer tmp4;
modelica_boolean tmp5 = 0;
modelica_metatype tmpMeta10;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
_outContinue = 0;
_outTpl = _inTpl;
tmpMeta1 = _outTpl;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp4 = mmc_unbox_integer(tmpMeta3);
_path = tmpMeta2;
_containsCall = tmp4;
if(_containsCall)
{
goto _return;
}
{
modelica_metatype tmp8_1;
tmp8_1 = _inExp;
{
volatile mmc_switch_type tmp8;
int tmp9;
tmp8 = 0;
for (; tmp8 < 2; tmp8++) {
switch (MMC_SWITCH_CAST(tmp8)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,13,3) == 0) goto tmp7_end;
tmp5 = omc_AbsynUtil_pathEqual(threadData, _path, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))));
goto tmp7_done;
}
case 1: {
tmp5 = 1;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
goto_6:;
MMC_THROW_INTERNAL();
goto tmp7_done;
tmp7_done:;
}
}
_outContinue = tmp5;
if((!_outContinue))
{
tmpMeta10 = mmc_mk_box2(0, _path, mmc_mk_boolean(0));
_outTpl = tmpMeta10;
}
_return: OMC_LABEL_UNUSED
if (out_outContinue) { *out_outContinue = _outContinue; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_containsCallTo__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outContinue, modelica_metatype *out_outTpl)
{
modelica_boolean _outContinue;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_containsCallTo__traverser(threadData, _inExp, _inTpl, &_outContinue, out_outTpl);
if (out_outContinue) { *out_outContinue = mmc_mk_icon(_outContinue); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_containsCallTo(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _path)
{
modelica_boolean _outContainsCall;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _path, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_containsCallTo__traverser, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_outContainsCall = tmp3;
_return: OMC_LABEL_UNUSED
return _outContainsCall;
}
modelica_metatype boxptr_Expression_containsCallTo(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _path)
{
modelica_boolean _outContainsCall;
modelica_metatype out_outContainsCall;
_outContainsCall = omc_Expression_containsCallTo(threadData, _inExp, _path);
out_outContainsCall = mmc_mk_icon(_outContainsCall);
return out_outContainsCall;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_containsAnyCall__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inContainsCall, modelica_boolean *out_outContinue, modelica_boolean *out_outContainsCall)
{
modelica_metatype _outExp = NULL;
modelica_boolean _outContinue;
modelica_boolean _outContainsCall;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,13,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = _inContainsCall;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outContainsCall = tmp1;
_outContinue = (!_outContainsCall);
_return: OMC_LABEL_UNUSED
if (out_outContinue) { *out_outContinue = _outContinue; }
if (out_outContainsCall) { *out_outContainsCall = _outContainsCall; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_containsAnyCall__traverser(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inContainsCall, modelica_metatype *out_outContinue, modelica_metatype *out_outContainsCall)
{
modelica_integer tmp1;
modelica_boolean _outContinue;
modelica_boolean _outContainsCall;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inContainsCall);
_outExp = omc_Expression_containsAnyCall__traverser(threadData, _inExp, tmp1, &_outContinue, &_outContainsCall);
if (out_outContinue) { *out_outContinue = mmc_mk_icon(_outContinue); }
if (out_outContainsCall) { *out_outContainsCall = mmc_mk_icon(_outContainsCall); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_containsAnyCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outContainsCall;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_containsAnyCall__traverser, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_outContainsCall = tmp2;
_return: OMC_LABEL_UNUSED
return _outContainsCall;
}
modelica_metatype boxptr_Expression_containsAnyCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outContainsCall;
modelica_metatype out_outContainsCall;
_outContainsCall = omc_Expression_containsAnyCall(threadData, _inExp);
out_outContainsCall = mmc_mk_icon(_outContainsCall);
return out_outContainsCall;
}
DLLExport
modelica_boolean omc_Expression_isScalar(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsScalar;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 7: {
tmp1 = 1;
goto tmp3_done;
}
case 8: {
tmp1 = 1;
goto tmp3_done;
}
case 11: {
_inExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3)));
goto _tailrecursive;
goto tmp3_done;
}
case 13: {
_inExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3)));
goto _tailrecursive;
goto tmp3_done;
}
case 14: {
tmp1 = 1;
goto tmp3_done;
}
case 19: {
tmp1 = 0;
goto tmp3_done;
}
case 20: {
tmp1 = 0;
goto tmp3_done;
}
case 21: {
tmp1 = 0;
goto tmp3_done;
}
case 23: {
_inExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3)));
goto _tailrecursive;
goto tmp3_done;
}
case 27: {
tmp1 = isSome((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3))));
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = omc_Types_isSimpleType(threadData, omc_Expression_typeof(threadData, _inExp));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsScalar = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsScalar;
}
modelica_metatype boxptr_Expression_isScalar(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsScalar;
modelica_metatype out_outIsScalar;
_outIsScalar = omc_Expression_isScalar(threadData, _inExp);
out_outIsScalar = mmc_mk_icon(_outIsScalar);
return out_outIsScalar;
}
DLLExport
modelica_metatype omc_Expression_expandRange(threadData_t *threadData, modelica_metatype _inRange)
{
modelica_metatype _outValues = NULL;
modelica_metatype _start_exp = NULL;
modelica_metatype _stop_exp = NULL;
modelica_metatype _ostep_exp = NULL;
modelica_integer _istep;
modelica_real _rstep;
modelica_metatype _vals = NULL;
modelica_metatype _enum_names = NULL;
modelica_metatype _enum_type = NULL;
modelica_metatype _range_ty = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inRange;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,18,4) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
_start_exp = tmpMeta2;
_ostep_exp = tmpMeta3;
_stop_exp = tmpMeta4;
{
modelica_metatype tmp8_1;modelica_metatype tmp8_2;
tmp8_1 = _start_exp;
tmp8_2 = _stop_exp;
{
volatile mmc_switch_type tmp8;
int tmp9;
tmp8 = 0;
for (; tmp8 < 6; tmp8++) {
switch (MMC_SWITCH_CAST(tmp8)) {
case 0: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,0,1) == 0) goto tmp7_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_2,0,1) == 0) goto tmp7_end;
tmpMeta10 = omc_Util_getOptionOrDefault(threadData, _ostep_exp, _OMC_LIT4);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,1) == 0) goto goto_6;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
_istep = tmp12;
{
modelica_metatype __omcQ_24tmpVar1;
modelica_metatype* tmp14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype __omcQ_24tmpVar0;
modelica_integer tmp17;
modelica_metatype _i_loopVar = 0;
modelica_metatype _i;
_i_loopVar = omc_List_intRange3(threadData, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_start_exp), 2)))), _istep, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stop_exp), 2)))));
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar1 = tmpMeta15;
tmp14 = &__omcQ_24tmpVar1;
while(1) {
tmp17 = 1;
if (!listEmpty(_i_loopVar)) {
_i = MMC_CAR(_i_loopVar);
_i_loopVar = MMC_CDR(_i_loopVar);
tmp17--;
}
if (tmp17 == 0) {
tmpMeta16 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, _i);
__omcQ_24tmpVar0 = tmpMeta16;
*tmp14 = mmc_mk_cons(__omcQ_24tmpVar0,0);
tmp14 = &MMC_CDR(*tmp14);
} else if (tmp17 == 1) {
break;
} else {
goto goto_6;
}
}
*tmp14 = mmc_mk_nil();
tmpMeta13 = __omcQ_24tmpVar1;
}
tmpMeta5 = tmpMeta13;
goto tmp7_done;
}
case 1: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_real tmp20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,1,1) == 0) goto tmp7_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_2,1,1) == 0) goto tmp7_end;
tmpMeta18 = omc_Util_getOptionOrDefault(threadData, _ostep_exp, _OMC_LIT6);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,1,1) == 0) goto goto_6;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
tmp20 = mmc_unbox_real(tmpMeta19);
_rstep = tmp20;
{
modelica_metatype __omcQ_24tmpVar3;
modelica_metatype* tmp22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype __omcQ_24tmpVar2;
modelica_integer tmp25;
modelica_metatype _r_loopVar = 0;
modelica_metatype _r;
_r_loopVar = omc_ExpressionSimplify_simplifyRangeReal(threadData, mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_start_exp), 2)))), _rstep, mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stop_exp), 2)))));
tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar3 = tmpMeta23;
tmp22 = &__omcQ_24tmpVar3;
while(1) {
tmp25 = 1;
if (!listEmpty(_r_loopVar)) {
_r = MMC_CAR(_r_loopVar);
_r_loopVar = MMC_CDR(_r_loopVar);
tmp25--;
}
if (tmp25 == 0) {
tmpMeta24 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, _r);
__omcQ_24tmpVar2 = tmpMeta24;
*tmp22 = mmc_mk_cons(__omcQ_24tmpVar2,0);
tmp22 = &MMC_CDR(*tmp22);
} else if (tmp25 == 1) {
break;
} else {
goto goto_6;
}
}
*tmp22 = mmc_mk_nil();
tmpMeta21 = __omcQ_24tmpVar3;
}
tmpMeta5 = tmpMeta21;
goto tmp7_done;
}
case 2: {
modelica_metatype tmpMeta26;
modelica_integer tmp27;
modelica_metatype tmpMeta28;
modelica_integer tmp29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,3,1) == 0) goto tmp7_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 2));
tmp27 = mmc_unbox_integer(tmpMeta26);
if (0 != tmp27) goto tmp7_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_2,3,1) == 0) goto tmp7_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_2), 2));
tmp29 = mmc_unbox_integer(tmpMeta28);
if (1 != tmp29) goto tmp7_end;
tmpMeta30 = mmc_mk_cons(_start_exp, mmc_mk_cons(_stop_exp, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta5 = tmpMeta30;
goto tmp7_done;
}
case 3: {
modelica_metatype tmpMeta31;
modelica_integer tmp32;
modelica_metatype tmpMeta33;
modelica_integer tmp34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,3,1) == 0) goto tmp7_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_1), 2));
tmp32 = mmc_unbox_integer(tmpMeta31);
if (1 != tmp32) goto tmp7_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_2,3,1) == 0) goto tmp7_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp8_2), 2));
tmp34 = mmc_unbox_integer(tmpMeta33);
if (0 != tmp34) goto tmp7_end;
tmpMeta35 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta5 = tmpMeta35;
goto tmp7_done;
}
case 4: {
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,3,1) == 0) goto tmp7_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_2,3,1) == 0) goto tmp7_end;
tmpMeta36 = mmc_mk_cons(_start_exp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta5 = tmpMeta36;
goto tmp7_done;
}
case 5: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_1,5,2) == 0) goto tmp7_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp8_2,5,2) == 0) goto tmp7_end;
if((mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_start_exp), 3)))) > mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stop_exp), 3))))))
{
tmpMeta37 = MMC_REFSTRUCTLIT(mmc_nil);
_vals = tmpMeta37;
}
else
{
if((mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_start_exp), 3)))) == mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stop_exp), 3))))))
{
tmpMeta38 = mmc_mk_cons(_start_exp, MMC_REFSTRUCTLIT(mmc_nil));
_vals = tmpMeta38;
}
else
{
tmpMeta39 = _inRange;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,18,4) == 0) goto goto_6;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
_range_ty = tmpMeta40;
tmpMeta41 = omc_Types_arrayElementType(threadData, _range_ty);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta41,5,5) == 0) goto goto_6;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 3));
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 4));
_enum_type = tmpMeta42;
_enum_names = tmpMeta43;
_enum_names = omc_List_sublist(threadData, _enum_names, mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_start_exp), 3)))), ((modelica_integer) 1) + mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_stop_exp), 3)))) - (mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_start_exp), 3))))));
_vals = omc_Expression_makeEnumLiterals(threadData, _enum_type, _enum_names);
}
}
tmpMeta5 = _vals;
goto tmp7_done;
}
}
goto tmp7_end;
tmp7_end: ;
}
goto goto_6;
goto_6:;
MMC_THROW_INTERNAL();
goto tmp7_done;
tmp7_done:;
}
}
_outValues = tmpMeta5;
_return: OMC_LABEL_UNUSED
return _outValues;
}
DLLExport
modelica_metatype omc_Expression_typeCastElements(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inType)
{
modelica_metatype _outExp = NULL;
modelica_metatype _ty = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ty = omc_Expression_typeof(threadData, _inExp);
_ty = omc_Types_setArrayElementType(threadData, _ty, _inType);
_outExp = omc_Expression_typeCast(threadData, _inExp, _ty);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_typeCast(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inType)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box3(23, &DAE_Exp_CAST__desc, _inType, _inExp);
_outExp = tmpMeta1;
_outExp = omc_ExpressionSimplify_simplify1(threadData, _outExp, NULL);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_isAsubExp(threadData_t *threadData, modelica_metatype _expIn)
{
modelica_boolean _isAsub;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _expIn;
{
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,21,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isAsub = tmp1;
_return: OMC_LABEL_UNUSED
return _isAsub;
}
modelica_metatype boxptr_Expression_isAsubExp(threadData_t *threadData, modelica_metatype _expIn)
{
modelica_boolean _isAsub;
modelica_metatype out_isAsub;
_isAsub = omc_Expression_isAsubExp(threadData, _expIn);
out_isAsub = mmc_mk_icon(_isAsub);
return out_isAsub;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_createResidualExp4(threadData_t *threadData, modelica_string _f)
{
modelica_boolean _resB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_string tmp4_1;
tmp4_1 = _f;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (4 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT7), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (3 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT8), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (3 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT9), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (5 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT10), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
if (4 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT11), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 5: {
if (4 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT12), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_resB = tmp1;
_return: OMC_LABEL_UNUSED
return _resB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_createResidualExp4(threadData_t *threadData, modelica_metatype _f)
{
modelica_boolean _resB;
modelica_metatype out_resB;
_resB = omc_Expression_createResidualExp4(threadData, _f);
out_resB = mmc_mk_icon(_resB);
return out_resB;
}
DLLExport
modelica_metatype omc_Expression_createResidualExp3(threadData_t *threadData, modelica_metatype _iExp1, modelica_metatype _iExp2, modelica_metatype *out_oExp2, modelica_boolean *out_con)
{
modelica_metatype _oExp1 = NULL;
modelica_metatype _oExp2 = NULL;
modelica_boolean _con;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _iExp1;
tmp4_2 = _iExp2;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_metatype _tp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmpMeta8);
tmpMeta10 = MMC_CDR(tmpMeta8);
if (!listEmpty(tmpMeta10)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (listEmpty(tmpMeta13)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmpMeta13);
tmpMeta15 = MMC_CDR(tmpMeta13);
if (!listEmpty(tmpMeta15)) goto tmp3_end;
_s1 = tmpMeta7;
_e1 = tmpMeta9;
_s2 = tmpMeta12;
_e2 = tmpMeta14;
tmp4 += 1;
if (!((stringEqual(_s1, _s2)) && omc_Expression_createResidualExp4(threadData, _s1))) goto tmp3_end;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta16;
modelica_real tmp17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp17 = mmc_unbox_real(tmpMeta16);
if (0.0 != tmp17) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,1,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
if (4 != MMC_STRLEN(tmpMeta19) || strcmp(MMC_STRINGDATA(_OMC_LIT7), MMC_STRINGDATA(tmpMeta19)) != 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta20)) goto tmp3_end;
tmpMeta21 = MMC_CAR(tmpMeta20);
tmpMeta22 = MMC_CDR(tmpMeta20);
if (!listEmpty(tmpMeta22)) goto tmp3_end;
_e1 = tmpMeta21;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _iExp2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,1,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
if (4 != MMC_STRLEN(tmpMeta24) || strcmp(MMC_STRINGDATA(_OMC_LIT7), MMC_STRINGDATA(tmpMeta24)) != 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta25)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmpMeta25);
tmpMeta27 = MMC_CDR(tmpMeta25);
if (!listEmpty(tmpMeta27)) goto tmp3_end;
_e1 = tmpMeta26;
_e2 = tmp4_2;
tmp4 += 5;
if (!omc_Expression_isConst(threadData, _e2)) goto tmp3_end;
_e = omc_Expression_expPow(threadData, _iExp2, _OMC_LIT14);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e;
tmp1_c2 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,1,1) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
if (3 != MMC_STRLEN(tmpMeta29) || strcmp(MMC_STRINGDATA(_OMC_LIT9), MMC_STRINGDATA(tmpMeta29)) != 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta30)) goto tmp3_end;
tmpMeta31 = MMC_CAR(tmpMeta30);
tmpMeta32 = MMC_CDR(tmpMeta30);
if (!listEmpty(tmpMeta32)) goto tmp3_end;
_e1 = tmpMeta31;
_e2 = tmp4_2;
tmp4 += 4;
if (!omc_Expression_isConst(threadData, _e2)) goto tmp3_end;
_tp = omc_Expression_typeof(threadData, _iExp2);
tmpMeta33 = mmc_mk_cons(_iExp2, MMC_REFSTRUCTLIT(mmc_nil));
_e = omc_Expression_makePureBuiltinCall(threadData, _OMC_LIT8, tmpMeta33, _tp);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e;
tmp1_c2 = 1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,1,1) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
if (5 != MMC_STRLEN(tmpMeta35) || strcmp(MMC_STRINGDATA(_OMC_LIT10), MMC_STRINGDATA(tmpMeta35)) != 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta36)) goto tmp3_end;
tmpMeta37 = MMC_CAR(tmpMeta36);
tmpMeta38 = MMC_CDR(tmpMeta36);
if (!listEmpty(tmpMeta38)) goto tmp3_end;
_e1 = tmpMeta37;
_e2 = tmp4_2;
tmp4 += 3;
if (!omc_Expression_isConst(threadData, _e2)) goto tmp3_end;
_e = omc_Expression_expPow(threadData, _OMC_LIT16, _iExp2);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e;
tmp1_c2 = 1;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta39;
modelica_real tmp40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_real tmp47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp40 = mmc_unbox_real(tmpMeta39);
if (0.0 != tmp40) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta41,1,1) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 2));
if (10 != MMC_STRLEN(tmpMeta42) || strcmp(MMC_STRINGDATA(_OMC_LIT17), MMC_STRINGDATA(tmpMeta42)) != 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta43)) goto tmp3_end;
tmpMeta44 = MMC_CAR(tmpMeta43);
tmpMeta45 = MMC_CDR(tmpMeta43);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,1,1) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta44), 2));
tmp47 = mmc_unbox_real(tmpMeta46);
if (0.0 != tmp47) goto tmp3_end;
if (listEmpty(tmpMeta45)) goto tmp3_end;
tmpMeta48 = MMC_CAR(tmpMeta45);
tmpMeta49 = MMC_CDR(tmpMeta45);
if (listEmpty(tmpMeta49)) goto tmp3_end;
tmpMeta50 = MMC_CAR(tmpMeta49);
tmpMeta51 = MMC_CDR(tmpMeta49);
if (!listEmpty(tmpMeta51)) goto tmp3_end;
_e1 = tmpMeta48;
_e2 = tmpMeta50;
tmp4 += 2;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta52;
modelica_real tmp53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp53 = mmc_unbox_real(tmpMeta52);
if (0.0 != tmp53) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta54,5,1) == 0) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e2 = tmp4_2;
_e1 = tmpMeta55;
tmp4 += 1;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta56;
modelica_real tmp57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp57 = mmc_unbox_real(tmpMeta56);
if (0.0 != tmp57) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta58,13,3) == 0) goto tmp3_end;
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta58), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta59,1,1) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta59), 2));
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta58), 3));
if (listEmpty(tmpMeta61)) goto tmp3_end;
tmpMeta62 = MMC_CAR(tmpMeta61);
tmpMeta63 = MMC_CDR(tmpMeta61);
if (!listEmpty(tmpMeta63)) goto tmp3_end;
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta64,1,1) == 0) goto tmp3_end;
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta65,13,3) == 0) goto tmp3_end;
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta65), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta66,1,1) == 0) goto tmp3_end;
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta66), 2));
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta65), 3));
if (listEmpty(tmpMeta68)) goto tmp3_end;
tmpMeta69 = MMC_CAR(tmpMeta68);
tmpMeta70 = MMC_CDR(tmpMeta68);
if (!listEmpty(tmpMeta70)) goto tmp3_end;
_s1 = tmpMeta60;
_e1 = tmpMeta62;
_s2 = tmpMeta67;
_e2 = tmpMeta69;
if (!((stringEqual(_s1, _s2)) && omc_Expression_createResidualExp4(threadData, _s1))) goto tmp3_end;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 8: {
tmpMeta[0+0] = _iExp1;
tmpMeta[0+1] = _iExp2;
tmp1_c2 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 9) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oExp1 = tmpMeta[0+0];
_oExp2 = tmpMeta[0+1];
_con = tmp1_c2;
_return: OMC_LABEL_UNUSED
if (out_oExp2) { *out_oExp2 = _oExp2; }
if (out_con) { *out_con = _con; }
return _oExp1;
}
modelica_metatype boxptr_Expression_createResidualExp3(threadData_t *threadData, modelica_metatype _iExp1, modelica_metatype _iExp2, modelica_metatype *out_oExp2, modelica_metatype *out_con)
{
modelica_boolean _con;
modelica_metatype _oExp1 = NULL;
_oExp1 = omc_Expression_createResidualExp3(threadData, _iExp1, _iExp2, out_oExp2, &_con);
if (out_con) { *out_con = mmc_mk_icon(_con); }
return _oExp1;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_createResidualExp2(threadData_t *threadData, modelica_metatype _iExp1, modelica_metatype _iExp2, modelica_metatype *out_oExp2)
{
modelica_metatype _oExp1 = NULL;
modelica_metatype _oExp2 = NULL;
modelica_boolean _con;
modelica_boolean _con1;
modelica_integer _ii;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_boolean tmp12_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_oExp1 = _iExp1;
_oExp2 = _iExp2;
_con = 1;
_ii = ((modelica_integer) 1);
while(1)
{
if(!(_con && (_ii < ((modelica_integer) 15)))) break;
{
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
modelica_metatype tmpMeta8;
tmpMeta8 = omc_Expression_createResidualExp3(threadData, _oExp1, _oExp2, &tmpMeta6, &tmp7);
_e1 = tmpMeta8;
if (1 != tmp7) goto goto_2;
_e2 = tmpMeta6;
_e1 = omc_ExpressionSimplify_simplify1(threadData, _e1, NULL);
_e2 = omc_ExpressionSimplify_simplify1(threadData, _e2, NULL);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
tmpMeta11 = omc_Expression_createResidualExp3(threadData, _oExp2, _oExp1, &tmpMeta9, &tmp10);
_e2 = tmpMeta11;
if (1 != tmp10) goto goto_2;
_e1 = tmpMeta9;
_e1 = omc_ExpressionSimplify_simplify1(threadData, _e1, NULL);
_e2 = omc_ExpressionSimplify_simplify1(threadData, _e2, NULL);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp1_c2 = 1;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _oExp1;
tmpMeta[0+1] = _oExp2;
tmp1_c2 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oExp1 = tmpMeta[0+0];
_oExp2 = tmpMeta[0+1];
_con = tmp1_c2;
{
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp15;
int tmp16;
tmp15 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp14_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp15 < 5; tmp15++) {
switch (MMC_SWITCH_CAST(tmp15)) {
case 0: {
modelica_boolean tmp17;
tmp17 = omc_Expression_isZero(threadData, _oExp1);
if (1 != tmp17) goto goto_13;
_e1 = omc_Expression_makeFraction(threadData, _oExp2 ,&_e2);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _oExp1;
tmp12_c2 = (!omc_Expression_isOne(threadData, _e2));
goto tmp14_done;
}
case 1: {
modelica_boolean tmp18;
tmp18 = omc_Expression_isZero(threadData, _oExp2);
if (1 != tmp18) goto goto_13;
_e1 = omc_Expression_makeFraction(threadData, _oExp1 ,&_e2);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _oExp2;
tmp12_c2 = (!omc_Expression_isOne(threadData, _e2));
goto tmp14_done;
}
case 2: {
modelica_boolean tmp19;
tmp19 = omc_Expression_isOne(threadData, _oExp1);
if (1 != tmp19) goto goto_13;
_e1 = omc_Expression_makeFraction(threadData, _oExp2 ,&_e2);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp12_c2 = (!omc_Expression_isOne(threadData, _e2));
goto tmp14_done;
}
case 3: {
modelica_boolean tmp20;
tmp20 = omc_Expression_isOne(threadData, _oExp2);
if (1 != tmp20) goto goto_13;
_e1 = omc_Expression_makeFraction(threadData, _oExp1 ,&_e2);
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
tmp12_c2 = (!omc_Expression_isOne(threadData, _e2));
goto tmp14_done;
}
case 4: {
tmpMeta[0+0] = _oExp1;
tmpMeta[0+1] = _oExp2;
tmp12_c2 = 0;
goto tmp14_done;
}
}
goto tmp14_end;
tmp14_end: ;
}
goto goto_13;
tmp14_done:
(void)tmp15;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp14_done2;
goto_13:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp15 < 5) {
goto tmp14_top;
}
MMC_THROW_INTERNAL();
tmp14_done2:;
}
}
_oExp1 = tmpMeta[0+0];
_oExp2 = tmpMeta[0+1];
_con1 = tmp12_c2;
_con = (_con || _con1);
_ii = ((modelica_integer) 1) + _ii;
if((!_con))
{
_oExp1 = omc_ExpressionSimplify_simplify1(threadData, _oExp1 ,&_con);
_oExp2 = omc_ExpressionSimplify_simplify1(threadData, _oExp2 ,&_con1);
_con = (_con || _con1);
_ii = ((modelica_integer) 3) + _ii;
}
}
_oExp1 = omc_ExpressionSimplify_simplify1(threadData, _oExp1, NULL);
_oExp2 = omc_ExpressionSimplify_simplify1(threadData, _oExp2, NULL);
_return: OMC_LABEL_UNUSED
if (out_oExp2) { *out_oExp2 = _oExp2; }
return _oExp1;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_moveDivToMul(threadData_t *threadData, modelica_metatype _iExpLst, modelica_metatype _iExpLstAcc, modelica_metatype _iExpMuls, modelica_metatype *out_oExpMuls)
{
modelica_metatype _oExpLst = NULL;
modelica_metatype _oExpMuls = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iExpLst;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _acc = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta[0+0] = _iExpLstAcc;
tmpMeta[0+1] = _iExpMuls;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,8,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,3,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
_e1 = tmpMeta9;
_e2 = tmpMeta11;
_rest = tmpMeta7;
_acc = omc_List_map1(threadData, _iExpLstAcc, boxvar_Expression_expMul, _e2);
_rest = omc_List_map1(threadData, _rest, boxvar_Expression_expMul, _e2);
_rest = omc_ExpressionSimplify_simplifyList(threadData, _rest);
tmpMeta12 = mmc_mk_cons(omc_Expression_negate(threadData, _e1), _acc);
tmpMeta13 = mmc_mk_cons(_e2, _iExpMuls);
_iExpLst = _rest;
_iExpLstAcc = tmpMeta12;
_iExpMuls = tmpMeta13;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,8,2) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,7,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,16,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
_e1 = tmpMeta17;
_e2 = tmpMeta19;
_rest = tmpMeta15;
_acc = omc_List_map1(threadData, _iExpLstAcc, boxvar_Expression_expMul, _e2);
_rest = omc_List_map1(threadData, _rest, boxvar_Expression_expMul, _e2);
_rest = omc_ExpressionSimplify_simplifyList(threadData, _rest);
tmpMeta20 = mmc_mk_cons(omc_Expression_negate(threadData, _e1), _acc);
tmpMeta21 = mmc_mk_cons(_e2, _iExpMuls);
_iExpLst = _rest;
_iExpLstAcc = tmpMeta20;
_iExpMuls = tmpMeta21;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta22 = MMC_CAR(tmp4_1);
tmpMeta23 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,7,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,3,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 4));
_e1 = tmpMeta24;
_e2 = tmpMeta26;
_rest = tmpMeta23;
_acc = omc_List_map1(threadData, _iExpLstAcc, boxvar_Expression_expMul, _e2);
_rest = omc_List_map1(threadData, _rest, boxvar_Expression_expMul, _e2);
_rest = omc_ExpressionSimplify_simplifyList(threadData, _rest);
tmpMeta27 = mmc_mk_cons(_e1, _acc);
tmpMeta28 = mmc_mk_cons(_e2, _iExpMuls);
_iExpLst = _rest;
_iExpLstAcc = tmpMeta27;
_iExpMuls = tmpMeta28;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta29 = MMC_CAR(tmp4_1);
tmpMeta30 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,7,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,16,1) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 4));
_e1 = tmpMeta31;
_e2 = tmpMeta33;
_rest = tmpMeta30;
_acc = omc_List_map1(threadData, _iExpLstAcc, boxvar_Expression_expMul, _e2);
_rest = omc_List_map1(threadData, _rest, boxvar_Expression_expMul, _e2);
_rest = omc_ExpressionSimplify_simplifyList(threadData, _rest);
tmpMeta34 = mmc_mk_cons(_e1, _acc);
tmpMeta35 = mmc_mk_cons(_e2, _iExpMuls);
_iExpLst = _rest;
_iExpLstAcc = tmpMeta34;
_iExpMuls = tmpMeta35;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta36 = MMC_CAR(tmp4_1);
tmpMeta37 = MMC_CDR(tmp4_1);
_e = tmpMeta36;
_rest = tmpMeta37;
tmpMeta38 = mmc_mk_cons(_e, _iExpLstAcc);
_iExpLst = _rest;
_iExpLstAcc = tmpMeta38;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oExpLst = tmpMeta[0+0];
_oExpMuls = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_oExpMuls) { *out_oExpMuls = _oExpMuls; }
return _oExpLst;
}
DLLExport
modelica_metatype omc_Expression_makeFraction(threadData_t *threadData, modelica_metatype _iExp, modelica_metatype *out_d)
{
modelica_metatype _n = NULL;
modelica_metatype _d = NULL;
modelica_metatype _N = NULL;
modelica_metatype _D = NULL;
modelica_metatype _T = NULL;
modelica_metatype _tp = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_tp = omc_Expression_typeof(threadData, _iExp);
_T = omc_Expression_terms(threadData, _iExp);
_T = omc_ExpressionSimplify_simplifyList(threadData, _T);
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_N = omc_Expression_moveDivToMul(threadData, _T, tmpMeta1, tmpMeta2 ,&_D);
_N = omc_ExpressionSimplify_simplifyList(threadData, _N);
_D = omc_ExpressionSimplify_simplifyList(threadData, _D);
_n = omc_Expression_makeSum1(threadData, _N, 0);
_d = omc_Expression_makeProductLst(threadData, _D);
_n = omc_ExpressionSimplify_simplify1(threadData, _n, NULL);
_d = omc_ExpressionSimplify_simplify1(threadData, _d, NULL);
_return: OMC_LABEL_UNUSED
if (out_d) { *out_d = _d; }
return _n;
}
DLLExport
modelica_metatype omc_Expression_createResidualExp(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_metatype _resExp = NULL;
modelica_metatype _iExp1 = NULL;
modelica_metatype _iExp2 = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_iExp1 = omc_Expression_createResidualExp2(threadData, _inExp1, _inExp2 ,&_iExp2);
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _iExp1;
tmp4_2 = _iExp2;
{
modelica_metatype _res = NULL;
modelica_metatype _res1 = NULL;
modelica_metatype _res2 = NULL;
modelica_metatype _N1 = NULL;
modelica_metatype _D1 = NULL;
modelica_metatype _N2 = NULL;
modelica_metatype _D2 = NULL;
modelica_metatype _explst = NULL;
modelica_metatype _explst1 = 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 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_real tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp7 = mmc_unbox_real(tmpMeta6);
if (0.0 != tmp7) goto tmp3_end;
tmp4 += 1;
tmpMeta1 = _iExp1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
if (0 != tmp9) goto tmp3_end;
tmpMeta1 = _iExp1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_real tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp11 = mmc_unbox_real(tmpMeta10);
if (0.0 != tmp11) goto tmp3_end;
tmp4 += 1;
tmpMeta1 = _iExp2;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_integer tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp13 = mmc_unbox_integer(tmpMeta12);
if (0 != tmp13) goto tmp3_end;
tmpMeta1 = _iExp2;
goto tmp3_done;
}
case 4: {
modelica_boolean tmp14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
_ty = omc_Expression_typeof(threadData, _iExp1);
tmp14 = omc_Types_isIntegerOrRealOrSubTypeOfEither(threadData, _ty);
if (1 != tmp14) goto goto_2;
_N1 = omc_Expression_makeFraction(threadData, _iExp1 ,&_D1);
_N2 = omc_Expression_makeFraction(threadData, _iExp2 ,&_D2);
tmpMeta15 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _ty);
_res1 = omc_ExpressionSimplify_simplifySumOperatorExpression(threadData, _N1, tmpMeta15, _D2);
tmpMeta16 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _ty);
_res2 = omc_ExpressionSimplify_simplifySumOperatorExpression(threadData, _N2, tmpMeta16, _D1);
_explst = omc_Expression_terms(threadData, _iExp1);
_explst1 = omc_Expression_terms(threadData, _iExp2);
if((omc_Expression_isConst(threadData, _res1) || (((modelica_integer) 1) + listLength(_explst1) > listLength(_explst))))
{
_res = omc_Expression_expSub(threadData, _res2, _res1);
}
else
{
_res = omc_Expression_expSub(threadData, _res1, _res2);
}
tmpMeta1 = omc_ExpressionSimplify_simplify(threadData, _res, NULL);
goto tmp3_done;
}
case 5: {
modelica_boolean tmp17;
_ty = omc_Expression_typeof(threadData, _iExp1);
tmp17 = omc_Types_isEnumeration(threadData, _ty);
if (1 != tmp17) goto goto_2;
tmpMeta1 = omc_Expression_expSub(threadData, _iExp1, _iExp2);
goto tmp3_done;
}
case 6: {
modelica_boolean tmp18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
_ty = omc_Expression_typeof(threadData, _iExp1);
tmp18 = omc_Types_isBooleanOrSubTypeBoolean(threadData, _ty);
if (1 != tmp18) goto goto_2;
tmpMeta19 = mmc_mk_box2(27, &DAE_Operator_NOT__desc, _ty);
tmpMeta20 = mmc_mk_box2(32, &DAE_Operator_EQUAL__desc, _ty);
tmpMeta21 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _iExp1, tmpMeta20, _iExp2, mmc_mk_integer(((modelica_integer) -1)), mmc_mk_none());
tmpMeta22 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, tmpMeta19, tmpMeta21);
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
case 7: {
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
_ty = omc_Expression_typeof(threadData, _iExp1);
tmp23 = omc_Types_isStringOrSubTypeString(threadData, _ty);
if (1 != tmp23) goto goto_2;
tmpMeta24 = mmc_mk_box2(27, &DAE_Operator_NOT__desc, _ty);
tmpMeta25 = mmc_mk_box2(32, &DAE_Operator_EQUAL__desc, _ty);
tmpMeta26 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _iExp1, tmpMeta25, _iExp2, mmc_mk_integer(((modelica_integer) -1)), mmc_mk_none());
tmpMeta27 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, tmpMeta24, tmpMeta26);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 8: {
_res = omc_Expression_expSub(threadData, _iExp1, _iExp2);
tmpMeta1 = omc_ExpressionSimplify_simplify(threadData, _res, 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 < 9) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_resExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _resExp;
}
DLLExport
modelica_metatype omc_Expression_dimensionSizeSubscripts(threadData_t *threadData, modelica_integer _inDimSize)
{
modelica_metatype _outSubscripts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype __omcQ_24tmpVar5;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype __omcQ_24tmpVar4;
modelica_integer tmp6;
modelica_integer tmp7;
modelica_integer tmp8;
modelica_integer _i;
tmp7 = 1;
tmp8 = _inDimSize;
_i = ((modelica_integer) 1);
_i = (((modelica_integer) 1) /* Range start-value */)-tmp7;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar5 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar5;
while(1) {
tmp6 = 1;
if (tmp7 > 0 ? _i+tmp7 <= tmp8 : _i+tmp7 >= tmp8) {
_i += tmp7;
tmp6--;
}
if (tmp6 == 0) {
tmpMeta4 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta5 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, tmpMeta4);
__omcQ_24tmpVar4 = tmpMeta5;
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar4,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp6 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar5;
}
_outSubscripts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
modelica_metatype boxptr_Expression_dimensionSizeSubscripts(threadData_t *threadData, modelica_metatype _inDimSize)
{
modelica_integer tmp1;
modelica_metatype _outSubscripts = NULL;
tmp1 = mmc_unbox_integer(_inDimSize);
_outSubscripts = omc_Expression_dimensionSizeSubscripts(threadData, tmp1);
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_dimensionSizesSubcriptsOpt(threadData_t *threadData, modelica_metatype _inDimSizes)
{
modelica_metatype _outSubscripts = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outSubscripts = omc_List_mapOption(threadData, _inDimSizes, boxvar_Expression_dimensionSizeSubscripts);
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_dimensionSizesSubscripts(threadData_t *threadData, modelica_metatype _inDimSizes)
{
modelica_metatype _outSubscripts = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outSubscripts = omc_List_map(threadData, _inDimSizes, boxvar_Expression_dimensionSizeSubscripts);
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_expandSliceExp(threadData_t *threadData, modelica_metatype _inSliceExp)
{
modelica_metatype _outSubscripts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSliceExp;
{
modelica_metatype _expl = 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,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta6;
tmpMeta1 = omc_List_map(threadData, _expl, boxvar_Expression_makeIndexSubscript);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta1 = omc_List_map(threadData, omc_Expression_expandRange(threadData, _inSliceExp), boxvar_Expression_makeIndexSubscript);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscripts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_expandDimension(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDimension;
{
modelica_integer _dim_int;
modelica_metatype _enum_ty = NULL;
modelica_metatype _enum_lits = NULL;
modelica_metatype _enum_expl = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_dim_int = tmp6;
tmpMeta1 = omc_Expression_dimensionSizeSubscripts(threadData, _dim_int);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_enum_ty = tmpMeta7;
_enum_lits = tmpMeta8;
_enum_expl = omc_Expression_makeEnumLiterals(threadData, _enum_ty, _enum_lits);
tmpMeta1 = omc_List_map(threadData, _enum_expl, boxvar_Expression_makeIndexSubscript);
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT23;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_metatype tmpMeta9;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscript = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscript;
}
DLLExport
modelica_metatype omc_Expression_expandSubscript(threadData_t *threadData, modelica_metatype _inSubscript, modelica_metatype _inDimension)
{
modelica_metatype _outSubscripts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,18,4) == 0) goto tmp3_end;
{
modelica_metatype __omcQ_24tmpVar7;
modelica_metatype* tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype __omcQ_24tmpVar6;
modelica_integer tmp11;
modelica_metatype _e_loopVar = 0;
modelica_metatype _e;
_e_loopVar = omc_Expression_expandRange(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inSubscript), 2))));
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar7 = tmpMeta9;
tmp8 = &__omcQ_24tmpVar7;
while(1) {
tmp11 = 1;
if (!listEmpty(_e_loopVar)) {
_e = MMC_CAR(_e_loopVar);
_e_loopVar = MMC_CDR(_e_loopVar);
tmp11--;
}
if (tmp11 == 0) {
tmpMeta10 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _e);
__omcQ_24tmpVar6 = tmpMeta10;
*tmp8 = mmc_mk_cons(__omcQ_24tmpVar6,0);
tmp8 = &MMC_CDR(*tmp8);
} else if (tmp11 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp8 = mmc_mk_nil();
tmpMeta7 = __omcQ_24tmpVar7;
}
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,16,3) == 0) goto tmp3_end;
tmpMeta1 = omc_Expression_expandSliceExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inSubscript), 2))));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta13 = mmc_mk_cons(_inSubscript, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmpMeta1 = omc_Expression_expandDimension(threadData, _inDimension);
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta1 = omc_Expression_expandSliceExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inSubscript), 2))));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscripts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_rangesToSubscripts(threadData_t *threadData, modelica_metatype _inRangelist)
{
modelica_metatype _outSubslst = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outSubslst = omc_List_allCombinations(threadData, _inRangelist, mmc_mk_none(), _OMC_LIT26);
_return: OMC_LABEL_UNUSED
return _outSubslst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeMatrix(threadData_t *threadData, modelica_metatype _expl, modelica_integer _n)
{
modelica_metatype _res = NULL;
modelica_metatype _col = NULL;
modelica_integer _r;
modelica_metatype tmpMeta1;
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);
_res = tmpMeta1;
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_col = tmpMeta2;
_r = _n;
{
modelica_metatype _e;
for (tmpMeta3 = _expl; !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
{
_e = MMC_CAR(tmpMeta3);
_r = ((modelica_integer) -1) + _r;
tmpMeta4 = mmc_mk_cons(_e, _col);
_col = tmpMeta4;
if((_r == ((modelica_integer) 0)))
{
tmpMeta5 = mmc_mk_cons(listReverseInPlace(_col), _res);
_res = tmpMeta5;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
_col = tmpMeta6;
_r = _n;
}
}
}
omc_Error_assertionOrAddSourceMessage(threadData, listEmpty(_col), _OMC_LIT31, _OMC_LIT33, _OMC_LIT34);
_res = listReverseInPlace(_res);
_return: OMC_LABEL_UNUSED
return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_makeMatrix(threadData_t *threadData, modelica_metatype _expl, modelica_metatype _n)
{
modelica_integer tmp1;
modelica_metatype _res = NULL;
tmp1 = mmc_unbox_integer(_n);
_res = omc_Expression_makeMatrix(threadData, _expl, tmp1);
return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_insertSubScripts(threadData_t *threadData, modelica_metatype _templSubScript, modelica_metatype _value, modelica_metatype _lstIn)
{
modelica_metatype _outSubScript = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _templSubScript;
{
modelica_metatype _sub = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _lsts = 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 (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;
_rest = tmpMeta7;
tmp4 += 1;
_lsts = omc_List_map1(threadData, _value, boxvar_listAppend, _lstIn);
tmpMeta1 = omc_List_map1(threadData, _lsts, boxvar_List_append__reverser, _rest);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,2,1) == 0) goto tmp3_end;
_rest = tmpMeta9;
_sub = listHead(_templSubScript);
tmpMeta10 = mmc_mk_cons(_sub, _lstIn);
tmpMeta1 = omc_Expression_insertSubScripts(threadData, _rest, _value, tmpMeta10);
goto tmp3_done;
}
case 2: {
tmpMeta1 = _value;
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:;
}
}
_outSubScript = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubScript;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingextendArrExp(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inExpanded, modelica_boolean *out_outExpanded)
{
modelica_metatype _outExp = NULL;
modelica_boolean _outExpanded;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _id = NULL;
modelica_metatype _jd = NULL;
modelica_integer _i;
modelica_integer _j;
modelica_metatype _expl = NULL;
modelica_metatype _e = NULL;
modelica_metatype _varLst = NULL;
modelica_metatype _name = NULL;
modelica_metatype _mat = NULL;
modelica_metatype _field_names = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_ty = tmpMeta6;
_id = tmpMeta8;
_jd = tmpMeta10;
_i = omc_Expression_dimensionSize(threadData, _id);
_j = omc_Expression_dimensionSize(threadData, _jd);
_expl = omc_Expression_expandExpression(threadData, _inExp, 0);
_mat = omc_Expression_makeMatrix(threadData, _expl, _j);
tmpMeta12 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _ty, mmc_mk_integer(_i), _mat);
_e = tmpMeta12;
tmpMeta[0+0] = _e;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,6,2) == 0) goto tmp3_end;
_ty = tmpMeta13;
_expl = omc_Expression_expandExpression(threadData, _inExp, 0);
tmpMeta14 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(1), _expl);
_e = tmpMeta14;
tmpMeta[0+0] = _e;
tmp1_c1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,9,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,3,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
_cr = tmpMeta15;
_ty = tmpMeta16;
_name = tmpMeta18;
_varLst = tmpMeta19;
_expl = omc_List_map1(threadData, _varLst, boxvar_Expression_generateCrefsExpFromExpVar, _cr);
_i = listLength(_expl);
tmp20 = (_i > ((modelica_integer) 0));
if (1 != tmp20) goto goto_2;
{
modelica_metatype __omcQ_24tmpVar9;
modelica_metatype* tmp22;
modelica_metatype tmpMeta23;
modelica_string __omcQ_24tmpVar8;
modelica_integer tmp24;
modelica_metatype _v_loopVar = 0;
modelica_metatype _v;
_v_loopVar = _varLst;
tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar9 = tmpMeta23;
tmp22 = &__omcQ_24tmpVar9;
while(1) {
tmp24 = 1;
if (!listEmpty(_v_loopVar)) {
_v = MMC_CAR(_v_loopVar);
_v_loopVar = MMC_CDR(_v_loopVar);
tmp24--;
}
if (tmp24 == 0) {
__omcQ_24tmpVar8 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 2)));
*tmp22 = mmc_mk_cons(__omcQ_24tmpVar8,0);
tmp22 = &MMC_CDR(*tmp22);
} else if (tmp24 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp22 = mmc_mk_nil();
tmpMeta21 = __omcQ_24tmpVar9;
}
_field_names = tmpMeta21;
tmpMeta25 = mmc_mk_box5(17, &DAE_Exp_RECORD__desc, _name, _expl, _field_names, _ty);
_e = tmpMeta25;
_e = omc_Expression_traverseExpBottomUp(threadData, _e, boxvar_Expression_traversingextendArrExp, mmc_mk_boolean(1), NULL);
tmpMeta[0+0] = _e;
tmp1_c1 = 1;
goto tmp3_done;
}
case 3: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = _inExpanded;
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];
_outExpanded = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_outExpanded) { *out_outExpanded = _outExpanded; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingextendArrExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inExpanded, modelica_metatype *out_outExpanded)
{
modelica_integer tmp1;
modelica_boolean _outExpanded;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inExpanded);
_outExp = omc_Expression_traversingextendArrExp(threadData, _inExp, tmp1, &_outExpanded);
if (out_outExpanded) { *out_outExpanded = mmc_mk_icon(_outExpanded); }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_extendArrExp(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inExpanded, modelica_boolean *out_outExpanded)
{
modelica_metatype _outExp = NULL;
modelica_boolean _outExpanded;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _exp = NULL;
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
modelica_metatype tmpMeta8;
_outExp = tmp4_1;
tmpMeta8 = omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_traversingextendArrExp, mmc_mk_boolean(0), &tmpMeta6);
_exp = tmpMeta8;
tmp7 = mmc_unbox_integer(tmpMeta6);
_b = tmp7;
tmpMeta[0+0] = _exp;
tmp1_c1 = _b;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = _inExpanded;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outExpanded = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_outExpanded) { *out_outExpanded = _outExpanded; }
return _outExp;
}
modelica_metatype boxptr_Expression_extendArrExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inExpanded, modelica_metatype *out_outExpanded)
{
modelica_integer tmp1;
modelica_boolean _outExpanded;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inExpanded);
_outExp = omc_Expression_extendArrExp(threadData, _inExp, tmp1, &_outExpanded);
if (out_outExpanded) { *out_outExpanded = mmc_mk_icon(_outExpanded); }
return _outExp;
}
static modelica_metatype closure0_Expression_expandExpression(threadData_t *thData, modelica_metatype closure, modelica_metatype inExp)
{
modelica_metatype expandRecord = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
return boxptr_Expression_expandExpression(thData, inExp, expandRecord);
}
DLLExport
modelica_metatype omc_Expression_expandExpression(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _expandRecord)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp5_1;
tmp5_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _crlst = NULL;
modelica_metatype _expl = NULL;
modelica_metatype tmpMeta3;
modelica_metatype _expl1 = NULL;
modelica_metatype _expl2 = NULL;
modelica_string _msg = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _op = NULL;
volatile mmc_switch_type tmp5;
int tmp6;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
_expl = tmpMeta3;
tmp5 = 0;
for (; tmp5 < 5; tmp5++) {
switch (MMC_SWITCH_CAST(tmp5)) {
case 0: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,6,2) == 0) goto tmp4_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
_cr = tmpMeta7;
_crlst = omc_ComponentReference_expandCref(threadData, _cr, _expandRecord);
tmpMeta1 = omc_List_map(threadData, _crlst, boxvar_Expression_crefToExp);
goto tmp4_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,8,2) == 0) goto tmp4_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,5,1) == 0) goto tmp4_end;
{
modelica_metatype __omcQ_24tmpVar11;
modelica_metatype* tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype __omcQ_24tmpVar10;
modelica_integer tmp13;
modelica_metatype _exp_loopVar = 0;
modelica_metatype _exp;
_exp_loopVar = omc_Expression_expandExpression(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3))), _expandRecord);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar11 = tmpMeta11;
tmp10 = &__omcQ_24tmpVar11;
while(1) {
tmp13 = 1;
if (!listEmpty(_exp_loopVar)) {
_exp = MMC_CAR(_exp_loopVar);
_exp_loopVar = MMC_CDR(_exp_loopVar);
tmp13--;
}
if (tmp13 == 0) {
tmpMeta12 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))), _exp);
__omcQ_24tmpVar10 = tmpMeta12;
*tmp10 = mmc_mk_cons(__omcQ_24tmpVar10,0);
tmp10 = &MMC_CDR(*tmp10);
} else if (tmp13 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp10 = mmc_mk_nil();
tmpMeta9 = __omcQ_24tmpVar11;
}
tmpMeta1 = tmpMeta9;
goto tmp4_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_integer tmp16;
modelica_integer tmp17;
modelica_integer tmp18;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,7,3) == 0) goto tmp4_end;
_op = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3)));
_expl1 = omc_Expression_expandExpression(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))), _expandRecord);
_expl2 = omc_Expression_expandExpression(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 4))), _expandRecord);
if((listLength(_expl1) != listLength(_expl2)))
{
goto goto_2;
}
_e1 = listGet(_expl1, ((modelica_integer) 1));
_e2 = listGet(_expl1, ((modelica_integer) 2));
tmp16 = ((modelica_integer) 1); tmp17 = 1; tmp18 = listLength(_expl1);
if(!(((tmp17 > 0) && (tmp16 > tmp18)) || ((tmp17 < 0) && (tmp16 < tmp18))))
{
modelica_integer _i;
for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp16, tmp18); _i += tmp17)
{
_e1 = listGet(_expl1, _i);
_e2 = listGet(_expl2, _i);
tmpMeta15 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta14 = mmc_mk_cons(tmpMeta15, _expl);
_expl = tmpMeta14;
}
}
tmpMeta1 = listReverse(_expl);
goto tmp4_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,16,3) == 0) goto tmp4_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 4));
_expl = tmpMeta19;
tmpMeta20 = mmc_mk_box1(0, mmc_mk_boolean(_expandRecord));
tmpMeta1 = omc_List_mapFlat(threadData, _expl, (modelica_fnptr) mmc_mk_box2(0,closure0_Expression_expandExpression,tmpMeta20));
goto tmp4_done;
}
case 4: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
tmpMeta21 = stringAppend(_OMC_LIT35,omc_ExpressionDump_printExpStr(threadData, _inExp));
_msg = tmpMeta21;
tmpMeta22 = mmc_mk_cons(_msg, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT31, tmpMeta22);
goto goto_2;
goto tmp4_done;
}
}
goto tmp4_end;
tmp4_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp4_done;
tmp4_done:;
}
}
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExps;
}
modelica_metatype boxptr_Expression_expandExpression(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _expandRecord)
{
modelica_integer tmp1;
modelica_metatype _outExps = NULL;
tmp1 = mmc_unbox_integer(_expandRecord);
_outExps = omc_Expression_expandExpression(threadData, _inExp, tmp1);
return _outExps;
}
DLLExport
modelica_metatype omc_Expression_expandCrefs(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _expandRecord, modelica_integer __omcQ_24in_5Fdummy, modelica_integer *out_dummy)
{
modelica_metatype _outExp = NULL;
modelica_integer _dummy;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_dummy = __omcQ_24in_5Fdummy;
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _arr_ty = NULL;
modelica_metatype _exp_lst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
_arr_ty = tmpMeta6;
{
modelica_metatype __omcQ_24tmpVar13;
modelica_metatype* tmp8;
modelica_metatype tmpMeta9;
modelica_metatype __omcQ_24tmpVar12;
modelica_integer tmp10;
modelica_metatype _cr_loopVar = 0;
modelica_metatype _cr;
_cr_loopVar = omc_ComponentReference_expandCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))), _expandRecord);
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar13 = tmpMeta9;
tmp8 = &__omcQ_24tmpVar13;
while(1) {
tmp10 = 1;
if (!listEmpty(_cr_loopVar)) {
_cr = MMC_CAR(_cr_loopVar);
_cr_loopVar = MMC_CDR(_cr_loopVar);
tmp10--;
}
if (tmp10 == 0) {
__omcQ_24tmpVar12 = omc_Expression_makeCrefExp(threadData, _cr, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_arr_ty), 2))));
*tmp8 = mmc_mk_cons(__omcQ_24tmpVar12,0);
tmp8 = &MMC_CDR(*tmp8);
} else if (tmp10 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp8 = mmc_mk_nil();
tmpMeta7 = __omcQ_24tmpVar13;
}
_exp_lst = tmpMeta7;
tmpMeta1 = omc_Expression_listToArray(threadData, _exp_lst, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_arr_ty), 3))));
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_dummy) { *out_dummy = _dummy; }
return _outExp;
}
modelica_metatype boxptr_Expression_expandCrefs(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _expandRecord, modelica_metatype __omcQ_24in_5Fdummy, modelica_metatype *out_dummy)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer _dummy;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_expandRecord);
tmp2 = mmc_unbox_integer(__omcQ_24in_5Fdummy);
_outExp = omc_Expression_expandCrefs(threadData, _inExp, tmp1, tmp2, &_dummy);
if (out_dummy) { *out_dummy = mmc_mk_icon(_dummy); }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeVectorCall(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _tp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_exp, MMC_REFSTRUCTLIT(mmc_nil));
_outExp = omc_Expression_makePureBuiltinCall(threadData, _OMC_LIT36, tmpMeta1, _tp);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_emptyToWild(threadData_t *threadData, modelica_metatype _exp)
{
modelica_metatype _outExp = NULL;
modelica_metatype _ty = NULL;
modelica_metatype tmpMeta1;
modelica_boolean tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ty = omc_Expression_typeof(threadData, _exp);
tmp2 = (modelica_boolean)omc_Types_isZeroLengthArray(threadData, _ty);
if(tmp2)
{
tmpMeta1 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _OMC_LIT37, _ty);
tmpMeta3 = tmpMeta1;
}
else
{
tmpMeta3 = _exp;
}
_outExp = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_renameExpCrefIdent(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
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_metatype _ty1 = NULL;
modelica_metatype _ty2 = NULL;
modelica_string _name = NULL;
modelica_string _from = NULL;
modelica_string _to = NULL;
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;
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_boolean tmp16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
if (!listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_name = tmpMeta7;
_ty1 = tmpMeta8;
_ty2 = tmpMeta10;
_from = tmpMeta11;
_to = tmpMeta12;
tmp16 = (modelica_boolean)(stringEqual(_name, _from));
if(tmp16)
{
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta14 = mmc_mk_box4(4, &DAE_ComponentRef_CREF__IDENT__desc, _to, _ty1, tmpMeta13);
tmpMeta15 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, tmpMeta14, _ty2);
tmpMeta17 = tmpMeta15;
}
else
{
tmpMeta17 = _inExp;
}
_exp = tmpMeta17;
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _inTpl;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTpl;
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];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_isCrefListWithEqualIdents(threadData_t *threadData, modelica_metatype _iExpressions)
{
modelica_boolean _oCrefWithEqualIdents;
modelica_boolean _tmpCrefWithEqualIdents;
modelica_metatype _boolHelperList = NULL;
modelica_metatype _crefs = NULL;
modelica_metatype _head = NULL;
modelica_metatype _headCref = NULL;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _iExpressions;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_head = tmpMeta6;
tmp4 += 1;
tmp8 = omc_List_mapBoolAnd(threadData, _iExpressions, boxvar_Expression_isCref);
if (1 != tmp8) goto goto_2;
_crefs = omc_List_map(threadData, _iExpressions, boxvar_Expression_expCref);
_headCref = omc_Expression_expCref(threadData, _head);
tmp1 = omc_List_map1BoolAnd(threadData, _crefs, boxvar_ComponentReference_crefEqualWithoutLastSubs, _headCref);
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oCrefWithEqualIdents = tmp1;
_return: OMC_LABEL_UNUSED
return _oCrefWithEqualIdents;
}
modelica_metatype boxptr_Expression_isCrefListWithEqualIdents(threadData_t *threadData, modelica_metatype _iExpressions)
{
modelica_boolean _oCrefWithEqualIdents;
modelica_metatype out_oCrefWithEqualIdents;
_oCrefWithEqualIdents = omc_Expression_isCrefListWithEqualIdents(threadData, _iExpressions);
out_oCrefWithEqualIdents = mmc_mk_icon(_oCrefWithEqualIdents);
return out_oCrefWithEqualIdents;
}
DLLExport
modelica_metatype omc_Expression_expDimensionsList(threadData_t *threadData, modelica_metatype _inDims)
{
modelica_metatype _outValues = NULL;
modelica_metatype _dims = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
tmp6 = omc_List_mapBoolAnd(threadData, _inDims, boxvar_Expression_checkExpDimensionSizes);
if (1 != tmp6) goto goto_2;
tmpMeta1 = omc_List_map(threadData, _inDims, boxvar_Expression_expInt);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
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:;
}
}
_outValues = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outValues;
}
DLLExport
modelica_boolean omc_Expression_hasZeroDimension(threadData_t *threadData, modelica_metatype _inDims)
{
modelica_boolean _hasZeroDimension;
modelica_metatype _intDims = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_hasZeroDimension = 0;
if((listLength(_inDims) == ((modelica_integer) 0)))
{
_hasZeroDimension = 1;
goto _return;
}
_intDims = omc_Expression_dimensionsList(threadData, _inDims);
{
modelica_metatype _dim;
for (tmpMeta1 = _intDims; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_dim = MMC_CAR(tmpMeta1);
if((mmc_unbox_integer(_dim) == ((modelica_integer) 0)))
{
_hasZeroDimension = 1;
break;
}
}
}
_return: OMC_LABEL_UNUSED
return _hasZeroDimension;
}
modelica_metatype boxptr_Expression_hasZeroDimension(threadData_t *threadData, modelica_metatype _inDims)
{
modelica_boolean _hasZeroDimension;
modelica_metatype out_hasZeroDimension;
_hasZeroDimension = omc_Expression_hasZeroDimension(threadData, _inDims);
out_hasZeroDimension = mmc_mk_icon(_hasZeroDimension);
return out_hasZeroDimension;
}
DLLExport
modelica_metatype omc_Expression_dimensionsList(threadData_t *threadData, modelica_metatype _inDims)
{
modelica_metatype _outValues = NULL;
modelica_metatype _dims = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
tmp6 = omc_List_mapBoolAnd(threadData, _inDims, boxvar_Expression_checkDimensionSizes);
if (1 != tmp6) goto goto_2;
tmpMeta1 = omc_List_map(threadData, _inDims, boxvar_Expression_dimensionSizeAll);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
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:;
}
}
_outValues = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outValues;
}
DLLExport
modelica_boolean omc_Expression_checkDimensionSizes(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _value;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 7: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_value = tmp1;
_return: OMC_LABEL_UNUSED
return _value;
}
modelica_metatype boxptr_Expression_checkDimensionSizes(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _value;
modelica_metatype out_value;
_value = omc_Expression_checkDimensionSizes(threadData, _dim);
out_value = mmc_mk_icon(_value);
return out_value;
}
DLLExport
modelica_boolean omc_Expression_checkExpDimensionSizes(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _value;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
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,1) == 0) goto tmp3_end;
tmp1 = (mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_dim), 2)))) > ((modelica_integer) 0));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_value = tmp1;
_return: OMC_LABEL_UNUSED
return _value;
}
modelica_metatype boxptr_Expression_checkExpDimensionSizes(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _value;
modelica_metatype out_value;
_value = omc_Expression_checkExpDimensionSizes(threadData, _dim);
out_value = mmc_mk_icon(_value);
return out_value;
}
DLLExport
modelica_metatype omc_Expression_makeBinaryExp(threadData_t *threadData, modelica_metatype _inLhs, modelica_metatype _inOp, modelica_metatype _inRhs)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _inLhs, _inOp, _inRhs);
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_replaceDerOpInExpTraverser(threadData_t *threadData, modelica_metatype _e, modelica_metatype _optCr, modelica_metatype *out_outCr)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outCr = 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 = _e;
tmp4_2 = _optCr;
{
modelica_metatype _cr = NULL;
modelica_metatype _derCr = NULL;
modelica_metatype _cref_exp = NULL;
modelica_metatype _cref = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
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));
if (3 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_cref = tmpMeta6;
_cr = tmpMeta12;
tmp4 += 1;
_derCr = omc_ComponentReference_crefPrefixDer(threadData, _cr);
tmp13 = omc_ComponentReference_crefEqualNoStringCompare(threadData, _derCr, _cref);
if (1 != tmp13) goto goto_2;
_cref_exp = omc_Expression_crefExp(threadData, _derCr);
tmpMeta[0+0] = _cref_exp;
tmpMeta[0+1] = _optCr;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (!optionNone(tmp4_2)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (3 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta16)) goto tmp3_end;
tmpMeta17 = MMC_CAR(tmpMeta16);
tmpMeta18 = MMC_CDR(tmpMeta16);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,6,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
if (!listEmpty(tmpMeta18)) goto tmp3_end;
_cr = tmpMeta19;
_cr = omc_ComponentReference_crefPrefixDer(threadData, _cr);
_cref_exp = omc_Expression_crefExp(threadData, _cr);
tmpMeta[0+0] = _cref_exp;
tmpMeta[0+1] = mmc_mk_none();
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _e;
tmpMeta[0+1] = _optCr;
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];
_outCr = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outCr) { *out_outCr = _outCr; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_replaceDerOpInExpCond(threadData_t *threadData, modelica_metatype _e, modelica_metatype _cr, modelica_metatype *out_outCr)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outCr = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_Expression_traverseExpBottomUp(threadData, _e, boxvar_Expression_replaceDerOpInExpTraverser, _cr ,&_outCr);
_return: OMC_LABEL_UNUSED
if (out_outCr) { *out_outCr = _outCr; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_replaceDerOpInExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_replaceDerOpInExpTraverser, mmc_mk_none(), NULL);
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_fromAbsynOperator(threadData_t *threadData, modelica_metatype _aop, modelica_metatype _ty)
{
modelica_metatype _op = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _aop;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
tmpMeta5 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _ty);
tmpMeta1 = tmpMeta5;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _ty);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
tmpMeta7 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _ty);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta8;
tmpMeta8 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _ty);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta9;
tmpMeta9 = mmc_mk_box2(7, &DAE_Operator_POW__desc, _ty);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta10;
tmpMeta10 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _ty);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta11;
tmpMeta11 = mmc_mk_box2(25, &DAE_Operator_AND__desc, _ty);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta12;
tmpMeta12 = mmc_mk_box2(26, &DAE_Operator_OR__desc, _ty);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta13;
tmpMeta13 = mmc_mk_box2(27, &DAE_Operator_NOT__desc, _ty);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta14;
tmpMeta14 = mmc_mk_box2(28, &DAE_Operator_LESS__desc, _ty);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta15;
tmpMeta15 = mmc_mk_box2(29, &DAE_Operator_LESSEQ__desc, _ty);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta16;
tmpMeta16 = mmc_mk_box2(30, &DAE_Operator_GREATER__desc, _ty);
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta17;
tmpMeta17 = mmc_mk_box2(31, &DAE_Operator_GREATEREQ__desc, _ty);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta18;
tmpMeta18 = mmc_mk_box2(32, &DAE_Operator_EQUAL__desc, _ty);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta19;
tmpMeta19 = mmc_mk_box2(33, &DAE_Operator_NEQUAL__desc, _ty);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
tmpMeta20 = stringAppend(_OMC_LIT39,omc_Dump_opSymbol(threadData, _aop));
tmpMeta21 = stringAppend(tmpMeta20,_OMC_LIT40);
fputs(MMC_STRINGDATA(tmpMeta21),stdout);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_op = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _op;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_fromAbsynExpOpt(threadData_t *threadData, modelica_metatype _aoe)
{
modelica_metatype _oe = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _aoe;
{
modelica_metatype _ae = NULL;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_ae = tmpMeta6;
_e = omc_Expression_fromAbsynExp(threadData, _ae);
tmpMeta1 = mmc_mk_some(_e);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oe = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oe;
}
DLLExport
modelica_metatype omc_Expression_fargsToExps(threadData_t *threadData, modelica_metatype _inFargs)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inFargs;
{
modelica_metatype _aexps = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!listEmpty(tmpMeta7)) goto tmp3_end;
_aexps = tmpMeta6;
tmpMeta1 = omc_List_map(threadData, _aexps, boxvar_Expression_fromAbsynExp);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
fputs(MMC_STRINGDATA(_OMC_LIT41),stdout);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExps;
}
DLLExport
modelica_metatype omc_Expression_fromAbsynExp(threadData_t *threadData, modelica_metatype _inAExp)
{
modelica_metatype _outDExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inAExp;
{
modelica_integer _i;
modelica_real _r;
modelica_boolean _b;
modelica_string _s = NULL;
modelica_metatype _ae = NULL;
modelica_metatype _ae1 = NULL;
modelica_metatype _ae2 = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _aop = NULL;
modelica_metatype _acr = NULL;
modelica_metatype _aexps = NULL;
modelica_metatype _aexpslst = NULL;
modelica_metatype _fargs = NULL;
modelica_metatype _p = NULL;
modelica_metatype _aoe = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _op = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _expslst = NULL;
modelica_metatype _oe = 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_integer tmp7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmpMeta8 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_s = tmpMeta9;
_r = stringReal(_s);
tmpMeta10 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
_b = tmp12;
tmpMeta13 = mmc_mk_box2(6, &DAE_Exp_BCONST__desc, mmc_mk_boolean(_b));
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_s = tmpMeta14;
tmpMeta15 = mmc_mk_box2(5, &DAE_Exp_SCONST__desc, _s);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_acr = tmpMeta16;
_cr = omc_ComponentReference_toExpCref(threadData, _acr);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr, _OMC_LIT42);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae1 = tmpMeta17;
_aop = tmpMeta18;
_ae2 = tmpMeta19;
_op = omc_Expression_fromAbsynOperator(threadData, _aop, _OMC_LIT42);
_e1 = omc_Expression_fromAbsynExp(threadData, _ae1);
_e2 = omc_Expression_fromAbsynExp(threadData, _ae2);
tmpMeta20 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_aop = tmpMeta21;
_ae = tmpMeta22;
_op = omc_Expression_fromAbsynOperator(threadData, _aop, _OMC_LIT42);
_e = omc_Expression_fromAbsynExp(threadData, _ae);
tmpMeta23 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op, _e);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae1 = tmpMeta24;
_aop = tmpMeta25;
_ae2 = tmpMeta26;
_op = omc_Expression_fromAbsynOperator(threadData, _aop, _OMC_LIT42);
_e1 = omc_Expression_fromAbsynExp(threadData, _ae1);
_e2 = omc_Expression_fromAbsynExp(threadData, _ae2);
tmpMeta27 = mmc_mk_box4(12, &DAE_Exp_LBINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_aop = tmpMeta28;
_ae = tmpMeta29;
_op = omc_Expression_fromAbsynOperator(threadData, _aop, _OMC_LIT42);
_e = omc_Expression_fromAbsynExp(threadData, _ae);
tmpMeta30 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, _op, _e);
tmpMeta1 = tmpMeta30;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae1 = tmpMeta31;
_aop = tmpMeta32;
_ae2 = tmpMeta33;
_op = omc_Expression_fromAbsynOperator(threadData, _aop, _OMC_LIT42);
_e1 = omc_Expression_fromAbsynExp(threadData, _ae1);
_e2 = omc_Expression_fromAbsynExp(threadData, _ae2);
tmpMeta34 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _e1, _op, _e2, mmc_mk_integer(((modelica_integer) 0)), mmc_mk_none());
tmpMeta1 = tmpMeta34;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
_ae = tmp4_1;
tmpMeta35 = omc_AbsynUtil_canonIfExp(threadData, _ae);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,10,4) == 0) goto goto_2;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 3));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 4));
_cond = tmpMeta36;
_ae1 = tmpMeta37;
_ae2 = tmpMeta38;
_e = omc_Expression_fromAbsynExp(threadData, _cond);
_e1 = omc_Expression_fromAbsynExp(threadData, _ae1);
_e2 = omc_Expression_fromAbsynExp(threadData, _ae2);
tmpMeta39 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _e, _e1, _e2);
tmpMeta1 = tmpMeta39;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,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));
_acr = tmpMeta40;
_fargs = tmpMeta41;
_exps = omc_Expression_fargsToExps(threadData, _fargs);
_p = omc_AbsynUtil_crefToPath(threadData, _acr);
tmpMeta42 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _p, _exps, _OMC_LIT45);
tmpMeta1 = tmpMeta42;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,2) == 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_acr = tmpMeta43;
_fargs = tmpMeta44;
_exps = omc_Expression_fargsToExps(threadData, _fargs);
_p = omc_AbsynUtil_crefToPath(threadData, _acr);
tmpMeta45 = mmc_mk_box5(18, &DAE_Exp_PARTEVALFUNCTION__desc, _p, _exps, _OMC_LIT42, _OMC_LIT42);
tmpMeta1 = tmpMeta45;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_aexps = tmpMeta46;
_exps = omc_List_map(threadData, _aexps, boxvar_Expression_fromAbsynExp);
tmpMeta47 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _OMC_LIT42, mmc_mk_boolean(0), _exps);
tmpMeta1 = tmpMeta47;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,1) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_aexpslst = tmpMeta48;
_expslst = omc_List_mapList(threadData, _aexpslst, boxvar_Expression_fromAbsynExp);
_i = listLength(listHead(_expslst));
tmpMeta49 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _OMC_LIT42, mmc_mk_integer(_i), _expslst);
tmpMeta1 = tmpMeta49;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,3) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae1 = tmpMeta50;
_aoe = tmpMeta51;
_ae2 = tmpMeta52;
_e1 = omc_Expression_fromAbsynExp(threadData, _ae1);
_e2 = omc_Expression_fromAbsynExp(threadData, _ae2);
_oe = omc_Expression_fromAbsynExpOpt(threadData, _aoe);
tmpMeta53 = mmc_mk_box5(21, &DAE_Exp_RANGE__desc, _OMC_LIT42, _e1, _oe, _e2);
tmpMeta1 = tmpMeta53;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_aexps = tmpMeta54;
_exps = omc_List_map(threadData, _aexps, boxvar_Expression_fromAbsynExp);
tmpMeta55 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _exps);
tmpMeta1 = tmpMeta55;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
tmpMeta56 = stringAppend(_OMC_LIT46,omc_Dump_printExpStr(threadData, _inAExp));
tmpMeta57 = stringAppend(tmpMeta56,_OMC_LIT40);
fputs(MMC_STRINGDATA(tmpMeta57),stdout);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDExp;
}
DLLExport
modelica_metatype omc_Expression_arrayContent(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outContent = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inExp;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,16,3) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
_outContent = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _outContent;
}
DLLExport
modelica_metatype omc_Expression_arrayElements(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _expl = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _crl = NULL;
modelica_metatype _mat = 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));
_cr = tmpMeta6;
_crl = omc_ComponentReference_expandCref(threadData, _cr, 0);
tmpMeta1 = omc_List_map(threadData, _crl, boxvar_Expression_crefExp);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta8;
tmpMeta1 = omc_List_mapFlat(threadData, _expl, boxvar_Expression_arrayElements);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta9;
tmpMeta1 = _expl;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_mat = tmpMeta10;
tmpMeta1 = omc_List_flatten(threadData, _mat);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta11;
tmpMeta11 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_getCrefFromCrefOrAsub(threadData_t *threadData, modelica_metatype _exp)
{
modelica_metatype _cr = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
tmpMeta1 = _cr;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_cr = tmpMeta8;
tmpMeta1 = _cr;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cr = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _cr;
}
DLLExport
modelica_metatype omc_Expression_transposeArray(threadData_t *threadData, modelica_metatype _inArray, modelica_boolean *out_outWasTransposed)
{
modelica_metatype _outArray = NULL;
modelica_boolean _outWasTransposed;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inArray;
{
modelica_metatype _ty = NULL;
modelica_metatype _row_ty = NULL;
modelica_metatype _dim1 = NULL;
modelica_metatype _dim2 = NULL;
modelica_metatype _rest_dims = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _matrix = NULL;
modelica_integer _i;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,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;
tmpMeta9 = MMC_CAR(tmpMeta8);
tmpMeta10 = MMC_CDR(tmpMeta8);
if (listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmpMeta10);
tmpMeta12 = MMC_CDR(tmpMeta10);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!listEmpty(tmpMeta13)) goto tmp3_end;
_ty = tmpMeta7;
_dim1 = tmpMeta9;
_dim2 = tmpMeta11;
_rest_dims = tmpMeta12;
tmpMeta15 = mmc_mk_cons(_dim1, _rest_dims);
tmpMeta14 = mmc_mk_cons(_dim2, tmpMeta15);
tmpMeta16 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta14);
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta18 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta16, mmc_mk_boolean(0), tmpMeta17);
tmpMeta[0+0] = tmpMeta18;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,6,2) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
if (listEmpty(tmpMeta21)) goto tmp3_end;
tmpMeta22 = MMC_CAR(tmpMeta21);
tmpMeta23 = MMC_CDR(tmpMeta21);
if (listEmpty(tmpMeta23)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmpMeta23);
tmpMeta25 = MMC_CDR(tmpMeta23);
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta20;
_dim1 = tmpMeta22;
_dim2 = tmpMeta24;
_rest_dims = tmpMeta25;
_expl = tmpMeta26;
tmpMeta27 = mmc_mk_cons(_dim1, _rest_dims);
tmpMeta28 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta27);
_row_ty = tmpMeta28;
_matrix = omc_List_map(threadData, _expl, boxvar_Expression_getArrayOrMatrixContents);
_matrix = omc_List_transposeList(threadData, _matrix);
_expl = omc_List_map2(threadData, _matrix, boxvar_Expression_makeArray, _row_ty, mmc_mk_boolean(1));
tmpMeta30 = mmc_mk_cons(_dim1, _rest_dims);
tmpMeta29 = mmc_mk_cons(_dim2, tmpMeta30);
tmpMeta31 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta29);
tmpMeta32 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta31, mmc_mk_boolean(0), _expl);
tmpMeta[0+0] = tmpMeta32;
tmp1_c1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,6,2) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 3));
if (listEmpty(tmpMeta35)) goto tmp3_end;
tmpMeta36 = MMC_CAR(tmpMeta35);
tmpMeta37 = MMC_CDR(tmpMeta35);
if (listEmpty(tmpMeta37)) goto tmp3_end;
tmpMeta38 = MMC_CAR(tmpMeta37);
tmpMeta39 = MMC_CDR(tmpMeta37);
if (!listEmpty(tmpMeta39)) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta34;
_dim1 = tmpMeta36;
_dim2 = tmpMeta38;
_matrix = tmpMeta40;
_matrix = omc_List_transposeList(threadData, _matrix);
tmpMeta41 = mmc_mk_cons(_dim2, mmc_mk_cons(_dim1, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta42 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta41);
_ty = tmpMeta42;
_i = listLength(_matrix);
tmpMeta43 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _ty, mmc_mk_integer(_i), _matrix);
tmpMeta[0+0] = tmpMeta43;
tmp1_c1 = 1;
goto tmp3_done;
}
case 3: {
tmpMeta[0+0] = _inArray;
tmp1_c1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArray = tmpMeta[0+0];
_outWasTransposed = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_outWasTransposed) { *out_outWasTransposed = _outWasTransposed; }
return _outArray;
}
modelica_metatype boxptr_Expression_transposeArray(threadData_t *threadData, modelica_metatype _inArray, modelica_metatype *out_outWasTransposed)
{
modelica_boolean _outWasTransposed;
modelica_metatype _outArray = NULL;
_outArray = omc_Expression_transposeArray(threadData, _inArray, &_outWasTransposed);
if (out_outWasTransposed) { *out_outWasTransposed = mmc_mk_icon(_outWasTransposed); }
return _outArray;
}
DLLExport
modelica_metatype omc_Expression_matrixToArray(threadData_t *threadData, modelica_metatype _inMatrix)
{
modelica_metatype _outArray = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inMatrix;
{
modelica_metatype _ty = NULL;
modelica_metatype _row_ty = NULL;
modelica_metatype _matrix = NULL;
modelica_metatype _rows = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta6;
_matrix = tmpMeta7;
_row_ty = omc_Expression_unliftArray(threadData, _ty);
_rows = omc_List_map2(threadData, _matrix, boxvar_Expression_makeArray, _row_ty, mmc_mk_boolean(1));
tmpMeta8 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(0), _rows);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inMatrix;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArray = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outArray;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_hashOp(threadData_t *threadData, modelica_metatype _op)
{
modelica_integer _hash;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
modelica_metatype _path = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = ((modelica_integer) 25);
goto tmp3_done;
}
case 4: {
tmp1 = ((modelica_integer) 26);
goto tmp3_done;
}
case 5: {
tmp1 = ((modelica_integer) 27);
goto tmp3_done;
}
case 6: {
tmp1 = ((modelica_integer) 28);
goto tmp3_done;
}
case 7: {
tmp1 = ((modelica_integer) 29);
goto tmp3_done;
}
case 8: {
tmp1 = ((modelica_integer) 30);
goto tmp3_done;
}
case 9: {
tmp1 = ((modelica_integer) 31);
goto tmp3_done;
}
case 10: {
tmp1 = ((modelica_integer) 32);
goto tmp3_done;
}
case 11: {
tmp1 = ((modelica_integer) 33);
goto tmp3_done;
}
case 12: {
tmp1 = ((modelica_integer) 34);
goto tmp3_done;
}
case 13: {
tmp1 = ((modelica_integer) 35);
goto tmp3_done;
}
case 14: {
tmp1 = ((modelica_integer) 36);
goto tmp3_done;
}
case 15: {
tmp1 = ((modelica_integer) 37);
goto tmp3_done;
}
case 16: {
tmp1 = ((modelica_integer) 38);
goto tmp3_done;
}
case 17: {
tmp1 = ((modelica_integer) 39);
goto tmp3_done;
}
case 18: {
tmp1 = ((modelica_integer) 40);
goto tmp3_done;
}
case 19: {
tmp1 = ((modelica_integer) 41);
goto tmp3_done;
}
case 20: {
tmp1 = ((modelica_integer) 42);
goto tmp3_done;
}
case 21: {
tmp1 = ((modelica_integer) 43);
goto tmp3_done;
}
case 22: {
tmp1 = ((modelica_integer) 44);
goto tmp3_done;
}
case 23: {
tmp1 = ((modelica_integer) 45);
goto tmp3_done;
}
case 24: {
tmp1 = ((modelica_integer) 46);
goto tmp3_done;
}
case 25: {
tmp1 = ((modelica_integer) 47);
goto tmp3_done;
}
case 26: {
tmp1 = ((modelica_integer) 48);
goto tmp3_done;
}
case 27: {
tmp1 = ((modelica_integer) 49);
goto tmp3_done;
}
case 28: {
tmp1 = ((modelica_integer) 50);
goto tmp3_done;
}
case 29: {
tmp1 = ((modelica_integer) 51);
goto tmp3_done;
}
case 30: {
tmp1 = ((modelica_integer) 52);
goto tmp3_done;
}
case 31: {
tmp1 = ((modelica_integer) 53);
goto tmp3_done;
}
case 32: {
tmp1 = ((modelica_integer) 54);
goto tmp3_done;
}
case 33: {
tmp1 = ((modelica_integer) 55);
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_path = tmpMeta5;
tmp1 = ((modelica_integer) 56) + stringHashDjb2(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT47, 1, 0));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_hash = tmp1;
_return: OMC_LABEL_UNUSED
return _hash;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_hashOp(threadData_t *threadData, modelica_metatype _op)
{
modelica_integer _hash;
modelica_metatype out_hash;
_hash = omc_Expression_hashOp(threadData, _op);
out_hash = mmc_mk_icon(_hash);
return out_hash;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_hashReductionIter(threadData_t *threadData, modelica_metatype _iter)
{
modelica_integer _hash;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iter;
{
modelica_string _id = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = 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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
_id = tmpMeta6;
_e1 = tmpMeta7;
_e2 = tmpMeta9;
tmp1 = ((modelica_integer) 23) + stringHashDjb2(_id) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashExp(threadData, _e2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta12)) goto tmp3_end;
_id = tmpMeta10;
_e1 = tmpMeta11;
tmp1 = ((modelica_integer) 24) + stringHashDjb2(_id) + omc_Expression_hashExp(threadData, _e1);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_hash = tmp1;
_return: OMC_LABEL_UNUSED
return _hash;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_hashReductionIter(threadData_t *threadData, modelica_metatype _iter)
{
modelica_integer _hash;
modelica_metatype out_hash;
_hash = omc_Expression_hashReductionIter(threadData, _iter);
out_hash = mmc_mk_icon(_hash);
return out_hash;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_hashReductionInfo(threadData_t *threadData, modelica_metatype _info)
{
modelica_integer _hash;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _info;
{
modelica_metatype _path = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_path = tmpMeta6;
tmp1 = ((modelica_integer) 22) + stringHashDjb2(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT47, 1, 0));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_hash = tmp1;
_return: OMC_LABEL_UNUSED
return _hash;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_hashReductionInfo(threadData_t *threadData, modelica_metatype _info)
{
modelica_integer _hash;
modelica_metatype out_hash;
_hash = omc_Expression_hashReductionInfo(threadData, _info);
out_hash = mmc_mk_icon(_hash);
return out_hash;
}
DLLExport
modelica_integer omc_Expression_hashExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_integer _hash;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_real _r;
modelica_integer _i;
modelica_boolean _b;
modelica_string _s = NULL;
modelica_metatype _path = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _op = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _mexpl = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _iters = 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 < 27; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmp4 += 25;
tmp1 = stringHashDjb2(intString(_i));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_real tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
_r = tmp9;
tmp4 += 24;
tmp1 = stringHashDjb2(realString(_r));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_integer tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp11 = mmc_unbox_integer(tmpMeta10);
_b = tmp11;
tmp4 += 23;
tmp1 = stringHashDjb2((_b?_OMC_LIT48:_OMC_LIT49));
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_s = tmpMeta12;
tmp4 += 22;
tmp1 = stringHashDjb2(_s);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_path = tmpMeta13;
tmp4 += 21;
tmp1 = stringHashDjb2(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT47, 1, 0));
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta14;
tmp4 += 20;
tmp1 = omc_ComponentReference_hashComponentRef(threadData, _cr);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta15;
_op = tmpMeta16;
_e2 = tmpMeta17;
tmp4 += 19;
tmp1 = ((modelica_integer) 1) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashOp(threadData, _op) + omc_Expression_hashExp(threadData, _e2);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta18;
_e1 = tmpMeta19;
tmp4 += 18;
tmp1 = ((modelica_integer) 2) + omc_Expression_hashOp(threadData, _op) + omc_Expression_hashExp(threadData, _e1);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta20;
_op = tmpMeta21;
_e2 = tmpMeta22;
tmp4 += 17;
tmp1 = ((modelica_integer) 3) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashOp(threadData, _op) + omc_Expression_hashExp(threadData, _e2);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,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));
_op = tmpMeta23;
_e1 = tmpMeta24;
tmp4 += 16;
tmp1 = ((modelica_integer) 4) + omc_Expression_hashOp(threadData, _op) + omc_Expression_hashExp(threadData, _e1);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta25;
_op = tmpMeta26;
_e2 = tmpMeta27;
tmp4 += 15;
tmp1 = ((modelica_integer) 5) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashOp(threadData, _op) + omc_Expression_hashExp(threadData, _e2);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta28;
_e2 = tmpMeta29;
_e3 = tmpMeta30;
tmp4 += 14;
tmp1 = ((modelica_integer) 6) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashExp(threadData, _e2) + omc_Expression_hashExp(threadData, _e3);
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta31;
_expl = tmpMeta32;
tmp4 += 13;
tmp1 = ((modelica_integer) 7) + stringHashDjb2(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT47, 1, 0)) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _expl, boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta33;
_expl = tmpMeta34;
tmp4 += 12;
tmp1 = ((modelica_integer) 8) + stringHashDjb2(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT47, 1, 0)) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _expl, boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta35;
_expl = tmpMeta36;
tmp4 += 11;
tmp1 = ((modelica_integer) 9) + stringHashDjb2(omc_AbsynUtil_pathString(threadData, _path, _OMC_LIT47, 1, 0)) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _expl, boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta37;
tmp4 += 10;
tmp1 = ((modelica_integer) 10) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _expl, boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_mexpl = tmpMeta38;
tmp4 += 9;
tmp1 = ((modelica_integer) 11) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, omc_List_flatten(threadData, _mexpl), boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta40)) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta40), 1));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta39;
_e2 = tmpMeta41;
_e3 = tmpMeta42;
tmp4 += 8;
tmp1 = ((modelica_integer) 12) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashExp(threadData, _e2) + omc_Expression_hashExp(threadData, _e3);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta44)) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta43;
_e3 = tmpMeta45;
tmp4 += 7;
tmp1 = ((modelica_integer) 13) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashExp(threadData, _e3);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta46;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta46;
tmp4 += 6;
tmp1 = ((modelica_integer) 14) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _expl, boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta47;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta47;
tmp4 += 5;
tmp1 = ((modelica_integer) 15) + omc_Expression_hashExp(threadData, _e1);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta48;
_expl = tmpMeta49;
tmp4 += 4;
tmp1 = ((modelica_integer) 16) + omc_Expression_hashExp(threadData, _e1) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _expl, boxvar_Expression_hashExp), boxvar_intAdd));
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_integer tmp52;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp52 = mmc_unbox_integer(tmpMeta51);
_e1 = tmpMeta50;
_i = tmp52;
tmp4 += 3;
tmp1 = ((modelica_integer) 17) + omc_Expression_hashExp(threadData, _e1) + stringHashDjb2(intString(_i));
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta54)) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 1));
_e1 = tmpMeta53;
_e2 = tmpMeta55;
tmp4 += 2;
tmp1 = ((modelica_integer) 18) + omc_Expression_hashExp(threadData, _e1) + omc_Expression_hashExp(threadData, _e2);
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta57)) goto tmp3_end;
_e1 = tmpMeta56;
tmp4 += 1;
tmp1 = ((modelica_integer) 19) + omc_Expression_hashExp(threadData, _e1);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_info = tmpMeta58;
_e1 = tmpMeta59;
_iters = tmpMeta60;
tmp1 = ((modelica_integer) 22) + omc_Expression_hashReductionInfo(threadData, _info) + omc_Expression_hashExp(threadData, _e1) + mmc_unbox_integer(omc_List_reduce(threadData, omc_List_map(threadData, _iters, boxvar_Expression_hashReductionIter), boxvar_intAdd));
goto tmp3_done;
}
case 26: {
tmp1 = stringHashDjb2(omc_ExpressionDump_printExpStr(threadData, _e));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 27) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_hash = tmp1;
_return: OMC_LABEL_UNUSED
return _hash;
}
modelica_metatype boxptr_Expression_hashExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_integer _hash;
modelica_metatype out_hash;
_hash = omc_Expression_hashExp(threadData, _e);
out_hash = mmc_mk_icon(_hash);
return out_hash;
}
DLLExport
modelica_integer omc_Expression_hashExpMod(threadData_t *threadData, modelica_metatype _e, modelica_integer _mod)
{
modelica_integer _hash;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_hash = modelica_integer_mod(labs(omc_Expression_hashExp(threadData, _e)), _mod);
_return: OMC_LABEL_UNUSED
return _hash;
}
modelica_metatype boxptr_Expression_hashExpMod(threadData_t *threadData, modelica_metatype _e, modelica_metatype _mod)
{
modelica_integer tmp1;
modelica_integer _hash;
modelica_metatype out_hash;
tmp1 = mmc_unbox_integer(_mod);
_hash = omc_Expression_hashExpMod(threadData, _e, tmp1);
out_hash = mmc_mk_icon(_hash);
return out_hash;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_promoteExp3(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTypes)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTypes;
{
modelica_metatype _ty = NULL;
modelica_metatype _rest_ty = NULL;
modelica_metatype _exp = 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;
tmpMeta1 = _inExp;
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 (!listEmpty(tmpMeta7)) goto tmp3_end;
_ty = tmpMeta6;
tmpMeta8 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = omc_Expression_makeArray(threadData, tmpMeta8, _ty, 1);
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);
_ty = tmpMeta9;
_rest_ty = tmpMeta10;
_exp = omc_Expression_promoteExp3(threadData, _inExp, _rest_ty);
tmpMeta11 = mmc_mk_cons(_exp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = omc_Expression_makeArray(threadData, tmpMeta11, _ty, 0);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_promoteExp2(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inIsArray, modelica_integer _inDims, modelica_metatype _inTypes)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inExp;
tmp4_2 = _inIsArray;
tmp4_3 = _inTypes;
{
modelica_metatype _ty = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _rest_ty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta1 = _inExp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmp4_3);
tmpMeta8 = MMC_CDR(tmp4_3);
_expl = tmpMeta6;
_ty = tmpMeta7;
_rest_ty = tmpMeta8;
_expl = omc_List_map3(threadData, _expl, boxvar_Expression_promoteExp2, mmc_mk_boolean(0), mmc_mk_integer(_inDims), _rest_ty);
tmpMeta9 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(0), _expl);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (1 != tmp4_2) goto tmp3_end;
if (listEmpty(tmp4_3)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_3);
tmpMeta11 = MMC_CDR(tmp4_3);
_ty = tmpMeta10;
tmpMeta13 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_inDims));
tmpMeta12 = mmc_mk_cons(_inExp, mmc_mk_cons(tmpMeta13, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta1 = omc_Expression_makePureBuiltinCall(threadData, _OMC_LIT50, tmpMeta12, _ty);
goto tmp3_done;
}
case 3: {
tmpMeta1 = omc_Expression_promoteExp3(threadData, _inExp, _inTypes);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_promoteExp2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inIsArray, modelica_metatype _inDims, modelica_metatype _inTypes)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inIsArray);
tmp2 = mmc_unbox_integer(_inDims);
_outExp = omc_Expression_promoteExp2(threadData, _inExp, tmp1, tmp2, _inTypes);
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makePromotedTypes(threadData_t *threadData, modelica_metatype _inDimensions, modelica_metatype _inElementType, modelica_metatype _inAccumTypes)
{
modelica_metatype _outAccumTypes = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDimensions;
{
modelica_metatype _rest_dims = NULL;
modelica_metatype _ty = 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 (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_rest_dims = tmpMeta7;
tmpMeta8 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _inElementType, _inDimensions);
_ty = tmpMeta8;
tmpMeta9 = mmc_mk_cons(_ty, _inAccumTypes);
_inDimensions = _rest_dims;
_inAccumTypes = tmpMeta9;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta1 = listReverse(_inAccumTypes);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outAccumTypes = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outAccumTypes;
}
DLLExport
modelica_metatype omc_Expression_promoteExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inType, modelica_integer _inDims, modelica_metatype *out_outType)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_integer _dims_to_add;
modelica_metatype _ty = NULL;
modelica_metatype _res_ty = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _added_dims = NULL;
modelica_boolean _is_array_ty;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
modelica_metatype tmpMeta7;
_dims_to_add = _inDims - omc_Types_numberOfDimensions(threadData, _inType);
tmp6 = (_dims_to_add > ((modelica_integer) 0));
if (1 != tmp6) goto goto_2;
_added_dims = omc_List_fill(threadData, _OMC_LIT51, _dims_to_add);
_dims = listAppend(omc_Types_getDimensions(threadData, _inType), _added_dims);
_ty = omc_Types_arrayElementType(threadData, _inType);
_res_ty = omc_Types_liftArrayListDims(threadData, _ty, _dims);
_ty = omc_Types_simplifyType(threadData, _ty);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
_tys = omc_Expression_makePromotedTypes(threadData, _dims, _ty, tmpMeta7);
_is_array_ty = omc_Types_isArray(threadData, _inType);
_exp = omc_Expression_promoteExp2(threadData, _inExp, _is_array_ty, _inDims, _tys);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _res_ty;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inType;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outType = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outType) { *out_outType = _outType; }
return _outExp;
}
modelica_metatype boxptr_Expression_promoteExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inType, modelica_metatype _inDims, modelica_metatype *out_outType)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inDims);
_outExp = omc_Expression_promoteExp(threadData, _inExp, _inType, tmp1, out_outType);
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_equationExpEqual(threadData_t *threadData, modelica_metatype _exp1, modelica_metatype _exp2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _exp1;
tmp4_2 = _exp2;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _e4 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_e1 = tmpMeta6;
_e2 = tmpMeta7;
tmp1 = omc_Expression_expEqual(threadData, _e1, _e2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_e1 = tmpMeta8;
_e2 = tmpMeta9;
tmp1 = omc_Expression_expEqual(threadData, _e1, _e2);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e1 = tmpMeta10;
_e2 = tmpMeta11;
_e3 = tmpMeta12;
_e4 = tmpMeta13;
tmp1 = (omc_Expression_expEqual(threadData, _e1, _e3) && omc_Expression_expEqual(threadData, _e2, _e4));
goto tmp3_done;
}
case 3: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_equationExpEqual(threadData_t *threadData, modelica_metatype _exp1, modelica_metatype _exp2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_equationExpEqual(threadData, _exp1, _exp2);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_metatype omc_Expression_splitArray(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean *out_didSplit)
{
modelica_metatype _outExp = NULL;
modelica_boolean _didSplit;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _expl = NULL;
modelica_metatype _mat = NULL;
modelica_integer _istart;
modelica_integer _istop;
modelica_integer _istep;
modelica_metatype _step = 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,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta6;
tmpMeta[0+0] = _expl;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_mat = tmpMeta7;
tmpMeta[0+0] = omc_List_flatten(threadData, _mat);
tmp1_c1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmp10 = mmc_unbox_integer(tmpMeta9);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_istart = tmp10;
_step = tmpMeta11;
_istop = tmp14;
{
modelica_metatype __omcQ_24tmpVar15;
modelica_metatype* tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype __omcQ_24tmpVar14;
modelica_integer tmp19;
modelica_metatype _i_loopVar = 0;
modelica_integer tmp20 = 0;
modelica_metatype _i;
{
modelica_metatype tmp23_1;
tmp23_1 = _step;
{
volatile mmc_switch_type tmp23;
int tmp24;
tmp23 = 0;
for (; tmp23 < 2; tmp23++) {
switch (MMC_SWITCH_CAST(tmp23)) {
case 0: {
if (!optionNone(tmp23_1)) goto tmp22_end;
tmp20 = ((modelica_integer) 1);
goto tmp22_done;
}
case 1: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_integer tmp27;
if (optionNone(tmp23_1)) goto tmp22_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp23_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,0,1) == 0) goto tmp22_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 2));
tmp27 = mmc_unbox_integer(tmpMeta26);
_istep = tmp27;
tmp20 = _istep;
goto tmp22_done;
}
}
goto tmp22_end;
tmp22_end: ;
}
goto goto_21;
goto_21:;
goto goto_2;
goto tmp22_done;
tmp22_done:;
}
}_i_loopVar = omc_ExpressionSimplify_simplifyRange(threadData, _istart, tmp20, _istop);
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar15 = tmpMeta17;
tmp16 = &__omcQ_24tmpVar15;
while(1) {
tmp19 = 1;
if (!listEmpty(_i_loopVar)) {
_i = MMC_CAR(_i_loopVar);
_i_loopVar = MMC_CDR(_i_loopVar);
tmp19--;
}
if (tmp19 == 0) {
tmpMeta18 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, _i);
__omcQ_24tmpVar14 = tmpMeta18;
*tmp16 = mmc_mk_cons(__omcQ_24tmpVar14,0);
tmp16 = &MMC_CDR(*tmp16);
} else if (tmp19 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp16 = mmc_mk_nil();
tmpMeta15 = __omcQ_24tmpVar15;
}
tmpMeta[0+0] = tmpMeta15;
tmp1_c1 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta28;
tmpMeta28 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta[0+0] = tmpMeta28;
tmp1_c1 = 0;
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];
_didSplit = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_didSplit) { *out_didSplit = _didSplit; }
return _outExp;
}
modelica_metatype boxptr_Expression_splitArray(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype *out_didSplit)
{
modelica_boolean _didSplit;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_splitArray(threadData, _inExp, &_didSplit);
if (out_didSplit) { *out_didSplit = mmc_mk_icon(_didSplit); }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_splitRecord2(threadData_t *threadData, modelica_metatype _var, modelica_metatype _cr)
{
modelica_metatype _exp = NULL;
modelica_string _n = NULL;
modelica_metatype _tt = NULL;
modelica_metatype _ty = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _var;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
_n = tmpMeta2;
_tt = tmpMeta3;
_ty = omc_Types_simplifyType(threadData, _tt);
tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
_exp = omc_Expression_makeCrefExp(threadData, omc_ComponentReference_crefPrependIdent(threadData, _cr, _n, tmpMeta4, _ty), _ty);
_return: OMC_LABEL_UNUSED
return _exp;
}
DLLExport
modelica_metatype omc_Expression_splitRecord(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _ty)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _ty;
{
modelica_metatype _exp = NULL;
modelica_metatype _vs = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _p1 = NULL;
modelica_metatype _p2 = NULL;
modelica_metatype _exps = 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,20,2) == 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,17,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (!listEmpty(tmpMeta8)) goto tmp3_end;
goto goto_2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_cr = tmpMeta9;
_vs = tmpMeta10;
tmpMeta1 = omc_List_map1(threadData, _vs, boxvar_Expression_splitRecord2, _cr);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,9,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,3,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
_p1 = tmpMeta11;
_exps = tmpMeta12;
_p2 = tmpMeta16;
tmp17 = omc_AbsynUtil_pathEqual(threadData, _p1, _p2);
if (1 != tmp17) goto goto_2;
tmpMeta1 = _exps;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exps = tmpMeta18;
tmpMeta1 = _exps;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExps;
}
DLLExport
modelica_metatype omc_Expression_dimensionsToExps(threadData_t *threadData, modelica_metatype _dims)
{
modelica_metatype _exps = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta10;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_exps = tmpMeta1;
{
modelica_metatype _d;
for (tmpMeta2 = _dims; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_d = MMC_CAR(tmpMeta2);
{
modelica_metatype tmp6_1;
tmp6_1 = _d;
{
modelica_metatype _exp = NULL;
volatile mmc_switch_type tmp6;
int tmp7;
tmp6 = 0;
for (; tmp6 < 2; tmp6++) {
switch (MMC_SWITCH_CAST(tmp6)) {
case 0: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,3,1) == 0) goto tmp5_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
_exp = tmpMeta8;
tmpMeta9 = mmc_mk_cons(_exp, _exps);
tmpMeta3 = tmpMeta9;
goto tmp5_done;
}
case 1: {
tmpMeta3 = _exps;
goto tmp5_done;
}
}
goto tmp5_end;
tmp5_end: ;
}
goto goto_4;
goto_4:;
MMC_THROW_INTERNAL();
goto tmp5_done;
tmp5_done:;
}
}
_exps = tmpMeta3;
}
}
_exps = listReverse(_exps);
_return: OMC_LABEL_UNUSED
return _exps;
}
DLLExport
modelica_boolean omc_Expression_isNotWild(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,0) == 0) goto tmp3_end;
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:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isNotWild(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isNotWild(threadData, _exp);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isWild(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isWild(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isWild(threadData, _exp);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_priorityLBinop(threadData_t *threadData, modelica_metatype _inOp)
{
modelica_integer _outPriority;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOp;
{
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,22,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 8);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,23,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 9);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPriority = tmp1;
_return: OMC_LABEL_UNUSED
return _outPriority;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_priorityLBinop(threadData_t *threadData, modelica_metatype _inOp)
{
modelica_integer _outPriority;
modelica_metatype out_outPriority;
_outPriority = omc_Expression_priorityLBinop(threadData, _inOp);
out_outPriority = mmc_mk_icon(_outPriority);
return out_outPriority;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_priorityBinopRhs(threadData_t *threadData, modelica_metatype _inOp)
{
modelica_integer _outPriority;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = ((modelica_integer) 6);
goto tmp3_done;
}
case 4: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 5: {
tmp1 = ((modelica_integer) 3);
goto tmp3_done;
}
case 6: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 7: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 10: {
tmp1 = ((modelica_integer) 6);
goto tmp3_done;
}
case 11: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 12: {
tmp1 = ((modelica_integer) 3);
goto tmp3_done;
}
case 13: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 14: {
tmp1 = ((modelica_integer) 3);
goto tmp3_done;
}
case 15: {
tmp1 = ((modelica_integer) 6);
goto tmp3_done;
}
case 16: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 17: {
tmp1 = ((modelica_integer) 3);
goto tmp3_done;
}
case 18: {
tmp1 = ((modelica_integer) 3);
goto tmp3_done;
}
case 19: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 20: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 21: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 22: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 23: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 24: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPriority = tmp1;
_return: OMC_LABEL_UNUSED
return _outPriority;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_priorityBinopRhs(threadData_t *threadData, modelica_metatype _inOp)
{
modelica_integer _outPriority;
modelica_metatype out_outPriority;
_outPriority = omc_Expression_priorityBinopRhs(threadData, _inOp);
out_outPriority = mmc_mk_icon(_outPriority);
return out_outPriority;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_priorityBinopLhs(threadData_t *threadData, modelica_metatype _inOp)
{
modelica_integer _outPriority;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 4: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 5: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 6: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 7: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 10: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 11: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 12: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 13: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 14: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 15: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 16: {
tmp1 = ((modelica_integer) 5);
goto tmp3_done;
}
case 17: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 18: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 19: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 20: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 21: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 22: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 23: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 24: {
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPriority = tmp1;
_return: OMC_LABEL_UNUSED
return _outPriority;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_priorityBinopLhs(threadData_t *threadData, modelica_metatype _inOp)
{
modelica_integer _outPriority;
modelica_metatype out_outPriority;
_outPriority = omc_Expression_priorityBinopLhs(threadData, _inOp);
out_outPriority = mmc_mk_icon(_outPriority);
return out_outPriority;
}
DLLExport
modelica_integer omc_Expression_priority(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inLhs)
{
modelica_integer _outPriority;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inLhs;
{
modelica_metatype _op = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 10; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (0 != tmp4_2) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta6;
tmp1 = omc_Expression_priorityBinopRhs(threadData, _op);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (1 != tmp4_2) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta7;
tmp1 = omc_Expression_priorityBinopLhs(threadData, _op);
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
if (!(mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2)))) < 0.0)) goto tmp3_end;
tmp1 = ((modelica_integer) 4);
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 4);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta8;
tmp1 = omc_Expression_priorityLBinop(threadData, _op);
goto tmp3_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 7);
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 6);
goto tmp3_done;
}
case 7: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 10);
goto tmp3_done;
}
case 8: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 11);
goto tmp3_done;
}
case 9: {
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outPriority = tmp1;
_return: OMC_LABEL_UNUSED
return _outPriority;
}
modelica_metatype boxptr_Expression_priority(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inLhs)
{
modelica_integer tmp1;
modelica_integer _outPriority;
modelica_metatype out_outPriority;
tmp1 = mmc_unbox_integer(_inLhs);
_outPriority = omc_Expression_priority(threadData, _inExp, tmp1);
out_outPriority = mmc_mk_icon(_outPriority);
return out_outPriority;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isNonAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _isNonAssociative;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperator;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 7: {
tmp1 = 1;
goto tmp3_done;
}
case 21: {
tmp1 = 1;
goto tmp3_done;
}
case 22: {
tmp1 = 1;
goto tmp3_done;
}
case 23: {
tmp1 = 1;
goto tmp3_done;
}
case 24: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isNonAssociative = tmp1;
_return: OMC_LABEL_UNUSED
return _isNonAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isNonAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _isNonAssociative;
modelica_metatype out_isNonAssociative;
_isNonAssociative = omc_Expression_isNonAssociativeOp(threadData, _inOperator);
out_isNonAssociative = mmc_mk_icon(_isNonAssociative);
return out_isNonAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isNonAssociativeExp(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _isNonAssociative;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
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,7,3) == 0) goto tmp3_end;
tmp1 = omc_Expression_isNonAssociativeOp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exp), 3))));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isNonAssociative = tmp1;
_return: OMC_LABEL_UNUSED
return _isNonAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isNonAssociativeExp(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _isNonAssociative;
modelica_metatype out_isNonAssociative;
_isNonAssociative = omc_Expression_isNonAssociativeExp(threadData, _exp);
out_isNonAssociative = mmc_mk_icon(_isNonAssociative);
return out_isNonAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _outIsAssociative;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperator;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 10: {
tmp1 = 1;
goto tmp3_done;
}
case 14: {
tmp1 = 1;
goto tmp3_done;
}
case 15: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsAssociative = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isAssociativeOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _outIsAssociative;
modelica_metatype out_outIsAssociative;
_outIsAssociative = omc_Expression_isAssociativeOp(threadData, _inOperator);
out_outIsAssociative = mmc_mk_icon(_outIsAssociative);
return out_outIsAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isAssociativeExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsAssociative;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _op = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 10: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta5;
tmp1 = omc_Expression_isAssociativeOp(threadData, _op);
goto tmp3_done;
}
case 12: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsAssociative = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isAssociativeExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsAssociative;
modelica_metatype out_outIsAssociative;
_outIsAssociative = omc_Expression_isAssociativeExp(threadData, _inExp);
out_outIsAssociative = mmc_mk_icon(_outIsAssociative);
return out_outIsAssociative;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_shouldParenthesize2(threadData_t *threadData, modelica_integer _inPrioDiff, modelica_metatype _inOperand, modelica_boolean _inLhs)
{
modelica_boolean _outShouldParenthesize;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_integer tmp4_1;
tmp4_1 = _inPrioDiff;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(tmp4_1)) {
case 1: {
if (1 != tmp4_1) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 0: {
if (0 != tmp4_1) goto tmp3_end;
tmp1 = (_inLhs?omc_Expression_isNonAssociativeExp(threadData, _inOperand):(!omc_Expression_isAssociativeExp(threadData, _inOperand)));
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outShouldParenthesize = tmp1;
_return: OMC_LABEL_UNUSED
return _outShouldParenthesize;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_shouldParenthesize2(threadData_t *threadData, modelica_metatype _inPrioDiff, modelica_metatype _inOperand, modelica_metatype _inLhs)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_boolean _outShouldParenthesize;
modelica_metatype out_outShouldParenthesize;
tmp1 = mmc_unbox_integer(_inPrioDiff);
tmp2 = mmc_unbox_integer(_inLhs);
_outShouldParenthesize = omc_Expression_shouldParenthesize2(threadData, tmp1, _inOperand, tmp2);
out_outShouldParenthesize = mmc_mk_icon(_outShouldParenthesize);
return out_outShouldParenthesize;
}
DLLExport
modelica_boolean omc_Expression_shouldParenthesize(threadData_t *threadData, modelica_metatype _inOperand, modelica_metatype _inOperator, modelica_boolean _inLhs)
{
modelica_boolean _outShouldParenthesize;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperand;
{
modelica_integer _diff;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
_diff = omc_Util_intCompare(threadData, omc_Expression_priority(threadData, _inOperand, _inLhs), omc_Expression_priority(threadData, _inOperator, _inLhs));
tmp1 = omc_Expression_shouldParenthesize2(threadData, _diff, _inOperand, _inLhs);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outShouldParenthesize = tmp1;
_return: OMC_LABEL_UNUSED
return _outShouldParenthesize;
}
modelica_metatype boxptr_Expression_shouldParenthesize(threadData_t *threadData, modelica_metatype _inOperand, modelica_metatype _inOperator, modelica_metatype _inLhs)
{
modelica_integer tmp1;
modelica_boolean _outShouldParenthesize;
modelica_metatype out_outShouldParenthesize;
tmp1 = mmc_unbox_integer(_inLhs);
_outShouldParenthesize = omc_Expression_shouldParenthesize(threadData, _inOperand, _inOperator, tmp1);
out_outShouldParenthesize = mmc_mk_icon(_outShouldParenthesize);
return out_outShouldParenthesize;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeEnumLiteral(threadData_t *threadData, modelica_metatype _name, modelica_integer _index, modelica_integer *out_newIndex)
{
modelica_metatype _enumExp = NULL;
modelica_integer _newIndex;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box3(8, &DAE_Exp_ENUM__LITERAL__desc, _name, mmc_mk_integer(_index));
_enumExp = tmpMeta1;
_newIndex = ((modelica_integer) 1) + _index;
_return: OMC_LABEL_UNUSED
if (out_newIndex) { *out_newIndex = _newIndex; }
return _enumExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_makeEnumLiteral(threadData_t *threadData, modelica_metatype _name, modelica_metatype _index, modelica_metatype *out_newIndex)
{
modelica_integer tmp1;
modelica_integer _newIndex;
modelica_metatype _enumExp = NULL;
tmp1 = mmc_unbox_integer(_index);
_enumExp = omc_Expression_makeEnumLiteral(threadData, _name, tmp1, &_newIndex);
if (out_newIndex) { *out_newIndex = mmc_mk_icon(_newIndex); }
return _enumExp;
}
DLLExport
modelica_metatype omc_Expression_makeEnumLiterals(threadData_t *threadData, modelica_metatype _inTypeName, modelica_metatype _inLiterals)
{
modelica_metatype _outLiterals = NULL;
modelica_metatype _enum_lit_names = NULL;
modelica_metatype _enum_lit_expl = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_enum_lit_names = omc_List_map1r(threadData, _inLiterals, boxvar_AbsynUtil_suffixPath, _inTypeName);
_outLiterals = omc_List_mapFold(threadData, _enum_lit_names, boxvar_Expression_makeEnumLiteral, mmc_mk_integer(((modelica_integer) 1)), NULL);
_return: OMC_LABEL_UNUSED
return _outLiterals;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_opComplexity(threadData_t *threadData, modelica_metatype _op)
{
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
modelica_metatype _tp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 34; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 100);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 30);
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta7;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta8;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta9;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta10;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta11;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta12;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta13;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta14;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta15;
tmp1 = ((modelica_integer) 5) + (((modelica_integer) 3)) * (omc_Expression_tpComplexity(threadData, _tp));
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta16;
tmp1 = ((modelica_integer) 5) + (((modelica_integer) 3)) * (omc_Expression_tpComplexity(threadData, _tp));
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta17;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta18;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta19;
tmp1 = ((modelica_integer) 5) + (((modelica_integer) 30)) * (omc_Expression_tpComplexity(threadData, _tp));
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta20;
tmp1 = ((modelica_integer) 5) + (((modelica_integer) 30)) * (omc_Expression_tpComplexity(threadData, _tp));
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta21;
tmp1 = ((modelica_integer) 5) + (((modelica_integer) 30)) * (omc_Expression_tpComplexity(threadData, _tp));
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta22;
tmp1 = ((modelica_integer) 5) + (((modelica_integer) 30)) * (omc_Expression_tpComplexity(threadData, _tp));
goto tmp3_done;
}
case 23: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 24: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,23,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 25: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 26: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 27: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,26,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 28: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 29: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 30: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 31: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 32: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 100);
goto tmp3_done;
}
case 33: {
omc_Error_addMessage(threadData, _OMC_LIT31, _OMC_LIT53);
goto goto_2;
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
return _i;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_opComplexity(threadData_t *threadData, modelica_metatype _op)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_Expression_opComplexity(threadData, _op);
out_i = mmc_mk_icon(_i);
return out_i;
}
DLLExport
modelica_integer omc_Expression_dimComplexity(threadData_t *threadData, modelica_metatype _dim)
{
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmp1 = _i;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
modelica_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp8 = mmc_unbox_integer(tmpMeta7);
_i = tmp8;
tmp1 = _i;
goto tmp3_done;
}
case 4: {
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = ((modelica_integer) 1000);
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
return _i;
}
modelica_metatype boxptr_Expression_dimComplexity(threadData_t *threadData, modelica_metatype _dim)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_Expression_dimComplexity(threadData, _dim);
out_i = mmc_mk_icon(_i);
return out_i;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_tpComplexity(threadData_t *threadData, modelica_metatype _tp)
{
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _tp;
{
modelica_metatype _dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_dims = tmpMeta6;
tmp1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _dims, boxvar_intMul, boxvar_Expression_dimComplexity, mmc_mk_integer(((modelica_integer) 1))));
goto tmp3_done;
}
case 1: {
tmp1 = ((modelica_integer) 0);
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
return _i;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_tpComplexity(threadData_t *threadData, modelica_metatype _tp)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_Expression_tpComplexity(threadData, _tp);
out_i = mmc_mk_icon(_i);
return out_i;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_complexityBuiltin(threadData_t *threadData, modelica_string _name, modelica_metatype _tp)
{
modelica_integer _complexity;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_string tmp4_1;
tmp4_1 = _name;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (8 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT54), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = ((modelica_integer) 5) + omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 1: {
if (5 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT55), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmp1 = ((modelica_integer) 9);
goto tmp3_done;
}
case 2: {
tmp1 = ((modelica_integer) 25);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_complexity = tmp1;
_return: OMC_LABEL_UNUSED
return _complexity;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_complexityBuiltin(threadData_t *threadData, modelica_metatype _name, modelica_metatype _tp)
{
modelica_integer _complexity;
modelica_metatype out_complexity;
_complexity = omc_Expression_complexityBuiltin(threadData, _name, _tp);
out_complexity = mmc_mk_icon(_complexity);
return out_complexity;
}
DLLExport
modelica_integer omc_Expression_complexity(threadData_t *threadData, modelica_metatype _exp)
{
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
modelica_metatype _op = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_integer _c1;
modelica_integer _c2;
modelica_integer _c3;
modelica_metatype _exps = NULL;
modelica_metatype _matrix = NULL;
modelica_string _str = NULL;
modelica_string _name = NULL;
modelica_metatype _tp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 41; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,36,2) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 6: {
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), 3));
_tp = tmpMeta6;
tmp1 = omc_Expression_tpComplexity(threadData, _tp);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta7;
_op = tmpMeta8;
_e2 = tmpMeta9;
_c1 = omc_Expression_complexity(threadData, _e1);
_c2 = omc_Expression_complexity(threadData, _e2);
_c3 = omc_Expression_opComplexity(threadData, _op);
tmp1 = _c1 + _c2 + _c3;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta10;
_e = tmpMeta11;
_c1 = omc_Expression_complexity(threadData, _e);
_c2 = omc_Expression_opComplexity(threadData, _op);
tmp1 = _c1 + _c2;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 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));
_e1 = tmpMeta12;
_op = tmpMeta13;
_e2 = tmpMeta14;
_c1 = omc_Expression_complexity(threadData, _e1);
_c2 = omc_Expression_complexity(threadData, _e2);
_c3 = omc_Expression_opComplexity(threadData, _op);
tmp1 = _c1 + _c2 + _c3;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta15;
_e = tmpMeta16;
_c1 = omc_Expression_complexity(threadData, _e);
_c2 = omc_Expression_opComplexity(threadData, _op);
tmp1 = _c1 + _c2;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta17;
_op = tmpMeta18;
_e2 = tmpMeta19;
_c1 = omc_Expression_complexity(threadData, _e1);
_c2 = omc_Expression_complexity(threadData, _e2);
_c3 = omc_Expression_opComplexity(threadData, _op);
tmp1 = _c1 + _c2 + _c3;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta20;
_e2 = tmpMeta21;
_e3 = tmpMeta22;
_c1 = omc_Expression_complexity(threadData, _e1);
_c2 = omc_Expression_complexity(threadData, _e2);
_c3 = omc_Expression_complexity(threadData, _e3);
tmp1 = _c1 + modelica_integer_max((modelica_integer)(_c2),(modelica_integer)(_c3));
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_integer tmp29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,1,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 4));
tmp29 = mmc_unbox_integer(tmpMeta28);
if (1 != tmp29) goto tmp3_end;
_name = tmpMeta24;
_exps = tmpMeta25;
_tp = tmpMeta27;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 0))));
_c2 = omc_Expression_complexityBuiltin(threadData, _name, _tp);
tmp1 = _c1 + _c2;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exps = tmpMeta30;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 0))));
_c2 = listLength(_exps);
tmp1 = ((modelica_integer) 25) + _c1 + _c2;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exps = tmpMeta31;
tmp1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 1))));
goto tmp3_done;
}
case 16: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 500000);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta32;
_exps = tmpMeta33;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer((omc_Expression_isArrayType(threadData, _tp)?((modelica_integer) 0):((modelica_integer) 5)))));
_c2 = listLength(_exps);
tmp1 = _c1 + _c2;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta34)) goto tmp3_end;
tmpMeta35 = MMC_CAR(tmpMeta34);
tmpMeta36 = MMC_CDR(tmpMeta34);
_matrix = tmpMeta34;
_exps = tmpMeta35;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, omc_List_flatten(threadData, _matrix), boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 5))));
_c2 = (listLength(_exps)) * (listLength(_matrix));
tmp1 = _c1 + _c2;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta38)) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta37;
_e2 = tmpMeta39;
tmp1 = ((modelica_integer) 1000) + omc_Expression_complexity(threadData, _e1) + omc_Expression_complexity(threadData, _e2);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta41)) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 1));
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta40;
_e3 = tmpMeta42;
_e2 = tmpMeta43;
tmp1 = ((modelica_integer) 1000) + omc_Expression_complexity(threadData, _e1) + omc_Expression_complexity(threadData, _e2) + omc_Expression_complexity(threadData, _e3);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta44;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exps = tmpMeta44;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 5))));
_c2 = listLength(_exps);
tmp1 = _c1 + _c2;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta45;
_e = tmpMeta46;
tmp1 = omc_Expression_tpComplexity(threadData, _tp) + omc_Expression_complexity(threadData, _e);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta47;
_exps = tmpMeta48;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 5))));
_c2 = listLength(_exps);
_c3 = omc_Expression_complexity(threadData, _e);
tmp1 = _c1 + _c2 + _c3;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta49;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta49;
tmp1 = ((modelica_integer) 1) + omc_Expression_complexity(threadData, _e);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta51)) goto tmp3_end;
_e = tmpMeta50;
tmp1 = ((modelica_integer) 15) + omc_Expression_complexity(threadData, _e);
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,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));
if (optionNone(tmpMeta53)) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta53), 1));
_e1 = tmpMeta52;
_e2 = tmpMeta54;
tmp1 = ((modelica_integer) 1) + omc_Expression_complexity(threadData, _e1) + omc_Expression_complexity(threadData, _e2);
goto tmp3_done;
}
case 27: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 500000);
goto tmp3_done;
}
case 28: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,26,4) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 500000);
goto tmp3_done;
}
case 29: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 500000);
goto tmp3_done;
}
case 30: {
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exps = tmpMeta55;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 5))));
_c2 = listLength(_exps);
tmp1 = ((modelica_integer) 5) + _c1 + _c2;
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta56;
_e2 = tmpMeta57;
tmp1 = ((modelica_integer) 5) + omc_Expression_complexity(threadData, _e1) + omc_Expression_complexity(threadData, _e2);
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta58;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exps = tmpMeta58;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 5))));
_c2 = listLength(_exps);
tmp1 = ((modelica_integer) 5) + _c1 + _c2;
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta59;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (!optionNone(tmpMeta59)) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta60)) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 1));
_e = tmpMeta61;
tmp1 = ((modelica_integer) 5) + omc_Expression_complexity(threadData, _e);
goto tmp3_done;
}
case 35: {
modelica_metatype tmpMeta62;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,32,5) == 0) goto tmp3_end;
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exps = tmpMeta62;
_c1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _exps, boxvar_intAdd, boxvar_Expression_complexity, mmc_mk_integer(((modelica_integer) 5))));
_c2 = listLength(_exps);
tmp1 = ((modelica_integer) 5) + _c1 + _c2;
goto tmp3_done;
}
case 36: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 500000);
goto tmp3_done;
}
case 37: {
modelica_metatype tmpMeta63;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta63;
tmp1 = ((modelica_integer) 5) + omc_Expression_complexity(threadData, _e);
goto tmp3_done;
}
case 38: {
modelica_metatype tmpMeta64;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,35,2) == 0) goto tmp3_end;
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta64;
tmp1 = ((modelica_integer) 1) + omc_Expression_complexity(threadData, _e);
goto tmp3_done;
}
case 39: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 40: {
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
tmpMeta65 = stringAppend(_OMC_LIT56,omc_ExpressionDump_printExpStr(threadData, _exp));
_str = tmpMeta65;
tmpMeta66 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT31, tmpMeta66);
goto goto_2;
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
return _i;
}
modelica_metatype boxptr_Expression_complexity(threadData_t *threadData, modelica_metatype _exp)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_Expression_complexity(threadData, _exp);
out_i = mmc_mk_icon(_i);
return out_i;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_complexityTraverse2(threadData_t *threadData, modelica_metatype _exp, modelica_integer _complexity_, modelica_integer *out_outComplexity)
{
modelica_metatype _outExp = NULL;
modelica_integer _outComplexity;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outComplexity = _complexity_ + omc_Expression_complexity(threadData, _exp);
_outExp = _exp;
_return: OMC_LABEL_UNUSED
if (out_outComplexity) { *out_outComplexity = _outComplexity; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_complexityTraverse2(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _complexity_, modelica_metatype *out_outComplexity)
{
modelica_integer tmp1;
modelica_integer _outComplexity;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_complexity_);
_outExp = omc_Expression_complexityTraverse2(threadData, _exp, tmp1, &_outComplexity);
if (out_outComplexity) { *out_outComplexity = mmc_mk_icon(_outComplexity); }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_complexityTraverse(threadData_t *threadData, modelica_metatype _exp, modelica_integer _complexity, modelica_integer *out_outComplexity)
{
modelica_metatype _outExp = NULL;
modelica_integer _outComplexity;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta3 = omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Expression_complexityTraverse2, mmc_mk_integer(_complexity), &tmpMeta1);
_outExp = tmpMeta3;
tmp2 = mmc_unbox_integer(tmpMeta1);
_outComplexity = tmp2;
_return: OMC_LABEL_UNUSED
if (out_outComplexity) { *out_outComplexity = _outComplexity; }
return _outExp;
}
modelica_metatype boxptr_Expression_complexityTraverse(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _complexity, modelica_metatype *out_outComplexity)
{
modelica_integer tmp1;
modelica_integer _outComplexity;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_complexity);
_outExp = omc_Expression_complexityTraverse(threadData, _exp, tmp1, &_outComplexity);
if (out_outComplexity) { *out_outComplexity = mmc_mk_icon(_outComplexity); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_isTailCall(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _isTail;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 8));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isTail = tmp1;
_return: OMC_LABEL_UNUSED
return _isTail;
}
modelica_metatype boxptr_Expression_isTailCall(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _isTail;
modelica_metatype out_isTail;
_isTail = omc_Expression_isTailCall(threadData, _exp);
out_isTail = mmc_mk_icon(_isTail);
return out_isTail;
}
DLLExport
modelica_string omc_Expression_simpleCrefName(threadData_t *threadData, modelica_metatype _exp)
{
modelica_string _name = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _exp;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,6,2) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta2,1,3) == 0) MMC_THROW_INTERNAL();
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 4));
if (!listEmpty(tmpMeta4)) MMC_THROW_INTERNAL();
_name = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _name;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIterators(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fiters, modelica_fnptr _func, modelica_metatype __omcQ_24in_5Farg, modelica_metatype *out_arg)
{
modelica_metatype _iters = NULL;
modelica_metatype _arg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_iters = __omcQ_24in_5Fiters;
_arg = __omcQ_24in_5Farg;
{
modelica_metatype tmp4_1;
tmp4_1 = _iters;
{
modelica_metatype _iter = NULL;
modelica_metatype _iter1 = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _iters1 = 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;
tmpMeta[0+0] = _iters;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_iter = tmpMeta6;
_rest = tmpMeta7;
_iter1 = omc_Expression_traverseReductionIterator(threadData, _iter, ((modelica_fnptr) _func), _arg ,&_arg);
_iters1 = omc_Expression_traverseReductionIterators(threadData, _rest, ((modelica_fnptr) _func), _arg ,&_arg);
tmp9 = (modelica_boolean)(referenceEq(_iter, _iter1) && referenceEq(_rest, _iters1));
if(tmp9)
{
tmpMeta10 = _iters;
}
else
{
tmpMeta8 = mmc_mk_cons(_iter1, _iters1);
tmpMeta10 = tmpMeta8;
}
_iters = tmpMeta10;
tmpMeta[0+0] = _iters;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_iters = tmpMeta[0+0];
_arg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_arg) { *out_arg = _arg; }
return _iters;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIterator(threadData_t *threadData, modelica_metatype _iter, modelica_fnptr _func, modelica_metatype _iarg, modelica_metatype *out_outArg)
{
modelica_metatype _outIter = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _iter;
tmp4_2 = _iarg;
{
modelica_string _id = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _exp1 = NULL;
modelica_metatype _gexp = NULL;
modelica_metatype _gexp1 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _arg = 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_boolean tmp11;
modelica_metatype tmpMeta12;
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;
_exp = tmpMeta7;
_gexp = tmpMeta8;
_ty = tmpMeta9;
_arg = tmp4_2;
_exp1 = omc_Expression_traverseExpBottomUp(threadData, _exp, ((modelica_fnptr) _func), _arg ,&_arg);
_gexp1 = omc_Expression_traverseExpOpt(threadData, _gexp, ((modelica_fnptr) _func), _arg ,&_arg);
tmp11 = (modelica_boolean)(referenceEq(_exp, _exp1) && referenceEq(_gexp, _gexp1));
if(tmp11)
{
tmpMeta12 = _iter;
}
else
{
tmpMeta10 = mmc_mk_box5(3, &DAE_ReductionIterator_REDUCTIONITER__desc, _id, _exp1, _gexp1, _ty);
tmpMeta12 = tmpMeta10;
}
_outIter = tmpMeta12;
tmpMeta[0+0] = _outIter;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIter = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outIter;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIteratorsTopDown(threadData_t *threadData, modelica_metatype _inIters, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outIters = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inIters;
tmp4_2 = _inArg;
{
modelica_metatype _arg = NULL;
modelica_metatype _iter = NULL;
modelica_metatype _iters = 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;
_arg = tmp4_2;
tmpMeta[0+0] = _inIters;
tmpMeta[0+1] = _arg;
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);
_iter = tmpMeta6;
_iters = tmpMeta7;
_arg = tmp4_2;
_iter = omc_Expression_traverseReductionIteratorTopDown(threadData, _iter, ((modelica_fnptr) _func), _arg ,&_arg);
_iters = omc_Expression_traverseReductionIteratorsTopDown(threadData, _iters, ((modelica_fnptr) _func), _arg ,&_arg);
tmpMeta8 = mmc_mk_cons(_iter, _iters);
tmpMeta[0+0] = tmpMeta8;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIters = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outIters;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIteratorTopDown(threadData_t *threadData, modelica_metatype _iter, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outIter = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _iter;
tmp4_2 = _inArg;
{
modelica_string _id = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _gexp = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _arg = 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;
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;
_exp = tmpMeta7;
_gexp = tmpMeta8;
_ty = tmpMeta9;
_arg = tmp4_2;
_exp = omc_Expression_traverseExpTopDown(threadData, _exp, ((modelica_fnptr) _func), _arg ,&_arg);
_gexp = omc_Expression_traverseExpOptTopDown(threadData, _gexp, ((modelica_fnptr) _func), _arg ,&_arg);
tmpMeta10 = mmc_mk_box5(3, &DAE_ReductionIterator_REDUCTIONITER__desc, _id, _exp, _gexp, _ty);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIter = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outIter;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseReductionIteratorBidir(threadData_t *threadData, modelica_metatype _inIter, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outIter = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inIter;
{
modelica_string _id = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _gexp = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _arg = 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;
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;
_exp = tmpMeta7;
_gexp = tmpMeta8;
_ty = tmpMeta9;
_exp = omc_Expression_traverseExpBidir(threadData, _exp, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_gexp = omc_Expression_traverseExpOptBidir(threadData, _gexp, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmpMeta10 = mmc_mk_box5(3, &DAE_ReductionIterator_REDUCTIONITER__desc, _id, _exp, _gexp, _ty);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIter = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outIter;
}
DLLExport
modelica_string omc_Expression_reductionIterName(threadData_t *threadData, modelica_metatype _iter)
{
modelica_string _name = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _iter;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_name = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _name;
}
DLLExport
modelica_metatype omc_Expression_makeImpureBuiltinCall(threadData_t *threadData, modelica_string _name, modelica_metatype _args, modelica_metatype _result_type)
{
modelica_metatype _call = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_call = omc_Expression_makeBuiltinCall(threadData, _name, _args, _result_type, 1);
_return: OMC_LABEL_UNUSED
return _call;
}
DLLExport
modelica_metatype omc_Expression_makePureBuiltinCall(threadData_t *threadData, modelica_string _name, modelica_metatype _args, modelica_metatype _result_type)
{
modelica_metatype _call = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_call = omc_Expression_makeBuiltinCall(threadData, _name, _args, _result_type, 0);
_return: OMC_LABEL_UNUSED
return _call;
}
DLLExport
modelica_metatype omc_Expression_makeBuiltinCall(threadData_t *threadData, modelica_string _name, modelica_metatype _args, modelica_metatype _result_type, modelica_boolean _isImpure)
{
modelica_metatype _call = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(4, &Absyn_Path_IDENT__desc, _name);
tmpMeta2 = mmc_mk_box8(3, &DAE_CallAttributes_CALL__ATTR__desc, _result_type, mmc_mk_boolean(0), mmc_mk_boolean(1), mmc_mk_boolean(_isImpure), mmc_mk_boolean(0), _OMC_LIT43, _OMC_LIT44);
tmpMeta3 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, tmpMeta1, _args, tmpMeta2);
_call = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _call;
}
modelica_metatype boxptr_Expression_makeBuiltinCall(threadData_t *threadData, modelica_metatype _name, modelica_metatype _args, modelica_metatype _result_type, modelica_metatype _isImpure)
{
modelica_integer tmp1;
modelica_metatype _call = NULL;
tmp1 = mmc_unbox_integer(_isImpure);
_call = omc_Expression_makeBuiltinCall(threadData, _name, _args, _result_type, tmp1);
return _call;
}
DLLExport
modelica_metatype omc_Expression_makeCons(threadData_t *threadData, modelica_metatype _car, modelica_metatype _cdr)
{
modelica_metatype _exp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box3(32, &DAE_Exp_CONS__desc, _car, _cdr);
_exp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _exp;
}
DLLExport
modelica_boolean omc_Expression_isBuiltinFunctionReference(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
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_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,13,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (1 != tmp8) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isBuiltinFunctionReference(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isBuiltinFunctionReference(threadData, _exp);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_metatype omc_Expression_hasNoSideEffects(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _ib, modelica_boolean *out_ob)
{
modelica_metatype _outExp = NULL;
modelica_boolean _ob;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 16: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
goto tmp3_done;
}
case 36: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inExp;
tmp1_c1 = _ib;
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];
_ob = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_ob) { *out_ob = _ob; }
return _outExp;
}
modelica_metatype boxptr_Expression_hasNoSideEffects(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _ib, modelica_metatype *out_ob)
{
modelica_integer tmp1;
modelica_boolean _ob;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_ib);
_outExp = omc_Expression_hasNoSideEffects(threadData, _inExp, tmp1, &_ob);
if (out_ob) { *out_ob = mmc_mk_icon(_ob); }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_subscriptContain2(threadData_t *threadData, modelica_integer _inInt, modelica_metatype _inExp2)
{
modelica_boolean _contained;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_integer tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inInt;
tmp4_2 = _inExp2;
{
modelica_boolean _b;
modelica_metatype _expl = NULL;
modelica_metatype _expl2 = NULL;
modelica_integer _i;
modelica_integer _j;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_2);
tmpMeta7 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
_j = tmp9;
_i = tmp4_1;
if (!(_i == _j)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_2);
tmpMeta11 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,1) == 0) goto tmp3_end;
_expl = tmpMeta11;
_i = tmp4_1;
if (!omc_Expression_subscriptContain2(threadData, _i, _expl)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_boolean tmp16;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_2);
tmpMeta13 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,16,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 4));
_expl2 = tmpMeta14;
_expl = tmpMeta13;
_i = tmp4_1;
_b = omc_Expression_subscriptContain2(threadData, _i, _expl2);
tmp15 = (modelica_boolean)_b;
if(tmp15)
{
tmp16 = 1;
}
else
{
_inInt = _i;
_inExp2 = _expl;
goto _tailrecursive;
}
tmp1 = tmp16;
goto tmp3_done;
}
case 3: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_contained = tmp1;
_return: OMC_LABEL_UNUSED
return _contained;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_subscriptContain2(threadData_t *threadData, modelica_metatype _inInt, modelica_metatype _inExp2)
{
modelica_integer tmp1;
modelica_boolean _contained;
modelica_metatype out_contained;
tmp1 = mmc_unbox_integer(_inInt);
_contained = omc_Expression_subscriptContain2(threadData, tmp1, _inExp2);
out_contained = mmc_mk_icon(_contained);
return out_contained;
}
DLLExport
modelica_boolean omc_Expression_subscriptContain(threadData_t *threadData, modelica_metatype _issl1, modelica_metatype _issl2)
{
modelica_boolean _contained;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _issl1;
tmp4_2 = _issl2;
{
modelica_metatype _ss1 = NULL;
modelica_metatype _ss2 = NULL;
modelica_metatype _ssl1 = NULL;
modelica_metatype _ssl2 = NULL;
modelica_integer _i;
modelica_metatype _expl = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; 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;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
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 (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,0) == 0) goto tmp3_end;
_ssl1 = tmpMeta7;
_ssl2 = tmpMeta9;
_issl1 = _ssl1;
_issl2 = _ssl2;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_2);
tmpMeta13 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,3,1) == 0) goto tmp3_end;
_ssl1 = tmpMeta11;
_ssl2 = tmpMeta13;
_issl1 = _ssl1;
_issl2 = _ssl2;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta14 = MMC_CAR(tmp4_1);
tmpMeta15 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,2,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,0,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmp18 = mmc_unbox_integer(tmpMeta17);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_2);
tmpMeta20 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,16,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 4));
_i = tmp18;
_ssl1 = tmpMeta15;
_expl = tmpMeta22;
_ssl2 = tmpMeta20;
tmp23 = omc_Expression_subscriptContain2(threadData, _i, _expl);
if (1 != tmp23) goto goto_2;
_issl1 = _ssl1;
_issl2 = _ssl2;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_boolean tmp30;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmp4_1);
tmpMeta25 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmp4_2);
tmpMeta27 = MMC_CDR(tmp4_2);
_ss1 = tmpMeta24;
_ssl1 = tmpMeta25;
_ss2 = tmpMeta26;
_ssl2 = tmpMeta27;
tmpMeta28 = mmc_mk_cons(_ss1, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta29 = mmc_mk_cons(_ss2, MMC_REFSTRUCTLIT(mmc_nil));
tmp30 = omc_Expression_subscriptEqual(threadData, tmpMeta28, tmpMeta29);
if (1 != tmp30) goto goto_2;
_issl1 = _ssl1;
_issl2 = _ssl2;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_contained = tmp1;
_return: OMC_LABEL_UNUSED
return _contained;
}
modelica_metatype boxptr_Expression_subscriptContain(threadData_t *threadData, modelica_metatype _issl1, modelica_metatype _issl2)
{
modelica_boolean _contained;
modelica_metatype out_contained;
_contained = omc_Expression_subscriptContain(threadData, _issl1, _issl2);
out_contained = mmc_mk_icon(_contained);
return out_contained;
}
DLLExport
modelica_boolean omc_Expression_isValidSubscript(threadData_t *threadData, modelica_metatype _inSub)
{
modelica_boolean _isValid;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSub;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 8: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_isValid = tmp1;
_return: OMC_LABEL_UNUSED
return _isValid;
}
modelica_metatype boxptr_Expression_isValidSubscript(threadData_t *threadData, modelica_metatype _inSub)
{
modelica_boolean _isValid;
modelica_metatype out_isValid;
_isValid = omc_Expression_isValidSubscript(threadData, _inSub);
out_isValid = mmc_mk_icon(_isValid);
return out_isValid;
}
DLLExport
modelica_boolean omc_Expression_subscriptConstants(threadData_t *threadData, modelica_metatype _inSubs)
{
modelica_boolean _areConstant;
modelica_metatype tmpMeta1;
modelica_boolean tmp2 = 0;
modelica_metatype tmpMeta10;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_areConstant = 1;
{
modelica_metatype _sub;
for (tmpMeta1 = _inSubs; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_sub = MMC_CAR(tmpMeta1);
{
modelica_metatype tmp5_1;
tmp5_1 = _sub;
{
volatile mmc_switch_type tmp5;
int tmp6;
tmp5 = 0;
for (; tmp5 < 4; tmp5++) {
switch (MMC_SWITCH_CAST(tmp5)) {
case 0: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,2,1) == 0) goto tmp4_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp4_end;
tmp2 = 1;
goto tmp4_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,2,1) == 0) goto tmp4_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,5,2) == 0) goto tmp4_end;
tmp2 = 1;
goto tmp4_done;
}
case 2: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,2,1) == 0) goto tmp4_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp5_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,1) == 0) goto tmp4_end;
tmp2 = 1;
goto tmp4_done;
}
case 3: {
tmp2 = 0;
goto tmp4_done;
}
}
goto tmp4_end;
tmp4_end: ;
}
goto goto_3;
goto_3:;
MMC_THROW_INTERNAL();
goto tmp4_done;
tmp4_done:;
}
}
_areConstant = tmp2;
if((!_areConstant))
{
goto _return;
}
}
}
_return: OMC_LABEL_UNUSED
return _areConstant;
}
modelica_metatype boxptr_Expression_subscriptConstants(threadData_t *threadData, modelica_metatype _inSubs)
{
modelica_boolean _areConstant;
modelica_metatype out_areConstant;
_areConstant = omc_Expression_subscriptConstants(threadData, _inSubs);
out_areConstant = mmc_mk_icon(_areConstant);
return out_areConstant;
}
DLLExport
modelica_boolean omc_Expression_subscriptEqual(threadData_t *threadData, modelica_metatype _inSubscriptLst1, modelica_metatype _inSubscriptLst2)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inSubscriptLst1;
tmp4_2 = _inSubscriptLst2;
{
modelica_metatype _xs1 = NULL;
modelica_metatype _xs2 = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,0) == 0) goto tmp3_end;
_xs1 = tmpMeta7;
_xs2 = tmpMeta9;
_inSubscriptLst1 = _xs1;
_inSubscriptLst2 = _xs2;
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_boolean tmp16;
modelica_boolean tmp17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_2);
tmpMeta14 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
_e1 = tmpMeta12;
_xs1 = tmpMeta11;
_e2 = tmpMeta15;
_xs2 = tmpMeta14;
tmp16 = (modelica_boolean)omc_Expression_expEqual(threadData, _e1, _e2);
if(tmp16)
{
_inSubscriptLst1 = _xs1;
_inSubscriptLst2 = _xs2;
goto _tailrecursive;
}
else
{
tmp17 = 0;
}
tmp1 = tmp17;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_boolean tmp24;
modelica_boolean tmp25;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta21 = MMC_CAR(tmp4_2);
tmpMeta22 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,2,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
_e1 = tmpMeta20;
_xs1 = tmpMeta19;
_e2 = tmpMeta23;
_xs2 = tmpMeta22;
tmp24 = (modelica_boolean)omc_Expression_expEqual(threadData, _e1, _e2);
if(tmp24)
{
_inSubscriptLst1 = _xs1;
_inSubscriptLst2 = _xs2;
goto _tailrecursive;
}
else
{
tmp25 = 0;
}
tmp1 = tmp25;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_boolean tmp32;
modelica_boolean tmp33;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmp4_1);
tmpMeta27 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,3,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta29 = MMC_CAR(tmp4_2);
tmpMeta30 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,3,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
_e1 = tmpMeta28;
_xs1 = tmpMeta27;
_e2 = tmpMeta31;
_xs2 = tmpMeta30;
tmp32 = (modelica_boolean)omc_Expression_expEqual(threadData, _e1, _e2);
if(tmp32)
{
_inSubscriptLst1 = _xs1;
_inSubscriptLst2 = _xs2;
goto _tailrecursive;
}
else
{
tmp33 = 0;
}
tmp1 = tmp33;
goto tmp3_done;
}
case 5: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_subscriptEqual(threadData_t *threadData, modelica_metatype _inSubscriptLst1, modelica_metatype _inSubscriptLst2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_subscriptEqual(threadData, _inSubscriptLst1, _inSubscriptLst2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_hasUnknownDims(threadData_t *threadData, modelica_metatype _dims)
{
modelica_boolean _hasUnkown;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_hasUnkown = omc_List_mapBoolOr(threadData, _dims, boxvar_Expression_dimensionUnknown);
_return: OMC_LABEL_UNUSED
return _hasUnkown;
}
modelica_metatype boxptr_Expression_hasUnknownDims(threadData_t *threadData, modelica_metatype _dims)
{
modelica_boolean _hasUnkown;
modelica_metatype out_hasUnkown;
_hasUnkown = omc_Expression_hasUnknownDims(threadData, _dims);
out_hasUnkown = mmc_mk_icon(_hasUnkown);
return out_hasUnkown;
}
DLLExport
modelica_boolean omc_Expression_dimensionUnknown(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_boolean _outUnknown;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDimension;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outUnknown = tmp1;
_return: OMC_LABEL_UNUSED
return _outUnknown;
}
modelica_metatype boxptr_Expression_dimensionUnknown(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_boolean _outUnknown;
modelica_metatype out_outUnknown;
_outUnknown = omc_Expression_dimensionUnknown(threadData, _inDimension);
out_outUnknown = mmc_mk_icon(_outUnknown);
return out_outUnknown;
}
DLLExport
modelica_boolean omc_Expression_dimensionUnknownOrExp(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _known;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 7: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_known = tmp1;
_return: OMC_LABEL_UNUSED
return _known;
}
modelica_metatype boxptr_Expression_dimensionUnknownOrExp(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _known;
modelica_metatype out_known;
_known = omc_Expression_dimensionUnknownOrExp(threadData, _dim);
out_known = mmc_mk_icon(_known);
return out_known;
}
DLLExport
modelica_boolean omc_Expression_dimensionsKnownAndNonZero(threadData_t *threadData, modelica_metatype _dims)
{
modelica_boolean _allKnown;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_allKnown = omc_List_mapBoolAnd(threadData, _dims, boxvar_Expression_dimensionKnownAndNonZero);
_return: OMC_LABEL_UNUSED
return _allKnown;
}
modelica_metatype boxptr_Expression_dimensionsKnownAndNonZero(threadData_t *threadData, modelica_metatype _dims)
{
modelica_boolean _allKnown;
modelica_metatype out_allKnown;
_allKnown = omc_Expression_dimensionsKnownAndNonZero(threadData, _dims);
out_allKnown = mmc_mk_icon(_allKnown);
return out_allKnown;
}
DLLExport
modelica_boolean omc_Expression_dimensionKnownAndNonZero(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _known;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
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_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (0 != tmp8) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_integer tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp10 = mmc_unbox_integer(tmpMeta9);
if (0 != tmp10) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
tmp1 = omc_Expression_dimensionKnown(threadData, _dim);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_known = tmp1;
_return: OMC_LABEL_UNUSED
return _known;
}
modelica_metatype boxptr_Expression_dimensionKnownAndNonZero(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _known;
modelica_metatype out_known;
_known = omc_Expression_dimensionKnownAndNonZero(threadData, _dim);
out_known = mmc_mk_icon(_known);
return out_known;
}
DLLExport
modelica_boolean omc_Expression_dimensionKnown(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _known;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,5,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_known = tmp1;
_return: OMC_LABEL_UNUSED
return _known;
}
modelica_metatype boxptr_Expression_dimensionKnown(threadData_t *threadData, modelica_metatype _dim)
{
modelica_boolean _known;
modelica_metatype out_known;
_known = omc_Expression_dimensionKnown(threadData, _dim);
out_known = mmc_mk_icon(_known);
return out_known;
}
DLLExport
modelica_boolean omc_Expression_dimensionsKnownAndEqual(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _dim1;
tmp4_2 = _dim2;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
tmp1 = omc_Expression_expEqual(threadData, omc_Expression_dimensionSizeExp(threadData, _dim1), omc_Expression_dimensionSizeExp(threadData, _dim2));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_dimensionsKnownAndEqual(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_dimensionsKnownAndEqual(threadData, _dim1, _dim2);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_dimensionsEqualAllowZero(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _dim1;
tmp4_2 = _dim2;
{
modelica_integer _d1;
modelica_integer _d2;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
_d1 = omc_Expression_dimensionSize(threadData, _dim1);
_d2 = omc_Expression_dimensionSize(threadData, _dim2);
tmp1 = ((_d1 == _d2) || (((_d1 == ((modelica_integer) 0)) && (_d2 != ((modelica_integer) 0))) || ((_d2 == ((modelica_integer) 0)) && (_d1 != ((modelica_integer) 0)))));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_dimensionsEqualAllowZero(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_dimensionsEqualAllowZero(threadData, _dim1, _dim2);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_dimsEqualAllowZero(threadData_t *threadData, modelica_metatype _dims1, modelica_metatype _dims2)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _dims1;
tmp4_2 = _dims2;
{
modelica_metatype _d1 = NULL;
modelica_metatype _d2 = NULL;
modelica_metatype _dl1 = NULL;
modelica_metatype _dl2 = 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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
_d1 = tmpMeta6;
_dl1 = tmpMeta7;
_d2 = tmpMeta8;
_dl2 = tmpMeta9;
if (!omc_Expression_dimensionsEqualAllowZero(threadData, _d1, _d2)) goto tmp3_end;
_dims1 = _dl1;
_dims2 = _dl2;
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:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_dimsEqualAllowZero(threadData_t *threadData, modelica_metatype _dims1, modelica_metatype _dims2)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_dimsEqualAllowZero(threadData, _dims1, _dims2);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_dimsEqual(threadData_t *threadData, modelica_metatype _dims1, modelica_metatype _dims2)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _dims1;
tmp4_2 = _dims2;
{
modelica_metatype _d1 = NULL;
modelica_metatype _d2 = NULL;
modelica_metatype _dl1 = NULL;
modelica_metatype _dl2 = 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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
_d1 = tmpMeta6;
_dl1 = tmpMeta7;
_d2 = tmpMeta8;
_dl2 = tmpMeta9;
if (!omc_Expression_dimensionsEqual(threadData, _d1, _d2)) goto tmp3_end;
_dims1 = _dl1;
_dims2 = _dl2;
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:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_dimsEqual(threadData_t *threadData, modelica_metatype _dims1, modelica_metatype _dims2)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_dimsEqual(threadData, _dims1, _dims2);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_dimensionsEqual(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _dim1;
tmp4_2 = _dim2;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = (omc_Expression_dimensionSize(threadData, _dim1) == omc_Expression_dimensionSize(threadData, _dim2));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_dimensionsEqual(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_dimensionsEqual(threadData, _dim1, _dim2);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isRealType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isRealType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isRealType(threadData, _inType);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isNotComplex(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _e2 = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 16: {
tmp1 = 0;
goto tmp3_done;
}
case 17: {
tmp1 = 0;
goto tmp3_done;
}
case 19: {
tmp1 = 0;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e2 = tmpMeta5;
_e = _e2;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isNotComplex(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isNotComplex(threadData, _e);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isRecordType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isRecordType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isRecordType(threadData, _inType);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isArrayType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isArrayType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isArrayType(threadData, _inType);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_arrayContainWholeDimension(threadData_t *threadData, modelica_metatype _inDim)
{
modelica_boolean _wholedim;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDim;
{
modelica_metatype _rest_dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,4,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
_rest_dims = tmpMeta9;
_inDim = _rest_dims;
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:;
}
}
_wholedim = tmp1;
_return: OMC_LABEL_UNUSED
return _wholedim;
}
modelica_metatype boxptr_Expression_arrayContainWholeDimension(threadData_t *threadData, modelica_metatype _inDim)
{
modelica_boolean _wholedim;
modelica_metatype out_wholedim;
_wholedim = omc_Expression_arrayContainWholeDimension(threadData, _inDim);
out_wholedim = mmc_mk_icon(_wholedim);
return out_wholedim;
}
DLLExport
modelica_boolean omc_Expression_arrayContainZeroDimension(threadData_t *threadData, modelica_metatype _inDimensions)
{
modelica_boolean _outContainZeroDim;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDimensions;
{
modelica_metatype _rest_dims = 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_integer tmp9;
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,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
if (0 != tmp9) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
_rest_dims = tmpMeta11;
_inDimensions = _rest_dims;
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:;
}
}
_outContainZeroDim = tmp1;
_return: OMC_LABEL_UNUSED
return _outContainZeroDim;
}
modelica_metatype boxptr_Expression_arrayContainZeroDimension(threadData_t *threadData, modelica_metatype _inDimensions)
{
modelica_boolean _outContainZeroDim;
modelica_metatype out_outContainZeroDim;
_outContainZeroDim = omc_Expression_arrayContainZeroDimension(threadData, _inDimensions);
out_outContainZeroDim = mmc_mk_icon(_outContainZeroDim);
return out_outContainZeroDim;
}
DLLExport
modelica_integer omc_Expression_operatorCompare(threadData_t *threadData, modelica_metatype _inOperator1, modelica_metatype _inOperator2)
{
modelica_integer _comp;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inOperator1;
tmp4_2 = _inOperator2;
{
modelica_metatype _p1 = NULL;
modelica_metatype _p2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,31,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_p1 = tmpMeta6;
_p2 = tmpMeta7;
tmp1 = omc_AbsynUtil_pathCompare(threadData, _p1, _p2);
goto tmp3_done;
}
case 1: {
tmp1 = omc_Util_intCompare(threadData, valueConstructor(_inOperator1), valueConstructor(_inOperator2));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_comp = tmp1;
_return: OMC_LABEL_UNUSED
return _comp;
}
modelica_metatype boxptr_Expression_operatorCompare(threadData_t *threadData, modelica_metatype _inOperator1, modelica_metatype _inOperator2)
{
modelica_integer _comp;
modelica_metatype out_comp;
_comp = omc_Expression_operatorCompare(threadData, _inOperator1, _inOperator2);
out_comp = mmc_mk_icon(_comp);
return out_comp;
}
DLLExport
modelica_boolean omc_Expression_operatorEqual(threadData_t *threadData, modelica_metatype _inOperator1, modelica_metatype _inOperator2)
{
modelica_boolean _outBoolean;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outBoolean = (((modelica_integer) 0) == omc_Expression_operatorCompare(threadData, _inOperator1, _inOperator2));
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_operatorEqual(threadData_t *threadData, modelica_metatype _inOperator1, modelica_metatype _inOperator2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_operatorEqual(threadData, _inOperator1, _inOperator2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isExpIfExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
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,12,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isExpIfExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isExpIfExp(threadData, _e);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isExpCrefOrIfExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 9: {
tmp1 = 1;
goto tmp3_done;
}
case 15: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isExpCrefOrIfExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isExpCrefOrIfExp(threadData, _e);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isExpCref(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
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,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isExpCref(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isExpCref(threadData, _e);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_containsExp(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outBoolean = omc_Expression_expContains(threadData, _inExp2, _inExp1);
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_containsExp(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_containsExp(threadData, _inExp1, _inExp2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_expContains(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp1;
tmp4_2 = _inExp2;
{
modelica_boolean _b1;
modelica_boolean _b2;
modelica_boolean _res;
modelica_metatype _cr1 = NULL;
modelica_metatype _cr2 = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _c = NULL;
modelica_metatype _t = NULL;
modelica_metatype _f = NULL;
modelica_integer _i1;
modelica_integer _i2;
modelica_metatype _expLst = NULL;
modelica_metatype _expl = NULL;
modelica_real _r1;
modelica_real _r2;
modelica_string _str = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = 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 < 31; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
_i1 = tmp7;
_i2 = tmp9;
tmp1 = (_i1 == _i2);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp4 += 28;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_real tmp11;
modelica_metatype tmpMeta12;
modelica_real tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp11 = mmc_unbox_real(tmpMeta10);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp13 = mmc_unbox_real(tmpMeta12);
_r1 = tmp11;
_r2 = tmp13;
tmp1 = (_r1 == _r2);
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp4 += 26;
tmp1 = 0;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_s1 = tmpMeta14;
_s2 = tmpMeta15;
tmp1 = (stringEqual(_s1, _s2));
goto tmp3_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmp4 += 24;
tmp1 = 0;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta16;
modelica_integer tmp17;
modelica_metatype tmpMeta18;
modelica_integer tmp19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp17 = mmc_unbox_integer(tmpMeta16);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp19 = mmc_unbox_integer(tmpMeta18);
_b1 = tmp17;
_b2 = tmp19;
tmp1 = ((!_b1 && !_b2) || (_b1 && _b2));
goto tmp3_done;
}
case 7: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp4 += 22;
tmp1 = 1;
goto tmp3_done;
}
case 8: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmp4 += 21;
tmp1 = 0;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expLst = tmpMeta20;
tmp4 += 20;
tmp1 = omc_Expression_expContainsList(threadData, _expLst, _inExp2);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta21;
tmp4 += 19;
tmp1 = omc_List_map1ListBoolOr(threadData, _expl, boxvar_Expression_expContains, _inExp2);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_cr1 = tmpMeta22;
_cr2 = tmpMeta23;
_res = omc_ComponentReference_crefEqual(threadData, _cr1, _cr2);
if((!_res))
{
_expLst = omc_List_map(threadData, omc_ComponentReference_crefSubs(threadData, _cr1), boxvar_Expression_getSubscriptExp);
_res = omc_Expression_expContainsList(threadData, _expLst, _inExp2);
}
tmp1 = _res;
goto tmp3_done;
}
case 12: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmp4 += 17;
tmp1 = 0;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta24;
_e2 = tmpMeta25;
tmp4 += 16;
tmp1 = (omc_Expression_expContains(threadData, _e1, _inExp2) || omc_Expression_expContains(threadData, _e2, _inExp2));
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta26;
tmp4 += 15;
tmp1 = omc_Expression_expContains(threadData, _e, _inExp2);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta27;
_e2 = tmpMeta28;
tmp4 += 14;
tmp1 = (omc_Expression_expContains(threadData, _e1, _inExp2) || omc_Expression_expContains(threadData, _e2, _inExp2));
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta29;
tmp4 += 13;
tmp1 = omc_Expression_expContains(threadData, _e, _inExp2);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta30;
_e2 = tmpMeta31;
tmp4 += 12;
tmp1 = (omc_Expression_expContains(threadData, _e1, _inExp2) || omc_Expression_expContains(threadData, _e2, _inExp2));
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_c = tmpMeta32;
_t = tmpMeta33;
_f = tmpMeta34;
tmp4 += 11;
tmp1 = ((omc_Expression_expContains(threadData, _c, _inExp2) || omc_Expression_expContains(threadData, _t, _inExp2)) || omc_Expression_expContains(threadData, _f, _inExp2));
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,1,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
if (3 != MMC_STRLEN(tmpMeta36) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta36)) != 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta37)) goto tmp3_end;
tmpMeta38 = MMC_CAR(tmpMeta37);
tmpMeta39 = MMC_CDR(tmpMeta37);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,6,2) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
if (!listEmpty(tmpMeta39)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,3) == 0) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta41,1,1) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 2));
if (3 != MMC_STRLEN(tmpMeta42) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta42)) != 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (listEmpty(tmpMeta43)) goto tmp3_end;
tmpMeta44 = MMC_CAR(tmpMeta43);
tmpMeta45 = MMC_CDR(tmpMeta43);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,6,2) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta44), 2));
if (!listEmpty(tmpMeta45)) goto tmp3_end;
_cr1 = tmpMeta40;
_cr2 = tmpMeta46;
tmp4 += 3;
tmp1 = omc_ComponentReference_crefEqual(threadData, _cr1, _cr2);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta47,1,1) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta47), 2));
if (3 != MMC_STRLEN(tmpMeta48) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta48)) != 0) goto tmp3_end;
tmp4 += 1;
tmp1 = 0;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta49,1,1) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 2));
if (8 != MMC_STRLEN(tmpMeta50) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta50)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!listEmpty(tmpMeta51)) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta52;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_expLst = tmpMeta52;
tmp4 += 6;
tmp1 = omc_Expression_expContainsList(threadData, _expLst, _inExp2);
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta53;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_expLst = tmpMeta53;
tmp4 += 5;
tmp1 = omc_Expression_expContainsList(threadData, _expLst, _inExp2);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta54;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
_expLst = tmpMeta54;
tmp4 += 4;
tmp1 = omc_Expression_expContainsList(threadData, _expLst, _inExp2);
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta55,1,1) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta56,0,1) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta57,1,1) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta58;
tmp4 += 2;
tmp1 = omc_Expression_expContains(threadData, _e, _inExp2);
goto tmp3_done;
}
case 28: {
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta59;
_expLst = tmpMeta60;
tmp4 += 1;
tmp1 = (omc_Expression_expContainsList(threadData, _expLst, _inExp2) || omc_Expression_expContains(threadData, _e, _inExp2));
goto tmp3_done;
}
case 29: {
modelica_metatype tmpMeta61;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta61;
tmp1 = omc_Expression_expContains(threadData, _e, _inExp2);
goto tmp3_done;
}
case 30: {
modelica_boolean tmp62;
modelica_metatype tmpMeta63;
tmp62 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp62) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT61);
_s1 = omc_ExpressionDump_printExpStr(threadData, _inExp1);
_s2 = omc_ExpressionDump_printExpStr(threadData, _inExp2);
tmpMeta63 = mmc_mk_cons(_OMC_LIT62, mmc_mk_cons(_s1, mmc_mk_cons(_OMC_LIT63, mmc_mk_cons(_s2, MMC_REFSTRUCTLIT(mmc_nil)))));
_str = stringAppendList(tmpMeta63);
omc_Debug_traceln(threadData, _str);
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 < 31) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_expContains(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_expContains(threadData, _inExp1, _inExp2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_expContainsList(threadData_t *threadData, modelica_metatype _expl, modelica_metatype _exp)
{
modelica_boolean _contains;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_contains = omc_List_map1BoolOr(threadData, _expl, boxvar_Expression_expContains, _exp);
_return: OMC_LABEL_UNUSED
return _contains;
}
modelica_metatype boxptr_Expression_expContainsList(threadData_t *threadData, modelica_metatype _expl, modelica_metatype _exp)
{
modelica_boolean _contains;
modelica_metatype out_contains;
_contains = omc_Expression_expContainsList(threadData, _expl, _exp);
out_contains = mmc_mk_icon(_contains);
return out_contains;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_expStructuralEqualListLst(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp1;
tmp4_2 = _inExp2;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _es1 = NULL;
modelica_metatype _es2 = 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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
_e1 = tmpMeta6;
_es1 = tmpMeta7;
_e2 = tmpMeta8;
_es2 = tmpMeta9;
if (!omc_Expression_expStructuralEqualList(threadData, _e1, _e2)) goto tmp3_end;
_inExp1 = _es1;
_inExp2 = _es2;
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:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expStructuralEqualListLst(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_expStructuralEqualListLst(threadData, _inExp1, _inExp2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_expStructuralEqualList(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp1;
tmp4_2 = _inExp2;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _es1 = NULL;
modelica_metatype _es2 = 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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
_e1 = tmpMeta6;
_es1 = tmpMeta7;
_e2 = tmpMeta8;
_es2 = tmpMeta9;
if (!omc_Expression_expStructuralEqual(threadData, _e1, _e2)) goto tmp3_end;
_inExp1 = _es1;
_inExp2 = _es2;
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:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_expStructuralEqualList(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_expStructuralEqualList(threadData, _inExp1, _inExp2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_expStructuralEqual(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp1;
tmp4_2 = _inExp2;
{
modelica_integer _i1;
modelica_integer _i2;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_boolean _b;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_metatype _e11 = NULL;
modelica_metatype _e12 = NULL;
modelica_metatype _e21 = NULL;
modelica_metatype _e22 = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e13 = NULL;
modelica_metatype _e23 = NULL;
modelica_metatype _op1 = NULL;
modelica_metatype _op2 = NULL;
modelica_metatype _path1 = NULL;
modelica_metatype _path2 = NULL;
modelica_metatype _expl1 = NULL;
modelica_metatype _expl2 = NULL;
modelica_metatype _explstlst1 = NULL;
modelica_metatype _explstlst2 = NULL;
modelica_metatype _tp1 = NULL;
modelica_metatype _tp2 = NULL;
modelica_real _r1;
modelica_real _r2;
modelica_metatype _enum1 = NULL;
modelica_metatype _enum2 = NULL;
modelica_metatype _ae1 = NULL;
modelica_metatype _ae2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 41; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
_i1 = tmp7;
_i2 = tmp9;
tmp1 = (_i1 == _i2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_integer tmp11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_integer tmp15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp11 = mmc_unbox_integer(tmpMeta10);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,5,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmp15 = mmc_unbox_integer(tmpMeta14);
_i2 = tmp11;
_i1 = tmp15;
_i1 = (-_i1);
tmp1 = (_i1 == _i2);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta16;
modelica_integer tmp17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp17 = mmc_unbox_integer(tmpMeta16);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,5,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp21 = mmc_unbox_integer(tmpMeta20);
_i1 = tmp17;
_i2 = tmp21;
_i2 = (-_i2);
tmp1 = (_i1 == _i2);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta22;
modelica_real tmp23;
modelica_metatype tmpMeta24;
modelica_real tmp25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp23 = mmc_unbox_real(tmpMeta22);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp25 = mmc_unbox_real(tmpMeta24);
_r1 = tmp23;
_r2 = tmp25;
tmp1 = (_r1 == _r2);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta26;
modelica_real tmp27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_real tmp31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp27 = mmc_unbox_real(tmpMeta26);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,5,1) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,1,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmp31 = mmc_unbox_real(tmpMeta30);
_r2 = tmp27;
_r1 = tmp31;
_r1 = (-_r1);
tmp1 = (_r1 == _r2);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta32;
modelica_real tmp33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_real tmp37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp33 = mmc_unbox_real(tmpMeta32);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,5,1) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,1,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
tmp37 = mmc_unbox_real(tmpMeta36);
_r1 = tmp33;
_r2 = tmp37;
_r2 = (-_r2);
tmp1 = (_r1 == _r2);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_s1 = tmpMeta38;
_s2 = tmpMeta39;
tmp1 = (stringEqual(_s1, _s2));
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta40;
modelica_integer tmp41;
modelica_metatype tmpMeta42;
modelica_integer tmp43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp41 = mmc_unbox_integer(tmpMeta40);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp43 = mmc_unbox_integer(tmpMeta42);
_b1 = tmp41;
_b2 = tmp43;
tmp1 = ((!_b1 && !_b2) || (_b1 && _b2));
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,5,2) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_enum1 = tmpMeta44;
_enum2 = tmpMeta45;
tmp1 = omc_AbsynUtil_pathEqual(threadData, _enum1, _enum2);
goto tmp3_done;
}
case 9: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_boolean tmp52;
modelica_boolean tmp53;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e11 = tmpMeta46;
_op1 = tmpMeta47;
_e12 = tmpMeta48;
_e21 = tmpMeta49;
_op2 = tmpMeta50;
_e22 = tmpMeta51;
_b = omc_Expression_operatorEqual(threadData, _op1, _op2);
_b = (_b?omc_Expression_expStructuralEqual(threadData, _e11, _e21):_b);
tmp52 = (modelica_boolean)_b;
if(tmp52)
{
_inExp1 = _e12;
_inExp2 = _e22;
goto _tailrecursive;
}
else
{
tmp53 = _b;
}
tmp1 = tmp53;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_boolean tmp60;
modelica_boolean tmp61;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,3) == 0) goto tmp3_end;
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e11 = tmpMeta54;
_op1 = tmpMeta55;
_e12 = tmpMeta56;
_e21 = tmpMeta57;
_op2 = tmpMeta58;
_e22 = tmpMeta59;
_b = omc_Expression_operatorEqual(threadData, _op1, _op2);
_b = (_b?omc_Expression_expStructuralEqual(threadData, _e11, _e21):_b);
tmp60 = (modelica_boolean)_b;
if(tmp60)
{
_inExp1 = _e12;
_inExp2 = _e22;
goto _tailrecursive;
}
else
{
tmp61 = _b;
}
tmp1 = tmp61;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_boolean tmp66;
modelica_boolean tmp67;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_op1 = tmpMeta62;
_e1 = tmpMeta63;
_op2 = tmpMeta64;
_e2 = tmpMeta65;
_b = omc_Expression_operatorEqual(threadData, _op1, _op2);
tmp66 = (modelica_boolean)_b;
if(tmp66)
{
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp67 = _b;
}
tmp1 = tmp67;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_boolean tmp72;
modelica_boolean tmp73;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,10,2) == 0) goto tmp3_end;
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_op1 = tmpMeta68;
_e1 = tmpMeta69;
_op2 = tmpMeta70;
_e2 = tmpMeta71;
_b = omc_Expression_operatorEqual(threadData, _op1, _op2);
tmp72 = (modelica_boolean)_b;
if(tmp72)
{
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp73 = _b;
}
tmp1 = tmp73;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_boolean tmp80;
modelica_boolean tmp81;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta74 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta76 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,5) == 0) goto tmp3_end;
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e11 = tmpMeta74;
_op1 = tmpMeta75;
_e12 = tmpMeta76;
_e21 = tmpMeta77;
_op2 = tmpMeta78;
_e22 = tmpMeta79;
_b = omc_Expression_operatorEqual(threadData, _op1, _op2);
_b = (_b?omc_Expression_expStructuralEqual(threadData, _e11, _e21):_b);
tmp80 = (modelica_boolean)_b;
if(tmp80)
{
_inExp1 = _e12;
_inExp2 = _e22;
goto _tailrecursive;
}
else
{
tmp81 = _b;
}
tmp1 = tmp81;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_metatype tmpMeta87;
modelica_boolean tmp88;
modelica_boolean tmp89;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta83 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta84 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,12,3) == 0) goto tmp3_end;
tmpMeta85 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta86 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e11 = tmpMeta82;
_e12 = tmpMeta83;
_e13 = tmpMeta84;
_e21 = tmpMeta85;
_e22 = tmpMeta86;
_e23 = tmpMeta87;
_b = omc_Expression_expStructuralEqual(threadData, _e11, _e21);
_b = (_b?omc_Expression_expStructuralEqual(threadData, _e12, _e22):_b);
tmp88 = (modelica_boolean)_b;
if(tmp88)
{
_inExp1 = _e13;
_inExp2 = _e23;
goto _tailrecursive;
}
else
{
tmp89 = _b;
}
tmp1 = tmp89;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta90;
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
modelica_metatype tmpMeta93;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta90 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta91 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,3) == 0) goto tmp3_end;
tmpMeta92 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_path1 = tmpMeta90;
_expl1 = tmpMeta91;
_path2 = tmpMeta92;
_expl2 = tmpMeta93;
_b = omc_AbsynUtil_pathEqual(threadData, _path1, _path2);
tmp1 = (_b?omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2):_b);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta94 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta95 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,14,4) == 0) goto tmp3_end;
tmpMeta96 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta97 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_path1 = tmpMeta94;
_expl1 = tmpMeta95;
_path2 = tmpMeta96;
_expl2 = tmpMeta97;
_b = omc_AbsynUtil_pathEqual(threadData, _path1, _path2);
tmp1 = (_b?omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2):_b);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_metatype tmpMeta100;
modelica_metatype tmpMeta101;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta99 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,15,4) == 0) goto tmp3_end;
tmpMeta100 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta101 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_path1 = tmpMeta98;
_expl1 = tmpMeta99;
_path2 = tmpMeta100;
_expl2 = tmpMeta101;
_b = omc_AbsynUtil_pathEqual(threadData, _path1, _path2);
tmp1 = (_b?omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2):_b);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta102;
modelica_metatype tmpMeta103;
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta102 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta103 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,3) == 0) goto tmp3_end;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_tp1 = tmpMeta102;
_expl1 = tmpMeta103;
_tp2 = tmpMeta104;
_expl2 = tmpMeta105;
_b = valueEq(_tp1, _tp2);
tmp1 = (_b?omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2):_b);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta106;
modelica_metatype tmpMeta107;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta106 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,17,3) == 0) goto tmp3_end;
tmpMeta107 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_explstlst1 = tmpMeta106;
_explstlst2 = tmpMeta107;
tmp1 = omc_Expression_expStructuralEqualListLst(threadData, _explstlst1, _explstlst2);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta108;
modelica_metatype tmpMeta109;
modelica_metatype tmpMeta110;
modelica_metatype tmpMeta111;
modelica_metatype tmpMeta112;
modelica_metatype tmpMeta113;
modelica_boolean tmp114;
modelica_boolean tmp115;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta108 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta109 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta109)) goto tmp3_end;
tmpMeta110 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,18,4) == 0) goto tmp3_end;
tmpMeta111 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta112 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (!optionNone(tmpMeta112)) goto tmp3_end;
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_e11 = tmpMeta108;
_e13 = tmpMeta110;
_e21 = tmpMeta111;
_e23 = tmpMeta113;
_b = omc_Expression_expStructuralEqual(threadData, _e11, _e21);
tmp114 = (modelica_boolean)_b;
if(tmp114)
{
_inExp1 = _e13;
_inExp2 = _e23;
goto _tailrecursive;
}
else
{
tmp115 = _b;
}
tmp1 = tmp115;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta116;
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
modelica_metatype tmpMeta119;
modelica_metatype tmpMeta120;
modelica_metatype tmpMeta121;
modelica_metatype tmpMeta122;
modelica_metatype tmpMeta123;
modelica_boolean tmp124;
modelica_boolean tmp125;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta116 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta117 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta117)) goto tmp3_end;
tmpMeta118 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta117), 1));
tmpMeta119 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,18,4) == 0) goto tmp3_end;
tmpMeta120 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta121 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (optionNone(tmpMeta121)) goto tmp3_end;
tmpMeta122 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta121), 1));
tmpMeta123 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_e11 = tmpMeta116;
_e12 = tmpMeta118;
_e13 = tmpMeta119;
_e21 = tmpMeta120;
_e22 = tmpMeta122;
_e23 = tmpMeta123;
_b = omc_Expression_expStructuralEqual(threadData, _e11, _e21);
_b = (_b?omc_Expression_expStructuralEqual(threadData, _e12, _e22):_b);
tmp124 = (modelica_boolean)_b;
if(tmp124)
{
_inExp1 = _e13;
_inExp2 = _e23;
goto _tailrecursive;
}
else
{
tmp125 = _b;
}
tmp1 = tmp125;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta126;
modelica_metatype tmpMeta127;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta126 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,1) == 0) goto tmp3_end;
tmpMeta127 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_expl1 = tmpMeta126;
_expl2 = tmpMeta127;
tmp1 = omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2);
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta128;
modelica_metatype tmpMeta129;
modelica_metatype tmpMeta130;
modelica_metatype tmpMeta131;
modelica_boolean tmp132;
modelica_boolean tmp133;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta128 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta129 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,20,2) == 0) goto tmp3_end;
tmpMeta130 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta131 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_tp1 = tmpMeta128;
_e1 = tmpMeta129;
_tp2 = tmpMeta130;
_e2 = tmpMeta131;
_b = valueEq(_tp1, _tp2);
tmp132 = (modelica_boolean)_b;
if(tmp132)
{
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
}
else
{
tmp133 = _b;
}
tmp1 = tmp133;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta134;
modelica_metatype tmpMeta135;
modelica_metatype tmpMeta136;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta134 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta135 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,21,2) == 0) goto tmp3_end;
tmpMeta136 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e1 = tmpMeta134;
_ae1 = tmpMeta135;
_ae2 = tmpMeta136;
_b = omc_Expression_expStructuralEqual(threadData, _e1, _e1);
tmp1 = (_b?omc_Expression_expStructuralEqualList(threadData, _ae1, _ae2):_b);
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta137;
modelica_metatype tmpMeta138;
modelica_metatype tmpMeta139;
modelica_metatype tmpMeta140;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta137 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta138 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta138)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,24,2) == 0) goto tmp3_end;
tmpMeta139 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta140 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (!optionNone(tmpMeta140)) goto tmp3_end;
_e1 = tmpMeta137;
_e2 = tmpMeta139;
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta141;
modelica_metatype tmpMeta142;
modelica_metatype tmpMeta143;
modelica_metatype tmpMeta144;
modelica_metatype tmpMeta145;
modelica_metatype tmpMeta146;
modelica_boolean tmp147;
modelica_boolean tmp148;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta141 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta142 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta142)) goto tmp3_end;
tmpMeta143 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta142), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,24,2) == 0) goto tmp3_end;
tmpMeta144 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta145 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (optionNone(tmpMeta145)) goto tmp3_end;
tmpMeta146 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta145), 1));
_e1 = tmpMeta141;
_e11 = tmpMeta143;
_e2 = tmpMeta144;
_e22 = tmpMeta146;
_b = omc_Expression_expStructuralEqual(threadData, _e1, _e2);
tmp147 = (modelica_boolean)_b;
if(tmp147)
{
_inExp1 = _e11;
_inExp2 = _e22;
goto _tailrecursive;
}
else
{
tmp148 = _b;
}
tmp1 = tmp148;
goto tmp3_done;
}
case 28: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,25,2) == 0) goto tmp3_end;
omc_Debug_trace(threadData, _OMC_LIT66);
tmp1 = 0;
goto tmp3_done;
}
case 29: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,27,3) == 0) goto tmp3_end;
tmp1 = valueEq(_inExp1, _inExp2);
goto tmp3_done;
}
case 30: {
modelica_metatype tmpMeta149;
modelica_metatype tmpMeta150;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta149 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,28,1) == 0) goto tmp3_end;
tmpMeta150 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_expl1 = tmpMeta149;
_expl2 = tmpMeta150;
tmp1 = omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2);
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta151;
modelica_metatype tmpMeta152;
modelica_metatype tmpMeta153;
modelica_metatype tmpMeta154;
modelica_boolean tmp155;
modelica_boolean tmp156;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmpMeta151 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta152 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,29,2) == 0) goto tmp3_end;
tmpMeta153 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta154 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e11 = tmpMeta151;
_e12 = tmpMeta152;
_e21 = tmpMeta153;
_e22 = tmpMeta154;
_b = omc_Expression_expStructuralEqual(threadData, _e11, _e21);
tmp155 = (modelica_boolean)_b;
if(tmp155)
{
_inExp1 = _e12;
_inExp2 = _e22;
goto _tailrecursive;
}
else
{
tmp156 = _b;
}
tmp1 = tmp156;
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta157;
modelica_metatype tmpMeta158;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmpMeta157 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,30,1) == 0) goto tmp3_end;
tmpMeta158 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_expl1 = tmpMeta157;
_expl2 = tmpMeta158;
tmp1 = omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2);
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta159;
modelica_metatype tmpMeta160;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta159 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (!optionNone(tmpMeta159)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,31,1) == 0) goto tmp3_end;
tmpMeta160 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (!optionNone(tmpMeta160)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta161;
modelica_metatype tmpMeta162;
modelica_metatype tmpMeta163;
modelica_metatype tmpMeta164;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta161 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta161)) goto tmp3_end;
tmpMeta162 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta161), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,31,1) == 0) goto tmp3_end;
tmpMeta163 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (optionNone(tmpMeta163)) goto tmp3_end;
tmpMeta164 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta163), 1));
_e1 = tmpMeta162;
_e2 = tmpMeta164;
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
goto tmp3_done;
}
case 35: {
modelica_metatype tmpMeta165;
modelica_metatype tmpMeta166;
modelica_metatype tmpMeta167;
modelica_metatype tmpMeta168;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,32,5) == 0) goto tmp3_end;
tmpMeta165 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta166 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,32,5) == 0) goto tmp3_end;
tmpMeta167 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta168 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_path1 = tmpMeta165;
_expl1 = tmpMeta166;
_path2 = tmpMeta167;
_expl2 = tmpMeta168;
_b = omc_AbsynUtil_pathEqual(threadData, _path1, _path2);
tmp1 = (_b?omc_Expression_expStructuralEqualList(threadData, _expl1, _expl2):_b);
goto tmp3_done;
}
case 36: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,33,6) == 0) goto tmp3_end;
_e1 = tmp4_1;
_e2 = tmp4_2;
tmp1 = valueEq(_e1, _e2);
goto tmp3_done;
}
case 37: {
modelica_metatype tmpMeta169;
modelica_metatype tmpMeta170;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta169 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,34,1) == 0) goto tmp3_end;
tmpMeta170 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_e1 = tmpMeta169;
_e2 = tmpMeta170;
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
goto tmp3_done;
}
case 38: {
modelica_metatype tmpMeta171;
modelica_metatype tmpMeta172;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,35,2) == 0) goto tmp3_end;
tmpMeta171 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,35,2) == 0) goto tmp3_end;
tmpMeta172 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_e1 = tmpMeta171;
_e2 = tmpMeta172;
_inExp1 = _e1;
_inExp2 = _e2;
goto _tailrecursive;
goto tmp3_done;
}
case 39: {
modelica_metatype tmpMeta173;
modelica_integer tmp174;
modelica_metatype tmpMeta175;
modelica_integer tmp176;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,36,2) == 0) goto tmp3_end;
tmpMeta173 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp174 = mmc_unbox_integer(tmpMeta173);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,36,2) == 0) goto tmp3_end;
tmpMeta175 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp176 = mmc_unbox_integer(tmpMeta175);
_i1 = tmp174;
_i2 = tmp176;
tmp1 = (_i1 == _i2);
goto tmp3_done;
}
case 40: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_expStructuralEqual(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_expStructuralEqual(threadData, _inExp1, _inExp2);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_compareListList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2)
{
modelica_integer _comp;
modelica_metatype _expl2 = NULL;
modelica_metatype _rest_expl2 = NULL;
modelica_integer _len1;
modelica_integer _len2;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_rest_expl2 = _inExpl2;
_len1 = listLength(_inExpl1);
_len2 = listLength(_inExpl2);
_comp = omc_Util_intCompare(threadData, _len1, _len2);
if((_comp != ((modelica_integer) 0)))
{
goto _return;
}
{
modelica_metatype _expl1;
for (tmpMeta1 = _inExpl1; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_expl1 = MMC_CAR(tmpMeta1);
tmpMeta2 = _rest_expl2;
if (listEmpty(tmpMeta2)) MMC_THROW_INTERNAL();
tmpMeta3 = MMC_CAR(tmpMeta2);
tmpMeta4 = MMC_CDR(tmpMeta2);
_expl2 = tmpMeta3;
_rest_expl2 = tmpMeta4;
_comp = omc_Expression_compareList(threadData, _expl1, _expl2);
if((((modelica_integer) 0) != _comp))
{
goto _return;
}
}
}
_comp = ((modelica_integer) 0);
_return: OMC_LABEL_UNUSED
return _comp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_compareListList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2)
{
modelica_integer _comp;
modelica_metatype out_comp;
_comp = omc_Expression_compareListList(threadData, _inExpl1, _inExpl2);
out_comp = mmc_mk_icon(_comp);
return out_comp;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_compareList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2)
{
modelica_integer _comp;
modelica_integer _len1;
modelica_integer _len2;
modelica_metatype _e2 = NULL;
modelica_metatype _rest_expl2 = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_rest_expl2 = _inExpl2;
_len1 = listLength(_inExpl1);
_len2 = listLength(_inExpl2);
_comp = omc_Util_intCompare(threadData, _len1, _len2);
if((_comp != ((modelica_integer) 0)))
{
goto _return;
}
{
modelica_metatype _e1;
for (tmpMeta1 = _inExpl1; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_e1 = MMC_CAR(tmpMeta1);
tmpMeta2 = _rest_expl2;
if (listEmpty(tmpMeta2)) MMC_THROW_INTERNAL();
tmpMeta3 = MMC_CAR(tmpMeta2);
tmpMeta4 = MMC_CDR(tmpMeta2);
_e2 = tmpMeta3;
_rest_expl2 = tmpMeta4;
_comp = omc_Expression_compare(threadData, _e1, _e2);
if((((modelica_integer) 0) != _comp))
{
goto _return;
}
}
}
_comp = ((modelica_integer) 0);
_return: OMC_LABEL_UNUSED
return _comp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_compareList(threadData_t *threadData, modelica_metatype _inExpl1, modelica_metatype _inExpl2)
{
modelica_integer _comp;
modelica_metatype out_comp;
_comp = omc_Expression_compareList(threadData, _inExpl1, _inExpl2);
out_comp = mmc_mk_icon(_comp);
return out_comp;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_Expression_compareOpt(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_integer _comp;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp1;
tmp4_2 = _inExp2;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_1)) goto tmp3_end;
if (!optionNone(tmp4_2)) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 1: {
if (!optionNone(tmp4_1)) goto tmp3_end;
tmp1 = ((modelica_integer) -1);
goto tmp3_done;
}
case 2: {
if (!optionNone(tmp4_2)) goto tmp3_end;
tmp1 = ((modelica_integer) 1);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_e1 = tmpMeta6;
_e2 = tmpMeta7;
tmp1 = omc_Expression_compare(threadData, _e1, _e2);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_comp = tmp1;
_return: OMC_LABEL_UNUSED
return _comp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_compareOpt(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_integer _comp;
modelica_metatype out_comp;
_comp = omc_Expression_compareOpt(threadData, _inExp1, _inExp2);
out_comp = mmc_mk_icon(_comp);
return out_comp;
}
DLLExport
modelica_boolean omc_Expression_expEqual(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outEqual;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outEqual = (((modelica_integer) 0) == omc_Expression_compare(threadData, _inExp1, _inExp2));
_return: OMC_LABEL_UNUSED
return _outEqual;
}
modelica_metatype boxptr_Expression_expEqual(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_boolean _outEqual;
modelica_metatype out_outEqual;
_outEqual = omc_Expression_expEqual(threadData, _inExp1, _inExp2);
out_outEqual = mmc_mk_icon(_outEqual);
return out_outEqual;
}
DLLExport
modelica_boolean omc_Expression_isIntegerOrReal(threadData_t *threadData, modelica_metatype _tp)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _tp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 3: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isIntegerOrReal(threadData_t *threadData, modelica_metatype _tp)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isIntegerOrReal(threadData, _tp);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isOdd(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _even;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_integer _i;
modelica_real _r;
modelica_metatype _exp = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmp1 = (modelica_integer_mod(_i, ((modelica_integer) 2)) == ((modelica_integer) 1));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta7;
modelica_real tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp8 = mmc_unbox_real(tmpMeta7);
_r = tmp8;
tmp1 = (modelica_real_mod(_r, 2.0) == 1.0);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp = tmpMeta9;
_e = _exp;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_even = tmp1;
_return: OMC_LABEL_UNUSED
return _even;
}
modelica_metatype boxptr_Expression_isOdd(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _even;
modelica_metatype out_even;
_even = omc_Expression_isOdd(threadData, _e);
out_even = mmc_mk_icon(_even);
return out_even;
}
DLLExport
modelica_boolean omc_Expression_isEven(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _even;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_integer _i;
modelica_real _r;
modelica_metatype _exp = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmp1 = (modelica_integer_mod(_i, ((modelica_integer) 2)) == ((modelica_integer) 0));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta7;
modelica_real tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp8 = mmc_unbox_real(tmpMeta7);
_r = tmp8;
tmp1 = (modelica_real_mod(_r, 2.0) == 0.0);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp = tmpMeta9;
_e = _exp;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_even = tmp1;
_return: OMC_LABEL_UNUSED
return _even;
}
modelica_metatype boxptr_Expression_isEven(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _even;
modelica_metatype out_even;
_even = omc_Expression_isEven(threadData, _e);
out_even = mmc_mk_icon(_even);
return out_even;
}
DLLExport
modelica_boolean omc_Expression_expIsPositive(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = (omc_Expression_isPositiveOrZero(threadData, _e) && (!omc_Expression_isZero(threadData, _e)));
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_expIsPositive(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_expIsPositive(threadData, _e);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isScalarConst(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsScalar;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 8: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsScalar = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsScalar;
}
modelica_metatype boxptr_Expression_isScalarConst(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsScalar;
modelica_metatype out_outIsScalar;
_outIsScalar = omc_Expression_isScalarConst(threadData, _inExp);
out_outIsScalar = mmc_mk_icon(_outIsScalar);
return out_outIsScalar;
}
DLLExport
modelica_boolean omc_Expression_isRecord(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsRecord;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,14,4) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsRecord = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsRecord;
}
modelica_metatype boxptr_Expression_isRecord(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsRecord;
modelica_metatype out_outIsRecord;
_outIsRecord = omc_Expression_isRecord(threadData, _inExp);
out_outIsRecord = mmc_mk_icon(_outIsRecord);
return out_outIsRecord;
}
DLLExport
modelica_boolean omc_Expression_isTuple(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsTuple;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,19,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsTuple = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsTuple;
}
modelica_metatype boxptr_Expression_isTuple(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsTuple;
modelica_metatype out_outIsTuple;
_outIsTuple = omc_Expression_isTuple(threadData, _inExp);
out_outIsTuple = mmc_mk_icon(_outIsTuple);
return out_outIsTuple;
}
DLLExport
modelica_boolean omc_Expression_isCrefScalar(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _isScalar;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
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), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
_cr = omc_Expression_expCref(threadData, _inExp);
tmp1 = omc_ComponentReference_crefHasScalarSubscripts(threadData, _cr);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_isScalar = tmp1;
_return: OMC_LABEL_UNUSED
return _isScalar;
}
modelica_metatype boxptr_Expression_isCrefScalar(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _isScalar;
modelica_metatype out_isScalar;
_isScalar = omc_Expression_isCrefScalar(threadData, _inExp);
out_isScalar = mmc_mk_icon(_isScalar);
return out_isScalar;
}
DLLExport
modelica_boolean omc_Expression_isCrefArray(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsArray;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsArray = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsArray;
}
modelica_metatype boxptr_Expression_isCrefArray(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsArray;
modelica_metatype out_outIsArray;
_outIsArray = omc_Expression_isCrefArray(threadData, _inExp);
out_outIsArray = mmc_mk_icon(_outIsArray);
return out_outIsArray;
}
DLLExport
modelica_boolean omc_Expression_isNotCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCref;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,6,2) == 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:;
}
}
_outIsCref = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsCref;
}
modelica_metatype boxptr_Expression_isNotCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCref;
modelica_metatype out_outIsCref;
_outIsCref = omc_Expression_isNotCref(threadData, _inExp);
out_outIsCref = mmc_mk_icon(_outIsCref);
return out_outIsCref;
}
DLLExport
modelica_boolean omc_Expression_isRecordCall(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _funcsIn)
{
modelica_boolean _outIsCall;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _path = NULL;
modelica_metatype _func = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_path = tmpMeta6;
tmpMeta7 = omc_DAE_AvlTreePathFunction_get(threadData, _funcsIn, _path);
if (optionNone(tmpMeta7)) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
_func = tmpMeta8;
tmp1 = listEmpty(omc_DAEUtil_getFunctionElements(threadData, _func));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsCall = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsCall;
}
modelica_metatype boxptr_Expression_isRecordCall(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _funcsIn)
{
modelica_boolean _outIsCall;
modelica_metatype out_outIsCall;
_outIsCall = omc_Expression_isRecordCall(threadData, _inExp, _funcsIn);
out_outIsCall = mmc_mk_icon(_outIsCall);
return out_outIsCall;
}
DLLExport
modelica_boolean omc_Expression_isImpureCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsPureCall;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outIsPureCall = (omc_Expression_isCall(threadData, _inExp) && omc_Expression_isImpure(threadData, _inExp));
_return: OMC_LABEL_UNUSED
return _outIsPureCall;
}
modelica_metatype boxptr_Expression_isImpureCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsPureCall;
modelica_metatype out_outIsPureCall;
_outIsPureCall = omc_Expression_isImpureCall(threadData, _inExp);
out_outIsPureCall = mmc_mk_icon(_outIsPureCall);
return out_outIsPureCall;
}
DLLExport
modelica_boolean omc_Expression_isPureCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsPureCall;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outIsPureCall = (omc_Expression_isCall(threadData, _inExp) && (!omc_Expression_isImpure(threadData, _inExp)));
_return: OMC_LABEL_UNUSED
return _outIsPureCall;
}
modelica_metatype boxptr_Expression_isPureCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsPureCall;
modelica_metatype out_outIsPureCall;
_outIsPureCall = omc_Expression_isPureCall(threadData, _inExp);
out_outIsPureCall = mmc_mk_icon(_outIsPureCall);
return out_outIsPureCall;
}
DLLExport
modelica_boolean omc_Expression_isTSUB(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCall;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,22,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsCall = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsCall;
}
modelica_metatype boxptr_Expression_isTSUB(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCall;
modelica_metatype out_outIsCall;
_outIsCall = omc_Expression_isTSUB(threadData, _inExp);
out_outIsCall = mmc_mk_icon(_outIsCall);
return out_outIsCall;
}
DLLExport
modelica_boolean omc_Expression_isCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCall;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,13,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsCall = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsCall;
}
modelica_metatype boxptr_Expression_isCall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCall;
modelica_metatype out_outIsCall;
_outIsCall = omc_Expression_isCall(threadData, _inExp);
out_outIsCall = mmc_mk_icon(_outIsCall);
return out_outIsCall;
}
DLLExport
modelica_boolean omc_Expression_isUnaryCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCref;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsCref = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsCref;
}
modelica_metatype boxptr_Expression_isUnaryCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCref;
modelica_metatype out_outIsCref;
_outIsCref = omc_Expression_isUnaryCref(threadData, _inExp);
out_outIsCref = mmc_mk_icon(_outIsCref);
return out_outIsCref;
}
DLLExport
modelica_boolean omc_Expression_isCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCref;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsCref = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsCref;
}
modelica_metatype boxptr_Expression_isCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsCref;
modelica_metatype out_outIsCref;
_outIsCref = omc_Expression_isCref(threadData, _inExp);
out_outIsCref = mmc_mk_icon(_outIsCref);
return out_outIsCref;
}
DLLExport
modelica_boolean omc_Expression_isNegativeUnary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
modelica_metatype boxptr_Expression_isNegativeUnary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isNegativeUnary(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_isBinary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,7,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
modelica_metatype boxptr_Expression_isBinary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isBinary(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_isUnary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
modelica_metatype boxptr_Expression_isUnary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isUnary(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_isVector(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsVector;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,2) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsVector = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsVector;
}
modelica_metatype boxptr_Expression_isVector(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outIsVector;
modelica_metatype out_outIsVector;
_outIsVector = omc_Expression_isVector(threadData, _inExp);
out_outIsVector = mmc_mk_icon(_outIsVector);
return out_outIsVector;
}
DLLExport
modelica_boolean omc_Expression_isMatrix(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,17,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
modelica_metatype boxptr_Expression_isMatrix(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isMatrix(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_isMetaArray(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outB = omc_Types_isMetaArray(threadData, omc_Expression_typeof(threadData, _inExp));
_return: OMC_LABEL_UNUSED
return _outB;
}
modelica_metatype boxptr_Expression_isMetaArray(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isMetaArray(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_isArray(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,16,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
modelica_metatype boxptr_Expression_isArray(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isArray(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_expIntOrder(threadData_t *threadData, modelica_integer _expectedValue, modelica_metatype _integers)
{
modelica_boolean _ob;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_integer tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _expectedValue;
tmp4_2 = _integers;
{
modelica_metatype _expl = NULL;
modelica_integer _x1;
modelica_integer _x2;
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;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_2);
tmpMeta7 = MMC_CDR(tmp4_2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp9 = mmc_unbox_integer(tmpMeta8);
_x2 = tmp9;
_expl = tmpMeta7;
_x1 = tmp4_1;
if (!(_x1 == _x2)) goto tmp3_end;
_expectedValue = ((modelica_integer) 1) + _x1;
_integers = _expl;
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:;
}
}
_ob = tmp1;
_return: OMC_LABEL_UNUSED
return _ob;
}
modelica_metatype boxptr_Expression_expIntOrder(threadData_t *threadData, modelica_metatype _expectedValue, modelica_metatype _integers)
{
modelica_integer tmp1;
modelica_boolean _ob;
modelica_metatype out_ob;
tmp1 = mmc_unbox_integer(_expectedValue);
_ob = omc_Expression_expIntOrder(threadData, tmp1, _integers);
out_ob = mmc_mk_icon(_ob);
return out_ob;
}
DLLExport
modelica_boolean omc_Expression_containFunctioncall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _elst = NULL;
modelica_metatype _flatexplst = NULL;
modelica_metatype _explst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 27; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (3 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (8 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_elst = tmpMeta12;
tmp1 = omc_List_mapBoolOr(threadData, _elst, boxvar_Expression_containFunctioncall);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta13;
if (!omc_Expression_containFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta14;
if (!omc_Expression_containFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta15;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta16;
if (!omc_Expression_containFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta17;
if (!omc_Expression_containFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta18;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta19;
if (!omc_Expression_containFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta20;
if (!omc_Expression_containFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta21;
if (!omc_Expression_containFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e2 = tmpMeta22;
if (!omc_Expression_containFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e3 = tmpMeta23;
if (!omc_Expression_containFunctioncall(threadData, _e3)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_elst = tmpMeta24;
tmp1 = omc_List_mapBoolOr(threadData, _elst, boxvar_Expression_containFunctioncall);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_explst = tmpMeta25;
_flatexplst = omc_List_flatten(threadData, _explst);
tmp1 = omc_List_mapBoolOr(threadData, _flatexplst, boxvar_Expression_containFunctioncall);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta26;
if (!omc_Expression_containFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e2 = tmpMeta27;
if (!omc_Expression_containFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta28)) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 1));
_e = tmpMeta29;
if (!omc_Expression_containFunctioncall(threadData, _e)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_elst = tmpMeta30;
tmp1 = omc_List_mapBoolOr(threadData, _elst, boxvar_Expression_containVectorFunctioncall);
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta31;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta32;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta33;
if (!omc_Expression_containFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta34)) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 1));
_e2 = tmpMeta35;
if (!omc_Expression_containFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 26: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_containFunctioncall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_containFunctioncall(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_containVectorFunctioncall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _elst = NULL;
modelica_metatype _flatexplst = NULL;
modelica_metatype _explst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 29; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (3 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (8 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,1,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (8 != MMC_STRLEN(tmpMeta13) || strcmp(MMC_STRINGDATA(_OMC_LIT67), MMC_STRINGDATA(tmpMeta13)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (12 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT68), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,6,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_elst = tmpMeta18;
tmp1 = omc_List_mapBoolOr(threadData, _elst, boxvar_Expression_containVectorFunctioncall);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta19;
if (!omc_Expression_containVectorFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta20;
if (!omc_Expression_containVectorFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta21;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta22;
if (!omc_Expression_containVectorFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta23;
if (!omc_Expression_containVectorFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta24;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta25;
if (!omc_Expression_containVectorFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta26;
if (!omc_Expression_containVectorFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta27;
if (!omc_Expression_containVectorFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e2 = tmpMeta28;
if (!omc_Expression_containVectorFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e3 = tmpMeta29;
if (!omc_Expression_containVectorFunctioncall(threadData, _e3)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_elst = tmpMeta30;
tmp1 = omc_List_mapBoolOr(threadData, _elst, boxvar_Expression_containVectorFunctioncall);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_explst = tmpMeta31;
_flatexplst = omc_List_flatten(threadData, _explst);
tmp1 = omc_List_mapBoolOr(threadData, _flatexplst, boxvar_Expression_containVectorFunctioncall);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta32;
if (!omc_Expression_containVectorFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e2 = tmpMeta33;
if (!omc_Expression_containVectorFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta34)) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 1));
_e = tmpMeta35;
if (!omc_Expression_containVectorFunctioncall(threadData, _e)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_elst = tmpMeta36;
tmp1 = omc_List_mapBoolOr(threadData, _elst, boxvar_Expression_containVectorFunctioncall);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta37;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta38;
if (!omc_Expression_containVectorFunctioncall(threadData, _e1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta39)) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 1));
_e2 = tmpMeta40;
if (!omc_Expression_containVectorFunctioncall(threadData, _e2)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 28: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_containVectorFunctioncall(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_containVectorFunctioncall(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isLesseqOrLess(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 28: {
tmp1 = 1;
goto tmp3_done;
}
case 29: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isLesseqOrLess(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isLesseqOrLess(threadData, _op);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isGreatereqOrLesseq(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 31: {
tmp1 = 1;
goto tmp3_done;
}
case 29: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isGreatereqOrLesseq(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isGreatereqOrLesseq(threadData, _op);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isConstMinusOne(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_real _rval;
modelica_integer _ival;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
modelica_real tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_real(tmpMeta5);
_rval = tmp6;
tmp1 = (_rval == -1.0);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta7;
modelica_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
_ival = tmp8;
tmp1 = (_ival == ((modelica_integer) -1));
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstMinusOne(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstMinusOne(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isConstOne(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_real _rval;
modelica_integer _ival;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
modelica_real tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_real(tmpMeta5);
_rval = tmp6;
tmp1 = (_rval == 1.0);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta7;
modelica_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
_ival = tmp8;
tmp1 = (_ival == ((modelica_integer) 1));
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstOne(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstOne(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isConstTrue(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
if (1 != tmp7) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstTrue(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstTrue(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isConstFalse(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
if (0 != tmp7) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstFalse(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstFalse(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isConstZeroLength(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!listEmpty(tmpMeta6)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!listEmpty(tmpMeta7)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstZeroLength(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstZeroLength(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isExpReal(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _re;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_re = omc_Expression_isReal(threadData, omc_Expression_typeof(threadData, _e));
_return: OMC_LABEL_UNUSED
return _re;
}
modelica_metatype boxptr_Expression_isExpReal(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _re;
modelica_metatype out_re;
_re = omc_Expression_isExpReal(threadData, _e);
out_re = mmc_mk_icon(_re);
return out_re;
}
DLLExport
modelica_boolean omc_Expression_isReal(threadData_t *threadData, modelica_metatype _it)
{
modelica_boolean _re;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _it;
{
modelica_metatype _t1 = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t1 = tmpMeta5;
_it = _t1;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_re = tmp1;
_return: OMC_LABEL_UNUSED
return _re;
}
modelica_metatype boxptr_Expression_isReal(threadData_t *threadData, modelica_metatype _it)
{
modelica_boolean _re;
modelica_metatype out_re;
_re = omc_Expression_isReal(threadData, _it);
out_re = mmc_mk_icon(_re);
return out_re;
}
DLLExport
modelica_boolean omc_Expression_isInt(threadData_t *threadData, modelica_metatype _it)
{
modelica_boolean _re;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _it;
{
modelica_metatype _t1 = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t1 = tmpMeta5;
_it = _t1;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_re = tmp1;
_return: OMC_LABEL_UNUSED
return _re;
}
modelica_metatype boxptr_Expression_isInt(threadData_t *threadData, modelica_metatype _it)
{
modelica_boolean _re;
modelica_metatype out_re;
_re = omc_Expression_isInt(threadData, _it);
out_re = mmc_mk_icon(_re);
return out_re;
}
DLLExport
modelica_boolean omc_Expression_isWholeDim(threadData_t *threadData, modelica_metatype _s)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _s;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_isWholeDim(threadData_t *threadData, modelica_metatype _s)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_isWholeDim(threadData, _s);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_typeBuiltin(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 7: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_typeBuiltin(threadData_t *threadData, modelica_metatype _inType)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_typeBuiltin(threadData, _inType);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_equalTypesComplexVars(threadData_t *threadData, modelica_metatype _inVars1, modelica_metatype _inVars2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inVars1;
tmp4_2 = _inVars2;
{
modelica_metatype _t1 = NULL;
modelica_metatype _t2 = NULL;
modelica_string _s1 = NULL;
modelica_string _s2 = NULL;
modelica_metatype _vars1 = NULL;
modelica_metatype _vars2 = 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;
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmp4 += 1;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_boolean tmp14;
modelica_boolean tmp15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_2);
tmpMeta11 = MMC_CDR(tmp4_2);
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 4));
_s1 = tmpMeta8;
_t1 = tmpMeta9;
_vars1 = tmpMeta7;
_s2 = tmpMeta12;
_t2 = tmpMeta13;
_vars2 = tmpMeta11;
tmp14 = (stringEqual(_s1, _s2));
if (1 != tmp14) goto goto_2;
tmp15 = omc_Expression_equalTypes(threadData, _t1, _t2);
if (1 != tmp15) goto goto_2;
tmp1 = omc_Expression_equalTypesComplexVars(threadData, _vars1, _vars2);
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_equalTypesComplexVars(threadData_t *threadData, modelica_metatype _inVars1, modelica_metatype _inVars2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_equalTypesComplexVars(threadData, _inVars1, _inVars2);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_equalTypes(threadData_t *threadData, modelica_metatype _t1, modelica_metatype _t2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _t1;
tmp4_2 = _t2;
{
modelica_metatype _vars1 = NULL;
modelica_metatype _vars2 = NULL;
modelica_metatype _ty1 = NULL;
modelica_metatype _ty2 = NULL;
modelica_metatype _ad1 = NULL;
modelica_metatype _ad2 = NULL;
modelica_metatype _li1 = NULL;
modelica_metatype _li2 = 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 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmp4 += 6;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmp4 += 5;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
tmp4 += 4;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
tmp4 += 3;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,1) == 0) goto tmp3_end;
tmp4 += 2;
tmp1 = 1;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_vars1 = tmpMeta6;
_vars2 = tmpMeta7;
tmp4 += 1;
tmp1 = omc_Expression_equalTypesComplexVars(threadData, _vars1, _vars2);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
modelica_boolean tmp13;
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));
_ty1 = tmpMeta8;
_ad1 = tmpMeta9;
_ty2 = tmpMeta10;
_ad2 = tmpMeta11;
_li1 = omc_List_map(threadData, _ad1, boxvar_Expression_dimensionSize);
_li2 = omc_List_map(threadData, _ad2, boxvar_Expression_dimensionSize);
tmp12 = omc_List_isEqualOnTrue(threadData, _li1, _li2, boxvar_intEq);
if (1 != tmp12) goto goto_2;
tmp13 = omc_Expression_equalTypes(threadData, _ty1, _ty2);
if (1 != tmp13) goto goto_2;
tmp1 = 1;
goto tmp3_done;
}
case 7: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 8) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_equalTypes(threadData_t *threadData, modelica_metatype _t1, modelica_metatype _t2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_equalTypes(threadData, _t1, _t2);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_Expression_isFunCall(threadData_t *threadData, modelica_metatype _iExp, modelica_string _name)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iExp;
{
modelica_string _name_ = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_name_ = tmpMeta7;
tmp1 = (stringEqual(_name_, _name));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isFunCall(threadData_t *threadData, modelica_metatype _iExp, modelica_metatype _name)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isFunCall(threadData, _iExp, _name);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isPow(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
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,4,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isPow(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isPow(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isMulorDivBinary(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_boolean _res;
modelica_metatype _op = NULL;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iExp;
{
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,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta6;
tmp1 = omc_Expression_isMulOrDiv(threadData, _op);
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isMulorDivBinary(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isMulorDivBinary(threadData, _iExp);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isDivBinary(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_boolean _res;
modelica_metatype _op = NULL;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iExp;
{
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,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta6;
tmp1 = omc_Expression_isDiv(threadData, _op);
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isDivBinary(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isDivBinary(threadData, _iExp);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isDiv(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 13: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isDiv(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isDiv(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isMul(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 12: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isMul(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isMul(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isMulOrDiv(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = (omc_Expression_isMul(threadData, _op) || omc_Expression_isDiv(threadData, _op));
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isMulOrDiv(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isMulOrDiv(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isAddOrSubBinary(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_boolean _res;
modelica_metatype _op = NULL;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iExp;
{
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,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta6;
tmp1 = omc_Expression_isAddOrSub(threadData, _op);
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isAddOrSubBinary(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isAddOrSubBinary(threadData, _iExp);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isSub(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 11: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isSub(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isSub(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isAdd(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 10: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isAdd(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isAdd(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isAddOrSub(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = (omc_Expression_isAdd(threadData, _op) || omc_Expression_isSub(threadData, _op));
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_isAddOrSub(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_isAddOrSub(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_boolean omc_Expression_isEventTriggeringFunctionExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT69), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (3 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT70), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (3 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT71), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,1,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (4 != MMC_STRLEN(tmpMeta13) || strcmp(MMC_STRINGDATA(_OMC_LIT72), MMC_STRINGDATA(tmpMeta13)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (5 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT73), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,1,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (7 != MMC_STRLEN(tmpMeta17) || strcmp(MMC_STRINGDATA(_OMC_LIT74), MMC_STRINGDATA(tmpMeta17)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 0;
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;
}
modelica_metatype boxptr_Expression_isEventTriggeringFunctionExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_Expression_isEventTriggeringFunctionExp(threadData, _inExp);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
DLLExport
modelica_boolean omc_Expression_isRelation(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,11,5) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isRelation(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isRelation(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isNotConst(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _nb;
modelica_boolean _b;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = omc_Expression_isConst(threadData, _e);
_nb = (!_b);
_return: OMC_LABEL_UNUSED
return _nb;
}
modelica_metatype boxptr_Expression_isNotConst(threadData_t *threadData, modelica_metatype _e)
{
modelica_boolean _nb;
modelica_metatype out_nb;
_nb = omc_Expression_isNotConst(threadData, _e);
out_nb = mmc_mk_icon(_nb);
return out_nb;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstValueWorkListList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outIsConst;
modelica_metatype _e = NULL;
modelica_metatype _exps = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = 1;
_exps = _inExps;
while(1)
{
if(!(_b && (!listEmpty(_exps)))) break;
tmpMeta1 = _exps;
if (listEmpty(tmpMeta1)) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_CAR(tmpMeta1);
tmpMeta3 = MMC_CDR(tmpMeta1);
_e = tmpMeta2;
_exps = tmpMeta3;
_b = omc_Expression_isConstValueWorkList(threadData, _e);
}
_outIsConst = _b;
_return: OMC_LABEL_UNUSED
return _outIsConst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstValueWorkListList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outIsConst;
modelica_metatype out_outIsConst;
_outIsConst = omc_Expression_isConstValueWorkListList(threadData, _inExps);
out_outIsConst = mmc_mk_icon(_outIsConst);
return out_outIsConst;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstValueWorkList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outBoolean;
modelica_metatype _e = NULL;
modelica_metatype _exps = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = 1;
_exps = _inExps;
while(1)
{
if(!(_b && (!listEmpty(_exps)))) break;
tmpMeta1 = _exps;
if (listEmpty(tmpMeta1)) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_CAR(tmpMeta1);
tmpMeta3 = MMC_CDR(tmpMeta1);
_e = tmpMeta2;
_exps = tmpMeta3;
_b = omc_Expression_isConstValueWork(threadData, _e);
}
_outBoolean = _b;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstValueWorkList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstValueWorkList(threadData, _inExps);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstWorkListList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outIsConst;
modelica_metatype _e = NULL;
modelica_metatype _exps = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = 1;
_exps = _inExps;
while(1)
{
if(!(_b && (!listEmpty(_exps)))) break;
tmpMeta1 = _exps;
if (listEmpty(tmpMeta1)) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_CAR(tmpMeta1);
tmpMeta3 = MMC_CDR(tmpMeta1);
_e = tmpMeta2;
_exps = tmpMeta3;
_b = omc_Expression_isConstWorkList(threadData, _e);
}
_outIsConst = _b;
_return: OMC_LABEL_UNUSED
return _outIsConst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstWorkListList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outIsConst;
modelica_metatype out_outIsConst;
_outIsConst = omc_Expression_isConstWorkListList(threadData, _inExps);
out_outIsConst = mmc_mk_icon(_outIsConst);
return out_outIsConst;
}
DLLExport
modelica_boolean omc_Expression_isConstWorkList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outBoolean;
modelica_metatype _e = NULL;
modelica_metatype _exps = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = 1;
_exps = _inExps;
while(1)
{
if(!(_b && (!listEmpty(_exps)))) break;
tmpMeta1 = _exps;
if (listEmpty(tmpMeta1)) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_CAR(tmpMeta1);
tmpMeta3 = MMC_CDR(tmpMeta1);
_e = tmpMeta2;
_exps = tmpMeta3;
_b = omc_Expression_isConst(threadData, _e);
}
_outBoolean = _b;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstWorkList(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstWorkList(threadData, _inExps);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isConstValue(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outBoolean = omc_Expression_isConstValueWork(threadData, _inExp);
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConstValue(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstValue(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_Expression_isConstValueWork(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _ae = NULL;
modelica_metatype _matrix = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 8: {
tmp1 = 1;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae = tmpMeta5;
tmp1 = omc_Expression_isConstValueWorkList(threadData, _ae);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_matrix = tmpMeta6;
tmp1 = omc_Expression_isConstValueWorkListList(threadData, _matrix);
goto tmp3_done;
}
case 17: {
tmp1 = 1;
goto tmp3_done;
}
case 35: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isConstValueWork(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConstValueWork(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isConst(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_boolean _res;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _ae = NULL;
modelica_metatype _matrix = NULL;
modelica_metatype _path = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 28; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta6;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_boolean tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta8;
_e2 = tmpMeta9;
_res = omc_Expression_isConst(threadData, _e2);
tmp10 = (modelica_boolean)_res;
if(tmp10)
{
_inExp = _e1;
goto _tailrecursive;
}
else
{
tmp11 = 0;
}
tmp1 = tmp11;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_boolean tmp16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 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));
_e = tmpMeta12;
_e1 = tmpMeta13;
_e2 = tmpMeta14;
_res = omc_Expression_isConst(threadData, _e2);
if(_res)
{
_res = omc_Expression_isConst(threadData, _e1);
}
tmp15 = (modelica_boolean)_res;
if(tmp15)
{
_inExp = _e;
goto _tailrecursive;
}
else
{
tmp16 = 0;
}
tmp1 = tmp16;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_boolean tmp19;
modelica_boolean tmp20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta17;
_e2 = tmpMeta18;
_res = omc_Expression_isConst(threadData, _e2);
tmp19 = (modelica_boolean)_res;
if(tmp19)
{
_inExp = _e1;
goto _tailrecursive;
}
else
{
tmp20 = 0;
}
tmp1 = tmp20;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta21;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_boolean tmp24;
modelica_boolean tmp25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta22;
_e2 = tmpMeta23;
_res = omc_Expression_isConst(threadData, _e2);
tmp24 = (modelica_boolean)_res;
if(tmp24)
{
_inExp = _e1;
goto _tailrecursive;
}
else
{
tmp25 = 0;
}
tmp1 = tmp25;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae = tmpMeta26;
tmp1 = omc_Expression_isConstWorkList(threadData, _ae);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_matrix = tmpMeta27;
tmp1 = omc_Expression_isConstWorkListList(threadData, _matrix);
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_boolean tmp31;
modelica_boolean tmp32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta29)) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta28;
_e2 = tmpMeta30;
_res = omc_Expression_isConst(threadData, _e2);
tmp31 = (modelica_boolean)_res;
if(tmp31)
{
_inExp = _e1;
goto _tailrecursive;
}
else
{
tmp32 = 0;
}
tmp1 = tmp32;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_boolean tmp37;
modelica_boolean tmp38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta34)) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 1));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e = tmpMeta33;
_e1 = tmpMeta35;
_e2 = tmpMeta36;
_res = omc_Expression_isConst(threadData, _e2);
if(_res)
{
_res = omc_Expression_isConst(threadData, _e1);
}
tmp37 = (modelica_boolean)_res;
if(tmp37)
{
_inExp = _e;
goto _tailrecursive;
}
else
{
tmp38 = 0;
}
tmp1 = tmp38;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta39;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_ae = tmpMeta39;
tmp1 = omc_Expression_isConstWorkList(threadData, _ae);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta40;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_ae = tmpMeta40;
tmp1 = omc_Expression_isConstWorkList(threadData, _ae);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta41;
_ae = tmpMeta42;
_res = omc_Expression_isConst(threadData, _e);
tmp1 = (_res?omc_Expression_isConstWorkList(threadData, _ae):0);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta43;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta45)) goto tmp3_end;
_e = tmpMeta44;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_boolean tmp49;
modelica_boolean tmp50;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta47)) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta47), 1));
_e1 = tmpMeta46;
_e2 = tmpMeta48;
_res = omc_Expression_isConst(threadData, _e2);
tmp49 = (modelica_boolean)_res;
if(tmp49)
{
_inExp = _e1;
goto _tailrecursive;
}
else
{
tmp50 = 0;
}
tmp1 = tmp50;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_integer tmp54;
modelica_metatype tmpMeta55;
modelica_integer tmp56;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 4));
tmp54 = mmc_unbox_integer(tmpMeta53);
if (0 != tmp54) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 5));
tmp56 = mmc_unbox_integer(tmpMeta55);
if (0 != tmp56) goto tmp3_end;
_ae = tmpMeta51;
tmp1 = omc_Expression_isConstWorkList(threadData, _ae);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_integer tmp61;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta59), 4));
tmp61 = mmc_unbox_integer(tmpMeta60);
if (1 != tmp61) goto tmp3_end;
_path = tmpMeta57;
_ae = tmpMeta58;
tmp1 = (listMember(omc_AbsynUtil_pathFirstIdent(threadData, _path), _OMC_LIT80)?0:omc_Expression_isConstWorkList(threadData, _ae));
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta62;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_ae = tmpMeta62;
tmp1 = omc_Expression_isConstWorkList(threadData, _ae);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_boolean tmp68;
modelica_boolean tmp69;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta64)) goto tmp3_end;
tmpMeta65 = MMC_CAR(tmpMeta64);
tmpMeta66 = MMC_CDR(tmpMeta64);
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta65), 3));
if (!listEmpty(tmpMeta66)) goto tmp3_end;
_e1 = tmpMeta63;
_e2 = tmpMeta67;
_res = omc_Expression_isConst(threadData, _e2);
tmp68 = (modelica_boolean)_res;
if(tmp68)
{
_inExp = _e1;
goto _tailrecursive;
}
else
{
tmp69 = 0;
}
tmp1 = tmp69;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta70;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta70;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 27: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isConst(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isConst(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_real omc_Expression_getEvaluatedConstReal(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_real _val;
modelica_real tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp1 = mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))));
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp1 = ((modelica_real)mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2)))));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_val = tmp1;
_return: OMC_LABEL_UNUSED
return _val;
}
modelica_metatype boxptr_Expression_getEvaluatedConstReal(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_real _val;
modelica_metatype out_val;
_val = omc_Expression_getEvaluatedConstReal(threadData, _inExp);
out_val = mmc_mk_rcon(_val);
return out_val;
}
DLLExport
modelica_integer omc_Expression_getEvaluatedConstInteger(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_integer _val;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _integer;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_integer = tmp7;
tmp1 = _integer;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = omc_Expression_realExpIntLit(threadData, _inExp);
if (optionNone(tmpMeta8)) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
tmp10 = mmc_unbox_integer(tmpMeta9);
_integer = tmp10;
tmp1 = _integer;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_val = tmp1;
_return: OMC_LABEL_UNUSED
return _val;
}
modelica_metatype boxptr_Expression_getEvaluatedConstInteger(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_integer _val;
modelica_metatype out_val;
_val = omc_Expression_getEvaluatedConstInteger(threadData, _inExp);
out_val = mmc_mk_icon(_val);
return out_val;
}
DLLExport
modelica_boolean omc_Expression_isEvaluatedConst(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 8: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isEvaluatedConst(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isEvaluatedConst(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_containsRecordTypeWork(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inRec, modelica_boolean *out_cont, modelica_boolean *out_outRec)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_boolean _outRec;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
_cont = 0;
_outRec = _inRec;
if((!_inRec))
{
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _ty = NULL;
modelica_metatype _expLst = NULL;
modelica_boolean _subRec;
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,14,4) == 0) goto tmp3_end;
tmp4 += 1;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_expLst = tmpMeta6;
_ty = tmpMeta8;
_subRec = omc_Expression_isRecordType(threadData, _ty);
if((!_subRec))
{
{
modelica_metatype _exp;
for (tmpMeta9 = _expLst; !listEmpty(tmpMeta9); tmpMeta9=MMC_CDR(tmpMeta9))
{
_exp = MMC_CAR(tmpMeta9);
_subRec = omc_Expression_containsRecordType(threadData, _exp);
if(_subRec)
{
break;
}
}
}
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_subRec);
tmp1_c2 = _subRec;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmp1_c2 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outRec = tmp1_c2;
}
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outRec) { *out_outRec = _outRec; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_containsRecordTypeWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inRec, modelica_metatype *out_cont, modelica_metatype *out_outRec)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _outRec;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inRec);
_outExp = omc_Expression_containsRecordTypeWork(threadData, _inExp, tmp1, &_cont, &_outRec);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_outRec) { *out_outRec = mmc_mk_icon(_outRec); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_containsRecordType(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _isRec;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_containsRecordTypeWork, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_isRec = tmp2;
_return: OMC_LABEL_UNUSED
return _isRec;
}
modelica_metatype boxptr_Expression_containsRecordType(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _isRec;
modelica_metatype out_isRec;
_isRec = omc_Expression_containsRecordType(threadData, _inExp);
out_isRec = mmc_mk_icon(_isRec);
return out_isRec;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_isImpureWork(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _isImpure, modelica_boolean *out_cont, modelica_boolean *out_outImpure)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_boolean _outImpure;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _isImpure;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 14; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_2) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (1 != tmp8) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_integer tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (5 != MMC_STRLEN(tmpMeta10) || strcmp(MMC_STRINGDATA(_OMC_LIT81), MMC_STRINGDATA(tmpMeta10)) != 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 4));
tmp13 = mmc_unbox_integer(tmpMeta12);
if (1 != tmp13) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (19 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT82), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
tmp18 = mmc_unbox_integer(tmpMeta17);
if (1 != tmp18) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_integer tmp23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (5 != MMC_STRLEN(tmpMeta20) || strcmp(MMC_STRINGDATA(_OMC_LIT83), MMC_STRINGDATA(tmpMeta20)) != 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 4));
tmp23 = mmc_unbox_integer(tmpMeta22);
if (1 != tmp23) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_integer tmp28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,1,1) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
if (7 != MMC_STRLEN(tmpMeta25) || strcmp(MMC_STRINGDATA(_OMC_LIT75), MMC_STRINGDATA(tmpMeta25)) != 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 4));
tmp28 = mmc_unbox_integer(tmpMeta27);
if (1 != tmp28) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_integer tmp33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,1,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
if (5 != MMC_STRLEN(tmpMeta30) || strcmp(MMC_STRINGDATA(_OMC_LIT84), MMC_STRINGDATA(tmpMeta30)) != 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta31), 4));
tmp33 = mmc_unbox_integer(tmpMeta32);
if (1 != tmp33) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_integer tmp38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,1,1) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
if (8 != MMC_STRLEN(tmpMeta35) || strcmp(MMC_STRINGDATA(_OMC_LIT85), MMC_STRINGDATA(tmpMeta35)) != 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 4));
tmp38 = mmc_unbox_integer(tmpMeta37);
if (1 != tmp38) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_integer tmp43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,1,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
if (6 != MMC_STRLEN(tmpMeta40) || strcmp(MMC_STRINGDATA(_OMC_LIT77), MMC_STRINGDATA(tmpMeta40)) != 0) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta41), 4));
tmp43 = mmc_unbox_integer(tmpMeta42);
if (1 != tmp43) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_integer tmp48;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,1,1) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta44), 2));
if (6 != MMC_STRLEN(tmpMeta45) || strcmp(MMC_STRINGDATA(_OMC_LIT86), MMC_STRINGDATA(tmpMeta45)) != 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 4));
tmp48 = mmc_unbox_integer(tmpMeta47);
if (1 != tmp48) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_integer tmp53;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta49,1,1) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 2));
if (15 != MMC_STRLEN(tmpMeta50) || strcmp(MMC_STRINGDATA(_OMC_LIT87), MMC_STRINGDATA(tmpMeta50)) != 0) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta51), 4));
tmp53 = mmc_unbox_integer(tmpMeta52);
if (1 != tmp53) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_integer tmp58;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta54,1,1) == 0) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 2));
if (8 != MMC_STRLEN(tmpMeta55) || strcmp(MMC_STRINGDATA(_OMC_LIT76), MMC_STRINGDATA(tmpMeta55)) != 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta56), 4));
tmp58 = mmc_unbox_integer(tmpMeta57);
if (1 != tmp58) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_integer tmp63;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta59,1,1) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta59), 2));
if (9 != MMC_STRLEN(tmpMeta60) || strcmp(MMC_STRINGDATA(_OMC_LIT88), MMC_STRINGDATA(tmpMeta60)) != 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta61), 4));
tmp63 = mmc_unbox_integer(tmpMeta62);
if (1 != tmp63) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 13: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmp1_c2 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outImpure = tmp1_c2;
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outImpure) { *out_outImpure = _outImpure; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_isImpureWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _isImpure, modelica_metatype *out_cont, modelica_metatype *out_outImpure)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _outImpure;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_isImpure);
_outExp = omc_Expression_isImpureWork(threadData, _inExp, tmp1, &_cont, &_outImpure);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_outImpure) { *out_outImpure = mmc_mk_icon(_outImpure); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_isImpure(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outBoolean = omc_Expression_isConst(threadData, _inExp);
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_isImpureWork, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_outBoolean = tmp2;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isImpure(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isImpure(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isAtomic(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 9: {
tmp1 = 1;
goto tmp3_done;
}
case 16: {
tmp1 = 1;
goto tmp3_done;
}
case 3: {
tmp1 = (mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2)))) >= ((modelica_integer) 0));
goto tmp3_done;
}
case 4: {
tmp1 = (mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2)))) > 0.0);
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isAtomic(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isAtomic(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isHalf(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_real _rval;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_real tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_real(tmpMeta6);
_rval = tmp7;
tmp1 = (_rval == 0.5);
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isHalf(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isHalf(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isNegativeOrZero(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _i;
modelica_real _r;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = 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_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmp1 = (_i <= ((modelica_integer) 0));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_real tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
_r = tmp9;
tmp1 = (_r <= 0.0);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,5,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta11;
tmp1 = omc_Expression_isPositiveOrZero(threadData, _e1);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,4,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta13;
if (!omc_Expression_isOdd(threadData, _e2)) goto tmp3_end;
_inExp = _e2;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
tmp1 = omc_Expression_isZero(threadData, _inExp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isNegativeOrZero(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isNegativeOrZero(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isPositiveOrZero(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_boolean _b;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_boolean _b3;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_integer _i;
modelica_real _r;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 13; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT89), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (3 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT8), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (4 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT90), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_integer tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp13 = mmc_unbox_integer(tmpMeta12);
_i = tmp13;
tmp1 = (_i >= ((modelica_integer) 0));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
modelica_real tmp15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp15 = mmc_unbox_real(tmpMeta14);
_r = tmp15;
tmp1 = (_r >= 0.0);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta16;
_e2 = tmpMeta18;
tmp1 = (omc_Expression_isPositiveOrZero(threadData, _e1) && omc_Expression_isPositiveOrZero(threadData, _e2));
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,1,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta19;
_e2 = tmpMeta21;
tmp1 = (omc_Expression_isPositiveOrZero(threadData, _e1) && omc_Expression_isNegativeOrZero(threadData, _e2));
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,2,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta22;
_e2 = tmpMeta24;
_b1 = (omc_Expression_isPositiveOrZero(threadData, _e1) && omc_Expression_isPositiveOrZero(threadData, _e2));
_b2 = (omc_Expression_isNegativeOrZero(threadData, _e1) && omc_Expression_isNegativeOrZero(threadData, _e2));
_b3 = omc_Expression_expEqual(threadData, _e1, _e2);
tmp1 = ((_b1 || _b2) || _b3);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,3,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta25;
_e2 = tmpMeta27;
_b1 = (omc_Expression_isPositiveOrZero(threadData, _e1) && omc_Expression_isPositiveOrZero(threadData, _e2));
_b2 = (omc_Expression_isNegativeOrZero(threadData, _e1) && omc_Expression_isNegativeOrZero(threadData, _e2));
tmp1 = (_b1 || _b2);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_real tmp32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,4,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,1,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
tmp32 = mmc_unbox_real(tmpMeta31);
_e1 = tmpMeta28;
_r = tmp32;
_i = ((modelica_integer)floor(_r));
_b1 = (_r == ((modelica_real)_i));
_b2 = (((modelica_integer) 0) == modelica_integer_mod(_i, ((modelica_integer) 2)));
_b3 = omc_Expression_isPositiveOrZero(threadData, _e1);
_b = (_b2 || _b3);
tmp1 = (_b1 && _b);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,4,1) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta34;
tmp1 = omc_Expression_isEven(threadData, _e2);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,5,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta36;
tmp1 = omc_Expression_isNegativeOrZero(threadData, _e1);
goto tmp3_done;
}
case 12: {
tmp1 = omc_Expression_isZero(threadData, _inExp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isPositiveOrZero(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isPositiveOrZero(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isZeroOrAlmostZero(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _nominal)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _nominal;
{
modelica_integer _ival;
modelica_real _rval;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _ae = NULL;
modelica_metatype _matrix = NULL;
modelica_real _rNom;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 10; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_ival = tmp7;
tmp1 = (_ival == ((modelica_integer) 0));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_real tmp9;
modelica_metatype tmpMeta10;
modelica_real tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp11 = mmc_unbox_real(tmpMeta10);
_rval = tmp9;
_rNom = tmp11;
tmp1 = (fabs(_rval) < (1e-06) * (fabs(_rNom)));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_real tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp13 = mmc_unbox_real(tmpMeta12);
_rval = tmp13;
tmp1 = (fabs(_rval) < 1e-06);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta14;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,5,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta16;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae = tmpMeta17;
tmp1 = omc_List_map1AllValueBool(threadData, _ae, boxvar_Expression_isZeroOrAlmostZero, mmc_mk_boolean(1), _nominal);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_matrix = tmpMeta18;
tmp1 = omc_List_map1ListAllValueBool(threadData, _matrix, boxvar_Expression_isZeroOrAlmostZero, mmc_mk_boolean(1), _nominal);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,6,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta20;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e = tmpMeta21;
_e1 = tmpMeta22;
tmp1 = (omc_Expression_isZeroOrAlmostZero(threadData, _e, _nominal) || omc_Expression_isZeroOrAlmostZero(threadData, _e1, _nominal));
goto tmp3_done;
}
case 9: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isZeroOrAlmostZero(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _nominal)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isZeroOrAlmostZero(threadData, _inExp, _nominal);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isZero(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _ival;
modelica_real _rval;
modelica_metatype _e = NULL;
modelica_metatype _ae = NULL;
modelica_metatype _matrix = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_ival = tmp7;
tmp1 = (_ival == ((modelica_integer) 0));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_real tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
_rval = tmp9;
tmp1 = (_rval == 0.0);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta10;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,5,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta12;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ae = tmpMeta13;
tmp1 = omc_List_mapAllValueBool(threadData, _ae, boxvar_Expression_isZero, mmc_mk_boolean(1));
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_matrix = tmpMeta14;
tmp1 = omc_List_mapListAllValueBool(threadData, _matrix, boxvar_Expression_isZero, mmc_mk_boolean(1));
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,6,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta16;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 7: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isZero(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isZero(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isOne(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _ival;
modelica_real _rval;
modelica_metatype _e = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_ival = tmp6;
tmp1 = (_ival == ((modelica_integer) 1));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta7;
modelica_real tmp8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp8 = mmc_unbox_real(tmpMeta7);
_rval = tmp8;
tmp1 = (_rval == 1.0);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta9;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isOne(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isOne(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isReduction(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,27,3) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isReduction(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isReduction(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_isRange(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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,18,4) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
modelica_metatype boxptr_Expression_isRange(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_Expression_isRange(threadData, _inExp);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_Expression_operatorDivOrMul(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_operatorDivOrMul(threadData_t *threadData, modelica_metatype _op)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_operatorDivOrMul(threadData, _op);
out_res = mmc_mk_icon(_res);
return out_res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTopDownSubs(threadData_t *threadData, modelica_metatype _inSubscript, modelica_fnptr _rel, modelica_metatype _iarg, modelica_metatype *out_arg)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype _arg = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _nsub = NULL;
modelica_boolean _allEq;
modelica_metatype _delst = NULL;
modelica_integer _nEq;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_boolean tmp19;
modelica_metatype tmpMeta20;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_arg = _iarg;
_allEq = 1;
_nEq = ((modelica_integer) 0);
{
modelica_metatype _sub;
for (tmpMeta1 = _inSubscript; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_sub = MMC_CAR(tmpMeta1);
{
modelica_metatype tmp5_1;
tmp5_1 = _sub;
{
int tmp5;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp5_1))) {
case 3: {
tmpMeta2 = _sub;
goto tmp4_done;
}
case 4: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
modelica_metatype tmpMeta8;
_exp = omc_Expression_traverseExpTopDown(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 2))), ((modelica_fnptr) _rel), _arg ,&_arg);
tmp7 = (modelica_boolean)referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 2))), _exp);
if(tmp7)
{
tmpMeta8 = _sub;
}
else
{
tmpMeta6 = mmc_mk_box2(4, &DAE_Subscript_SLICE__desc, _exp);
tmpMeta8 = tmpMeta6;
}
tmpMeta2 = tmpMeta8;
goto tmp4_done;
}
case 5: {
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
_exp = omc_Expression_traverseExpTopDown(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 2))), ((modelica_fnptr) _rel), _arg ,&_arg);
tmp10 = (modelica_boolean)referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 2))), _exp);
if(tmp10)
{
tmpMeta11 = _sub;
}
else
{
tmpMeta9 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _exp);
tmpMeta11 = tmpMeta9;
}
tmpMeta2 = tmpMeta11;
goto tmp4_done;
}
case 6: {
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta14;
_exp = omc_Expression_traverseExpTopDown(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 2))), ((modelica_fnptr) _rel), _arg ,&_arg);
tmp13 = (modelica_boolean)referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sub), 2))), _exp);
if(tmp13)
{
tmpMeta14 = _sub;
}
else
{
tmpMeta12 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, _exp);
tmpMeta14 = tmpMeta12;
}
tmpMeta2 = tmpMeta14;
goto tmp4_done;
}
}
goto tmp4_end;
tmp4_end: ;
}
goto goto_3;
goto_3:;
MMC_THROW_INTERNAL();
goto tmp4_done;
tmp4_done:;
}
}
_nsub = tmpMeta2;
if((_allEq?(!referenceEq(_nsub, _sub)):0))
{
_allEq = 0;
_delst = omc_DoubleEnded_empty(threadData, _nsub);
{
modelica_metatype _elt;
for (tmpMeta15 = _inSubscript; !listEmpty(tmpMeta15); tmpMeta15=MMC_CDR(tmpMeta15))
{
_elt = MMC_CAR(tmpMeta15);
if((_nEq < ((modelica_integer) 1)))
{
break;
}
omc_DoubleEnded_push__back(threadData, _delst, _elt);
_nEq = ((modelica_integer) -1) + _nEq;
}
}
}
if(_allEq)
{
_nEq = ((modelica_integer) 1) + _nEq;
}
else
{
omc_DoubleEnded_push__back(threadData, _delst, _nsub);
}
}
}
tmp19 = (modelica_boolean)_allEq;
if(tmp19)
{
tmpMeta20 = _inSubscript;
}
else
{
tmpMeta18 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta20 = omc_DoubleEnded_toListAndClear(threadData, _delst, tmpMeta18);
}
_outSubscript = tmpMeta20;
_return: OMC_LABEL_UNUSED
if (out_arg) { *out_arg = _arg; }
return _outSubscript;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpBidirSubs(threadData_t *threadData, modelica_metatype _inSubscript, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
modelica_metatype _sub_exp = NULL;
modelica_metatype _arg = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta[0+0] = _inSubscript;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_sub_exp = tmpMeta5;
_sub_exp = omc_Expression_traverseExpBidir(threadData, _sub_exp, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmpMeta6 = mmc_mk_box2(4, &DAE_Subscript_SLICE__desc, _sub_exp);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_sub_exp = tmpMeta7;
_sub_exp = omc_Expression_traverseExpBidir(threadData, _sub_exp, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmpMeta8 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _sub_exp);
tmpMeta[0+0] = tmpMeta8;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_sub_exp = tmpMeta9;
_sub_exp = omc_Expression_traverseExpBidir(threadData, _sub_exp, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmpMeta10 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, _sub_exp);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscript = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outSubscript;
}
DLLExport
modelica_metatype omc_Expression_traverseExpTopDownCrefHelper(threadData_t *threadData, modelica_metatype _inCref, modelica_fnptr _rel, modelica_metatype _iarg, modelica_metatype *out_outArg)
{
modelica_metatype _outCref = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCref;
tmp4_2 = _iarg;
{
modelica_string _name = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _cr_1 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _subs_1 = NULL;
modelica_metatype _arg = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
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,0,4) == 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));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta5;
_ty = tmpMeta6;
_subs = tmpMeta7;
_cr = tmpMeta8;
_arg = tmp4_2;
_subs_1 = omc_Expression_traverseExpTopDownSubs(threadData, _subs, ((modelica_fnptr) _rel), _arg ,&_arg);
_cr_1 = omc_Expression_traverseExpTopDownCrefHelper(threadData, _cr, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp10 = (modelica_boolean)(referenceEq(_subs, _subs_1) && referenceEq(_cr, _cr_1));
if(tmp10)
{
tmpMeta11 = _inCref;
}
else
{
tmpMeta9 = mmc_mk_box5(3, &DAE_ComponentRef_CREF__QUAL__desc, _name, _ty, _subs_1, _cr_1);
tmpMeta11 = tmpMeta9;
}
tmpMeta[0+0] = tmpMeta11;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 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));
_name = tmpMeta12;
_ty = tmpMeta13;
_subs = tmpMeta14;
_arg = tmp4_2;
_subs_1 = omc_Expression_traverseExpTopDownSubs(threadData, _subs, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp16 = (modelica_boolean)referenceEq(_subs, _subs_1);
if(tmp16)
{
tmpMeta17 = _inCref;
}
else
{
tmpMeta15 = mmc_mk_box4(4, &DAE_ComponentRef_CREF__IDENT__desc, _name, _ty, _subs_1);
tmpMeta17 = tmpMeta15;
}
tmpMeta[0+0] = tmpMeta17;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
_arg = tmp4_2;
tmpMeta[0+0] = _inCref;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCref = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outCref;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpSubs(threadData_t *threadData, modelica_metatype _inSubscript, modelica_fnptr _rel, modelica_metatype _iarg, modelica_metatype *out_outArg)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inSubscript;
tmp4_2 = _iarg;
{
modelica_metatype _sub_exp = NULL;
modelica_metatype _sub_exp_1 = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _res = NULL;
modelica_metatype _arg = 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;
_arg = tmp4_2;
tmpMeta[0+0] = _inSubscript;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,0) == 0) goto tmp3_end;
_rest = tmpMeta7;
_arg = tmp4_2;
_res = omc_Expression_traverseExpSubs(threadData, _rest, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp9 = (modelica_boolean)referenceEq(_rest, _res);
if(tmp9)
{
tmpMeta10 = _inSubscript;
}
else
{
tmpMeta8 = mmc_mk_cons(_OMC_LIT91, _res);
tmpMeta10 = tmpMeta8;
}
_res = tmpMeta10;
tmpMeta[0+0] = _res;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_sub_exp = tmpMeta13;
_rest = tmpMeta12;
_arg = tmp4_2;
_sub_exp_1 = omc_Expression_traverseExpBottomUp(threadData, _sub_exp, ((modelica_fnptr) _rel), _arg ,&_arg);
_res = omc_Expression_traverseExpSubs(threadData, _rest, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp16 = (modelica_boolean)(referenceEq(_sub_exp, _sub_exp_1) && referenceEq(_rest, _res));
if(tmp16)
{
tmpMeta17 = _inSubscript;
}
else
{
tmpMeta15 = mmc_mk_box2(4, &DAE_Subscript_SLICE__desc, _sub_exp_1);
tmpMeta14 = mmc_mk_cons(tmpMeta15, _res);
tmpMeta17 = tmpMeta14;
}
_res = tmpMeta17;
tmpMeta[0+0] = _res;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
_sub_exp = tmpMeta20;
_rest = tmpMeta19;
_arg = tmp4_2;
_sub_exp_1 = omc_Expression_traverseExpBottomUp(threadData, _sub_exp, ((modelica_fnptr) _rel), _arg ,&_arg);
_res = omc_Expression_traverseExpSubs(threadData, _rest, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp23 = (modelica_boolean)(referenceEq(_sub_exp, _sub_exp_1) && referenceEq(_rest, _res));
if(tmp23)
{
tmpMeta24 = _inSubscript;
}
else
{
tmpMeta22 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _sub_exp_1);
tmpMeta21 = mmc_mk_cons(tmpMeta22, _res);
tmpMeta24 = tmpMeta21;
}
_res = tmpMeta24;
tmpMeta[0+0] = _res;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_boolean tmp30;
modelica_metatype tmpMeta31;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta25 = MMC_CAR(tmp4_1);
tmpMeta26 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,3,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 2));
_sub_exp = tmpMeta27;
_rest = tmpMeta26;
_arg = tmp4_2;
_sub_exp_1 = omc_Expression_traverseExpBottomUp(threadData, _sub_exp, ((modelica_fnptr) _rel), _arg ,&_arg);
_res = omc_Expression_traverseExpSubs(threadData, _rest, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp30 = (modelica_boolean)(referenceEq(_sub_exp, _sub_exp_1) && referenceEq(_rest, _res));
if(tmp30)
{
tmpMeta31 = _inSubscript;
}
else
{
tmpMeta29 = mmc_mk_box2(6, &DAE_Subscript_WHOLE__NONEXP__desc, _sub_exp_1);
tmpMeta28 = mmc_mk_cons(tmpMeta29, _res);
tmpMeta31 = tmpMeta28;
}
_res = tmpMeta31;
tmpMeta[0+0] = _res;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscript = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outSubscript;
}
DLLExport
modelica_metatype omc_Expression_traverseExpCref(threadData_t *threadData, modelica_metatype _inCref, modelica_fnptr _rel, modelica_metatype _iarg, modelica_metatype *out_outArg)
{
modelica_metatype _outCref = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCref;
tmp4_2 = _iarg;
{
modelica_string _name = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _cr_1 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _subs_1 = NULL;
modelica_metatype _arg = NULL;
modelica_string _instant = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
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,0,4) == 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));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta5;
_ty = tmpMeta6;
_subs = tmpMeta7;
_cr = tmpMeta8;
_arg = tmp4_2;
_subs_1 = omc_Expression_traverseExpSubs(threadData, _subs, ((modelica_fnptr) _rel), _arg ,&_arg);
_cr_1 = omc_Expression_traverseExpCref(threadData, _cr, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp10 = (modelica_boolean)(referenceEq(_cr, _cr_1) && referenceEq(_subs, _subs_1));
if(tmp10)
{
tmpMeta11 = _inCref;
}
else
{
tmpMeta9 = mmc_mk_box5(3, &DAE_ComponentRef_CREF__QUAL__desc, _name, _ty, _subs_1, _cr_1);
tmpMeta11 = tmpMeta9;
}
_cr = tmpMeta11;
tmpMeta[0+0] = _cr;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 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));
_name = tmpMeta12;
_ty = tmpMeta13;
_subs = tmpMeta14;
_arg = tmp4_2;
_subs_1 = omc_Expression_traverseExpSubs(threadData, _subs, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp16 = (modelica_boolean)referenceEq(_subs, _subs_1);
if(tmp16)
{
tmpMeta17 = _inCref;
}
else
{
tmpMeta15 = mmc_mk_box4(4, &DAE_ComponentRef_CREF__IDENT__desc, _name, _ty, _subs_1);
tmpMeta17 = tmpMeta15;
}
_cr = tmpMeta17;
tmpMeta[0+0] = _cr;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_boolean tmp21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_cr = tmpMeta18;
_instant = tmpMeta19;
_arg = tmp4_2;
_cr_1 = omc_Expression_traverseExpCref(threadData, _cr, ((modelica_fnptr) _rel), _arg ,&_arg);
tmp21 = (modelica_boolean)referenceEq(_cr, _cr_1);
if(tmp21)
{
tmpMeta22 = _inCref;
}
else
{
tmpMeta20 = mmc_mk_box3(5, &DAE_ComponentRef_OPTIMICA__ATTR__INST__CREF__desc, _cr_1, _instant);
tmpMeta22 = tmpMeta20;
}
_cr = tmpMeta22;
tmpMeta[0+0] = _cr;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
_arg = tmp4_2;
tmpMeta[0+0] = _inCref;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
omc_Error_addMessage(threadData, _OMC_LIT31, _OMC_LIT93);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCref = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outCref;
}
DLLExport
modelica_metatype omc_Expression_traverseExpBidirCref(threadData_t *threadData, modelica_metatype _inCref, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outCref = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCref;
{
modelica_string _name = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _arg = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 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));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta5;
_ty = tmpMeta6;
_subs = tmpMeta7;
_cr = tmpMeta8;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_subs = omc_List_map2Fold(threadData, _subs, boxvar_Expression_traverseExpBidirSubs, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg, tmpMeta9 ,&_arg);
_cr = omc_Expression_traverseExpBidirCref(threadData, _cr, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmpMeta10 = mmc_mk_box5(3, &DAE_ComponentRef_CREF__QUAL__desc, _name, _ty, _subs, _cr);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta11;
_ty = tmpMeta12;
_subs = tmpMeta13;
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
_subs = omc_List_map2Fold(threadData, _subs, boxvar_Expression_traverseExpBidirSubs, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg, tmpMeta14 ,&_arg);
tmpMeta15 = mmc_mk_box4(4, &DAE_ComponentRef_CREF__IDENT__desc, _name, _ty, _subs);
tmpMeta[0+0] = tmpMeta15;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inCref;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCref = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outCref;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpBidirSubExps(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _i;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _e1_1 = NULL;
modelica_metatype _e2_1 = NULL;
modelica_metatype _e3_1 = NULL;
modelica_metatype _oe1 = NULL;
modelica_metatype _oe1_1 = NULL;
modelica_metatype _op = NULL;
modelica_metatype _cref = NULL;
modelica_metatype _cref_1 = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _expl_1 = NULL;
modelica_metatype _mat_expl = NULL;
modelica_metatype _match_ty = NULL;
modelica_metatype _match_decls = NULL;
modelica_metatype _match_cases = NULL;
modelica_integer _index;
modelica_integer _dim;
modelica_metatype _opt_exp_asub = NULL;
modelica_metatype _path = NULL;
modelica_boolean _b1;
modelica_metatype _ty = NULL;
modelica_metatype _t = NULL;
modelica_metatype _strl = NULL;
modelica_metatype _reductionInfo = NULL;
modelica_metatype _riters = NULL;
modelica_metatype _riters_1 = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _arg = NULL;
modelica_metatype _typeVars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 37; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
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));
_cref = tmpMeta6;
_ty = tmpMeta7;
_cref_1 = omc_Expression_traverseExpBidirCref(threadData, _cref, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp9 = (modelica_boolean)referenceEq(_cref, _cref_1);
if(tmp9)
{
tmpMeta10 = _inExp;
}
else
{
tmpMeta8 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cref_1, _ty);
tmpMeta10 = tmpMeta8;
}
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta11;
_op = tmpMeta12;
_e2 = tmpMeta13;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_e2_1 = omc_Expression_traverseExpBidir(threadData, _e2, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp15 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp15)
{
tmpMeta16 = _inExp;
}
else
{
tmpMeta14 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1_1, _op, _e2_1);
tmpMeta16 = tmpMeta14;
}
tmpMeta[0+0] = tmpMeta16;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta17;
_e1 = tmpMeta18;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp20 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp20)
{
tmpMeta21 = _inExp;
}
else
{
tmpMeta19 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op, _e1);
tmpMeta21 = tmpMeta19;
}
tmpMeta[0+0] = tmpMeta21;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_boolean tmp26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta22;
_op = tmpMeta23;
_e2 = tmpMeta24;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_e2_1 = omc_Expression_traverseExpBidir(threadData, _e2, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp26 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp26)
{
tmpMeta27 = _inExp;
}
else
{
tmpMeta25 = mmc_mk_box4(12, &DAE_Exp_LBINARY__desc, _e1_1, _op, _e2_1);
tmpMeta27 = tmpMeta25;
}
tmpMeta[0+0] = tmpMeta27;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_boolean tmp31;
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta28;
_e1 = tmpMeta29;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp31 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp31)
{
tmpMeta32 = _inExp;
}
else
{
tmpMeta30 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, _op, _e1);
tmpMeta32 = tmpMeta30;
}
tmpMeta[0+0] = tmpMeta32;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_integer tmp37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_boolean tmp40;
modelica_metatype tmpMeta41;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp37 = mmc_unbox_integer(tmpMeta36);
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_e1 = tmpMeta33;
_op = tmpMeta34;
_e2 = tmpMeta35;
_index = tmp37;
_opt_exp_asub = tmpMeta38;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_e2_1 = omc_Expression_traverseExpBidir(threadData, _e2, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp40 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp40)
{
tmpMeta41 = _inExp;
}
else
{
tmpMeta39 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _e1_1, _op, _e2_1, mmc_mk_integer(_index), _opt_exp_asub);
tmpMeta41 = tmpMeta39;
}
tmpMeta[0+0] = tmpMeta41;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_boolean tmp46;
modelica_metatype tmpMeta47;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta42;
_e2 = tmpMeta43;
_e3 = tmpMeta44;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_e2_1 = omc_Expression_traverseExpBidir(threadData, _e2, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
_e3_1 = omc_Expression_traverseExpBidir(threadData, _e3, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp46 = (modelica_boolean)((referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1)) && referenceEq(_e3, _e3_1));
if(tmp46)
{
tmpMeta47 = _inExp;
}
else
{
tmpMeta45 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _e1_1, _e2_1, _e3_1);
tmpMeta47 = tmpMeta45;
}
tmpMeta[0+0] = tmpMeta47;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_boolean tmp52;
modelica_metatype tmpMeta53;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_path = tmpMeta48;
_expl = tmpMeta49;
_attr = tmpMeta50;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp52 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp52)
{
tmpMeta53 = _inExp;
}
else
{
tmpMeta51 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _path, _expl_1, _attr);
tmpMeta53 = tmpMeta51;
}
tmpMeta[0+0] = tmpMeta53;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_boolean tmp59;
modelica_metatype tmpMeta60;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_path = tmpMeta54;
_expl = tmpMeta55;
_strl = tmpMeta56;
_ty = tmpMeta57;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp59 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp59)
{
tmpMeta60 = _inExp;
}
else
{
tmpMeta58 = mmc_mk_box5(17, &DAE_Exp_RECORD__desc, _path, _expl_1, _strl, _ty);
tmpMeta60 = tmpMeta58;
}
tmpMeta[0+0] = tmpMeta60;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_boolean tmp66;
modelica_metatype tmpMeta67;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_path = tmpMeta61;
_expl = tmpMeta62;
_ty = tmpMeta63;
_t = tmpMeta64;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp66 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp66)
{
tmpMeta67 = _inExp;
}
else
{
tmpMeta65 = mmc_mk_box5(18, &DAE_Exp_PARTEVALFUNCTION__desc, _path, _expl_1, _ty, _t);
tmpMeta67 = tmpMeta65;
}
tmpMeta[0+0] = tmpMeta67;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_integer tmp70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_boolean tmp73;
modelica_metatype tmpMeta74;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp70 = mmc_unbox_integer(tmpMeta69);
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta68;
_b1 = tmp70;
_expl = tmpMeta71;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp73 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp73)
{
tmpMeta74 = _inExp;
}
else
{
tmpMeta72 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(_b1), _expl_1);
tmpMeta74 = tmpMeta72;
}
tmpMeta[0+0] = tmpMeta74;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_integer tmp77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta76 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp77 = mmc_unbox_integer(tmpMeta76);
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta75;
_dim = tmp77;
_mat_expl = tmpMeta78;
tmpMeta79 = MMC_REFSTRUCTLIT(mmc_nil);
_mat_expl = omc_List_map2Fold(threadData, _mat_expl, boxvar_Expression_traverseExpListBidir, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg, tmpMeta79 ,&_arg);
tmpMeta80 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _ty, mmc_mk_integer(_dim), _mat_expl);
tmpMeta[0+0] = tmpMeta80;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta81;
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_boolean tmp86;
modelica_metatype tmpMeta87;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta81 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta83 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta84 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_ty = tmpMeta81;
_e1 = tmpMeta82;
_oe1 = tmpMeta83;
_e2 = tmpMeta84;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_oe1_1 = omc_Expression_traverseExpOptBidir(threadData, _oe1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
_e2_1 = omc_Expression_traverseExpBidir(threadData, _e2, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp86 = (modelica_boolean)((referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1)) && referenceEq(_oe1, _oe1_1));
if(tmp86)
{
tmpMeta87 = _inExp;
}
else
{
tmpMeta85 = mmc_mk_box5(21, &DAE_Exp_RANGE__desc, _ty, _e1_1, _oe1_1, _e2_1);
tmpMeta87 = tmpMeta85;
}
tmpMeta[0+0] = tmpMeta87;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta88;
modelica_metatype tmpMeta89;
modelica_boolean tmp90;
modelica_metatype tmpMeta91;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta88 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta88;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp90 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp90)
{
tmpMeta91 = _inExp;
}
else
{
tmpMeta89 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _expl_1);
tmpMeta91 = tmpMeta89;
}
tmpMeta[0+0] = tmpMeta91;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta92;
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_boolean tmp95;
modelica_metatype tmpMeta96;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta92 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_ty = tmpMeta92;
_e1 = tmpMeta93;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp95 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp95)
{
tmpMeta96 = _inExp;
}
else
{
tmpMeta94 = mmc_mk_box3(23, &DAE_Exp_CAST__desc, _ty, _e1);
tmpMeta96 = tmpMeta94;
}
tmpMeta[0+0] = tmpMeta96;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta97;
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_boolean tmp100;
modelica_metatype tmpMeta101;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta97 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta97;
_expl = tmpMeta98;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp100 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_expl, _expl_1));
if(tmp100)
{
tmpMeta101 = _inExp;
}
else
{
tmpMeta99 = mmc_mk_box3(24, &DAE_Exp_ASUB__desc, _e1_1, _expl_1);
tmpMeta101 = tmpMeta99;
}
tmpMeta[0+0] = tmpMeta101;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta102;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,23,4) == 0) goto tmp3_end;
_e1 = tmp4_1;
_e2 = omc_Expression_traverseExpBidir(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e1), 2))), ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
if(referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e1), 2))), _e2))
{
tmpMeta102 = MMC_TAGPTR(mmc_alloc_words(6));
memcpy(MMC_UNTAGPTR(tmpMeta102), MMC_UNTAGPTR(_e1), 6*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta102))[2] = _e2;
_e1 = tmpMeta102;
}
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta103;
modelica_metatype tmpMeta104;
modelica_integer tmp105;
modelica_metatype tmpMeta106;
modelica_metatype tmpMeta107;
modelica_boolean tmp108;
modelica_metatype tmpMeta109;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta103 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp105 = mmc_unbox_integer(tmpMeta104);
tmpMeta106 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta103;
_i = tmp105;
_ty = tmpMeta106;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp108 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp108)
{
tmpMeta109 = _inExp;
}
else
{
tmpMeta107 = mmc_mk_box4(25, &DAE_Exp_TSUB__desc, _e1_1, mmc_mk_integer(_i), _ty);
tmpMeta109 = tmpMeta107;
}
tmpMeta[0+0] = tmpMeta109;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta110;
modelica_metatype tmpMeta111;
modelica_metatype tmpMeta112;
modelica_boolean tmp113;
modelica_metatype tmpMeta114;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta110 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta111 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta110;
_oe1 = tmpMeta111;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_oe1_1 = omc_Expression_traverseExpOptBidir(threadData, _oe1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp113 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_oe1, _oe1_1));
if(tmp113)
{
tmpMeta114 = _inExp;
}
else
{
tmpMeta112 = mmc_mk_box3(27, &DAE_Exp_SIZE__desc, _e1_1, _oe1_1);
tmpMeta114 = tmpMeta112;
}
tmpMeta[0+0] = tmpMeta114;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 24: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta115;
modelica_metatype tmpMeta116;
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
modelica_metatype tmpMeta119;
modelica_boolean tmp120;
modelica_metatype tmpMeta121;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta115 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta116 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta117 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_reductionInfo = tmpMeta115;
_e1 = tmpMeta116;
_riters = tmpMeta117;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmpMeta118 = MMC_REFSTRUCTLIT(mmc_nil);
_riters_1 = omc_List_map2Fold(threadData, _riters, boxvar_Expression_traverseReductionIteratorBidir, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg, tmpMeta118 ,&_arg);
tmp120 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_riters, _riters_1));
if(tmp120)
{
tmpMeta121 = _inExp;
}
else
{
tmpMeta119 = mmc_mk_box4(30, &DAE_Exp_REDUCTION__desc, _reductionInfo, _e1, _riters);
tmpMeta121 = tmpMeta119;
}
tmpMeta[0+0] = tmpMeta121;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta122;
modelica_metatype tmpMeta123;
modelica_boolean tmp124;
modelica_metatype tmpMeta125;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta122 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta122;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp124 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp124)
{
tmpMeta125 = _inExp;
}
else
{
tmpMeta123 = mmc_mk_box2(31, &DAE_Exp_LIST__desc, _expl_1);
tmpMeta125 = tmpMeta123;
}
tmpMeta[0+0] = tmpMeta125;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta126;
modelica_metatype tmpMeta127;
modelica_metatype tmpMeta128;
modelica_boolean tmp129;
modelica_metatype tmpMeta130;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmpMeta126 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta127 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta126;
_e2 = tmpMeta127;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
_e2_1 = omc_Expression_traverseExpBidir(threadData, _e2, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _arg ,&_arg);
tmp129 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp129)
{
tmpMeta130 = _inExp;
}
else
{
tmpMeta128 = mmc_mk_box3(32, &DAE_Exp_CONS__desc, _e1_1, _e2_1);
tmpMeta130 = tmpMeta128;
}
tmpMeta[0+0] = tmpMeta130;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 28: {
modelica_metatype tmpMeta131;
modelica_metatype tmpMeta132;
modelica_boolean tmp133;
modelica_metatype tmpMeta134;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmpMeta131 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta131;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp133 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp133)
{
tmpMeta134 = _inExp;
}
else
{
tmpMeta132 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _expl_1);
tmpMeta134 = tmpMeta132;
}
tmpMeta[0+0] = tmpMeta134;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 29: {
modelica_metatype tmpMeta135;
modelica_metatype tmpMeta136;
modelica_boolean tmp137;
modelica_metatype tmpMeta138;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta135 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_oe1 = tmpMeta135;
_oe1_1 = omc_Expression_traverseExpOptBidir(threadData, _oe1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp137 = (modelica_boolean)referenceEq(_oe1, _oe1_1);
if(tmp137)
{
tmpMeta138 = _inExp;
}
else
{
tmpMeta136 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _oe1_1);
tmpMeta138 = tmpMeta136;
}
tmpMeta[0+0] = tmpMeta138;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 30: {
modelica_metatype tmpMeta139;
modelica_metatype tmpMeta140;
modelica_metatype tmpMeta141;
modelica_metatype tmpMeta142;
modelica_integer tmp143;
modelica_metatype tmpMeta144;
modelica_metatype tmpMeta145;
modelica_boolean tmp146;
modelica_metatype tmpMeta147;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,32,5) == 0) goto tmp3_end;
tmpMeta139 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta140 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta141 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta142 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp143 = mmc_unbox_integer(tmpMeta142);
tmpMeta144 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_path = tmpMeta139;
_expl = tmpMeta140;
_strl = tmpMeta141;
_index = tmp143;
_typeVars = tmpMeta144;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp146 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp146)
{
tmpMeta147 = _inExp;
}
else
{
tmpMeta145 = mmc_mk_box6(35, &DAE_Exp_METARECORDCALL__desc, _path, _expl_1, _strl, mmc_mk_integer(_index), _typeVars);
tmpMeta147 = tmpMeta145;
}
tmpMeta[0+0] = tmpMeta147;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta148;
modelica_metatype tmpMeta149;
modelica_metatype tmpMeta150;
modelica_metatype tmpMeta151;
modelica_metatype tmpMeta152;
modelica_metatype tmpMeta153;
modelica_metatype tmpMeta154;
modelica_metatype tmpMeta155;
modelica_metatype tmpMeta156;
modelica_metatype tmpMeta157;
modelica_metatype tmpMeta158;
modelica_boolean tmp159;
modelica_metatype tmpMeta160;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta148 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta149 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta150 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta151 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta152 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta153 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
_match_ty = tmpMeta148;
_expl = tmpMeta149;
_aliases = tmpMeta150;
_match_decls = tmpMeta151;
_match_cases = tmpMeta152;
_ty = tmpMeta153;
_expl_1 = omc_Expression_traverseExpListBidir(threadData, _expl, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmpMeta155 = stringAppend(_OMC_LIT98,omc_System_dladdr(threadData, ((modelica_fnptr) _inEnterFunc), NULL, NULL));
tmpMeta156 = stringAppend(tmpMeta155,_OMC_LIT1);
tmpMeta157 = stringAppend(tmpMeta156,omc_System_dladdr(threadData, ((modelica_fnptr) _inExitFunc), NULL, NULL));
tmpMeta154 = mmc_mk_cons(tmpMeta157, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT97, tmpMeta154, _OMC_LIT99);
tmp159 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp159)
{
tmpMeta160 = _inExp;
}
else
{
tmpMeta158 = mmc_mk_box7(36, &DAE_Exp_MATCHEXPRESSION__desc, _match_ty, _expl_1, _aliases, _match_decls, _match_cases, _ty);
tmpMeta160 = tmpMeta158;
}
tmpMeta[0+0] = tmpMeta160;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta161;
modelica_metatype tmpMeta162;
modelica_boolean tmp163;
modelica_metatype tmpMeta164;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta161 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta161;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp163 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp163)
{
tmpMeta164 = _inExp;
}
else
{
tmpMeta162 = mmc_mk_box2(37, &DAE_Exp_BOX__desc, _e1_1);
tmpMeta164 = tmpMeta162;
}
tmpMeta[0+0] = tmpMeta164;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta165;
modelica_metatype tmpMeta166;
modelica_metatype tmpMeta167;
modelica_boolean tmp168;
modelica_metatype tmpMeta169;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,35,2) == 0) goto tmp3_end;
tmpMeta165 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta166 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta165;
_ty = tmpMeta166;
_e1_1 = omc_Expression_traverseExpBidir(threadData, _e1, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmp168 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp168)
{
tmpMeta169 = _inExp;
}
else
{
tmpMeta167 = mmc_mk_box3(38, &DAE_Exp_UNBOX__desc, _e1_1, _ty);
tmpMeta169 = tmpMeta167;
}
tmpMeta[0+0] = tmpMeta169;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 34: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,36,2) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 35: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 36: {
modelica_metatype tmpMeta170;
modelica_metatype tmpMeta171;
modelica_metatype tmpMeta172;
modelica_metatype tmpMeta173;
modelica_metatype tmpMeta174;
tmpMeta170 = stringAppend(_OMC_LIT100,omc_ExpressionDump_printExpStr(threadData, _inExp));
tmpMeta171 = stringAppend(tmpMeta170,_OMC_LIT101);
tmpMeta172 = stringAppend(tmpMeta171,omc_System_dladdr(threadData, ((modelica_fnptr) _inEnterFunc), NULL, NULL));
tmpMeta173 = stringAppend(tmpMeta172,_OMC_LIT1);
tmpMeta174 = stringAppend(tmpMeta173,omc_System_dladdr(threadData, ((modelica_fnptr) _inExitFunc), NULL, NULL));
omc_Error_addInternalError(threadData, tmpMeta174, _OMC_LIT102);
goto goto_2;
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];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpOptBidir(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _arg = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_e = tmpMeta6;
_e1 = omc_Expression_traverseExpBidir(threadData, _e, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _inArg ,&_arg);
tmpMeta[0+0] = (referenceEq(_e, _e1)?_inExp:mmc_mk_some(_e1));
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
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];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpBidir(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outArg = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEnterFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEnterFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEnterFunc), 2))), _inExp, _inArg ,&_outArg) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEnterFunc), 1)))) (threadData, _inExp, _inArg ,&_outArg);
_outExp = omc_Expression_traverseExpBidirSubExps(threadData, _outExp, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _outArg ,&_outArg);
_outExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExitFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExitFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExitFunc), 2))), _outExp, _outArg ,&_outArg) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExitFunc), 1)))) (threadData, _outExp, _outArg ,&_outArg);
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpListBidir(threadData_t *threadData, modelica_metatype _inExpl, modelica_fnptr _inEnterFunc, modelica_fnptr _inExitFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outExpl = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype _e1 = NULL;
modelica_boolean _allEq;
modelica_metatype _delst = NULL;
modelica_integer _nEq;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_boolean tmp6;
modelica_metatype tmpMeta7;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outArg = _inArg;
_allEq = 1;
_nEq = ((modelica_integer) 0);
{
modelica_metatype _e;
for (tmpMeta1 = _inExpl; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_e = MMC_CAR(tmpMeta1);
_e1 = omc_Expression_traverseExpBidir(threadData, _e, ((modelica_fnptr) _inEnterFunc), ((modelica_fnptr) _inExitFunc), _outArg ,&_outArg);
if((_allEq?(!referenceEq(_e, _e1)):0))
{
_allEq = 0;
_delst = omc_DoubleEnded_empty(threadData, _e1);
{
modelica_metatype _elt;
for (tmpMeta2 = _inExpl; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_elt = MMC_CAR(tmpMeta2);
if((_nEq < ((modelica_integer) 1)))
{
break;
}
omc_DoubleEnded_push__back(threadData, _delst, _elt);
_nEq = ((modelica_integer) -1) + _nEq;
}
}
}
if(_allEq)
{
_nEq = ((modelica_integer) 1) + _nEq;
}
else
{
omc_DoubleEnded_push__back(threadData, _delst, _e1);
}
}
}
tmp6 = (modelica_boolean)_allEq;
if(tmp6)
{
tmpMeta7 = _inExpl;
}
else
{
tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = omc_DoubleEnded_toListAndClear(threadData, _delst, tmpMeta5);
}
_outExpl = tmpMeta7;
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outExpl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingDivExpFinder(threadData_t *threadData, modelica_metatype _e, modelica_metatype _exps, modelica_metatype *out_acc)
{
modelica_metatype _outExp = NULL;
modelica_metatype _acc = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta7;
tmpMeta8 = mmc_mk_cons(_e2, _exps);
tmpMeta[0+0] = _e;
tmpMeta[0+1] = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,10,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta10;
tmpMeta11 = mmc_mk_cons(_e2, _exps);
tmpMeta[0+0] = _e;
tmpMeta[0+1] = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,16,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta13;
tmpMeta14 = mmc_mk_cons(_e2, _exps);
tmpMeta[0+0] = _e;
tmpMeta[0+1] = tmpMeta14;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,17,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e2 = tmpMeta16;
tmpMeta17 = mmc_mk_cons(_e2, _exps);
tmpMeta[0+0] = _e;
tmpMeta[0+1] = tmpMeta17;
goto tmp3_done;
}
case 4: {
tmpMeta[0+0] = _e;
tmpMeta[0+1] = _exps;
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];
_acc = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_acc) { *out_acc = _acc; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_extractDivExpFromExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_traversingDivExpFinder, tmpMeta1 ,&_outExps);
_return: OMC_LABEL_UNUSED
return _outExps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingCrefFinder(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
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_metatype _arg = NULL;
modelica_metatype _arg1 = NULL;
modelica_fnptr _func;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
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_2), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_cr = tmpMeta6;
_func = tmpMeta7;
_arg = tmpMeta8;
_arg1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((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(_func), 2))), _cr, _arg) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _cr, _arg);
tmp10 = (modelica_boolean)referenceEq(_arg, _arg1);
if(tmp10)
{
tmpMeta11 = _inTpl;
}
else
{
tmpMeta9 = mmc_mk_box2(0, ((modelica_fnptr) _func), _arg1);
tmpMeta11 = tmpMeta9;
}
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta11;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTpl;
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];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseCrefsFromExp(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inFunc, modelica_metatype _inArg)
{
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_metatype _arg = 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;
tmpMeta8 = mmc_mk_box2(0, ((modelica_fnptr) _inFunc), _inArg);
omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_traversingCrefFinder, tmpMeta8, &tmpMeta6);
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_arg = tmpMeta7;
tmpMeta1 = _arg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArg = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outArg;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expHasCrefInSmoothZeroWork(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype __omcQ_24in_5Ftpl, modelica_metatype *out_tpl)
{
modelica_metatype _exp = NULL;
modelica_metatype _tpl = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_exp = __omcQ_24in_5Fexp;
_tpl = __omcQ_24in_5Ftpl;
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _exp;
tmp4_2 = _tpl;
{
modelica_metatype _cr = NULL;
modelica_metatype _sCr = NULL;
modelica_boolean _b;
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_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_integer tmp15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (0 != tmp8) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (6 != MMC_STRLEN(tmpMeta10) || strcmp(MMC_STRINGDATA(_OMC_LIT103), MMC_STRINGDATA(tmpMeta10)) != 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmpMeta11);
tmpMeta13 = MMC_CDR(tmpMeta11);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp15 = mmc_unbox_integer(tmpMeta14);
if (0 != tmp15) goto tmp3_end;
if (listEmpty(tmpMeta13)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmpMeta13);
tmpMeta17 = MMC_CDR(tmpMeta13);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,6,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (!listEmpty(tmpMeta17)) goto tmp3_end;
_cr = tmpMeta6;
_sCr = tmpMeta18;
_b = omc_ComponentReference_crefEqual(threadData, _sCr, _cr);
tmpMeta19 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _tpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_tpl = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_tpl) { *out_tpl = _tpl; }
return _exp;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefInSmoothZero(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _cr)
{
modelica_boolean _b;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _cr, mmc_mk_boolean(0));
omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_Expression_expHasCrefInSmoothZeroWork, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_b = tmp3;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_Expression_expHasCrefInSmoothZero(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _cr)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_Expression_expHasCrefInSmoothZero(threadData, _exp, _cr);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_metatype omc_Expression_expHasCrefInIfWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_integer _i;
modelica_metatype _cr = NULL;
modelica_metatype _e1 = 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_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_boolean tmp11;
modelica_metatype tmpMeta12;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (0 != tmp8) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
_e1 = tmpMeta9;
if (!(!omc_Expression_isFunCall(threadData, _e1, _OMC_LIT104))) goto tmp3_end;
_b = omc_Expression_expHasCref(threadData, _e1, _cr);
tmp11 = (modelica_boolean)_b;
if(tmp11)
{
tmpMeta10 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta12 = tmpMeta10;
}
else
{
tmpMeta12 = _inTpl;
}
tmpMeta[0+0] = _e1;
tmp1_c1 = 1;
tmpMeta[0+2] = tmpMeta12;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_integer tmp15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_integer tmp22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp15 = mmc_unbox_integer(tmpMeta14);
if (0 != tmp15) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,1,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (6 != MMC_STRLEN(tmpMeta17) || strcmp(MMC_STRINGDATA(_OMC_LIT103), MMC_STRINGDATA(tmpMeta17)) != 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta18)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmpMeta18);
tmpMeta20 = MMC_CDR(tmpMeta18);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp22 = mmc_unbox_integer(tmpMeta21);
if (listEmpty(tmpMeta20)) goto tmp3_end;
tmpMeta23 = MMC_CAR(tmpMeta20);
tmpMeta24 = MMC_CDR(tmpMeta20);
if (!listEmpty(tmpMeta24)) goto tmp3_end;
_cr = tmpMeta13;
_i = tmp22;
_e1 = tmpMeta23;
if (!(_i > ((modelica_integer) 1))) goto tmp3_end;
tmpMeta25 = mmc_mk_box2(0, _cr, mmc_mk_boolean(omc_Expression_expHasCref(threadData, _e1, _cr)));
tmpMeta[0+0] = _e1;
tmp1_c1 = 1;
tmpMeta[0+2] = tmpMeta25;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_integer tmp28;
modelica_metatype tmpMeta29;
modelica_boolean tmp30;
modelica_metatype tmpMeta31;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp28 = mmc_unbox_integer(tmpMeta27);
if (0 != tmp28) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
_cr = tmpMeta26;
if (!omc_Expression_isEventTriggeringFunctionExp(threadData, _inExp)) goto tmp3_end;
_b = omc_Expression_expHasCref(threadData, _inExp, _cr);
tmp30 = (modelica_boolean)_b;
if(tmp30)
{
tmpMeta29 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta31 = tmpMeta29;
}
else
{
tmpMeta31 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmpMeta[0+2] = tmpMeta31;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_integer tmp34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_boolean tmp45;
modelica_metatype tmpMeta46;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp34 = mmc_unbox_integer(tmpMeta33);
if (0 != tmp34) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,1,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
if (10 != MMC_STRLEN(tmpMeta36) || strcmp(MMC_STRINGDATA(_OMC_LIT17), MMC_STRINGDATA(tmpMeta36)) != 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta37)) goto tmp3_end;
tmpMeta38 = MMC_CAR(tmpMeta37);
tmpMeta39 = MMC_CDR(tmpMeta37);
if (listEmpty(tmpMeta39)) goto tmp3_end;
tmpMeta40 = MMC_CAR(tmpMeta39);
tmpMeta41 = MMC_CDR(tmpMeta39);
if (listEmpty(tmpMeta41)) goto tmp3_end;
tmpMeta42 = MMC_CAR(tmpMeta41);
tmpMeta43 = MMC_CDR(tmpMeta41);
if (!listEmpty(tmpMeta43)) goto tmp3_end;
_cr = tmpMeta32;
_e1 = tmpMeta38;
_b = omc_Expression_expHasCref(threadData, _e1, _cr);
tmp45 = (modelica_boolean)_b;
if(tmp45)
{
tmpMeta44 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta46 = tmpMeta44;
}
else
{
tmpMeta46 = _inTpl;
}
tmpMeta[0+0] = _e1;
tmp1_c1 = 1;
tmpMeta[0+2] = tmpMeta46;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_integer tmp49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_boolean tmp56;
modelica_metatype tmpMeta57;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp49 = mmc_unbox_integer(tmpMeta48);
if (0 != tmp49) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta50,1,1) == 0) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta50), 2));
if (4 != MMC_STRLEN(tmpMeta51) || strcmp(MMC_STRINGDATA(_OMC_LIT105), MMC_STRINGDATA(tmpMeta51)) != 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta52)) goto tmp3_end;
tmpMeta53 = MMC_CAR(tmpMeta52);
tmpMeta54 = MMC_CDR(tmpMeta52);
if (!listEmpty(tmpMeta54)) goto tmp3_end;
_cr = tmpMeta47;
_e1 = tmpMeta53;
_b = omc_Expression_expHasCref(threadData, _e1, _cr);
tmp56 = (modelica_boolean)_b;
if(tmp56)
{
tmpMeta55 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta57 = tmpMeta55;
}
else
{
tmpMeta57 = _inTpl;
}
tmpMeta[0+0] = _e1;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta57;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta58;
modelica_integer tmp59;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp59 = mmc_unbox_integer(tmpMeta58);
if (1 != tmp59) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 6: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
modelica_metatype boxptr_Expression_expHasCrefInIfWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_expHasCrefInIfWork(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefInIf(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _inCr, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_expHasCrefInIfWork, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_hasCref = tmp3;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasCrefInIf(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasCrefInIf(threadData, _inExp, _inCr);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingexpHasCrefNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (8 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (6 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT106), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,1,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (5 != MMC_STRLEN(tmpMeta13) || strcmp(MMC_STRINGDATA(_OMC_LIT83), MMC_STRINGDATA(tmpMeta13)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (4 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT107), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,1,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (7 != MMC_STRLEN(tmpMeta17) || strcmp(MMC_STRINGDATA(_OMC_LIT108), MMC_STRINGDATA(tmpMeta17)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_integer tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp20 = mmc_unbox_integer(tmpMeta19);
if (0 != tmp20) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta18;
_cr1 = tmpMeta21;
_b = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr, _cr1);
tmp23 = (modelica_boolean)_b;
if(tmp23)
{
tmpMeta22 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta24 = tmpMeta22;
}
else
{
tmpMeta24 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta24;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta25;
modelica_integer tmp26;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp26 = mmc_unbox_integer(tmpMeta25);
_b = tmp26;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingexpHasCrefNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_traversingexpHasCrefNoPreOrStart(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _inCr, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasCrefNoPreOrStart, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_hasCref = tmp3;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasCrefNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasCrefNoPreOrStart(threadData, _inExp, _inCr);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefsNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_integer tmp4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_hasCref = 0;
{
modelica_metatype _cr;
for (tmpMeta1 = _inCr; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_cr = MMC_CAR(tmpMeta1);
tmpMeta5 = mmc_mk_box2(0, _cr, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasCrefNoPreOrStart, tmpMeta5, &tmpMeta2);
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
tmp4 = mmc_unbox_integer(tmpMeta3);
_hasCref = tmp4;
if(_hasCref)
{
break;
}
}
}
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasCrefsNoPreOrStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasCrefsNoPreOrStart(threadData, _inExp, _inCr);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_metatype omc_Expression_traversingexpHasCrefNoPreorDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (8 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
if (0 != tmp12) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta10;
_cr1 = tmpMeta13;
_b = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr, _cr1);
tmp15 = (modelica_boolean)_b;
if(tmp15)
{
tmpMeta14 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta16 = tmpMeta14;
}
else
{
tmpMeta16 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta16;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta17;
modelica_integer tmp18;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp18 = mmc_unbox_integer(tmpMeta17);
_b = tmp18;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
modelica_metatype boxptr_Expression_traversingexpHasCrefNoPreorDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_traversingexpHasCrefNoPreorDer(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefNoPreorDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _inCr, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasCrefNoPreorDer, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_hasCref = tmp3;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasCrefNoPreorDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasCrefNoPreorDer(threadData, _inExp, _inCr);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingexpHasPrevious(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inHasIt, modelica_boolean *out_cont, modelica_boolean *out_outHasIt)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_boolean _outHasIt;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inHasIt;
{
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (0 != tmp4_2) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (8 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
_b = tmp4_2;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmp1_c2 = _inHasIt;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outHasIt = tmp1_c2;
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outHasIt) { *out_outHasIt = _outHasIt; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingexpHasPrevious(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHasIt, modelica_metatype *out_cont, modelica_metatype *out_outHasIt)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _outHasIt;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inHasIt);
_outExp = omc_Expression_traversingexpHasPrevious(threadData, _inExp, tmp1, &_cont, &_outHasIt);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_outHasIt) { *out_outHasIt = mmc_mk_icon(_outHasIt); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasPrevious(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasPre;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasPrevious, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_hasPre = tmp2;
_return: OMC_LABEL_UNUSED
return _hasPre;
}
modelica_metatype boxptr_Expression_expHasPrevious(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasPre;
modelica_metatype out_hasPre;
_hasPre = omc_Expression_expHasPrevious(threadData, _inExp);
out_hasPre = mmc_mk_icon(_hasPre);
return out_hasPre;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traversingexpHasPre(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inHasIt, modelica_boolean *out_cont, modelica_boolean *out_outHasIt)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_boolean _outHasIt;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inHasIt;
{
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (0 != tmp4_2) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
_b = tmp4_2;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmp1_c2 = _inHasIt;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outHasIt = tmp1_c2;
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outHasIt) { *out_outHasIt = _outHasIt; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traversingexpHasPre(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inHasIt, modelica_metatype *out_cont, modelica_metatype *out_outHasIt)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _outHasIt;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inHasIt);
_outExp = omc_Expression_traversingexpHasPre(threadData, _inExp, tmp1, &_cont, &_outHasIt);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_outHasIt) { *out_outHasIt = mmc_mk_icon(_outHasIt); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasPre(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasPre;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasPre, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_hasPre = tmp2;
_return: OMC_LABEL_UNUSED
return _hasPre;
}
modelica_metatype boxptr_Expression_expHasPre(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasPre;
modelica_metatype out_hasPre;
_hasPre = omc_Expression_expHasPre(threadData, _inExp);
out_hasPre = mmc_mk_icon(_hasPre);
return out_hasPre;
}
DLLExport
modelica_metatype omc_Expression_traversingexpHasDer(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inTpl, modelica_boolean *out_cont, modelica_boolean *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_boolean _outTpl;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (0 != tmp4_2) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (0 != tmp4_2) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta8;
if (!(omc_System_strncmp(threadData, omc_ComponentReference_crefFirstIdent(threadData, _cr), _OMC_LIT109, ((modelica_integer) 9)) == ((modelica_integer) 0))) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 2: {
_b = tmp4_2;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmp1_c2 = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outTpl = tmp1_c2;
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
modelica_metatype boxptr_Expression_traversingexpHasDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _outTpl;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inTpl);
_outExp = omc_Expression_traversingexpHasDer(threadData, _inExp, tmp1, &_cont, &_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_outTpl) { *out_outTpl = mmc_mk_icon(_outTpl); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasDer(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasDer, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_hasCref = tmp2;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasDer(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasDer(threadData, _inExp);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_metatype omc_Expression_traversingexpHasDerCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = 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_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (0 != tmp8) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (3 != MMC_STRLEN(tmpMeta10) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta10)) != 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmpMeta11);
tmpMeta13 = MMC_CDR(tmpMeta11);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,6,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (!listEmpty(tmpMeta13)) goto tmp3_end;
_cr = tmpMeta6;
_cr1 = tmpMeta14;
_b = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr, _cr1);
tmp16 = (modelica_boolean)_b;
if(tmp16)
{
tmpMeta15 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta17 = tmpMeta15;
}
else
{
tmpMeta17 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta17;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_integer tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_boolean tmp28;
modelica_metatype tmpMeta29;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp20 = mmc_unbox_integer(tmpMeta19);
if (0 != tmp20) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,1,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
if (3 != MMC_STRLEN(tmpMeta22) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta22)) != 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta23)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmpMeta23);
tmpMeta25 = MMC_CDR(tmpMeta23);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,6,2) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
if (!listEmpty(tmpMeta25)) goto tmp3_end;
_cr = tmpMeta18;
_cr1 = tmpMeta26;
_b = omc_ComponentReference_crefPrefixOf(threadData, _cr, _cr1);
tmp28 = (modelica_boolean)_b;
if(tmp28)
{
tmpMeta27 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta29 = tmpMeta27;
}
else
{
tmpMeta29 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta29;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta30;
modelica_integer tmp31;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp31 = mmc_unbox_integer(tmpMeta30);
_b = tmp31;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = _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];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
modelica_metatype boxptr_Expression_traversingexpHasDerCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_traversingexpHasDerCref(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasDerCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _inCr, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasDerCref, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_hasCref = tmp3;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasDerCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasDerCref(threadData, _inExp, _inCr);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_metatype omc_Expression_traversingexpHasName(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_string _name = NULL;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_boolean tmp11;
modelica_metatype tmpMeta12;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (0 != tmp8) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_name = tmpMeta6;
_cr = tmpMeta9;
_b = (stringEqual(_name, omc_ComponentReference_crefFirstIdent(threadData, _cr)));
tmp11 = (modelica_boolean)_b;
if(tmp11)
{
tmpMeta10 = mmc_mk_box2(0, _name, mmc_mk_boolean(_b));
tmpMeta12 = tmpMeta10;
}
else
{
tmpMeta12 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta12;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta13;
modelica_integer tmp14;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_b = tmp14;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
modelica_metatype boxptr_Expression_traversingexpHasName(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_traversingexpHasName(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_anyExpHasCrefName(threadData_t *threadData, modelica_metatype _inExps, modelica_string _name)
{
modelica_boolean _hasCref;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_hasCref = mmc_unbox_boolean(omc_List_applyAndFold1(threadData, _inExps, boxvar_boolOr, boxvar_Expression_expHasCrefName, _name, mmc_mk_boolean(0)));
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_anyExpHasCrefName(threadData_t *threadData, modelica_metatype _inExps, modelica_metatype _name)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_anyExpHasCrefName(threadData, _inExps, _name);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefName(threadData_t *threadData, modelica_metatype _inExp, modelica_string _name)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _name, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasName, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_hasCref = tmp3;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasCrefName(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _name)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasCrefName(threadData, _inExp, _name);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_metatype omc_Expression_traversingexpHasCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_boolean _b;
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = 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,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (3 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp4 += 1;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta14;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp10 = mmc_unbox_integer(tmpMeta9);
if (0 != tmp10) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta8;
_cr1 = tmpMeta11;
_b = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr, _cr1);
tmp13 = (modelica_boolean)_b;
if(tmp13)
{
tmpMeta12 = mmc_mk_box2(0, _cr, mmc_mk_boolean(_b));
tmpMeta14 = tmpMeta12;
}
else
{
tmpMeta14 = _inTpl;
}
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = tmpMeta14;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_integer tmp16;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp16 = mmc_unbox_integer(tmpMeta15);
_b = tmp16;
tmpMeta[0+0] = _inExp;
tmp1_c1 = (!_b);
tmpMeta[0+2] = _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];
_cont = tmp1_c1;
_outTpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
modelica_metatype boxptr_Expression_traversingexpHasCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_traversingexpHasCref(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box2(0, _inCr, mmc_mk_boolean(0));
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingexpHasCref, tmpMeta4, &tmpMeta1);
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_hasCref = tmp3;
_return: OMC_LABEL_UNUSED
return _hasCref;
}
modelica_metatype boxptr_Expression_expHasCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCr)
{
modelica_boolean _hasCref;
modelica_metatype out_hasCref;
_hasCref = omc_Expression_expHasCref(threadData, _inExp, _inCr);
out_hasCref = mmc_mk_icon(_hasCref);
return out_hasCref;
}
DLLExport
modelica_metatype omc_Expression_traversingComponentRefFinderNoPreDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefs, modelica_boolean *out_cont, modelica_metatype *out_crefs)
{
modelica_metatype _e = NULL;
modelica_boolean _cont;
modelica_metatype _crefs = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inCrefs;
{
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));
_cr = tmpMeta6;
_crefs = tmp4_2;
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _crefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _crefs;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
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));
if (3 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inCrefs;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (3 != MMC_STRLEN(tmpMeta10) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta10)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inCrefs;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
if (8 != MMC_STRLEN(tmpMeta12) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta12)) != 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _inCrefs;
goto tmp3_done;
}
case 4: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmpMeta[0+2] = _inCrefs;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_e = tmpMeta[0+0];
_cont = tmp1_c1;
_crefs = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_crefs) { *out_crefs = _crefs; }
return _e;
}
modelica_metatype boxptr_Expression_traversingComponentRefFinderNoPreDer(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefs, modelica_metatype *out_cont, modelica_metatype *out_crefs)
{
modelica_boolean _cont;
modelica_metatype _e = NULL;
_e = omc_Expression_traversingComponentRefFinderNoPreDer(threadData, _inExp, _inCrefs, &_cont, out_crefs);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _e;
}
DLLExport
modelica_metatype omc_Expression_traversingComponentRefPresent(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _found, modelica_boolean *out_cont, modelica_boolean *out_outFound)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_boolean _outFound;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_boolean tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _found;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_2) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmp1_c2 = 1;
goto tmp3_done;
}
case 2: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmp1_c2 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_outFound = tmp1_c2;
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outFound) { *out_outFound = _outFound; }
return _outExp;
}
modelica_metatype boxptr_Expression_traversingComponentRefPresent(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _found, modelica_metatype *out_cont, modelica_metatype *out_outFound)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _outFound;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_found);
_outExp = omc_Expression_traversingComponentRefPresent(threadData, _inExp, tmp1, &_cont, &_outFound);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_outFound) { *out_outFound = mmc_mk_icon(_outFound); }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_expHasCrefs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasCrefs;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingComponentRefPresent, mmc_mk_boolean(0), &tmpMeta6);
tmp7 = mmc_unbox_integer(tmpMeta6);
_b = tmp7;
tmp1 = _b;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_hasCrefs = tmp1;
_return: OMC_LABEL_UNUSED
return _hasCrefs;
}
modelica_metatype boxptr_Expression_expHasCrefs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _hasCrefs;
modelica_metatype out_hasCrefs;
_hasCrefs = omc_Expression_expHasCrefs(threadData, _inExp);
out_hasCrefs = mmc_mk_icon(_hasCrefs);
return out_hasCrefs;
}
DLLExport
modelica_metatype omc_Expression_traversingexpHasInitial(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_boolean __omcQ_24in_5Ffound, modelica_boolean *out_cont, modelica_boolean *out_found)
{
modelica_metatype _exp = NULL;
modelica_boolean _cont;
modelica_boolean _found;
modelica_boolean tmp1_c0 __attribute__((unused)) = 0;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_exp = __omcQ_24in_5Fexp;
_found = __omcQ_24in_5Ffound;
if(_found)
{
_cont = 0;
goto _return;
}
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (7 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT75), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1_c0 = 0;
tmp1_c1 = 1;
goto tmp3_done;
}
case 1: {
tmp1_c0 = 1;
tmp1_c1 = _found;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cont = tmp1_c0;
_found = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_found) { *out_found = _found; }
return _exp;
}
modelica_metatype boxptr_Expression_traversingexpHasInitial(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype __omcQ_24in_5Ffound, modelica_metatype *out_cont, modelica_metatype *out_found)
{
modelica_integer tmp1;
modelica_boolean _cont;
modelica_boolean _found;
modelica_metatype _exp = NULL;
tmp1 = mmc_unbox_integer(__omcQ_24in_5Ffound);
_exp = omc_Expression_traversingexpHasInitial(threadData, __omcQ_24in_5Fexp, tmp1, &_cont, &_found);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
if (out_found) { *out_found = mmc_mk_icon(_found); }
return _exp;
}
DLLExport
modelica_boolean omc_Expression_expHasInitial(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _found;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_Expression_traversingexpHasInitial, mmc_mk_boolean(0), &tmpMeta1);
tmp2 = mmc_unbox_integer(tmpMeta1);
_found = tmp2;
_return: OMC_LABEL_UNUSED
return _found;
}
modelica_metatype boxptr_Expression_expHasInitial(threadData_t *threadData, modelica_metatype _exp)
{
modelica_boolean _found;
modelica_metatype out_found;
_found = omc_Expression_expHasInitial(threadData, _exp);
out_found = mmc_mk_icon(_found);
return out_found;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getLhsCrefsFromStatement(threadData_t *threadData, modelica_metatype _inStmt)
{
modelica_metatype _lhsCrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inStmt;
{
modelica_metatype _exp1 = NULL;
modelica_metatype _expLst = NULL;
modelica_metatype _stmtLst = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp1 = tmpMeta5;
tmpMeta1 = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp1);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_expLst = tmpMeta6;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _expLst, boxvar_Expression_extractCrefsFromExpDerPreStart));
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp1 = tmpMeta7;
tmpMeta1 = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp1);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_stmtLst = tmpMeta8;
tmpMeta1 = omc_Expression_getLhsCrefsFromStatements(threadData, _stmtLst);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,6) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_stmtLst = tmpMeta9;
tmpMeta1 = omc_Expression_getLhsCrefsFromStatements(threadData, _stmtLst);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_stmtLst = tmpMeta10;
tmpMeta1 = omc_Expression_getLhsCrefsFromStatements(threadData, _stmtLst);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_stmtLst = tmpMeta11;
tmpMeta1 = omc_Expression_getLhsCrefsFromStatements(threadData, _stmtLst);
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_metatype tmpMeta12;
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_lhsCrefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _lhsCrefs;
}
DLLExport
modelica_metatype omc_Expression_getLhsCrefsFromStatements(threadData_t *threadData, modelica_metatype _inStmts)
{
modelica_metatype _lhsCrefs = NULL;
modelica_metatype _lhsCrefsLst = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_lhsCrefsLst = omc_List_map(threadData, _inStmts, boxvar_Expression_getLhsCrefsFromStatement);
_lhsCrefs = omc_List_flatten(threadData, _lhsCrefsLst);
_return: OMC_LABEL_UNUSED
return _lhsCrefs;
}
DLLExport
modelica_metatype omc_Expression_extractCrefsStatment(threadData_t *threadData, modelica_metatype _inStmt, modelica_metatype *out_orcrefs)
{
modelica_metatype _olcrefs = NULL;
modelica_metatype _orcrefs = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inStmt;
{
modelica_metatype _exp1 = NULL;
modelica_metatype _exp2 = NULL;
modelica_metatype _expLst = NULL;
modelica_metatype _stmtLst = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_exp1 = tmpMeta5;
_exp2 = tmpMeta6;
_olcrefs = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp1);
_orcrefs = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp2);
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expLst = tmpMeta7;
_exp2 = tmpMeta8;
_olcrefs = omc_List_flatten(threadData, omc_List_map(threadData, _expLst, boxvar_Expression_extractCrefsFromExpDerPreStart));
_orcrefs = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp2);
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_exp1 = tmpMeta9;
_exp2 = tmpMeta10;
_olcrefs = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp1);
_orcrefs = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp2);
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,4) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_stmtLst = tmpMeta11;
tmpMeta12 = omc_Expression_extractUniqueCrefsFromStatmentS(threadData, _stmtLst);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_olcrefs = tmpMeta13;
_orcrefs = tmpMeta14;
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,6) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_stmtLst = tmpMeta15;
tmpMeta16 = omc_Expression_extractUniqueCrefsFromStatmentS(threadData, _stmtLst);
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 1));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
_olcrefs = tmpMeta17;
_orcrefs = tmpMeta18;
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_stmtLst = tmpMeta19;
tmpMeta20 = omc_Expression_extractUniqueCrefsFromStatmentS(threadData, _stmtLst);
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 1));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
_olcrefs = tmpMeta21;
_orcrefs = tmpMeta22;
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,6) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_stmtLst = tmpMeta23;
tmpMeta24 = omc_Expression_extractUniqueCrefsFromStatmentS(threadData, _stmtLst);
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 1));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
_olcrefs = tmpMeta25;
_orcrefs = tmpMeta26;
tmpMeta[0+0] = _olcrefs;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,4) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp1 = tmpMeta27;
_orcrefs = omc_Expression_extractCrefsFromExpDerPreStart(threadData, _exp1);
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta28;
tmpMeta[0+1] = _orcrefs;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
tmpMeta29 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta30 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta29;
tmpMeta[0+1] = tmpMeta30;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_olcrefs = tmpMeta[0+0];
_orcrefs = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_orcrefs) { *out_orcrefs = _orcrefs; }
return _olcrefs;
}
DLLExport
modelica_metatype omc_Expression_extractUniqueCrefsFromStatmentS(threadData_t *threadData, modelica_metatype _inStmts)
{
modelica_metatype _ocrefs = NULL;
modelica_metatype _lhscreflstlst = NULL;
modelica_metatype _rhscreflstlst = NULL;
modelica_metatype _orhscrefs = NULL;
modelica_metatype _olhscrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_lhscreflstlst = omc_List_map__2(threadData, _inStmts, boxvar_Expression_extractCrefsStatment ,&_rhscreflstlst);
_orhscrefs = omc_List_unique(threadData, omc_List_flatten(threadData, _rhscreflstlst));
_olhscrefs = omc_List_unique(threadData, omc_List_flatten(threadData, _lhscreflstlst));
tmpMeta1 = mmc_mk_box2(0, _olhscrefs, _orhscrefs);
_ocrefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ocrefs;
}
DLLExport
modelica_metatype omc_Expression_traversingComponentRefFinderDerPreStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefs, modelica_boolean *out_cont, modelica_metatype *out_crefs)
{
modelica_metatype _e = NULL;
modelica_boolean _cont;
modelica_metatype _crefs = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inCrefs;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; 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));
_cr = tmpMeta6;
_crefs = tmp4_2;
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _inCrefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _crefs;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,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));
if (3 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_cr = tmpMeta12;
_cr = omc_ComponentReference_crefPrefixDer(threadData, _cr);
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _inCrefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _crefs;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (3 != MMC_STRLEN(tmpMeta14) || strcmp(MMC_STRINGDATA(_OMC_LIT64), MMC_STRINGDATA(tmpMeta14)) != 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta15)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmpMeta15);
tmpMeta17 = MMC_CDR(tmpMeta15);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,6,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
if (!listEmpty(tmpMeta17)) goto tmp3_end;
_cr = tmpMeta18;
_cr = omc_ComponentReference_crefPrefixPre(threadData, _cr);
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _inCrefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _crefs;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (8 != MMC_STRLEN(tmpMeta20) || strcmp(MMC_STRINGDATA(_OMC_LIT65), MMC_STRINGDATA(tmpMeta20)) != 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta21)) goto tmp3_end;
tmpMeta22 = MMC_CAR(tmpMeta21);
tmpMeta23 = MMC_CDR(tmpMeta21);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,6,2) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
if (!listEmpty(tmpMeta23)) goto tmp3_end;
_cr = tmpMeta24;
_cr = omc_ComponentReference_crefPrefixPrevious(threadData, _cr);
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _inCrefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _crefs;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,1,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 2));
if (5 != MMC_STRLEN(tmpMeta26) || strcmp(MMC_STRINGDATA(_OMC_LIT112), MMC_STRINGDATA(tmpMeta26)) != 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta27)) goto tmp3_end;
tmpMeta28 = MMC_CAR(tmpMeta27);
tmpMeta29 = MMC_CDR(tmpMeta27);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,6,2) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 2));
if (!listEmpty(tmpMeta29)) goto tmp3_end;
_cr = tmpMeta30;
tmpMeta31 = stringAppend(_OMC_LIT110,omc_ExpressionDump_printExpStr(threadData, _inExp));
omc_Error_addInternalError(threadData, tmpMeta31, _OMC_LIT111);
_cr = omc_ComponentReference_crefPrefixStart(threadData, _cr);
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _inCrefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmp1_c1 = 0;
tmpMeta[0+2] = _crefs;
goto tmp3_done;
}
case 5: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmpMeta[0+2] = _inCrefs;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_e = tmpMeta[0+0];
_cont = tmp1_c1;
_crefs = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_crefs) { *out_crefs = _crefs; }
return _e;
}
modelica_metatype boxptr_Expression_traversingComponentRefFinderDerPreStart(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefs, modelica_metatype *out_cont, modelica_metatype *out_crefs)
{
modelica_boolean _cont;
modelica_metatype _e = NULL;
_e = omc_Expression_traversingComponentRefFinderDerPreStart(threadData, _inExp, _inCrefs, &_cont, out_crefs);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _e;
}
DLLExport
modelica_metatype omc_Expression_extractCrefsFromExpDerPreStart(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _ocrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_traversingComponentRefFinderDerPreStart, tmpMeta1 ,&_ocrefs);
_return: OMC_LABEL_UNUSED
return _ocrefs;
}
DLLExport
modelica_metatype omc_Expression_extractUniqueCrefsFromExpDerPreStart(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _ocrefs = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ocrefs = omc_List_unique(threadData, omc_Expression_extractCrefsFromExpDerPreStart(threadData, _inExp));
_return: OMC_LABEL_UNUSED
return _ocrefs;
}
DLLExport
modelica_metatype omc_Expression_traversingComponentRefFinder(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefs, modelica_metatype *out_crefs)
{
modelica_metatype _outExp = NULL;
modelica_metatype _crefs = 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 = _inCrefs;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
_crefs = tmp4_2;
_crefs = omc_List_unionEltOnTrue(threadData, _cr, _crefs, boxvar_ComponentReference_crefEqual);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _crefs;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inCrefs;
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];
_crefs = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_crefs) { *out_crefs = _crefs; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_extractCrefsFromExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _ocrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_traversingComponentRefFinder, tmpMeta1 ,&_ocrefs);
_return: OMC_LABEL_UNUSED
return _ocrefs;
}
DLLExport
modelica_metatype omc_Expression_extractUniqueCrefsFromExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _ocrefs = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ocrefs = omc_List_unique(threadData, omc_Expression_extractCrefsFromExp(threadData, _inExp));
_return: OMC_LABEL_UNUSED
return _ocrefs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTypeDims2(threadData_t *threadData, modelica_metatype _inDims, modelica_fnptr _inFunc, modelica_metatype _inArg, modelica_metatype *out_outArg, modelica_boolean *out_outChanged)
{
modelica_metatype _outDims = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _outArg = NULL;
modelica_boolean _outChanged;
modelica_boolean _changed;
modelica_metatype _exp = NULL;
modelica_metatype _new_exp = NULL;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outDims = tmpMeta1;
_outArg = _inArg;
_outChanged = 0;
{
modelica_metatype _dim;
for (tmpMeta2 = _inDims; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_dim = MMC_CAR(tmpMeta2);
{
modelica_metatype tmp6_1;
tmp6_1 = _dim;
{
volatile mmc_switch_type tmp6;
int tmp7;
tmp6 = 0;
for (; tmp6 < 2; tmp6++) {
switch (MMC_SWITCH_CAST(tmp6)) {
case 0: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,3,1) == 0) goto tmp5_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
_exp = tmpMeta8;
_new_exp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _exp, _outArg ,&_outArg) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _exp, _outArg ,&_outArg);
_changed = (!referenceEq(_new_exp, _exp));
_outChanged = (_outChanged || _changed);
tmp10 = (modelica_boolean)_changed;
if(tmp10)
{
tmpMeta9 = mmc_mk_box2(6, &DAE_Dimension_DIM__EXP__desc, _exp);
tmpMeta11 = tmpMeta9;
}
else
{
tmpMeta11 = _dim;
}
tmpMeta3 = tmpMeta11;
goto tmp5_done;
}
case 1: {
tmpMeta3 = _dim;
goto tmp5_done;
}
}
goto tmp5_end;
tmp5_end: ;
}
goto goto_4;
goto_4:;
MMC_THROW_INTERNAL();
goto tmp5_done;
tmp5_done:;
}
}
_dim = tmpMeta3;
tmpMeta12 = mmc_mk_cons(_dim, _outDims);
_outDims = tmpMeta12;
}
}
_outDims = (_outChanged?listReverse(_outDims):_inDims);
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
if (out_outChanged) { *out_outChanged = _outChanged; }
return _outDims;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traverseExpTypeDims2(threadData_t *threadData, modelica_metatype _inDims, modelica_fnptr _inFunc, modelica_metatype _inArg, modelica_metatype *out_outArg, modelica_metatype *out_outChanged)
{
modelica_boolean _outChanged;
modelica_metatype _outDims = NULL;
modelica_metatype tmpMeta1;
_outDims = omc_Expression_traverseExpTypeDims2(threadData, _inDims, _inFunc, _inArg, out_outArg, &_outChanged);
if (out_outChanged) { *out_outChanged = mmc_mk_icon(_outChanged); }
return _outDims;
}
DLLExport
modelica_metatype omc_Expression_traverseExpTypeDims(threadData_t *threadData, modelica_metatype _inType, modelica_fnptr _inFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outType = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _ty = NULL;
modelica_metatype _new_ty = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _arg = NULL;
modelica_boolean _changed;
modelica_metatype _state = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _ec = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 9: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,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));
_ty = tmpMeta5;
_dims = tmpMeta6;
omc_Expression_traverseExpTypeDims2(threadData, _dims, ((modelica_fnptr) _inFunc), _inArg ,&_arg ,&_changed);
tmp8 = (modelica_boolean)_changed;
if(tmp8)
{
tmpMeta7 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, _dims);
tmpMeta9 = tmpMeta7;
}
else
{
tmpMeta9 = _inType;
}
_ty = tmpMeta9;
tmpMeta[0+0] = _ty;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,4) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_state = tmpMeta10;
_vars = tmpMeta11;
_ty = tmpMeta12;
_ec = tmpMeta13;
_new_ty = omc_Expression_traverseExpTypeDims(threadData, _ty, ((modelica_fnptr) _inFunc), _inArg ,&_arg);
tmp15 = (modelica_boolean)referenceEq(_new_ty, _ty);
if(tmp15)
{
tmpMeta16 = _inType;
}
else
{
tmpMeta14 = mmc_mk_box5(13, &DAE_Type_T__SUBTYPE__BASIC__desc, _state, _vars, _ty, _ec);
tmpMeta16 = tmpMeta14;
}
_ty = tmpMeta16;
tmpMeta[0+0] = _ty;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inType;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outType;
}
DLLExport
modelica_metatype omc_Expression_traverseExpCrefDims(threadData_t *threadData, modelica_metatype _inCref, modelica_fnptr _inFunc, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outCref = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inCref;
{
modelica_string _id = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _new_ty = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _new_cr = NULL;
modelica_metatype _arg = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
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,0,4) == 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));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_id = tmpMeta5;
_ty = tmpMeta6;
_subs = tmpMeta7;
_cr = tmpMeta8;
_new_cr = omc_Expression_traverseExpCrefDims(threadData, _cr, ((modelica_fnptr) _inFunc), _inArg ,&_arg);
_new_ty = omc_Expression_traverseExpTypeDims(threadData, _ty, ((modelica_fnptr) _inFunc), _inArg ,&_arg);
tmp10 = (modelica_boolean)(referenceEq(_new_cr, _cr) && referenceEq(_new_ty, _ty));
if(tmp10)
{
tmpMeta11 = _inCref;
}
else
{
tmpMeta9 = mmc_mk_box5(3, &DAE_ComponentRef_CREF__QUAL__desc, _id, _new_ty, _subs, _new_cr);
tmpMeta11 = tmpMeta9;
}
_cr = tmpMeta11;
tmpMeta[0+0] = _cr;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 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));
_id = tmpMeta12;
_ty = tmpMeta13;
_subs = tmpMeta14;
_new_ty = omc_Expression_traverseExpTypeDims(threadData, _ty, ((modelica_fnptr) _inFunc), _inArg ,&_arg);
tmp16 = (modelica_boolean)referenceEq(_new_ty, _ty);
if(tmp16)
{
tmpMeta17 = _inCref;
}
else
{
tmpMeta15 = mmc_mk_box4(4, &DAE_ComponentRef_CREF__IDENT__desc, _id, _new_ty, _subs);
tmpMeta17 = tmpMeta15;
}
_cr = tmpMeta17;
tmpMeta[0+0] = _cr;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inCref;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCref = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outCref;
}
DLLExport
modelica_metatype omc_Expression_traverseExpOptTopDown(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _inTypeA, modelica_metatype *out_outA)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outA = 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 = _inTypeA;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = 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: {
if (!optionNone(tmp4_1)) goto tmp3_end;
_a = tmp4_2;
tmpMeta[0+0] = mmc_mk_none();
tmpMeta[0+1] = _a;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_e = tmpMeta6;
_a = tmp4_2;
_e1 = omc_Expression_traverseExpTopDown(threadData, _e, ((modelica_fnptr) _func), _a ,&_a);
tmpMeta[0+0] = (referenceEq(_e, _e1)?_inExp:mmc_mk_some(_e1));
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:;
}
}
_outExp = tmpMeta[0+0];
_outA = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outA) { *out_outA = _outA; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpOpt(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _inTypeA, modelica_metatype *out_outTypeA)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTypeA = 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 = _inTypeA;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _a = NULL;
modelica_metatype _oe = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_1)) goto tmp3_end;
_a = tmp4_2;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _a;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
_oe = tmp4_1;
_e = tmpMeta6;
_a = tmp4_2;
_e1 = omc_Expression_traverseExpBottomUp(threadData, _e, ((modelica_fnptr) _func), _a ,&_a);
_oe = (referenceEq(_e, _e1)?_oe:mmc_mk_some(_e1));
tmpMeta[0+0] = _oe;
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:;
}
}
_outExp = tmpMeta[0+0];
_outTypeA = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTypeA) { *out_outTypeA = _outTypeA; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpListTopDown(threadData_t *threadData, modelica_metatype _inExpl, modelica_fnptr _rel, modelica_metatype _inExt_arg, modelica_metatype *out_outA)
{
modelica_metatype _outExpl = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _outA = NULL;
modelica_metatype _e_1 = NULL;
modelica_boolean _same;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outExpl = tmpMeta1;
_outA = _inExt_arg;
_same = 1;
{
modelica_metatype _e;
for (tmpMeta2 = _inExpl; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_e = MMC_CAR(tmpMeta2);
_e_1 = omc_Expression_traverseExpTopDown(threadData, _e, ((modelica_fnptr) _rel), _outA ,&_outA);
_same = (referenceEq(_e, _e_1)?_same:0);
tmpMeta3 = mmc_mk_cons(_e_1, _outExpl);
_outExpl = tmpMeta3;
}
}
if(_same)
{
_outExpl = _inExpl;
}
else
{
_outExpl = listReverseInPlace(_outExpl);
}
_return: OMC_LABEL_UNUSED
if (out_outA) { *out_outA = _outA; }
return _outExpl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpMatrixTopDown(threadData_t *threadData, modelica_metatype _inMatrix, modelica_fnptr _func, modelica_metatype _inTypeA, modelica_metatype *out_outTypeA)
{
modelica_metatype _outMatrix = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _outTypeA = NULL;
modelica_metatype _row_1 = NULL;
modelica_boolean _same;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outMatrix = tmpMeta1;
_outTypeA = _inTypeA;
_same = 1;
{
modelica_metatype _row;
for (tmpMeta2 = _inMatrix; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_row = MMC_CAR(tmpMeta2);
_row_1 = omc_Expression_traverseExpListTopDown(threadData, _row, ((modelica_fnptr) _func), _outTypeA ,&_outTypeA);
_same = (referenceEq(_row, _row_1)?_same:0);
tmpMeta3 = mmc_mk_cons(_row_1, _outMatrix);
_outMatrix = tmpMeta3;
}
}
if(_same)
{
_outMatrix = _inMatrix;
}
else
{
_outMatrix = listReverseInPlace(_outMatrix);
}
_return: OMC_LABEL_UNUSED
if (out_outTypeA) { *out_outTypeA = _outTypeA; }
return _outMatrix;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTopDown1(threadData_t *threadData, modelica_boolean _cont, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_boolean tmp4_1;modelica_metatype tmp4_2;modelica_fnptr tmp4_3;modelica_metatype tmp4_4;
tmp4_1 = _cont;
tmp4_2 = _inExp;
tmp4_3 = ((modelica_fnptr) _func);
tmp4_4 = _inArg;
{
modelica_metatype _e1_1 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2_1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3_1 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _ext_arg_1 = NULL;
modelica_metatype _ext_arg_2 = NULL;
modelica_metatype _ext_arg = NULL;
modelica_metatype _ext_arg_3 = NULL;
modelica_metatype _op = NULL;
modelica_fnptr _rel;
modelica_metatype _expl_1 = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _fn = NULL;
modelica_boolean _scalar;
modelica_metatype _tp = NULL;
modelica_metatype _et = NULL;
modelica_metatype _t = NULL;
modelica_integer _i;
modelica_string _str = NULL;
modelica_metatype _fieldNames = NULL;
modelica_metatype _lstexpl_1 = NULL;
modelica_metatype _lstexpl = NULL;
modelica_integer _dim;
modelica_integer _index_;
modelica_metatype _isExpisASUB = NULL;
modelica_metatype _oe1 = NULL;
modelica_metatype _reductionInfo = NULL;
modelica_metatype _riters = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _matchType = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _cr_1 = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _clk = NULL;
modelica_metatype _clk1 = NULL;
modelica_metatype _typeVars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 42; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (0 != tmp4_1) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,1) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,4,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_clk = tmpMeta6;
_ext_arg = tmp4_4;
_clk1 = omc_Expression_traverseExpTopDownClockHelper(threadData, _clk, ((modelica_fnptr) _func), _ext_arg ,&_ext_arg);
tmp8 = (modelica_boolean)referenceEq(_clk1, _clk);
if(tmp8)
{
tmpMeta9 = _inExp;
}
else
{
tmpMeta7 = mmc_mk_box2(7, &DAE_Exp_CLKCONST__desc, _clk1);
tmpMeta9 = tmpMeta7;
}
_e = tmpMeta9;
tmpMeta[0+0] = _e;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,5,2) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta14;
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));
_cr = tmpMeta10;
_tp = tmpMeta11;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_cr_1 = omc_Expression_traverseExpTopDownCrefHelper(threadData, _cr, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmp13 = (modelica_boolean)referenceEq(_cr, _cr_1);
if(tmp13)
{
tmpMeta14 = _inExp;
}
else
{
tmpMeta12 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cr_1, _tp);
tmpMeta14 = tmpMeta12;
}
tmpMeta[0+0] = tmpMeta14;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_boolean tmp18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_op = tmpMeta15;
_e1 = tmpMeta16;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmp18 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp18)
{
tmpMeta19 = _inExp;
}
else
{
tmpMeta17 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op, _e1_1);
tmpMeta19 = tmpMeta17;
}
tmpMeta[0+0] = tmpMeta19;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_boolean tmp24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e1 = tmpMeta20;
_op = tmpMeta21;
_e2 = tmpMeta22;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmp24 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp24)
{
tmpMeta25 = _inExp;
}
else
{
tmpMeta23 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1_1, _op, _e2_1);
tmpMeta25 = tmpMeta23;
}
tmpMeta[0+0] = tmpMeta25;
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_boolean tmp29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,10,2) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_op = tmpMeta26;
_e1 = tmpMeta27;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmp29 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp29)
{
tmpMeta30 = _inExp;
}
else
{
tmpMeta28 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, _op, _e1_1);
tmpMeta30 = tmpMeta28;
}
tmpMeta[0+0] = tmpMeta30;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_boolean tmp35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,9,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e1 = tmpMeta31;
_op = tmpMeta32;
_e2 = tmpMeta33;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmp35 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp35)
{
tmpMeta36 = _inExp;
}
else
{
tmpMeta34 = mmc_mk_box4(12, &DAE_Exp_LBINARY__desc, _e1_1, _op, _e2_1);
tmpMeta36 = tmpMeta34;
}
tmpMeta[0+0] = tmpMeta36;
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_integer tmp41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_boolean tmp44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,11,5) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmp41 = mmc_unbox_integer(tmpMeta40);
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
_e1 = tmpMeta37;
_op = tmpMeta38;
_e2 = tmpMeta39;
_index_ = tmp41;
_isExpisASUB = tmpMeta42;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmp44 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp44)
{
tmpMeta45 = _inExp;
}
else
{
tmpMeta43 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _e1_1, _op, _e2_1, mmc_mk_integer(_index_), _isExpisASUB);
tmpMeta45 = tmpMeta43;
}
tmpMeta[0+0] = tmpMeta45;
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_boolean tmp50;
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,12,3) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e1 = tmpMeta46;
_e2 = tmpMeta47;
_e3 = tmpMeta48;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
_e3_1 = omc_Expression_traverseExpTopDown(threadData, _e3, ((modelica_fnptr) _rel), _ext_arg_2 ,&_ext_arg_3);
tmp50 = (modelica_boolean)((referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1)) && referenceEq(_e3, _e3_1));
if(tmp50)
{
tmpMeta51 = _inExp;
}
else
{
tmpMeta49 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _e1_1, _e2_1, _e3_1);
tmpMeta51 = tmpMeta49;
}
tmpMeta[0+0] = tmpMeta51;
tmpMeta[0+1] = _ext_arg_3;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,13,3) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_fn = tmpMeta52;
_expl = tmpMeta53;
_attr = tmpMeta54;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta55 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _fn, _expl_1, _attr);
tmpMeta[0+0] = tmpMeta55;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,14,4) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_fn = tmpMeta56;
_expl = tmpMeta57;
_fieldNames = tmpMeta58;
_tp = tmpMeta59;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta60 = mmc_mk_box5(17, &DAE_Exp_RECORD__desc, _fn, _expl_1, _fieldNames, _tp);
tmpMeta[0+0] = tmpMeta60;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,15,4) == 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_fn = tmpMeta61;
_expl = tmpMeta62;
_tp = tmpMeta63;
_t = tmpMeta64;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta65 = mmc_mk_box5(18, &DAE_Exp_PARTEVALFUNCTION__desc, _fn, _expl_1, _tp, _t);
tmpMeta[0+0] = tmpMeta65;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_integer tmp68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,16,3) == 0) goto tmp3_end;
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmp68 = mmc_unbox_integer(tmpMeta67);
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_tp = tmpMeta66;
_scalar = tmp68;
_expl = tmpMeta69;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta70 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _tp, mmc_mk_boolean(_scalar), _expl_1);
tmpMeta[0+0] = tmpMeta70;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_integer tmp73;
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,17,3) == 0) goto tmp3_end;
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmp73 = mmc_unbox_integer(tmpMeta72);
tmpMeta74 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_tp = tmpMeta71;
_dim = tmp73;
_lstexpl = tmpMeta74;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_lstexpl_1 = omc_Expression_traverseExpMatrixTopDown(threadData, _lstexpl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta75 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _tp, mmc_mk_integer(_dim), _lstexpl_1);
tmpMeta[0+0] = tmpMeta75;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
modelica_boolean tmp81;
modelica_metatype tmpMeta82;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,18,4) == 0) goto tmp3_end;
tmpMeta76 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (!optionNone(tmpMeta78)) goto tmp3_end;
tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_tp = tmpMeta76;
_e1 = tmpMeta77;
_e2 = tmpMeta79;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmp81 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp81)
{
tmpMeta82 = _inExp;
}
else
{
tmpMeta80 = mmc_mk_box5(21, &DAE_Exp_RANGE__desc, _tp, _e1_1, mmc_mk_none(), _e2_1);
tmpMeta82 = tmpMeta80;
}
tmpMeta[0+0] = tmpMeta82;
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_metatype tmpMeta87;
modelica_metatype tmpMeta88;
modelica_boolean tmp89;
modelica_metatype tmpMeta90;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,18,4) == 0) goto tmp3_end;
tmpMeta83 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta84 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta85 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
if (optionNone(tmpMeta85)) goto tmp3_end;
tmpMeta86 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta85), 1));
tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
_tp = tmpMeta83;
_e1 = tmpMeta84;
_e2 = tmpMeta86;
_e3 = tmpMeta87;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
_e3_1 = omc_Expression_traverseExpTopDown(threadData, _e3, ((modelica_fnptr) _rel), _ext_arg_2 ,&_ext_arg_3);
tmp89 = (modelica_boolean)((referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1)) && referenceEq(_e3, _e3_1));
if(tmp89)
{
tmpMeta90 = _inExp;
}
else
{
tmpMeta88 = mmc_mk_box5(21, &DAE_Exp_RANGE__desc, _tp, _e1_1, mmc_mk_some(_e2_1), _e3_1);
tmpMeta90 = tmpMeta88;
}
tmpMeta[0+0] = tmpMeta90;
tmpMeta[0+1] = _ext_arg_3;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,1) == 0) goto tmp3_end;
tmpMeta91 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_expl = tmpMeta91;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta92 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _expl_1);
tmpMeta[0+0] = tmpMeta92;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,20,2) == 0) goto tmp3_end;
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta94 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_tp = tmpMeta93;
_e1 = tmpMeta94;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta95 = mmc_mk_box3(23, &DAE_Exp_CAST__desc, _tp, _e1_1);
tmpMeta[0+0] = tmpMeta95;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,21,2) == 0) goto tmp3_end;
tmpMeta96 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta97 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e1 = tmpMeta96;
_expl_1 = tmpMeta97;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl_1, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmpMeta[0+0] = omc_Expression_makeASUB(threadData, _e1_1, _expl_1);
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_integer tmp100;
modelica_metatype tmpMeta101;
modelica_metatype tmpMeta102;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,22,3) == 0) goto tmp3_end;
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta99 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmp100 = mmc_unbox_integer(tmpMeta99);
tmpMeta101 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_e1 = tmpMeta98;
_i = tmp100;
_tp = tmpMeta101;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta102 = mmc_mk_box4(25, &DAE_Exp_TSUB__desc, _e1_1, mmc_mk_integer(_i), _tp);
tmpMeta[0+0] = tmpMeta102;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta103;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,23,4) == 0) goto tmp3_end;
_e1 = tmp4_2;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e1), 2))), ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
if((!referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e1), 2))), _e1_1)))
{
tmpMeta103 = MMC_TAGPTR(mmc_alloc_words(6));
memcpy(MMC_UNTAGPTR(tmpMeta103), MMC_UNTAGPTR(_e1), 6*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta103))[2] = _e1_1;
_e1 = tmpMeta103;
}
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
modelica_metatype tmpMeta106;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,24,2) == 0) goto tmp3_end;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (!optionNone(tmpMeta105)) goto tmp3_end;
_e1 = tmpMeta104;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta106 = mmc_mk_box3(27, &DAE_Exp_SIZE__desc, _e1_1, mmc_mk_none());
tmpMeta[0+0] = tmpMeta106;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 27: {
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,24,2) == 0) goto tmp3_end;
tmpMeta107 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta108 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (optionNone(tmpMeta108)) goto tmp3_end;
tmpMeta109 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta108), 1));
_e1 = tmpMeta107;
_e2 = tmpMeta109;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmp111 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp111)
{
tmpMeta112 = _inExp;
}
else
{
tmpMeta110 = mmc_mk_box3(27, &DAE_Exp_SIZE__desc, _e1_1, mmc_mk_some(_e2_1));
tmpMeta112 = tmpMeta110;
}
tmpMeta[0+0] = tmpMeta112;
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 28: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,25,2) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 29: {
modelica_metatype tmpMeta113;
modelica_metatype tmpMeta114;
modelica_metatype tmpMeta115;
modelica_metatype tmpMeta116;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,27,3) == 0) goto tmp3_end;
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta114 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta115 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_reductionInfo = tmpMeta113;
_e1 = tmpMeta114;
_riters = tmpMeta115;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg);
_riters = omc_Expression_traverseReductionIteratorsTopDown(threadData, _riters, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg);
tmpMeta116 = mmc_mk_box4(30, &DAE_Exp_REDUCTION__desc, _reductionInfo, _e1, _riters);
tmpMeta[0+0] = tmpMeta116;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 30: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,26,4) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta117;
modelica_metatype tmpMeta118;
modelica_metatype tmpMeta119;
modelica_boolean tmp120;
modelica_metatype tmpMeta121;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,29,2) == 0) goto tmp3_end;
tmpMeta117 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta118 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e1 = tmpMeta117;
_e2 = tmpMeta118;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
_e2_1 = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _rel), _ext_arg_1 ,&_ext_arg_2);
tmp120 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp120)
{
tmpMeta121 = _inExp;
}
else
{
tmpMeta119 = mmc_mk_box3(32, &DAE_Exp_CONS__desc, _e1_1, _e2_1);
tmpMeta121 = tmpMeta119;
}
tmpMeta[0+0] = tmpMeta121;
tmpMeta[0+1] = _ext_arg_2;
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta122;
modelica_metatype tmpMeta123;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,28,1) == 0) goto tmp3_end;
tmpMeta122 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_expl = tmpMeta122;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta123 = mmc_mk_box2(31, &DAE_Exp_LIST__desc, _expl_1);
tmpMeta[0+0] = tmpMeta123;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta124;
modelica_metatype tmpMeta125;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,30,1) == 0) goto tmp3_end;
tmpMeta124 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_expl = tmpMeta124;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta125 = mmc_mk_box2(33, &DAE_Exp_META__TUPLE__desc, _expl_1);
tmpMeta[0+0] = tmpMeta125;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta126;
modelica_metatype tmpMeta127;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,31,1) == 0) goto tmp3_end;
tmpMeta126 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_oe1 = tmpMeta126;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_oe1 = omc_Expression_traverseExpOptTopDown(threadData, _oe1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg);
tmpMeta127 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, _oe1);
tmpMeta[0+0] = tmpMeta127;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 35: {
modelica_metatype tmpMeta128;
modelica_metatype tmpMeta129;
modelica_metatype tmpMeta130;
modelica_metatype tmpMeta131;
modelica_metatype tmpMeta132;
modelica_metatype tmpMeta133;
modelica_metatype tmpMeta134;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,33,6) == 0) goto tmp3_end;
tmpMeta128 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta129 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta130 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta131 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmpMeta132 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
tmpMeta133 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
_matchType = tmpMeta128;
_expl = tmpMeta129;
_aliases = tmpMeta130;
_localDecls = tmpMeta131;
_cases = tmpMeta132;
_et = tmpMeta133;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg);
_cases = omc_Patternm_traverseCasesTopDown(threadData, _cases, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg);
tmpMeta134 = mmc_mk_box7(36, &DAE_Exp_MATCHEXPRESSION__desc, _matchType, _expl, _aliases, _localDecls, _cases, _et);
tmpMeta[0+0] = tmpMeta134;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 36: {
modelica_metatype tmpMeta135;
modelica_metatype tmpMeta136;
modelica_metatype tmpMeta137;
modelica_metatype tmpMeta138;
modelica_integer tmp139;
modelica_metatype tmpMeta140;
modelica_metatype tmpMeta141;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,32,5) == 0) goto tmp3_end;
tmpMeta135 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta136 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
tmpMeta137 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
tmpMeta138 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
tmp139 = mmc_unbox_integer(tmpMeta138);
tmpMeta140 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
_fn = tmpMeta135;
_expl = tmpMeta136;
_fieldNames = tmpMeta137;
_i = tmp139;
_typeVars = tmpMeta140;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_expl_1 = omc_Expression_traverseExpListTopDown(threadData, _expl, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta141 = mmc_mk_box6(35, &DAE_Exp_METARECORDCALL__desc, _fn, _expl_1, _fieldNames, mmc_mk_integer(_i), _typeVars);
tmpMeta[0+0] = tmpMeta141;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 37: {
modelica_metatype tmpMeta142;
modelica_metatype tmpMeta143;
modelica_metatype tmpMeta144;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,35,2) == 0) goto tmp3_end;
tmpMeta142 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta143 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e1 = tmpMeta142;
_tp = tmpMeta143;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta144 = mmc_mk_box3(38, &DAE_Exp_UNBOX__desc, _e1_1, _tp);
tmpMeta[0+0] = tmpMeta144;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 38: {
modelica_metatype tmpMeta145;
modelica_metatype tmpMeta146;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,34,1) == 0) goto tmp3_end;
tmpMeta145 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_e1 = tmpMeta145;
_rel = tmp4_3;
_ext_arg = tmp4_4;
_e1_1 = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg_1);
tmpMeta146 = mmc_mk_box2(37, &DAE_Exp_BOX__desc, _e1_1);
tmpMeta[0+0] = tmpMeta146;
tmpMeta[0+1] = _ext_arg_1;
goto tmp3_done;
}
case 39: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,37,1) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 40: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,36,2) == 0) goto tmp3_end;
_ext_arg = tmp4_4;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _ext_arg;
goto tmp3_done;
}
case 41: {
modelica_metatype tmpMeta147;
modelica_metatype tmpMeta148;
modelica_metatype tmpMeta149;
modelica_metatype tmpMeta150;
_str = omc_ExpressionDump_printExpStr(threadData, _inExp);
tmpMeta147 = stringAppend(_OMC_LIT113,omc_System_dladdr(threadData, ((modelica_fnptr) _func), NULL, NULL));
tmpMeta148 = stringAppend(tmpMeta147,_OMC_LIT114);
tmpMeta149 = stringAppend(tmpMeta148,_str);
_str = tmpMeta149;
tmpMeta150 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT31, tmpMeta150);
goto goto_2;
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];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_traverseExpTopDown1(threadData_t *threadData, modelica_metatype _cont, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_cont);
_outExp = omc_Expression_traverseExpTopDown1(threadData, tmp1, _inExp, _func, _inArg, out_outArg);
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpTopDownClockHelper(threadData_t *threadData, modelica_metatype _inClk, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outClk = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inClk;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _ea = NULL;
modelica_metatype _eb = NULL;
modelica_metatype _arg = NULL;
modelica_metatype _clk = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,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));
_e1 = tmpMeta5;
_e2 = tmpMeta6;
_ea = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _func), _inArg ,&_arg);
_eb = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp8 = (modelica_boolean)(referenceEq(_ea, _e1) && referenceEq(_eb, _e2));
if(tmp8)
{
tmpMeta9 = _inClk;
}
else
{
tmpMeta7 = mmc_mk_box3(4, &DAE_ClockKind_RATIONAL__CLOCK__desc, _ea, _eb);
tmpMeta9 = tmpMeta7;
}
_clk = tmpMeta9;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta10;
_e1 = omc_Expression_traverseExpTopDown(threadData, _e, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp12 = (modelica_boolean)referenceEq(_e1, _e);
if(tmp12)
{
tmpMeta13 = _inClk;
}
else
{
tmpMeta11 = mmc_mk_box2(5, &DAE_ClockKind_REAL__CLOCK__desc, _e1);
tmpMeta13 = tmpMeta11;
}
_clk = tmpMeta13;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta14;
_e2 = tmpMeta15;
_ea = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _func), _inArg ,&_arg);
_eb = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp17 = (modelica_boolean)(referenceEq(_ea, _e1) && referenceEq(_eb, _e2));
if(tmp17)
{
tmpMeta18 = _inClk;
}
else
{
tmpMeta16 = mmc_mk_box3(6, &DAE_ClockKind_EVENT__CLOCK__desc, _ea, _eb);
tmpMeta18 = tmpMeta16;
}
_clk = tmpMeta18;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_boolean tmp22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta19;
_e2 = tmpMeta20;
_ea = omc_Expression_traverseExpTopDown(threadData, _e1, ((modelica_fnptr) _func), _inArg ,&_arg);
_eb = omc_Expression_traverseExpTopDown(threadData, _e2, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp22 = (modelica_boolean)(referenceEq(_ea, _e1) && referenceEq(_eb, _e2));
if(tmp22)
{
tmpMeta23 = _inClk;
}
else
{
tmpMeta21 = mmc_mk_box3(7, &DAE_ClockKind_SOLVER__CLOCK__desc, _ea, _eb);
tmpMeta23 = tmpMeta21;
}
_clk = tmpMeta23;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inClk;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outClk = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outClk;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpClk(threadData_t *threadData, modelica_metatype _inClk, modelica_fnptr _func, modelica_metatype _inArg, modelica_metatype *out_outArg)
{
modelica_metatype _outClk = NULL;
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inClk;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _ea = NULL;
modelica_metatype _eb = NULL;
modelica_metatype _arg = NULL;
modelica_metatype _clk = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,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));
_e1 = tmpMeta5;
_e2 = tmpMeta6;
_ea = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _func), _inArg ,&_arg);
_eb = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp8 = (modelica_boolean)(referenceEq(_ea, _e1) && referenceEq(_eb, _e2));
if(tmp8)
{
tmpMeta9 = _inClk;
}
else
{
tmpMeta7 = mmc_mk_box3(4, &DAE_ClockKind_RATIONAL__CLOCK__desc, _ea, _eb);
tmpMeta9 = tmpMeta7;
}
_clk = tmpMeta9;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta10;
_e1 = omc_Expression_traverseExpBottomUp(threadData, _e, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp12 = (modelica_boolean)referenceEq(_e1, _e);
if(tmp12)
{
tmpMeta13 = _inClk;
}
else
{
tmpMeta11 = mmc_mk_box2(5, &DAE_ClockKind_REAL__CLOCK__desc, _e1);
tmpMeta13 = tmpMeta11;
}
_clk = tmpMeta13;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta14;
_e2 = tmpMeta15;
_ea = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _func), _inArg ,&_arg);
_eb = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp17 = (modelica_boolean)(referenceEq(_ea, _e1) && referenceEq(_eb, _e2));
if(tmp17)
{
tmpMeta18 = _inClk;
}
else
{
tmpMeta16 = mmc_mk_box3(6, &DAE_ClockKind_EVENT__CLOCK__desc, _ea, _eb);
tmpMeta18 = tmpMeta16;
}
_clk = tmpMeta18;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_boolean tmp22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta19;
_e2 = tmpMeta20;
_ea = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _func), _inArg ,&_arg);
_eb = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _func), _inArg ,&_arg);
tmp22 = (modelica_boolean)(referenceEq(_ea, _e1) && referenceEq(_eb, _e2));
if(tmp22)
{
tmpMeta23 = _inClk;
}
else
{
tmpMeta21 = mmc_mk_box3(7, &DAE_ClockKind_SOLVER__CLOCK__desc, _ea, _eb);
tmpMeta23 = tmpMeta21;
}
_clk = tmpMeta23;
tmpMeta[0+0] = _clk;
tmpMeta[0+1] = _arg;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inClk;
tmpMeta[0+1] = _inArg;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outClk = tmpMeta[0+0];
_outArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outClk;
}
DLLExport
modelica_metatype omc_Expression_traverseExpTopDown(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _func, modelica_metatype _ext_arg, modelica_metatype *out_outArg)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outArg = NULL;
modelica_boolean _cont;
modelica_metatype tmpMeta1;
modelica_integer tmp2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, 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, _ext_arg, &tmpMeta1, &tmpMeta3) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _inExp, _ext_arg, &tmpMeta1, &tmpMeta3);
_outExp = tmpMeta4;
tmp2 = mmc_unbox_integer(tmpMeta1);
_cont = tmp2;
_outArg = tmpMeta3;
_outExp = omc_Expression_traverseExpTopDown1(threadData, _cont, _outExp, ((modelica_fnptr) _func), _outArg ,&_outArg);
_return: OMC_LABEL_UNUSED
if (out_outArg) { *out_outArg = _outArg; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpList(threadData_t *threadData, modelica_metatype _inExpl, modelica_fnptr _rel, modelica_metatype _iext_arg, modelica_metatype *out_ext_arg)
{
modelica_metatype _expl = NULL;
modelica_metatype _ext_arg = NULL;
modelica_metatype _e1 = NULL;
modelica_boolean _allEq;
modelica_metatype _delst = NULL;
modelica_integer _nEq;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_boolean tmp6;
modelica_metatype tmpMeta7;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ext_arg = _iext_arg;
_allEq = 1;
_nEq = ((modelica_integer) 0);
{
modelica_metatype _e;
for (tmpMeta1 = _inExpl; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_e = MMC_CAR(tmpMeta1);
_e1 = omc_Expression_traverseExpBottomUp(threadData, _e, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg);
if((_allEq?(!referenceEq(_e, _e1)):0))
{
_allEq = 0;
_delst = omc_DoubleEnded_empty(threadData, _e1);
{
modelica_metatype _elt;
for (tmpMeta2 = _inExpl; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_elt = MMC_CAR(tmpMeta2);
if((_nEq < ((modelica_integer) 1)))
{
break;
}
omc_DoubleEnded_push__back(threadData, _delst, _elt);
_nEq = ((modelica_integer) -1) + _nEq;
}
}
}
if(_allEq)
{
_nEq = ((modelica_integer) 1) + _nEq;
}
else
{
omc_DoubleEnded_push__back(threadData, _delst, _e1);
}
}
}
tmp6 = (modelica_boolean)_allEq;
if(tmp6)
{
tmpMeta7 = _inExpl;
}
else
{
tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = omc_DoubleEnded_toListAndClear(threadData, _delst, tmpMeta5);
}
_expl = tmpMeta7;
_return: OMC_LABEL_UNUSED
if (out_ext_arg) { *out_ext_arg = _ext_arg; }
return _expl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_traverseExpMatrix(threadData_t *threadData, modelica_metatype _inMatrix, modelica_fnptr _func, modelica_metatype _inTypeA, modelica_metatype *out_outTypeA)
{
modelica_metatype _outMatrix = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _outTypeA = NULL;
modelica_metatype _row_1 = NULL;
modelica_boolean _same;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outMatrix = tmpMeta1;
_outTypeA = _inTypeA;
_same = 1;
{
modelica_metatype _row;
for (tmpMeta2 = _inMatrix; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_row = MMC_CAR(tmpMeta2);
_row_1 = omc_Expression_traverseExpList(threadData, _row, ((modelica_fnptr) _func), _outTypeA ,&_outTypeA);
_same = (referenceEq(_row, _row_1)?_same:0);
tmpMeta3 = mmc_mk_cons(_row_1, _outMatrix);
_outMatrix = tmpMeta3;
}
}
if(_same)
{
_outMatrix = _inMatrix;
}
else
{
_outMatrix = listReverseInPlace(_outMatrix);
}
_return: OMC_LABEL_UNUSED
if (out_outTypeA) { *out_outTypeA = _outTypeA; }
return _outMatrix;
}
DLLExport
modelica_metatype omc_Expression_traverseSubexpressionsTopDownHelper(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _itpl, modelica_metatype *out_otpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _otpl = NULL;
modelica_fnptr _rel;
modelica_metatype _ext_arg = NULL;
modelica_metatype _ext_arg2 = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_boolean tmp5;
modelica_metatype tmpMeta6;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _itpl;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_rel = tmpMeta2;
_ext_arg = tmpMeta3;
_outExp = omc_Expression_traverseExpTopDown(threadData, _inExp, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg2);
tmp5 = (modelica_boolean)referenceEq(_ext_arg, _ext_arg2);
if(tmp5)
{
tmpMeta6 = _itpl;
}
else
{
tmpMeta4 = mmc_mk_box2(0, ((modelica_fnptr) _rel), _ext_arg2);
tmpMeta6 = tmpMeta4;
}
_otpl = tmpMeta6;
_return: OMC_LABEL_UNUSED
if (out_otpl) { *out_otpl = _otpl; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseSubexpressionsDummyHelper(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inFunc, modelica_fnptr *out_outFunc)
{
modelica_metatype _outExp = NULL;
modelica_fnptr _outFunc;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_traverseExpDummyHelper, ((modelica_fnptr) _inFunc) ,&_outFunc);
_return: OMC_LABEL_UNUSED
if (out_outFunc) { *out_outFunc = (modelica_fnptr)_outFunc; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseSubexpressions(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fe, modelica_metatype __omcQ_24in_5Farg, modelica_fnptr _func, modelica_metatype *out_arg)
{
modelica_metatype _e = NULL;
modelica_metatype _arg = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_e = __omcQ_24in_5Fe;
_arg = __omcQ_24in_5Farg;
_e = omc_Expression_traverseExpBottomUp(threadData, _e, ((modelica_fnptr) _func), _arg ,&_arg);
_return: OMC_LABEL_UNUSED
if (out_arg) { *out_arg = _arg; }
return _e;
}
DLLExport
modelica_metatype omc_Expression_traverseSubexpressionsHelper(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _itpl, modelica_metatype *out_otpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _otpl = NULL;
modelica_fnptr _rel;
modelica_metatype _ext_arg = NULL;
modelica_metatype _ext_arg2 = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_boolean tmp5;
modelica_metatype tmpMeta6;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _itpl;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_rel = tmpMeta2;
_ext_arg = tmpMeta3;
_outExp = omc_Expression_traverseExpBottomUp(threadData, _inExp, ((modelica_fnptr) _rel), _ext_arg ,&_ext_arg2);
tmp5 = (modelica_boolean)referenceEq(_ext_arg, _ext_arg2);
if(tmp5)
{
tmpMeta6 = _itpl;
}
else
{
tmpMeta4 = mmc_mk_box2(0, ((modelica_fnptr) _rel), _ext_arg2);
tmpMeta6 = tmpMeta4;
}
_otpl = tmpMeta6;
_return: OMC_LABEL_UNUSED
if (out_otpl) { *out_otpl = _otpl; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpDummyHelper(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _func, modelica_fnptr *out_outFunc)
{
modelica_metatype _outExp = NULL;
modelica_fnptr _outFunc;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))), _inExp) : ((modelica_metatype(*)(threadData_t*, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1)))) (threadData, _inExp);
_outFunc = (modelica_fnptr) ((modelica_fnptr) _func);
_return: OMC_LABEL_UNUSED
if (out_outFunc) { *out_outFunc = (modelica_fnptr)_outFunc; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpDummy(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _func)
{
modelica_metatype _outExp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_traverseExpDummyHelper, ((modelica_fnptr) _func), NULL);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traverseExpBottomUp(threadData_t *threadData, modelica_metatype _inExp, modelica_fnptr _inFunc, modelica_metatype _inExtArg, modelica_metatype *out_outExtArg)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outExtArg = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1_1 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2_1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3_1 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _ext_arg = NULL;
modelica_metatype _op = NULL;
modelica_metatype _expl_1 = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _fn = NULL;
modelica_boolean _scalar;
modelica_metatype _tp = NULL;
modelica_metatype _t = NULL;
modelica_integer _i;
modelica_metatype _lstexpl_1 = NULL;
modelica_metatype _lstexpl = NULL;
modelica_integer _dim;
modelica_string _str = NULL;
modelica_metatype _localDecls = NULL;
modelica_metatype _fieldNames = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _cases = NULL;
modelica_metatype _cases_1 = NULL;
modelica_metatype _matchTy = NULL;
modelica_integer _index_;
modelica_metatype _isExpisASUB = NULL;
modelica_metatype _reductionInfo = NULL;
modelica_metatype _riters = NULL;
modelica_metatype _riters_1 = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _cr_1 = NULL;
modelica_metatype _aliases = NULL;
modelica_metatype _clk = NULL;
modelica_metatype _clk1 = NULL;
modelica_metatype _typeVars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 42; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,26,4) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_boolean tmp8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_clk = tmpMeta6;
_clk1 = omc_Expression_traverseExpClk(threadData, _clk, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp8 = (modelica_boolean)referenceEq(_clk1, _clk);
if(tmp8)
{
tmpMeta9 = _inExp;
}
else
{
tmpMeta7 = mmc_mk_box2(7, &DAE_Exp_CLKCONST__desc, _clk1);
tmpMeta9 = tmpMeta7;
}
_e = tmpMeta9;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_cr = tmpMeta10;
_tp = tmpMeta11;
_cr_1 = omc_Expression_traverseExpCref(threadData, _cr, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp13 = (modelica_boolean)referenceEq(_cr, _cr_1);
if(tmp13)
{
tmpMeta14 = _inExp;
}
else
{
tmpMeta12 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cr_1, _tp);
tmpMeta14 = tmpMeta12;
}
_e = tmpMeta14;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_boolean tmp18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta15;
_e1 = tmpMeta16;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp18 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp18)
{
tmpMeta19 = _inExp;
}
else
{
tmpMeta17 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op, _e1_1);
tmpMeta19 = tmpMeta17;
}
_e = tmpMeta19;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_boolean tmp24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta20;
_op = tmpMeta21;
_e2 = tmpMeta22;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp24 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp24)
{
tmpMeta25 = _inExp;
}
else
{
tmpMeta23 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1_1, _op, _e2_1);
tmpMeta25 = tmpMeta23;
}
_e = tmpMeta25;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_boolean tmp29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta26;
_e1 = tmpMeta27;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp29 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp29)
{
tmpMeta30 = _inExp;
}
else
{
tmpMeta28 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, _op, _e1_1);
tmpMeta30 = tmpMeta28;
}
_e = tmpMeta30;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_boolean tmp35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta31;
_op = tmpMeta32;
_e2 = tmpMeta33;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp35 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp35)
{
tmpMeta36 = _inExp;
}
else
{
tmpMeta34 = mmc_mk_box4(12, &DAE_Exp_LBINARY__desc, _e1_1, _op, _e2_1);
tmpMeta36 = tmpMeta34;
}
_e = tmpMeta36;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_integer tmp41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_boolean tmp44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp41 = mmc_unbox_integer(tmpMeta40);
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_e1 = tmpMeta37;
_op = tmpMeta38;
_e2 = tmpMeta39;
_index_ = tmp41;
_isExpisASUB = tmpMeta42;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp44 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp44)
{
tmpMeta45 = _inExp;
}
else
{
tmpMeta43 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _e1_1, _op, _e2_1, mmc_mk_integer(_index_), _isExpisASUB);
tmpMeta45 = tmpMeta43;
}
_e = tmpMeta45;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_boolean tmp50;
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta46;
_e2 = tmpMeta47;
_e3 = tmpMeta48;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
_e3_1 = omc_Expression_traverseExpBottomUp(threadData, _e3, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp50 = (modelica_boolean)((referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1)) && referenceEq(_e3, _e3_1));
if(tmp50)
{
tmpMeta51 = _inExp;
}
else
{
tmpMeta49 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _e1_1, _e2_1, _e3_1);
tmpMeta51 = tmpMeta49;
}
_e = tmpMeta51;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_boolean tmp56;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_fn = tmpMeta52;
_expl = tmpMeta53;
_attr = tmpMeta54;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp56 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp56)
{
tmpMeta57 = _inExp;
}
else
{
tmpMeta55 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _fn, _expl_1, _attr);
tmpMeta57 = tmpMeta55;
}
_e = tmpMeta57;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_boolean tmp63;
modelica_metatype tmpMeta64;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_fn = tmpMeta58;
_expl = tmpMeta59;
_fieldNames = tmpMeta60;
_tp = tmpMeta61;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp63 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp63)
{
tmpMeta64 = _inExp;
}
else
{
tmpMeta62 = mmc_mk_box5(17, &DAE_Exp_RECORD__desc, _fn, _expl_1, _fieldNames, _tp);
tmpMeta64 = tmpMeta62;
}
_e = tmpMeta64;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_boolean tmp70;
modelica_metatype tmpMeta71;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_fn = tmpMeta65;
_expl = tmpMeta66;
_tp = tmpMeta67;
_t = tmpMeta68;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp70 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp70)
{
tmpMeta71 = _inExp;
}
else
{
tmpMeta69 = mmc_mk_box5(18, &DAE_Exp_PARTEVALFUNCTION__desc, _fn, _expl_1, _tp, _t);
tmpMeta71 = tmpMeta69;
}
_e = tmpMeta71;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_integer tmp74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_boolean tmp77;
modelica_metatype tmpMeta78;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta73 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp74 = mmc_unbox_integer(tmpMeta73);
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta72;
_scalar = tmp74;
_expl = tmpMeta75;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp77 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp77)
{
tmpMeta78 = _inExp;
}
else
{
tmpMeta76 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _tp, mmc_mk_boolean(_scalar), _expl_1);
tmpMeta78 = tmpMeta76;
}
_e = tmpMeta78;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
modelica_integer tmp81;
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
modelica_boolean tmp84;
modelica_metatype tmpMeta85;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta80 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp81 = mmc_unbox_integer(tmpMeta80);
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta79;
_dim = tmp81;
_lstexpl = tmpMeta82;
_lstexpl_1 = omc_Expression_traverseExpMatrix(threadData, _lstexpl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp84 = (modelica_boolean)referenceEq(_lstexpl, _lstexpl_1);
if(tmp84)
{
tmpMeta85 = _inExp;
}
else
{
tmpMeta83 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _tp, mmc_mk_integer(_dim), _lstexpl_1);
tmpMeta85 = tmpMeta83;
}
_e = tmpMeta85;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta86;
modelica_metatype tmpMeta87;
modelica_metatype tmpMeta88;
modelica_metatype tmpMeta89;
modelica_metatype tmpMeta90;
modelica_boolean tmp91;
modelica_metatype tmpMeta92;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta86 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta88 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta88)) goto tmp3_end;
tmpMeta89 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_tp = tmpMeta86;
_e1 = tmpMeta87;
_e2 = tmpMeta89;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp91 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp91)
{
tmpMeta92 = _inExp;
}
else
{
tmpMeta90 = mmc_mk_box5(21, &DAE_Exp_RANGE__desc, _tp, _e1_1, mmc_mk_none(), _e2_1);
tmpMeta92 = tmpMeta90;
}
_e = tmpMeta92;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
modelica_metatype tmpMeta98;
modelica_boolean tmp99;
modelica_metatype tmpMeta100;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta94 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta95 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta95)) goto tmp3_end;
tmpMeta96 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta95), 1));
tmpMeta97 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_tp = tmpMeta93;
_e1 = tmpMeta94;
_e2 = tmpMeta96;
_e3 = tmpMeta97;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
_e3_1 = omc_Expression_traverseExpBottomUp(threadData, _e3, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp99 = (modelica_boolean)((referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1)) && referenceEq(_e3, _e3_1));
if(tmp99)
{
tmpMeta100 = _inExp;
}
else
{
tmpMeta98 = mmc_mk_box5(21, &DAE_Exp_RANGE__desc, _tp, _e1_1, mmc_mk_some(_e2_1), _e3_1);
tmpMeta100 = tmpMeta98;
}
_e = tmpMeta100;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta101;
modelica_metatype tmpMeta102;
modelica_boolean tmp103;
modelica_metatype tmpMeta104;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta101 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta101;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp103 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp103)
{
tmpMeta104 = _inExp;
}
else
{
tmpMeta102 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _expl_1);
tmpMeta104 = tmpMeta102;
}
_e = tmpMeta104;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta105;
modelica_metatype tmpMeta106;
modelica_metatype tmpMeta107;
modelica_boolean tmp108;
modelica_metatype tmpMeta109;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta106 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta105;
_e1 = tmpMeta106;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp108 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp108)
{
tmpMeta109 = _inExp;
}
else
{
tmpMeta107 = mmc_mk_box3(23, &DAE_Exp_CAST__desc, _tp, _e1_1);
tmpMeta109 = tmpMeta107;
}
_e = tmpMeta109;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta110;
modelica_metatype tmpMeta111;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta110 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta111 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta110;
_expl = tmpMeta111;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
_e = ((referenceEq(_e1, _e1_1) && referenceEq(_expl, _expl_1))?_inExp:omc_Expression_makeASUB(threadData, _e1_1, _expl_1));
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta112;
modelica_metatype tmpMeta113;
modelica_integer tmp114;
modelica_metatype tmpMeta115;
modelica_metatype tmpMeta116;
modelica_boolean tmp117;
modelica_metatype tmpMeta118;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta112 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta113 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp114 = mmc_unbox_integer(tmpMeta113);
tmpMeta115 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta112;
_i = tmp114;
_tp = tmpMeta115;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp117 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp117)
{
tmpMeta118 = _inExp;
}
else
{
tmpMeta116 = mmc_mk_box4(25, &DAE_Exp_TSUB__desc, _e1_1, mmc_mk_integer(_i), _tp);
tmpMeta118 = tmpMeta116;
}
_e = tmpMeta118;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta119;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,23,4) == 0) goto tmp3_end;
_e1 = tmp4_1;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e1), 2))), ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
if((!referenceEq((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e1), 2))), _e1_1)))
{
tmpMeta119 = MMC_TAGPTR(mmc_alloc_words(6));
memcpy(MMC_UNTAGPTR(tmpMeta119), MMC_UNTAGPTR(_e1), 6*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta119))[2] = _e1_1;
_e1 = tmpMeta119;
}
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e1, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e1, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta120;
modelica_metatype tmpMeta121;
modelica_metatype tmpMeta122;
modelica_boolean tmp123;
modelica_metatype tmpMeta124;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta120 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta121 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta121)) goto tmp3_end;
_e1 = tmpMeta120;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp123 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp123)
{
tmpMeta124 = _inExp;
}
else
{
tmpMeta122 = mmc_mk_box3(27, &DAE_Exp_SIZE__desc, _e1_1, mmc_mk_none());
tmpMeta124 = tmpMeta122;
}
_e = tmpMeta124;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta125;
modelica_metatype tmpMeta126;
modelica_metatype tmpMeta127;
modelica_metatype tmpMeta128;
modelica_boolean tmp129;
modelica_metatype tmpMeta130;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta125 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta126 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta126)) goto tmp3_end;
tmpMeta127 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta126), 1));
_e1 = tmpMeta125;
_e2 = tmpMeta127;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp129 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp129)
{
tmpMeta130 = _inExp;
}
else
{
tmpMeta128 = mmc_mk_box3(27, &DAE_Exp_SIZE__desc, _e1_1, mmc_mk_some(_e2_1));
tmpMeta130 = tmpMeta128;
}
_e = tmpMeta130;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 28: {
modelica_metatype tmpMeta131;
modelica_metatype tmpMeta132;
modelica_metatype tmpMeta133;
modelica_metatype tmpMeta134;
modelica_boolean tmp135;
modelica_metatype tmpMeta136;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta131 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta132 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta133 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_reductionInfo = tmpMeta131;
_e1 = tmpMeta132;
_riters = tmpMeta133;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_riters_1 = omc_Expression_traverseReductionIterators(threadData, _riters, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp135 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_riters, _riters_1));
if(tmp135)
{
tmpMeta136 = _inExp;
}
else
{
tmpMeta134 = mmc_mk_box4(30, &DAE_Exp_REDUCTION__desc, _reductionInfo, _e1_1, _riters_1);
tmpMeta136 = tmpMeta134;
}
_e = tmpMeta136;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 29: {
modelica_metatype tmpMeta137;
modelica_metatype tmpMeta138;
modelica_metatype tmpMeta139;
modelica_boolean tmp140;
modelica_metatype tmpMeta141;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmpMeta137 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta138 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta137;
_e2 = tmpMeta138;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_e2_1 = omc_Expression_traverseExpBottomUp(threadData, _e2, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp140 = (modelica_boolean)(referenceEq(_e1, _e1_1) && referenceEq(_e2, _e2_1));
if(tmp140)
{
tmpMeta141 = _inExp;
}
else
{
tmpMeta139 = mmc_mk_box3(32, &DAE_Exp_CONS__desc, _e1_1, _e2_1);
tmpMeta141 = tmpMeta139;
}
_e = tmpMeta141;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 30: {
modelica_metatype tmpMeta142;
modelica_metatype tmpMeta143;
modelica_boolean tmp144;
modelica_metatype tmpMeta145;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta142 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta142;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp144 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp144)
{
tmpMeta145 = _inExp;
}
else
{
tmpMeta143 = mmc_mk_box2(31, &DAE_Exp_LIST__desc, _expl_1);
tmpMeta145 = tmpMeta143;
}
_e = tmpMeta145;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta146;
modelica_metatype tmpMeta147;
modelica_boolean tmp148;
modelica_metatype tmpMeta149;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmpMeta146 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta146;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp148 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp148)
{
tmpMeta149 = _inExp;
}
else
{
tmpMeta147 = mmc_mk_box2(33, &DAE_Exp_META__TUPLE__desc, _expl_1);
tmpMeta149 = tmpMeta147;
}
_e = tmpMeta149;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta150;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta150 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (!optionNone(tmpMeta150)) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta151;
modelica_metatype tmpMeta152;
modelica_metatype tmpMeta153;
modelica_boolean tmp154;
modelica_metatype tmpMeta155;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmpMeta151 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (optionNone(tmpMeta151)) goto tmp3_end;
tmpMeta152 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta151), 1));
_e1 = tmpMeta152;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp154 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp154)
{
tmpMeta155 = _inExp;
}
else
{
tmpMeta153 = mmc_mk_box2(34, &DAE_Exp_META__OPTION__desc, mmc_mk_some(_e1_1));
tmpMeta155 = tmpMeta153;
}
_e = tmpMeta155;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta156;
modelica_metatype tmpMeta157;
modelica_boolean tmp158;
modelica_metatype tmpMeta159;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta156 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta156;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp158 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp158)
{
tmpMeta159 = _inExp;
}
else
{
tmpMeta157 = mmc_mk_box2(37, &DAE_Exp_BOX__desc, _e1_1);
tmpMeta159 = tmpMeta157;
}
_e = tmpMeta159;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 35: {
modelica_metatype tmpMeta160;
modelica_metatype tmpMeta161;
modelica_metatype tmpMeta162;
modelica_boolean tmp163;
modelica_metatype tmpMeta164;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,35,2) == 0) goto tmp3_end;
tmpMeta160 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta161 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta160;
_tp = tmpMeta161;
_e1_1 = omc_Expression_traverseExpBottomUp(threadData, _e1, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp163 = (modelica_boolean)referenceEq(_e1, _e1_1);
if(tmp163)
{
tmpMeta164 = _inExp;
}
else
{
tmpMeta162 = mmc_mk_box3(38, &DAE_Exp_UNBOX__desc, _e1_1, _tp);
tmpMeta164 = tmpMeta162;
}
_e = tmpMeta164;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 36: {
modelica_metatype tmpMeta165;
modelica_metatype tmpMeta166;
modelica_metatype tmpMeta167;
modelica_metatype tmpMeta168;
modelica_integer tmp169;
modelica_metatype tmpMeta170;
modelica_metatype tmpMeta171;
modelica_boolean tmp172;
modelica_metatype tmpMeta173;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,32,5) == 0) goto tmp3_end;
tmpMeta165 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta166 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta167 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta168 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp169 = mmc_unbox_integer(tmpMeta168);
tmpMeta170 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_fn = tmpMeta165;
_expl = tmpMeta166;
_fieldNames = tmpMeta167;
_i = tmp169;
_typeVars = tmpMeta170;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
tmp172 = (modelica_boolean)referenceEq(_expl, _expl_1);
if(tmp172)
{
tmpMeta173 = _inExp;
}
else
{
tmpMeta171 = mmc_mk_box6(35, &DAE_Exp_METARECORDCALL__desc, _fn, _expl_1, _fieldNames, mmc_mk_integer(_i), _typeVars);
tmpMeta173 = tmpMeta171;
}
_e = tmpMeta173;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 37: {
modelica_metatype tmpMeta174;
modelica_metatype tmpMeta175;
modelica_metatype tmpMeta176;
modelica_metatype tmpMeta177;
modelica_metatype tmpMeta178;
modelica_metatype tmpMeta179;
modelica_metatype tmpMeta180;
modelica_boolean tmp181;
modelica_metatype tmpMeta182;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta174 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta175 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta176 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta177 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta178 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmpMeta179 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
_matchTy = tmpMeta174;
_expl = tmpMeta175;
_aliases = tmpMeta176;
_localDecls = tmpMeta177;
_cases = tmpMeta178;
_tp = tmpMeta179;
_expl_1 = omc_Expression_traverseExpList(threadData, _expl, ((modelica_fnptr) _inFunc), _inExtArg ,&_ext_arg);
_cases_1 = omc_Patternm_traverseCases(threadData, _cases, ((modelica_fnptr) _inFunc), _ext_arg ,&_ext_arg);
tmp181 = (modelica_boolean)(referenceEq(_expl, _expl_1) && referenceEq(_cases, _cases_1));
if(tmp181)
{
tmpMeta182 = _inExp;
}
else
{
tmpMeta180 = mmc_mk_box7(36, &DAE_Exp_MATCHEXPRESSION__desc, _matchTy, _expl_1, _aliases, _localDecls, _cases_1, _tp);
tmpMeta182 = tmpMeta180;
}
_e = tmpMeta182;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e, _ext_arg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e, _ext_arg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 38: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,36,2) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 39: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,37,1) == 0) goto tmp3_end;
tmpMeta[0+0] = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _inExtArg, &tmpMeta[0+1]) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _inExtArg, &tmpMeta[0+1]);
goto tmp3_done;
}
case 40: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inExtArg;
goto tmp3_done;
}
case 41: {
modelica_metatype tmpMeta183;
_str = omc_ExpressionDump_printExpStr(threadData, _inExp);
tmpMeta183 = stringAppend(_OMC_LIT115,_str);
_str = tmpMeta183;
omc_Error_addInternalError(threadData, _str, _OMC_LIT116);
goto goto_2;
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];
_outExtArg = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outExtArg) { *out_outExtArg = _outExtArg; }
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_containsInitialCall(threadData_t *threadData, modelica_metatype _condition)
{
modelica_boolean _res;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _condition;
{
modelica_metatype _array = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (7 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT75), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_array = tmpMeta8;
tmp1 = omc_List_mapBoolOr(threadData, _array, boxvar_Expression_containsInitialCall);
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:;
}
}
_res = tmp1;
_return: OMC_LABEL_UNUSED
return _res;
}
modelica_metatype boxptr_Expression_containsInitialCall(threadData_t *threadData, modelica_metatype _condition)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_Expression_containsInitialCall(threadData, _condition);
out_res = mmc_mk_icon(_res);
return out_res;
}
DLLExport
modelica_metatype omc_Expression_replaceCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_otpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _otpl = 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 = _inTpl;
{
modelica_metatype _target = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (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_2), 1));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_cr = tmpMeta6;
_cr1 = tmpMeta7;
_target = tmpMeta8;
if (!omc_ComponentReference_crefEqualNoStringCompare(threadData, _cr, _cr1)) goto tmp3_end;
tmpMeta[0+0] = _target;
tmpMeta[0+1] = _inTpl;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTpl;
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];
_otpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_otpl) { *out_otpl = _otpl; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_replaceCrefBottomUp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inSourceExp, modelica_metatype _inTargetExp)
{
modelica_metatype _exp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(0, _inSourceExp, _inTargetExp);
_exp = omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_replaceCref, tmpMeta1, NULL);
_return: OMC_LABEL_UNUSED
return _exp;
}
DLLExport
modelica_metatype omc_Expression_expressionCollector(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _acc, modelica_metatype *out_outExps)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _exp;
tmpMeta1 = mmc_mk_cons(_exp, _acc);
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
if (out_outExps) { *out_outExps = _outExps; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_replaceExpWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_otpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _otpl = NULL;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTpl;
{
modelica_metatype _source = NULL;
modelica_metatype _target = NULL;
modelica_integer _c;
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_integer tmp9;
modelica_metatype tmpMeta10;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp9 = mmc_unbox_integer(tmpMeta8);
_source = tmpMeta6;
_target = tmpMeta7;
_c = tmp9;
if (!omc_Expression_expEqual(threadData, _inExp, _source)) goto tmp3_end;
tmpMeta10 = mmc_mk_box3(0, _source, _target, mmc_mk_integer(((modelica_integer) 1) + _c));
tmpMeta[0+0] = _target;
tmp1_c1 = 0;
tmpMeta[0+2] = tmpMeta10;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inExp;
tmp1_c1 = 1;
tmpMeta[0+2] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_cont = tmp1_c1;
_otpl = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_otpl) { *out_otpl = _otpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_replaceExpWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_otpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_Expression_replaceExpWork(threadData, _inExp, _inTpl, &_cont, out_otpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_replaceExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inSourceExp, modelica_metatype _inTargetExp)
{
modelica_metatype _out = NULL;
modelica_metatype _exp = NULL;
modelica_integer _i;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta4 = mmc_mk_box3(0, _inSourceExp, _inTargetExp, mmc_mk_integer(((modelica_integer) 0)));
tmpMeta5 = omc_Expression_traverseExpTopDown(threadData, _inExp, boxvar_Expression_replaceExpWork, tmpMeta4, &tmpMeta1);
_exp = tmpMeta5;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
tmp3 = mmc_unbox_integer(tmpMeta2);
_i = tmp3;
tmpMeta6 = mmc_mk_box2(0, _exp, mmc_mk_integer(_i));
_out = tmpMeta6;
_return: OMC_LABEL_UNUSED
return _out;
}
DLLExport
modelica_metatype omc_Expression_replaceExpTpl(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _tpl, 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
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _tpl;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _s = NULL;
modelica_metatype _t = 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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_e = tmp4_1;
_s = tmpMeta6;
_t = tmpMeta7;
tmpMeta8 = omc_Expression_replaceExp(threadData, _e, _s, _t);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
_e1 = tmpMeta9;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _tpl;
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];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_concatArrayType(threadData_t *threadData, modelica_metatype _arrayType1, modelica_metatype _arrayType2)
{
modelica_metatype _concatType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _arrayType1;
tmp4_2 = _arrayType2;
{
modelica_metatype _et = NULL;
modelica_metatype _dim1 = NULL;
modelica_metatype _dim2 = NULL;
modelica_metatype _dims1 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmpMeta10);
tmpMeta12 = MMC_CDR(tmpMeta10);
_et = tmpMeta6;
_dim1 = tmpMeta8;
_dims1 = tmpMeta9;
_dim2 = tmpMeta11;
_dim1 = omc_Expression_dimensionsAdd(threadData, _dim1, _dim2);
tmpMeta13 = mmc_mk_cons(_dim1, _dims1);
tmpMeta14 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _et, tmpMeta13);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_concatType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _concatType;
}
DLLExport
modelica_metatype omc_Expression_dimensionsAdd(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_metatype _res = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 2; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
_res = omc_Expression_intDimension(threadData, omc_Expression_dimensionSize(threadData, _dim1) + omc_Expression_dimensionSize(threadData, _dim2));
goto tmp2_done;
}
case 1: {
_res = _OMC_LIT117;
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 _res;
}
DLLExport
modelica_metatype omc_Expression_dimensionsMult(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_metatype _res = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = omc_Expression_intDimension(threadData, (omc_Expression_dimensionSize(threadData, _dim1)) * (omc_Expression_dimensionSize(threadData, _dim2)));
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_makeVar(threadData_t *threadData, modelica_string _name, modelica_metatype _tp)
{
modelica_metatype _v = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box7(3, &DAE_Var_TYPES__VAR__desc, _name, _OMC_LIT124, _tp, _OMC_LIT125, mmc_mk_boolean(0), mmc_mk_none());
_v = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _v;
}
DLLExport
modelica_metatype omc_Expression_makeIndexSubscript(threadData_t *threadData, modelica_metatype _exp)
{
modelica_metatype _subscript = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _exp);
_subscript = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _subscript;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_arrayFill2(threadData_t *threadData, modelica_metatype _iDims, modelica_metatype _inExp)
{
modelica_metatype _oExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _iDims;
{
modelica_integer _i;
modelica_metatype _d = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _arrexp = NULL;
modelica_metatype _dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta7)) goto tmp3_end;
_d = tmpMeta6;
_ty = omc_Expression_typeof(threadData, _inExp);
_i = omc_Expression_dimensionSize(threadData, _d);
_expl = omc_List_fill(threadData, _inExp, _i);
tmpMeta9 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_i));
tmpMeta8 = mmc_mk_cons(tmpMeta9, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta10 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta8);
tmpMeta11 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta10, mmc_mk_boolean(1), _expl);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
_d = tmpMeta12;
_dims = tmpMeta13;
tmpMeta14 = mmc_mk_cons(_d, MMC_REFSTRUCTLIT(mmc_nil));
_arrexp = omc_Expression_arrayFill2(threadData, tmpMeta14, _inExp);
_iDims = _dims;
_inExp = _arrexp;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oExp;
}
DLLExport
modelica_metatype omc_Expression_arrayFill(threadData_t *threadData, modelica_metatype _dims, modelica_metatype _inExp)
{
modelica_metatype _oExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dims;
{
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 = _inExp;
goto tmp3_done;
}
case 1: {
tmpMeta1 = omc_Expression_arrayFill2(threadData, _dims, _inExp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_listToArray3(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _iDim)
{
modelica_metatype _oExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inList;
tmp4_2 = _iDim;
{
modelica_integer _i;
modelica_metatype _d = NULL;
modelica_metatype _explst = NULL;
modelica_metatype _restexps = NULL;
modelica_metatype _restarr = NULL;
modelica_metatype _arrexp = 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;
_d = tmp4_2;
_i = omc_Expression_dimensionSize(threadData, _d);
if((_i > listLength(_inList)))
{
omc_Error_addMessage(threadData, _OMC_LIT31, _OMC_LIT127);
goto goto_2;
}
else
{
_explst = omc_List_split(threadData, _inList, _i ,&_restexps);
_arrexp = omc_Expression_makeArrayFromList(threadData, _explst);
_restarr = omc_Expression_listToArray3(threadData, _restexps, _d);
}
tmpMeta7 = mmc_mk_cons(_arrexp, _restarr);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oExps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_listToArray2(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _iDims, modelica_metatype _inType)
{
modelica_metatype _oExp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _iDims;
{
modelica_integer _i;
modelica_metatype _d = NULL;
modelica_metatype _explst = NULL;
modelica_metatype _dims = NULL;
modelica_boolean _is_scalar;
modelica_metatype _ty = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 2; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_CAR(tmp3_1);
tmpMeta6 = MMC_CDR(tmp3_1);
if (!listEmpty(tmpMeta6)) goto tmp2_end;
_d = tmpMeta5;
_is_scalar = (!omc_Types_isArray(threadData, _inType));
if(omc_Expression_dimensionKnown(threadData, _d))
{
_i = omc_Expression_dimensionSize(threadData, _d);
if((_i != listLength(_inList)))
{
omc_Error_addMessage(threadData, _OMC_LIT31, _OMC_LIT129);
goto goto_1;
}
else
{
tmpMeta7 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(listLength(_inList)));
_ty = omc_Expression_liftArrayR(threadData, _inType, tmpMeta7);
tmpMeta8 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(_is_scalar), _inList);
_oExp = tmpMeta8;
}
}
else
{
_ty = omc_Expression_liftArrayR(threadData, _inType, _d);
tmpMeta9 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(_is_scalar), _inList);
_oExp = tmpMeta9;
}
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta10 = MMC_CAR(tmp3_1);
tmpMeta11 = MMC_CDR(tmp3_1);
_d = omc_List_splitLast(threadData, _iDims ,&_dims);
_explst = omc_Expression_listToArray3(threadData, _inList, _d);
tmpMeta12 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(listLength(_explst)));
_ty = omc_Expression_liftArrayR(threadData, _inType, tmpMeta12);
_oExp = omc_Expression_listToArray2(threadData, _explst, _dims, _ty);
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 _oExp;
}
DLLExport
modelica_metatype omc_Expression_listToArray(threadData_t *threadData, modelica_metatype _inList, modelica_metatype _dims)
{
modelica_metatype _oExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inList;
tmp4_2 = _dims;
{
modelica_metatype _ty = NULL;
modelica_metatype _exp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
omc_Error_addMessage(threadData, _OMC_LIT31, _OMC_LIT131);
goto goto_2;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 1;
omc_Error_addMessage(threadData, _OMC_LIT31, _OMC_LIT133);
goto goto_2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_exp = tmpMeta6;
_ty = omc_Expression_typeof(threadData, _exp);
tmpMeta1 = omc_Expression_listToArray2(threadData, _inList, _dims, _ty);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_oExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oExp;
}
DLLExport
modelica_metatype omc_Expression_makeOneExpression(threadData_t *threadData, modelica_metatype _inDims, modelica_metatype *out_outType)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDims;
{
modelica_integer _i;
modelica_metatype _d = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _e = NULL;
modelica_metatype _eLst = NULL;
modelica_metatype _ty = NULL;
modelica_boolean _scalar;
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;
tmpMeta[0+0] = _OMC_LIT6;
tmpMeta[0+1] = _OMC_LIT134;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_d = tmpMeta6;
_dims = tmpMeta7;
_i = omc_Expression_dimensionSize(threadData, _d);
_e = omc_Expression_makeOneExpression(threadData, _dims ,&_ty);
_eLst = omc_List_fill(threadData, _e, _i);
_scalar = listEmpty(_dims);
tmpMeta8 = mmc_mk_cons(_d, _dims);
tmpMeta9 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _OMC_LIT134, tmpMeta8);
tmpMeta10 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta9, mmc_mk_boolean(_scalar), _eLst);
tmpMeta11 = mmc_mk_cons(_d, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta12 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta11);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = tmpMeta12;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_outType = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outType) { *out_outType = _outType; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeZeroExpression(threadData_t *threadData, modelica_metatype _inDims, modelica_metatype *out_outType)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDims;
{
modelica_integer _i;
modelica_metatype _d = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _e = NULL;
modelica_metatype _eLst = NULL;
modelica_metatype _ty = NULL;
modelica_boolean _scalar;
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;
tmpMeta[0+0] = _OMC_LIT135;
tmpMeta[0+1] = _OMC_LIT134;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_d = tmpMeta6;
_dims = tmpMeta7;
_i = omc_Expression_dimensionSize(threadData, _d);
_e = omc_Expression_makeZeroExpression(threadData, _dims ,&_ty);
_eLst = omc_List_fill(threadData, _e, _i);
_scalar = listEmpty(_dims);
tmpMeta8 = mmc_mk_cons(_d, _dims);
tmpMeta9 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _OMC_LIT134, tmpMeta8);
tmpMeta10 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta9, mmc_mk_boolean(_scalar), _eLst);
tmpMeta11 = mmc_mk_cons(_d, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta12 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta11);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = tmpMeta12;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_outType = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outType) { *out_outType = _outType; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_createZeroExpression(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _typeLst = NULL;
modelica_metatype _expLst = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _path = NULL;
modelica_metatype _varLst = NULL;
modelica_metatype _varNames = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!omc_Expression_isIntegerOrReal(threadData, _inType)) goto tmp3_end;
tmpMeta1 = omc_Expression_makeConstZero(threadData, _inType);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_typeLst = tmpMeta6;
_expLst = omc_List_map(threadData, _typeLst, boxvar_Expression_createZeroExpression);
tmpMeta7 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _expLst);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_dims = tmpMeta8;
tmpMeta1 = omc_Expression_makeZeroExpression(threadData, _dims, NULL);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta10;
_varLst = tmpMeta11;
{
modelica_metatype __omcQ_24tmpVar17;
modelica_metatype* tmp13;
modelica_metatype tmpMeta14;
modelica_metatype __omcQ_24tmpVar16;
modelica_integer tmp15;
modelica_metatype _v_loopVar = 0;
modelica_metatype _v;
_v_loopVar = _varLst;
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar17 = tmpMeta14;
tmp13 = &__omcQ_24tmpVar17;
while(1) {
tmp15 = 1;
if (!listEmpty(_v_loopVar)) {
_v = MMC_CAR(_v_loopVar);
_v_loopVar = MMC_CDR(_v_loopVar);
tmp15--;
}
if (tmp15 == 0) {
__omcQ_24tmpVar16 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 4)));
*tmp13 = mmc_mk_cons(__omcQ_24tmpVar16,0);
tmp13 = &MMC_CDR(*tmp13);
} else if (tmp15 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp13 = mmc_mk_nil();
tmpMeta12 = __omcQ_24tmpVar17;
}
_typeLst = tmpMeta12;
_expLst = omc_List_map(threadData, _typeLst, boxvar_Expression_createZeroExpression);
_varNames = omc_List_map(threadData, _varLst, boxvar_Expression_varName);
tmp16 = (listLength(_varNames) == listLength(_expLst));
if (1 != tmp16) goto goto_2;
tmpMeta17 = mmc_mk_box5(17, &DAE_Exp_RECORD__desc, _path, _expLst, _varNames, _inType);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeRealArrayOfZeros(threadData_t *threadData, modelica_integer _inDimension)
{
modelica_metatype _outExp = NULL;
modelica_metatype _l = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_l = omc_Expression_makeListOfZeros(threadData, _inDimension);
_outExp = omc_Expression_makeRealArray(threadData, _l);
_return: OMC_LABEL_UNUSED
return _outExp;
}
modelica_metatype boxptr_Expression_makeRealArrayOfZeros(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inDimension);
_outExp = omc_Expression_makeRealArrayOfZeros(threadData, tmp1);
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeListOfZeros(threadData_t *threadData, modelica_integer _inDimension)
{
modelica_metatype _outList = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
modelica_integer tmp4;
modelica_integer tmp5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outList = tmpMeta1;
if((_inDimension > ((modelica_integer) 0)))
{
tmp3 = ((modelica_integer) 1); tmp4 = 1; tmp5 = _inDimension;
if(!(((tmp4 > 0) && (tmp3 > tmp5)) || ((tmp4 < 0) && (tmp3 < tmp5))))
{
modelica_integer _i;
for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp3, tmp5); _i += tmp4)
{
tmpMeta2 = mmc_mk_cons(_OMC_LIT135, _outList);
_outList = tmpMeta2;
}
}
}
_return: OMC_LABEL_UNUSED
return _outList;
}
modelica_metatype boxptr_Expression_makeListOfZeros(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_integer tmp1;
modelica_metatype _outList = NULL;
modelica_metatype tmpMeta2;
tmp1 = mmc_unbox_integer(_inDimension);
_outList = omc_Expression_makeListOfZeros(threadData, tmp1);
return _outList;
}
DLLExport
modelica_metatype omc_Expression_makeConstZeroE(threadData_t *threadData, modelica_metatype _iExp)
{
modelica_metatype _const = NULL;
modelica_metatype _tp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_tp = omc_Expression_typeof(threadData, _iExp);
_const = omc_Expression_makeConstZero(threadData, _tp);
_return: OMC_LABEL_UNUSED
return _const;
}
DLLExport
modelica_metatype omc_Expression_makeConstNumber(threadData_t *threadData, modelica_metatype _ty, modelica_integer _n)
{
modelica_metatype _exp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ty;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_n));
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
tmpMeta7 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(((modelica_real)_n)));
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _exp;
}
modelica_metatype boxptr_Expression_makeConstNumber(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _n)
{
modelica_integer tmp1;
modelica_metatype _exp = NULL;
tmp1 = mmc_unbox_integer(_n);
_exp = omc_Expression_makeConstNumber(threadData, _ty, tmp1);
return _exp;
}
DLLExport
modelica_metatype omc_Expression_makeConstZero(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _const = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
tmpMeta1 = _OMC_LIT135;
goto tmp3_done;
}
case 3: {
tmpMeta1 = _OMC_LIT136;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _OMC_LIT135;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_const = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _const;
}
DLLExport
modelica_metatype omc_Expression_makeConstOne(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT4;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT6;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _OMC_LIT6;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeBoolExp(threadData_t *threadData, modelica_boolean _b)
{
modelica_metatype _e = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(6, &DAE_Exp_BCONST__desc, mmc_mk_boolean(_b));
_e = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _e;
}
modelica_metatype boxptr_Expression_makeBoolExp(threadData_t *threadData, modelica_metatype _b)
{
modelica_integer tmp1;
modelica_metatype _e = NULL;
tmp1 = mmc_unbox_integer(_b);
_e = omc_Expression_makeBoolExp(threadData, tmp1);
return _e;
}
DLLExport
modelica_metatype omc_Expression_makeRealExp(threadData_t *threadData, modelica_real _r)
{
modelica_metatype _e = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r));
_e = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _e;
}
modelica_metatype boxptr_Expression_makeRealExp(threadData_t *threadData, modelica_metatype _r)
{
modelica_real tmp1;
modelica_metatype _e = NULL;
tmp1 = mmc_unbox_real(_r);
_e = omc_Expression_makeRealExp(threadData, tmp1);
return _e;
}
DLLExport
modelica_metatype omc_Expression_makeIntegerExp(threadData_t *threadData, modelica_integer _i)
{
modelica_metatype _e = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
_e = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _e;
}
modelica_metatype boxptr_Expression_makeIntegerExp(threadData_t *threadData, modelica_metatype _i)
{
modelica_integer tmp1;
modelica_metatype _e = NULL;
tmp1 = mmc_unbox_integer(_i);
_e = omc_Expression_makeIntegerExp(threadData, tmp1);
return _e;
}
DLLExport
modelica_metatype omc_Expression_makeAsubAddIndex(threadData_t *threadData, modelica_metatype _e, modelica_integer _indx)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _e;
{
modelica_metatype tmp4_1;
tmp4_1 = _outExp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta8 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_indx));
tmpMeta7 = mmc_mk_cons(tmpMeta8, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta6 = MMC_TAGPTR(mmc_alloc_words(4));
memcpy(MMC_UNTAGPTR(tmpMeta6), MMC_UNTAGPTR(_outExp), 4*sizeof(modelica_metatype));
((modelica_metatype*)MMC_UNTAGPTR(tmpMeta6))[3] = listAppend((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_outExp), 3))), tmpMeta7);
_outExp = tmpMeta6;
tmpMeta1 = _outExp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
tmpMeta10 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_indx));
tmpMeta9 = mmc_mk_cons(tmpMeta10, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = omc_Expression_makeASUB(threadData, _e, tmpMeta9);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
modelica_metatype boxptr_Expression_makeAsubAddIndex(threadData_t *threadData, modelica_metatype _e, modelica_metatype _indx)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_indx);
_outExp = omc_Expression_makeAsubAddIndex(threadData, _e, tmp1);
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeDivVector(threadData_t *threadData, modelica_metatype _v, modelica_metatype _e1)
{
modelica_metatype _res = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = omc_List_map1(threadData, _v, boxvar_Expression_makeDiv, _e1);
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_makeDiv(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _res = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!(omc_Expression_isZero(threadData, _e1) && (!omc_Expression_isZero(threadData, _e2)))) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 1: {
if (!omc_Expression_isOne(threadData, _e2)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 2: {
tmpMeta1 = omc_Expression_expDiv(threadData, _e1, _e2);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_res = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_expDiv(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype _tp = NULL;
modelica_boolean _b;
modelica_metatype _op = NULL;
modelica_boolean tmp1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_boolean tmp4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_tp = omc_Expression_typeof(threadData, _e1);
tmp1 = omc_Types_isIntegerOrRealOrSubTypeOfEither(threadData, _tp);
if (1 != tmp1) MMC_THROW_INTERNAL();
_b = omc_DAEUtil_expTypeArray(threadData, _tp);
tmp4 = (modelica_boolean)_b;
if(tmp4)
{
tmpMeta2 = mmc_mk_box2(13, &DAE_Operator_DIV__ARR__desc, _tp);
tmpMeta5 = tmpMeta2;
}
else
{
tmpMeta3 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _tp);
tmpMeta5 = tmpMeta3;
}
_op = tmpMeta5;
tmpMeta6 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
_outExp = tmpMeta6;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_checkIfOther(threadData_t *threadData, modelica_metatype _inTp)
{
modelica_metatype _outTp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT134;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inTp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outTp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outTp;
}
DLLExport
modelica_metatype omc_Expression_makeProductLst(threadData_t *threadData, modelica_metatype _inExpLst)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExpLst;
{
modelica_metatype _e1 = NULL;
modelica_metatype _res = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _p1 = NULL;
modelica_metatype _es = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _lst = NULL;
modelica_metatype _tp = NULL;
modelica_metatype _explst = NULL;
modelica_string _str = NULL;
modelica_boolean _b_isZero;
modelica_boolean _b1;
modelica_boolean _b2;
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 (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 11;
tmpMeta1 = _OMC_LIT6;
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 (!listEmpty(tmpMeta7)) goto tmp3_end;
_e1 = tmpMeta6;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
_e = tmpMeta8;
_es = tmpMeta9;
tmp10 = omc_Expression_isConstOne(threadData, _e);
if (1 != tmp10) goto goto_2;
tmpMeta1 = omc_Expression_makeProductLst(threadData, _es);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,7,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,3,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 4));
_e = tmpMeta14;
tmp15 = omc_Expression_isZero(threadData, _e);
if (1 != tmp15) goto goto_2;
goto goto_2;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_boolean tmp22;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmp4_1);
tmpMeta17 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta17)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmpMeta17);
tmpMeta19 = MMC_CDR(tmpMeta17);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,7,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,3,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 4));
if (!listEmpty(tmpMeta19)) goto tmp3_end;
_e = tmpMeta21;
tmp22 = omc_Expression_isZero(threadData, _e);
if (1 != tmp22) goto goto_2;
goto goto_2;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_boolean tmp25;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta23 = MMC_CAR(tmp4_1);
tmpMeta24 = MMC_CDR(tmp4_1);
_e = tmpMeta23;
tmp25 = omc_Expression_isZero(threadData, _e);
if (1 != tmp25) goto goto_2;
tmpMeta1 = _e;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_boolean tmp34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmp4_1);
tmpMeta27 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,7,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,3,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 4));
if (listEmpty(tmpMeta27)) goto tmp3_end;
tmpMeta32 = MMC_CAR(tmpMeta27);
tmpMeta33 = MMC_CDR(tmpMeta27);
if (!listEmpty(tmpMeta33)) goto tmp3_end;
_e1 = tmpMeta28;
_tp = tmpMeta30;
_e = tmpMeta31;
_e2 = tmpMeta32;
tmp34 = omc_Expression_isConstOne(threadData, _e1);
if (1 != tmp34) goto goto_2;
tmpMeta35 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _tp);
tmpMeta36 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e2, tmpMeta35, _e);
tmpMeta1 = tmpMeta36;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_boolean tmp45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta37 = MMC_CAR(tmp4_1);
tmpMeta38 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta38)) goto tmp3_end;
tmpMeta39 = MMC_CAR(tmpMeta38);
tmpMeta40 = MMC_CDR(tmpMeta38);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,7,3) == 0) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta42,3,1) == 0) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 2));
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 4));
if (!listEmpty(tmpMeta40)) goto tmp3_end;
_e2 = tmpMeta37;
_e1 = tmpMeta41;
_tp = tmpMeta43;
_e = tmpMeta44;
tmp45 = omc_Expression_isConstOne(threadData, _e1);
if (1 != tmp45) goto goto_2;
tmpMeta46 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _tp);
tmpMeta47 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e2, tmpMeta46, _e);
tmpMeta1 = tmpMeta47;
goto tmp3_done;
}
case 8: {
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;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta48 = MMC_CAR(tmp4_1);
tmpMeta49 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta48,7,3) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta51,3,1) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta51), 2));
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 4));
_e1 = tmpMeta50;
_tp = tmpMeta52;
_e = tmpMeta53;
_es = tmpMeta49;
tmp54 = omc_Expression_isConstOne(threadData, _e1);
if (1 != tmp54) goto goto_2;
_p1 = omc_Expression_makeProductLst(threadData, _es);
tmpMeta55 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _tp);
tmpMeta56 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _p1, tmpMeta55, _e);
_res = tmpMeta56;
_b_isZero = omc_Expression_isZero(threadData, _p1);
tmpMeta1 = (_b_isZero?omc_Expression_makeConstZero(threadData, omc_Expression_typeof(threadData, _e)):_res);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_boolean tmp61;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta57 = MMC_CAR(tmp4_1);
tmpMeta58 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta58)) goto tmp3_end;
tmpMeta59 = MMC_CAR(tmpMeta58);
tmpMeta60 = MMC_CDR(tmpMeta58);
if (!listEmpty(tmpMeta60)) goto tmp3_end;
_e1 = tmpMeta57;
_e2 = tmpMeta59;
tmp61 = omc_Expression_isConstOne(threadData, _e2);
if (1 != tmp61) goto goto_2;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta62 = MMC_CAR(tmp4_1);
tmpMeta63 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta63)) goto tmp3_end;
tmpMeta64 = MMC_CAR(tmpMeta63);
tmpMeta65 = MMC_CDR(tmpMeta63);
if (!listEmpty(tmpMeta65)) goto tmp3_end;
_e1 = tmpMeta62;
_e2 = tmpMeta64;
_b1 = omc_Expression_isZero(threadData, _e1);
_b2 = omc_Expression_isZero(threadData, _e2);
_b_isZero = (_b1 || _b2);
_tp = omc_Expression_typeof(threadData, _e1);
_tp = omc_Expression_checkIfOther(threadData, _tp);
tmpMeta66 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta67 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta66, _e2);
_res = tmpMeta67;
tmpMeta1 = (_b_isZero?omc_Expression_makeConstZero(threadData, _tp):_res);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta68 = MMC_CAR(tmp4_1);
tmpMeta69 = MMC_CDR(tmp4_1);
_e1 = tmpMeta68;
_rest = tmpMeta69;
_e2 = omc_Expression_makeProductLst(threadData, _rest);
_tp = omc_Expression_typeof(threadData, _e1);
_tp = omc_Expression_checkIfOther(threadData, _tp);
tmpMeta70 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta71 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta70, _e2);
_res = tmpMeta71;
_b1 = omc_Expression_isZero(threadData, _e1);
_b2 = omc_Expression_isZero(threadData, _e2);
_b_isZero = (_b1 || _b2);
tmpMeta1 = (_b_isZero?omc_Expression_makeConstZero(threadData, omc_Expression_typeof(threadData, _e1)):_res);
goto tmp3_done;
}
case 12: {
modelica_boolean tmp72;
_lst = tmp4_1;
tmp72 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp72) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT137);
_explst = omc_List_map(threadData, _lst, boxvar_ExpressionDump_printExpStr);
_str = stringDelimitList(_explst, _OMC_LIT138);
omc_Debug_traceln(threadData, _str);
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 < 13) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeProduct(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _product = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_e1, mmc_mk_cons(_e2, MMC_REFSTRUCTLIT(mmc_nil)));
_product = omc_Expression_makeProductLst(threadData, tmpMeta1);
_return: OMC_LABEL_UNUSED
return _product;
}
DLLExport
modelica_metatype omc_Expression_subVec(threadData_t *threadData, modelica_metatype _v, modelica_metatype _w)
{
modelica_metatype _y = NULL;
modelica_integer _size1;
modelica_integer _size2;
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer tmp3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_size1 = arrayLength(_v);
_size2 = arrayLength(_w);
if((_size1 != _size2))
{
fputs(MMC_STRINGDATA(_OMC_LIT139),stdout);
goto _return;
}
_y = arrayCreate(_size1, _OMC_LIT135);
tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = _size1;
if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
{
modelica_integer _i;
for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
{
arrayUpdate(_y, _i, omc_Expression_expSub(threadData, arrayGet(_v, _i), arrayGet(_w, _i)));
}
}
_return: OMC_LABEL_UNUSED
return _y;
}
DLLExport
modelica_metatype omc_Expression_addVec(threadData_t *threadData, modelica_metatype _v, modelica_metatype _w)
{
modelica_metatype _y = NULL;
modelica_integer _size1;
modelica_integer _size2;
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer tmp3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_size1 = arrayLength(_v);
_size2 = arrayLength(_w);
if((_size1 != _size2))
{
fputs(MMC_STRINGDATA(_OMC_LIT139),stdout);
goto _return;
}
_y = arrayCreate(_size1, _OMC_LIT135);
tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = _size1;
if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
{
modelica_integer _i;
for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
{
arrayUpdate(_y, _i, omc_Expression_expAdd(threadData, arrayGet(_v, _i), arrayGet(_w, _i)));
}
}
_return: OMC_LABEL_UNUSED
return _y;
}
DLLExport
modelica_metatype omc_Expression_lenVec(threadData_t *threadData, modelica_metatype _v)
{
modelica_metatype _len = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_len = omc_Expression_makeScalarProduct(threadData, _v, _v);
tmpMeta1 = mmc_mk_cons(_len, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta2 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT140, tmpMeta1, _OMC_LIT141);
_len = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _len;
}
DLLExport
modelica_metatype omc_Expression_makeScalarProduct(threadData_t *threadData, modelica_metatype _v, modelica_metatype _w)
{
modelica_metatype _s = NULL;
modelica_integer _size1;
modelica_integer _size2;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_s = _OMC_LIT135;
_size1 = arrayLength(_v);
_size2 = arrayLength(_w);
if((_size1 != _size2))
{
fputs(MMC_STRINGDATA(_OMC_LIT142),stdout);
goto _return;
}
{
modelica_metatype __omcQ_24tmpVar19;
modelica_metatype* tmp2;
modelica_metatype tmpMeta3;
modelica_metatype __omcQ_24tmpVar18;
modelica_integer tmp4;
modelica_integer tmp5;
modelica_integer tmp6;
modelica_integer _i;
tmp5 = 1;
tmp6 = _size1;
_i = ((modelica_integer) 1);
_i = (((modelica_integer) 1) /* Range start-value */)-tmp5;
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar19 = tmpMeta3;
tmp2 = &__omcQ_24tmpVar19;
while(1) {
tmp4 = 1;
if (tmp5 > 0 ? _i+tmp5 <= tmp6 : _i+tmp5 >= tmp6) {
_i += tmp5;
tmp4--;
}
if (tmp4 == 0) {
__omcQ_24tmpVar18 = omc_Expression_expMul(threadData, arrayGet(_v, _i), arrayGet(_w, _i));
*tmp2 = mmc_mk_cons(__omcQ_24tmpVar18,0);
tmp2 = &MMC_CDR(*tmp2);
} else if (tmp4 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
*tmp2 = mmc_mk_nil();
tmpMeta1 = __omcQ_24tmpVar19;
}
_s = omc_Expression_makeSum1(threadData, tmpMeta1, 0);
_s = omc_ExpressionSimplify_simplify(threadData, _s, NULL);
_return: OMC_LABEL_UNUSED
return _s;
}
DLLExport
modelica_metatype omc_Expression_makeProductVector(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _v)
{
modelica_metatype _res = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = omc_List_map1(threadData, _v, boxvar_Expression_makeProduct, _e1);
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_expOptMinScalar(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _e1;
tmp4_2 = _e2;
{
modelica_metatype _e11 = NULL;
modelica_metatype _e22 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_2)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 1: {
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_e11 = tmpMeta6;
_e22 = tmpMeta7;
tmpMeta1 = mmc_mk_some(omc_Expression_expMinScalar(threadData, _e11, _e22));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expMinScalar(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype _tp = NULL;
modelica_boolean _b;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_tp = omc_Expression_typeof(threadData, _e1);
tmpMeta1 = mmc_mk_cons(_e1, mmc_mk_cons(_e2, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta2 = mmc_mk_box8(3, &DAE_CallAttributes_CALL__ATTR__desc, _tp, mmc_mk_boolean(0), mmc_mk_boolean(1), mmc_mk_boolean(0), mmc_mk_boolean(0), _OMC_LIT43, _OMC_LIT44);
tmpMeta3 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT144, tmpMeta1, tmpMeta2);
_outExp = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expOptMaxScalar(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _e1;
tmp4_2 = _e2;
{
modelica_metatype _e11 = NULL;
modelica_metatype _e22 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!optionNone(tmp4_2)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 1: {
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_e11 = tmpMeta6;
_e22 = tmpMeta7;
tmpMeta1 = mmc_mk_some(omc_Expression_expMaxScalar(threadData, _e11, _e22));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expMaxScalar(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype _tp = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_tp = omc_Expression_typeof(threadData, _e1);
tmpMeta1 = mmc_mk_cons(_e1, mmc_mk_cons(_e2, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta2 = mmc_mk_box8(3, &DAE_CallAttributes_CALL__ATTR__desc, _tp, mmc_mk_boolean(0), mmc_mk_boolean(1), mmc_mk_boolean(0), mmc_mk_boolean(0), _OMC_LIT43, _OMC_LIT44);
tmpMeta3 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT146, tmpMeta1, tmpMeta2);
_outExp = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expPowLst(threadData_t *threadData, modelica_metatype _expLst, modelica_metatype _n)
{
modelica_metatype _outExp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_List_map1(threadData, _expLst, boxvar_Expression_expPow, _n);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expPow(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _e1;
tmp4_2 = _e2;
{
modelica_metatype _tp = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _e4 = NULL;
modelica_metatype _e5 = NULL;
modelica_boolean _b;
modelica_metatype _op = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!omc_Expression_isOne(threadData, _e2)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 1: {
if (!omc_Expression_isZero(threadData, _e2)) goto tmp3_end;
tmpMeta1 = omc_Expression_makeConstOne(threadData, omc_Expression_typeof(threadData, _e1));
goto tmp3_done;
}
case 2: {
if (!omc_Expression_isConstOne(threadData, _e1)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 3: {
if (!(omc_Expression_isZero(threadData, _e1) && omc_Expression_expIsPositive(threadData, _e2))) goto tmp3_end;
tmpMeta1 = omc_Expression_makeConstZero(threadData, omc_Expression_typeof(threadData, _e1));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
if (!omc_Expression_isEven(threadData, _e2)) goto tmp3_end;
_e1 = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 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,3,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,5,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e3 = tmpMeta8;
_e4 = tmpMeta10;
_e5 = tmpMeta12;
_e = omc_Expression_makeDiv(threadData, _e4, _e3);
_e1 = _e;
_e2 = _e5;
goto _tailrecursive;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,3,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e3 = tmpMeta13;
_e4 = tmpMeta15;
if (!omc_Expression_isNegativeOrZero(threadData, _e2)) goto tmp3_end;
_e1 = omc_Expression_makeDiv(threadData, _e4, _e3);
_e2 = omc_Expression_negate(threadData, _e2);
goto _tailrecursive;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (!omc_Expression_isHalf(threadData, _e2)) goto tmp3_end;
tmpMeta16 = mmc_mk_cons(_e1, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta17 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT140, tmpMeta16, _OMC_LIT141);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
_tp = omc_Expression_typeof(threadData, _e1);
_b = omc_DAEUtil_expTypeArray(threadData, _tp);
tmp20 = (modelica_boolean)_b;
if(tmp20)
{
tmpMeta18 = mmc_mk_box2(23, &DAE_Operator_POW__ARR__desc, _tp);
tmpMeta21 = tmpMeta18;
}
else
{
tmpMeta19 = mmc_mk_box2(7, &DAE_Operator_POW__desc, _tp);
tmpMeta21 = tmpMeta19;
}
_op = tmpMeta21;
tmpMeta22 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expMul(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _e1;
tmp4_2 = _e2;
{
modelica_metatype _tp = NULL;
modelica_boolean _b1;
modelica_boolean _b2;
modelica_metatype _op = NULL;
modelica_real _r1;
modelica_real _r2;
modelica_integer _i1;
modelica_integer _i2;
modelica_metatype _e1_1 = NULL;
modelica_metatype _e2_1 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
tmp6 = omc_Expression_isZero(threadData, _e1);
if (1 != tmp6) goto goto_2;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp7;
tmp7 = omc_Expression_isZero(threadData, _e2);
if (1 != tmp7) goto goto_2;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_real tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
if (1.0 != tmp9) goto tmp3_end;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_real tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp11 = mmc_unbox_real(tmpMeta10);
if (1.0 != tmp11) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta12;
modelica_integer tmp13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp13 = mmc_unbox_integer(tmpMeta12);
if (1 != tmp13) goto tmp3_end;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta14;
modelica_integer tmp15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp15 = mmc_unbox_integer(tmpMeta14);
if (1 != tmp15) goto tmp3_end;
tmp4 += 1;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta16;
modelica_real tmp17;
modelica_metatype tmpMeta18;
modelica_real tmp19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp17 = mmc_unbox_real(tmpMeta16);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp19 = mmc_unbox_real(tmpMeta18);
_r1 = tmp17;
_r2 = tmp19;
tmp4 += 1;
_r1 = (_r1) * (_r2);
tmpMeta20 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r1));
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta21;
modelica_integer tmp22;
modelica_metatype tmpMeta23;
modelica_integer tmp24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp22 = mmc_unbox_integer(tmpMeta21);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp24 = mmc_unbox_integer(tmpMeta23);
_i1 = tmp22;
_i2 = tmp24;
_i1 = (_i1) * (_i2);
tmpMeta25 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i1));
tmpMeta1 = tmpMeta25;
goto tmp3_done;
}
case 8: {
modelica_boolean tmp26;
modelica_boolean tmp27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_boolean tmp31;
modelica_metatype tmpMeta32;
modelica_boolean tmp33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
_tp = omc_Expression_typeof(threadData, _e1);
tmp26 = omc_Types_isIntegerOrRealOrSubTypeOfEither(threadData, _tp);
if (1 != tmp26) goto goto_2;
_b1 = omc_DAEUtil_expTypeArray(threadData, _tp);
_tp = omc_Expression_typeof(threadData, _e2);
tmp27 = omc_Types_isIntegerOrRealOrSubTypeOfEither(threadData, _tp);
if (1 != tmp27) goto goto_2;
_b2 = omc_DAEUtil_expTypeArray(threadData, _tp);
_e1_1 = omc_Util_swap(threadData, ((!_b1) && _b2), _e1, _e2 ,&_e2_1);
tmp33 = (modelica_boolean)(_b1 && _b2);
if(tmp33)
{
tmpMeta28 = mmc_mk_box2(12, &DAE_Operator_MUL__ARR__desc, _tp);
tmpMeta34 = tmpMeta28;
}
else
{
tmp31 = (modelica_boolean)((!_b1 && !_b2) || (_b1 && _b2));
if(tmp31)
{
tmpMeta29 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta32 = tmpMeta29;
}
else
{
tmpMeta30 = mmc_mk_box2(14, &DAE_Operator_MUL__ARRAY__SCALAR__desc, _tp);
tmpMeta32 = tmpMeta30;
}
tmpMeta34 = tmpMeta32;
}
_op = tmpMeta34;
tmpMeta35 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1_1, _op, _e2_1);
tmpMeta1 = tmpMeta35;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 9) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeSum(threadData_t *threadData, modelica_metatype _inExpLst)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExpLst;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _res = NULL;
modelica_boolean _b1;
modelica_metatype _tp = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _lst = NULL;
modelica_metatype _explst = NULL;
modelica_string _str = NULL;
modelica_metatype _op = NULL;
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 5;
tmpMeta1 = _OMC_LIT135;
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 (!listEmpty(tmpMeta7)) goto tmp3_end;
_e1 = tmpMeta6;
tmp4 += 3;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_e1 = tmpMeta8;
_e2 = tmpMeta10;
tmp12 = omc_Expression_isZero(threadData, _e1);
if (1 != tmp12) goto goto_2;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_1);
tmpMeta14 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta14)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmpMeta14);
tmpMeta16 = MMC_CDR(tmpMeta14);
if (!listEmpty(tmpMeta16)) goto tmp3_end;
_e1 = tmpMeta13;
_e2 = tmpMeta15;
tmp17 = omc_Expression_isZero(threadData, _e2);
if (1 != tmp17) goto goto_2;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_boolean tmp24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta19)) goto tmp3_end;
tmpMeta20 = MMC_CAR(tmpMeta19);
tmpMeta21 = MMC_CDR(tmpMeta19);
if (!listEmpty(tmpMeta21)) goto tmp3_end;
_e1 = tmpMeta18;
_e2 = tmpMeta20;
_tp = omc_Expression_typeof(threadData, _e1);
_b = omc_DAEUtil_expTypeArray(threadData, _tp);
tmp24 = (modelica_boolean)_b;
if(tmp24)
{
tmpMeta22 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _tp);
tmpMeta25 = tmpMeta22;
}
else
{
tmpMeta23 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _tp);
tmpMeta25 = tmpMeta23;
}
_op = tmpMeta25;
tmpMeta26 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta26;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_boolean tmp31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta27 = MMC_CAR(tmp4_1);
tmpMeta28 = MMC_CDR(tmp4_1);
_e1 = tmpMeta27;
_rest = tmpMeta28;
_b1 = omc_Expression_isZero(threadData, _e1);
_e2 = omc_Expression_makeSum(threadData, _rest);
_tp = omc_Expression_typeof(threadData, _e2);
_b = omc_DAEUtil_expTypeArray(threadData, _tp);
tmp31 = (modelica_boolean)_b;
if(tmp31)
{
tmpMeta29 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _tp);
tmpMeta32 = tmpMeta29;
}
else
{
tmpMeta30 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _tp);
tmpMeta32 = tmpMeta30;
}
_op = tmpMeta32;
tmpMeta33 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
_res = tmpMeta33;
tmpMeta1 = (_b1?_e2:_res);
goto tmp3_done;
}
case 6: {
modelica_boolean tmp34;
_lst = tmp4_1;
tmp34 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp34) goto goto_2;
omc_Debug_trace(threadData, _OMC_LIT147);
_explst = omc_List_map(threadData, _lst, boxvar_ExpressionDump_printExpStr);
_str = stringDelimitList(_explst, _OMC_LIT138);
omc_Debug_traceln(threadData, _str);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 7) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeSumWork(threadData_t *threadData, modelica_metatype _inExpLst, modelica_boolean _simplify)
{
modelica_metatype _outExp = NULL;
modelica_metatype _tp = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _eLst = NULL;
modelica_metatype _op = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_boolean tmp6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_boolean tmp11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inExpLst;
if (listEmpty(tmpMeta1)) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_CAR(tmpMeta1);
tmpMeta3 = MMC_CDR(tmpMeta1);
_eLst = tmpMeta2;
_rest = tmpMeta3;
_tp = omc_Expression_typeof(threadData, _eLst);
tmp6 = (modelica_boolean)omc_DAEUtil_expTypeArray(threadData, _tp);
if(tmp6)
{
tmpMeta4 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _tp);
tmpMeta7 = tmpMeta4;
}
else
{
tmpMeta5 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _tp);
tmpMeta7 = tmpMeta5;
}
_op = tmpMeta7;
_outExp = _eLst;
{
modelica_metatype _elem;
for (tmpMeta8 = _rest; !listEmpty(tmpMeta8); tmpMeta8=MMC_CDR(tmpMeta8))
{
_elem = MMC_CAR(tmpMeta8);
tmp15 = (modelica_boolean)omc_Expression_isZero(threadData, _elem);
if(tmp15)
{
tmpMeta16 = _outExp;
}
else
{
tmp13 = (modelica_boolean)omc_Expression_isZero(threadData, _outExp);
if(tmp13)
{
tmpMeta14 = _elem;
}
else
{
tmp11 = (modelica_boolean)_simplify;
if(tmp11)
{
tmpMeta9 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _outExp, _op, _elem);
tmpMeta12 = omc_ExpressionSimplify_simplify1(threadData, tmpMeta9, NULL);
}
else
{
tmpMeta10 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _outExp, _op, _elem);
tmpMeta12 = tmpMeta10;
}
tmpMeta14 = tmpMeta12;
}
tmpMeta16 = tmpMeta14;
}
_outExp = tmpMeta16;
}
}
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_makeSumWork(threadData_t *threadData, modelica_metatype _inExpLst, modelica_metatype _simplify)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_simplify);
_outExp = omc_Expression_makeSumWork(threadData, _inExpLst, tmp1);
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeSum1(threadData_t *threadData, modelica_metatype _inExpLst, modelica_boolean _simplify)
{
modelica_metatype _outExp = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExpLst;
{
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 (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta1 = _OMC_LIT135;
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 (!listEmpty(tmpMeta7)) goto tmp3_end;
_e1 = tmpMeta6;
tmp4 += 1;
tmpMeta1 = _e1;
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 (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_e1 = tmpMeta8;
_e2 = tmpMeta10;
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, _e2);
goto tmp3_done;
}
case 3: {
tmpMeta1 = omc_Expression_makeSumWork(threadData, _inExpLst, _simplify);
goto tmp3_done;
}
case 4: {
if(omc_Flags_isSet(threadData, _OMC_LIT60))
{
omc_Debug_trace(threadData, _OMC_LIT148);
omc_Debug_trace(threadData, omc_ExpressionDump_printExpListStr(threadData, _inExpLst));
}
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
modelica_metatype boxptr_Expression_makeSum1(threadData_t *threadData, modelica_metatype _inExpLst, modelica_metatype _simplify)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_simplify);
_outExp = omc_Expression_makeSum1(threadData, _inExpLst, tmp1);
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeLBinary(threadData_t *threadData, modelica_metatype _inExpLst, modelica_metatype _op)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExpLst;
tmp4_2 = _op;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _res = NULL;
modelica_metatype _rest = NULL;
modelica_string _str = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,22,1) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT20;
goto tmp3_done;
}
case 1: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,23,1) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT18;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta7)) goto tmp3_end;
_e1 = tmpMeta6;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_e1 = tmpMeta8;
_e2 = tmpMeta10;
tmpMeta12 = mmc_mk_box4(12, &DAE_Exp_LBINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_1);
tmpMeta14 = MMC_CDR(tmp4_1);
_e1 = tmpMeta13;
_rest = tmpMeta14;
_res = omc_Expression_makeLBinary(threadData, _rest, _op);
tmpMeta15 = mmc_mk_box4(12, &DAE_Exp_LBINARY__desc, _e1, _op, _res);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
tmpMeta16 = stringAppend(_OMC_LIT149,omc_ExpressionDump_lbinopSymbol(threadData, _op));
_str = tmpMeta16;
tmpMeta17 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT31, tmpMeta17);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expSub(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _e1;
tmp4_2 = _e2;
{
modelica_metatype _tp = NULL;
modelica_boolean _b;
modelica_metatype _op = NULL;
modelica_real _r1;
modelica_real _r2;
modelica_integer _i1;
modelica_integer _i2;
modelica_metatype _e = NULL;
modelica_metatype _x = NULL;
modelica_metatype _y = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 14; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!omc_Expression_isZero(threadData, _e1)) goto tmp3_end;
tmpMeta1 = omc_Expression_negate(threadData, _e2);
goto tmp3_done;
}
case 1: {
if (!omc_Expression_isZero(threadData, _e2)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_real tmp7;
modelica_metatype tmpMeta8;
modelica_real tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_real(tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
_r1 = tmp7;
_r2 = tmp9;
tmpMeta10 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r1 - _r2));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_i1 = tmp12;
_i2 = tmp14;
tmpMeta15 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i1 - _i2));
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,5,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e = tmpMeta17;
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, _e);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,6,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e = tmpMeta19;
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, _e);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,8,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,5,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 3));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,2,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta22;
_op = tmpMeta23;
_y = tmpMeta24;
tmpMeta25 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, tmpMeta25);
goto tmp3_done;
}
case 7: {
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_2,7,3) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,8,2) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,6,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 3));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,9,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta28;
_op = tmpMeta29;
_y = tmpMeta30;
tmpMeta31 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, tmpMeta31);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,8,2) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,5,1) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 3));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,3,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta34;
_op = tmpMeta35;
_y = tmpMeta36;
tmpMeta37 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, tmpMeta37);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,8,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,6,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 3));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta41,10,1) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta40;
_op = tmpMeta41;
_y = tmpMeta42;
tmpMeta43 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expAdd(threadData, _e1, tmpMeta43);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,5,1) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta45;
_e = omc_Expression_expAdd(threadData, _e, _e2);
tmpMeta1 = omc_Expression_negate(threadData, _e);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,6,1) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta47;
_e = omc_Expression_expAdd(threadData, _e, _e2);
tmpMeta1 = omc_Expression_negate(threadData, _e);
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_boolean tmp50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
if (!omc_Types_isIntegerOrRealOrSubTypeOfEither(threadData, omc_Expression_typeof(threadData, _e1))) goto tmp3_end;
_tp = omc_Expression_typeof(threadData, _e1);
_b = omc_DAEUtil_expTypeArray(threadData, _tp);
tmp50 = (modelica_boolean)_b;
if(tmp50)
{
tmpMeta48 = mmc_mk_box2(11, &DAE_Operator_SUB__ARR__desc, _tp);
tmpMeta51 = tmpMeta48;
}
else
{
tmpMeta49 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _tp);
tmpMeta51 = tmpMeta49;
}
_op = tmpMeta51;
tmpMeta52 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta52;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
if (!omc_Types_isEnumeration(threadData, omc_Expression_typeof(threadData, _e1))) goto tmp3_end;
tmpMeta53 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, omc_Expression_typeof(threadData, _e1));
tmpMeta54 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta53, _e2);
tmpMeta1 = tmpMeta54;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expAdd(threadData_t *threadData, modelica_metatype _e1, modelica_metatype _e2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _e1;
tmp4_2 = _e2;
{
modelica_metatype _tp = NULL;
modelica_boolean _b;
modelica_metatype _op = NULL;
modelica_real _r1;
modelica_real _r2;
modelica_integer _i1;
modelica_integer _i2;
modelica_metatype _e = NULL;
modelica_metatype _x = NULL;
modelica_metatype _y = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 18; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!omc_Expression_isZero(threadData, _e1)) goto tmp3_end;
tmpMeta1 = _e2;
goto tmp3_done;
}
case 1: {
if (!omc_Expression_isZero(threadData, _e2)) goto tmp3_end;
tmpMeta1 = _e1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta6;
modelica_real tmp7;
modelica_metatype tmpMeta8;
modelica_real tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_real(tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp9 = mmc_unbox_real(tmpMeta8);
_r1 = tmp7;
_r2 = tmp9;
tmpMeta10 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r1 + _r2));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_i1 = tmp12;
_i2 = tmp14;
tmpMeta15 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i1 + _i2));
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,5,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e = tmpMeta17;
tmpMeta1 = omc_Expression_expSub(threadData, _e1, _e);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,8,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,6,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_e = tmpMeta19;
tmpMeta1 = omc_Expression_expSub(threadData, _e1, _e);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,8,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,5,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 3));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta23,2,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta22;
_op = tmpMeta23;
_y = tmpMeta24;
tmpMeta25 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e1, tmpMeta25);
goto tmp3_done;
}
case 7: {
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_2,7,3) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,8,2) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,6,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 3));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,9,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta28;
_op = tmpMeta29;
_y = tmpMeta30;
tmpMeta31 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e1, tmpMeta31);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,8,2) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,5,1) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 3));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,3,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta34;
_op = tmpMeta35;
_y = tmpMeta36;
tmpMeta37 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e1, tmpMeta37);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,7,3) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,8,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,6,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 3));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta41,10,1) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_x = tmpMeta40;
_op = tmpMeta41;
_y = tmpMeta42;
tmpMeta43 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e1, tmpMeta43);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta44,5,1) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta45;
tmpMeta1 = omc_Expression_expSub(threadData, _e2, _e);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,6,1) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta47;
tmpMeta1 = omc_Expression_expSub(threadData, _e2, _e);
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta48,8,2) == 0) goto tmp3_end;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta49,5,1) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 3));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta51,2,1) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_x = tmpMeta50;
_op = tmpMeta51;
_y = tmpMeta52;
tmpMeta53 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e2, tmpMeta53);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta54,8,2) == 0) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta55,6,1) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 3));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta57,9,1) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_x = tmpMeta56;
_op = tmpMeta57;
_y = tmpMeta58;
tmpMeta59 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e2, tmpMeta59);
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta60,8,2) == 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta61,5,1) == 0) goto tmp3_end;
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 3));
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta63,3,1) == 0) goto tmp3_end;
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_x = tmpMeta62;
_op = tmpMeta63;
_y = tmpMeta64;
tmpMeta65 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e2, tmpMeta65);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta66,8,2) == 0) goto tmp3_end;
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta66), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta67,6,1) == 0) goto tmp3_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta66), 3));
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta69,10,1) == 0) goto tmp3_end;
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_x = tmpMeta68;
_op = tmpMeta69;
_y = tmpMeta70;
tmpMeta71 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _x, _op, _y);
tmpMeta1 = omc_Expression_expSub(threadData, _e2, tmpMeta71);
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_boolean tmp74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
if (!omc_Types_isIntegerOrRealOrSubTypeOfEither(threadData, omc_Expression_typeof(threadData, _e1))) goto tmp3_end;
_tp = omc_Expression_typeof(threadData, _e1);
_b = omc_DAEUtil_expTypeArray(threadData, _tp);
tmp74 = (modelica_boolean)_b;
if(tmp74)
{
tmpMeta72 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _tp);
tmpMeta75 = tmpMeta72;
}
else
{
tmpMeta73 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _tp);
tmpMeta75 = tmpMeta73;
}
_op = tmpMeta75;
tmpMeta76 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta1 = tmpMeta76;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
if (!omc_Types_isEnumeration(threadData, omc_Expression_typeof(threadData, _e1))) goto tmp3_end;
tmpMeta77 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, omc_Expression_typeof(threadData, _e1));
tmpMeta78 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta77, _e2);
tmpMeta1 = tmpMeta78;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeRealAdd(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _inExp1, _OMC_LIT150, _inExp2);
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeRealArray(threadData_t *threadData, modelica_metatype _expl)
{
modelica_metatype _outExp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_Expression_makeScalarArray(threadData, _expl, _OMC_LIT134);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeScalarArray(threadData_t *threadData, modelica_metatype _inExpLst, modelica_metatype _et)
{
modelica_metatype _outExp = NULL;
modelica_integer _i;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_i = listLength(_inExpLst);
tmpMeta2 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_i));
tmpMeta1 = mmc_mk_cons(tmpMeta2, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta3 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _et, tmpMeta1);
tmpMeta4 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta3, mmc_mk_boolean(1), _inExpLst);
_outExp = tmpMeta4;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeArrayFromList(threadData_t *threadData, modelica_metatype _inElements)
{
modelica_metatype _outArray = NULL;
modelica_metatype _ty = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ty = omc_Expression_typeof(threadData, listHead(_inElements));
tmpMeta2 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(listLength(_inElements)));
tmpMeta1 = mmc_mk_cons(tmpMeta2, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta3 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta1);
tmpMeta4 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta3, mmc_mk_boolean((!omc_Types_isArray(threadData, _ty))), _inElements);
_outArray = tmpMeta4;
_return: OMC_LABEL_UNUSED
return _outArray;
}
DLLExport
modelica_metatype omc_Expression_makeArray(threadData_t *threadData, modelica_metatype _inElements, modelica_metatype _inType, modelica_boolean _inScalar)
{
modelica_metatype _outArray = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _inType, mmc_mk_boolean(_inScalar), _inElements);
_outArray = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outArray;
}
modelica_metatype boxptr_Expression_makeArray(threadData_t *threadData, modelica_metatype _inElements, modelica_metatype _inType, modelica_metatype _inScalar)
{
modelica_integer tmp1;
modelica_metatype _outArray = NULL;
tmp1 = mmc_unbox_integer(_inScalar);
_outArray = omc_Expression_makeArray(threadData, _inElements, _inType, tmp1);
return _outArray;
}
DLLExport
modelica_metatype omc_Expression_generateCrefsExpLstFromExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefPrefix)
{
modelica_metatype _outCrefExpList = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inCrefPrefix;
{
modelica_string _name = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _incref = NULL;
modelica_metatype _e = NULL;
modelica_metatype _p1 = NULL;
modelica_metatype _p2 = NULL;
modelica_metatype _explst = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_explst = tmpMeta6;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpLstFromExp, _inCrefPrefix));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_explst = tmpMeta7;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpLstFromExp, _inCrefPrefix));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,9,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,3,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
_p1 = tmpMeta8;
_explst = tmpMeta9;
_p2 = tmpMeta13;
if (!omc_AbsynUtil_pathEqual(threadData, _p1, _p2)) goto tmp3_end;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpLstFromExp, _inCrefPrefix));
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_explst = tmpMeta14;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpLstFromExp, _inCrefPrefix));
goto tmp3_done;
}
case 4: {
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,13,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
if (3 != MMC_STRLEN(tmpMeta16) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta16)) != 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta17)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmpMeta17);
tmpMeta19 = MMC_CDR(tmpMeta17);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,6,2) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
if (!listEmpty(tmpMeta19)) goto tmp3_end;
_incref = tmpMeta20;
_cr = omc_ComponentReference_crefPrefixDer(threadData, _incref);
_e = omc_Expression_crefExp(threadData, _cr);
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmp4_2)) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
_cr = tmpMeta21;
_ty = tmpMeta22;
_incref = tmpMeta23;
_name = omc_ComponentReference_crefModelicaStr(threadData, _cr);
tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
_cr = omc_ComponentReference_crefPrependIdent(threadData, _incref, _name, tmpMeta24, _ty);
_e = omc_Expression_makeCrefExp(threadData, _cr, _ty);
tmpMeta25 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta25;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
if (!optionNone(tmp4_2)) goto tmp3_end;
tmpMeta26 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta26;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta27;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
tmpMeta28 = stringAppend(_OMC_LIT151,omc_ExpressionDump_printExpStr(threadData, _inExp));
tmpMeta29 = stringAppend(tmpMeta28,_OMC_LIT40);
fputs(MMC_STRINGDATA(tmpMeta29),stdout);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCrefExpList = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCrefExpList;
}
DLLExport
modelica_metatype omc_Expression_generateCrefsExpFromExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefPrefix)
{
modelica_metatype _outCrefExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_string _name = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _e = NULL;
modelica_metatype _p1 = NULL;
modelica_metatype _p2 = NULL;
modelica_metatype _explst = NULL;
modelica_boolean _b;
modelica_metatype _attr = NULL;
modelica_metatype _fields = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,0) == 0) goto tmp3_end;
tmpMeta1 = _inExp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp9 = mmc_unbox_integer(tmpMeta8);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta7;
_b = tmp9;
_explst = tmpMeta10;
_explst = omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpFromExp, _inCrefPrefix);
tmpMeta11 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(_b), _explst);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_boolean tmp18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 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(tmpMeta14), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,9,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,3,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
_p1 = tmpMeta12;
_explst = tmpMeta13;
_attr = tmpMeta14;
_p2 = tmpMeta17;
tmp18 = omc_AbsynUtil_pathEqual(threadData, _p1, _p2);
if (1 != tmp18) goto goto_2;
_explst = omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpFromExp, _inCrefPrefix);
tmpMeta19 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _p1, _explst, _attr);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_p1 = tmpMeta20;
_explst = tmpMeta21;
_fields = tmpMeta22;
_ty = tmpMeta23;
_explst = omc_List_map1(threadData, _explst, boxvar_Expression_generateCrefsExpFromExp, _inCrefPrefix);
tmpMeta24 = mmc_mk_box5(17, &DAE_Exp_RECORD__desc, _p1, _explst, _fields, _ty);
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
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));
_cr = tmpMeta25;
_ty = tmpMeta26;
_name = omc_ComponentReference_crefModelicaStr(threadData, _cr);
tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
_cr = omc_ComponentReference_crefPrependIdent(threadData, _inCrefPrefix, _name, tmpMeta27, _ty);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr, _ty);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta28;
tmpMeta1 = omc_Expression_negate(threadData, omc_Expression_generateCrefsExpFromExp(threadData, _e, _inCrefPrefix));
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
tmpMeta29 = stringAppend(_OMC_LIT152,omc_ExpressionDump_printExpStr(threadData, _inExp));
tmpMeta30 = stringAppend(tmpMeta29,_OMC_LIT40);
fputs(MMC_STRINGDATA(tmpMeta30),stdout);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCrefExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCrefExp;
}
DLLExport
modelica_metatype omc_Expression_generateCrefsFromExpVar(threadData_t *threadData, modelica_metatype _inVar, modelica_metatype _inCrefPrefix)
{
modelica_metatype _outCref = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVar;
{
modelica_string _name = NULL;
modelica_metatype _ty = 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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta6;
_ty = tmpMeta7;
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = omc_ComponentReference_crefPrependIdent(threadData, _inCrefPrefix, _name, tmpMeta8, _ty);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCref = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCref;
}
DLLExport
modelica_metatype omc_Expression_generateCrefsExpFromExpVar(threadData_t *threadData, modelica_metatype _inVar, modelica_metatype _inCrefPrefix)
{
modelica_metatype _outCrefExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVar;
{
modelica_string _name = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cr = 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;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_name = tmpMeta6;
_ty = tmpMeta7;
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
_cr = omc_ComponentReference_crefPrependIdent(threadData, _inCrefPrefix, _name, tmpMeta8, _ty);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr, _ty);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outCrefExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outCrefExp;
}
DLLExport
modelica_metatype omc_Expression_makeTuple(threadData_t *threadData, modelica_metatype _inExps)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
modelica_boolean tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmp2 = (modelica_boolean)(listLength(_inExps) > ((modelica_integer) 1));
if(tmp2)
{
tmpMeta1 = mmc_mk_box2(22, &DAE_Exp_TUPLE__desc, _inExps);
tmpMeta3 = tmpMeta1;
}
else
{
tmpMeta3 = omc_List_first(threadData, _inExps);
}
_outExp = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeASUBSingleSub(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _sub)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_sub, MMC_REFSTRUCTLIT(mmc_nil));
_outExp = omc_Expression_makeASUB(threadData, _exp, tmpMeta1);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeASUB(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inSubs)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inSubs;
{
modelica_metatype _exp = NULL;
modelica_metatype _subs = NULL;
modelica_metatype _subs1 = NULL;
modelica_metatype _subs2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,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));
_exp = tmpMeta6;
_subs1 = tmpMeta7;
_subs2 = tmp4_2;
_subs = listAppend(_subs1, _subs2);
tmpMeta8 = mmc_mk_box3(24, &DAE_Exp_ASUB__desc, _exp, _subs);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta19;
if(omc_Flags_isSet(threadData, _OMC_LIT162))
{
{
modelica_metatype tmp11_1;
tmp11_1 = _inExp;
{
volatile mmc_switch_type tmp11;
int tmp12;
tmp11 = 0;
for (; tmp11 < 2; tmp11++) {
switch (MMC_SWITCH_CAST(tmp11)) {
case 0: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp11_1,6,2) == 0) goto tmp10_end;
tmpMeta13 = stringAppend(_OMC_LIT153,omc_ExpressionDump_printExpStr(threadData, _inExp));
tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT154);
tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT155);
tmpMeta16 = stringAppend(tmpMeta15,stringDelimitList(omc_List_map(threadData, _inSubs, boxvar_ExpressionDump_printExpStr), _OMC_LIT156));
tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT157);
tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT158);
omc_Debug_traceln(threadData, tmpMeta18);
goto tmp10_done;
}
case 1: {
goto tmp10_done;
}
}
goto tmp10_end;
tmp10_end: ;
}
goto goto_9;
goto_9:;
goto goto_2;
goto tmp10_done;
tmp10_done:;
}
}
;
}
tmpMeta19 = mmc_mk_box3(24, &DAE_Exp_ASUB__desc, _inExp, _inSubs);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_crefExp(threadData_t *threadData, modelica_metatype _cr)
{
modelica_metatype _cref = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _cr;
{
modelica_metatype _ty1 = NULL;
modelica_metatype _ty2 = NULL;
modelica_metatype _subs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,0) == 0) goto tmp3_end;
tmpMeta6 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cr, _OMC_LIT42);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
_ty1 = omc_ComponentReference_crefLastType(threadData, _cr);
{
modelica_metatype tmp10_1;
tmp10_1 = _ty1;
{
volatile mmc_switch_type tmp10;
int tmp11;
tmp10 = 0;
for (; tmp10 < 2; tmp10++) {
switch (MMC_SWITCH_CAST(tmp10)) {
case 0: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp10_1,6,2) == 0) goto tmp9_end;
_subs = omc_ComponentReference_crefLastSubs(threadData, _cr);
_ty2 = omc_Expression_unliftArrayTypeWithSubs(threadData, _subs, _ty1);
tmpMeta12 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cr, _ty2);
tmpMeta7 = tmpMeta12;
goto tmp9_done;
}
case 1: {
modelica_metatype tmpMeta13;
tmpMeta13 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cr, _ty1);
tmpMeta7 = tmpMeta13;
goto tmp9_done;
}
}
goto tmp9_end;
tmp9_end: ;
}
goto goto_8;
goto_8:;
goto goto_2;
goto tmp9_done;
tmp9_done:;
}
}tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cref = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _cref;
}
DLLExport
modelica_metatype omc_Expression_crefToExp(threadData_t *threadData, modelica_metatype _cr)
{
modelica_metatype _cref = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cr, omc_ComponentReference_crefTypeFull(threadData, _cr));
_cref = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _cref;
}
DLLExport
modelica_metatype omc_Expression_makeCrefExp(threadData_t *threadData, modelica_metatype _inCref, modelica_metatype _inExpType)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCref;
tmp4_2 = _inExpType;
{
modelica_metatype _cref = NULL;
modelica_metatype _tGiven = NULL;
modelica_metatype _tExisting = 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;
_cref = tmp4_1;
_tGiven = tmp4_2;
if(omc_Flags_isSet(threadData, _OMC_LIT169))
{
_tExisting = omc_ComponentReference_crefLastType(threadData, _cref);
if((!valueEq(_tGiven, _tExisting)))
{
tmpMeta6 = stringAppend(_OMC_LIT163,omc_ComponentReference_printComponentRefStr(threadData, _cref));
tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT164);
tmpMeta8 = stringAppend(tmpMeta7,omc_Types_unparseType(threadData, _tGiven));
tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT165);
tmpMeta10 = stringAppend(tmpMeta9,omc_Types_unparseType(threadData, _tExisting));
omc_Debug_traceln(threadData, tmpMeta10);
}
}
tmpMeta11 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cref, _tGiven);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_makeNestedIf(threadData_t *threadData, modelica_metatype _inConds, modelica_metatype _inTbExps, modelica_metatype _fExp)
{
modelica_metatype _ifExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inConds;
tmp4_2 = _inTbExps;
{
modelica_metatype _c = NULL;
modelica_metatype _tbExp = NULL;
modelica_metatype _conds = NULL;
modelica_metatype _tbExps = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta7)) goto tmp3_end;
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_2);
tmpMeta9 = MMC_CDR(tmp4_2);
if (!listEmpty(tmpMeta9)) goto tmp3_end;
_c = tmpMeta6;
_tbExp = tmpMeta8;
tmpMeta10 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _c, _tbExp, _fExp);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta13 = MMC_CAR(tmp4_2);
tmpMeta14 = MMC_CDR(tmp4_2);
_c = tmpMeta11;
_conds = tmpMeta12;
_tbExp = tmpMeta13;
_tbExps = tmpMeta14;
_ifExp = omc_Expression_makeNestedIf(threadData, _conds, _tbExps, _fExp);
tmpMeta15 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, _c, _tbExp, _ifExp);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ifExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ifExp;
}
DLLExport
modelica_metatype omc_Expression_makeSign(threadData_t *threadData, modelica_metatype _e1)
{
modelica_metatype _res = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_e1, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta2 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT170, tmpMeta1, _OMC_LIT141);
_res = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_makeAbs(threadData_t *threadData, modelica_metatype _e1)
{
modelica_metatype _res = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_e1, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta2 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT171, tmpMeta1, _OMC_LIT141);
_res = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_makeNoEvent(threadData_t *threadData, modelica_metatype _e1)
{
modelica_metatype _res = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_e1, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta2 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT172, tmpMeta1, _OMC_LIT174);
_res = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _res;
}
DLLExport
modelica_metatype omc_Expression_flattenArrayExpToList(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _expLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _expl = NULL;
modelica_metatype _mexpl = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,16,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
_expl = tmpMeta8;
tmp4 += 3;
_expl = omc_List_flatten(threadData, omc_List_map(threadData, _expl, boxvar_Expression_flattenArrayExpToList));
tmpMeta1 = omc_List_map(threadData, _expl, boxvar_Expression_negate);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta9;
tmp4 += 2;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _expl, boxvar_Expression_flattenArrayExpToList));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,17,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 4));
_mexpl = tmpMeta12;
tmp4 += 1;
_expl = omc_List_flatten(threadData, omc_List_map(threadData, omc_List_flatten(threadData, _mexpl), boxvar_Expression_flattenArrayExpToList));
tmpMeta1 = omc_List_map(threadData, _expl, boxvar_Expression_negate);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_mexpl = tmpMeta13;
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, omc_List_flatten(threadData, _mexpl), boxvar_Expression_flattenArrayExpToList));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta14;
tmpMeta14 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_expLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _expLst;
}
DLLExport
modelica_metatype omc_Expression_getTermsContainingX(threadData_t *threadData, modelica_metatype _inExp1, modelica_metatype _inExp2, modelica_metatype *out_outExp2)
{
modelica_metatype _outExp1 = NULL;
modelica_metatype _outExp2 = 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 = _inExp1;
tmp4_2 = _inExp2;
{
modelica_metatype _xt1 = NULL;
modelica_metatype _nonxt1 = NULL;
modelica_metatype _xt2 = NULL;
modelica_metatype _nonxt2 = NULL;
modelica_metatype _xt = NULL;
modelica_metatype _nonxt = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _e = NULL;
modelica_metatype _zero = NULL;
modelica_metatype _ty = NULL;
modelica_boolean _res;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_cr = tmp4_2;
_e1 = tmpMeta6;
_ty = tmpMeta8;
_e2 = tmpMeta9;
tmp4 += 5;
_xt1 = omc_Expression_getTermsContainingX(threadData, _e1, _cr ,&_nonxt1);
_xt2 = omc_Expression_getTermsContainingX(threadData, _e2, _cr ,&_nonxt2);
tmpMeta10 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _ty);
tmpMeta11 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _xt1, tmpMeta10, _xt2);
_xt = tmpMeta11;
tmpMeta12 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _ty);
tmpMeta13 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _nonxt1, tmpMeta12, _nonxt2);
_nonxt = tmpMeta13;
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_cr = tmp4_2;
_e1 = tmpMeta14;
_ty = tmpMeta16;
_e2 = tmpMeta17;
tmp4 += 4;
_xt1 = omc_Expression_getTermsContainingX(threadData, _e1, _cr ,&_nonxt1);
_xt2 = omc_Expression_getTermsContainingX(threadData, _e2, _cr ,&_nonxt2);
tmpMeta18 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _ty);
tmpMeta19 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _xt1, tmpMeta18, _xt2);
_xt = tmpMeta19;
tmpMeta20 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _ty);
tmpMeta21 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _nonxt1, tmpMeta20, _nonxt2);
_nonxt = tmpMeta21;
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,5,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_cr = tmp4_2;
_ty = tmpMeta23;
_e = tmpMeta24;
tmp4 += 3;
_xt1 = omc_Expression_getTermsContainingX(threadData, _e, _cr ,&_nonxt1);
tmpMeta25 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _ty);
tmpMeta26 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, tmpMeta25, _xt1);
_xt = tmpMeta26;
tmpMeta27 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _ty);
tmpMeta28 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, tmpMeta27, _nonxt1);
_nonxt = tmpMeta28;
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,7,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_cr = tmp4_2;
_e1 = tmpMeta29;
_ty = tmpMeta31;
_e2 = tmpMeta32;
tmp4 += 2;
_xt1 = omc_Expression_getTermsContainingX(threadData, _e1, _cr ,&_nonxt1);
_xt2 = omc_Expression_getTermsContainingX(threadData, _e2, _cr ,&_nonxt2);
tmpMeta33 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _ty);
tmpMeta34 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _xt1, tmpMeta33, _xt2);
_xt = tmpMeta34;
tmpMeta35 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _ty);
tmpMeta36 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _nonxt1, tmpMeta35, _nonxt2);
_nonxt = tmpMeta36;
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta38,8,1) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_cr = tmp4_2;
_e1 = tmpMeta37;
_ty = tmpMeta39;
_e2 = tmpMeta40;
tmp4 += 1;
_xt1 = omc_Expression_getTermsContainingX(threadData, _e1, _cr ,&_nonxt1);
_xt2 = omc_Expression_getTermsContainingX(threadData, _e2, _cr ,&_nonxt2);
tmpMeta41 = mmc_mk_box2(11, &DAE_Operator_SUB__ARR__desc, _ty);
tmpMeta42 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _xt1, tmpMeta41, _xt2);
_xt = tmpMeta42;
tmpMeta43 = mmc_mk_box2(11, &DAE_Operator_SUB__ARR__desc, _ty);
tmpMeta44 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _nonxt1, tmpMeta43, _nonxt2);
_nonxt = tmpMeta44;
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
case 5: {
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_2,6,2) == 0) goto tmp3_end;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta45,6,1) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta45), 2));
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_cr = tmp4_2;
_ty = tmpMeta46;
_e = tmpMeta47;
_xt1 = omc_Expression_getTermsContainingX(threadData, _e, _cr ,&_nonxt1);
tmpMeta48 = mmc_mk_box2(9, &DAE_Operator_UMINUS__ARR__desc, _ty);
tmpMeta49 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, tmpMeta48, _xt1);
_xt = tmpMeta49;
tmpMeta50 = mmc_mk_box2(9, &DAE_Operator_UMINUS__ARR__desc, _ty);
tmpMeta51 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, tmpMeta50, _nonxt1);
_nonxt = tmpMeta51;
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta52;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,6,2) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_cr = tmp4_2;
_ty = tmpMeta52;
_e = tmp4_1;
_res = omc_Expression_expContains(threadData, _e, _cr);
_zero = omc_Expression_makeZeroExpression(threadData, omc_Expression_arrayDimension(threadData, _ty), NULL);
_xt = (_res?_e:_zero);
_nonxt = (_res?_zero:_e);
tmpMeta[0+0] = _xt;
tmpMeta[0+1] = _nonxt;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 7) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp1 = tmpMeta[0+0];
_outExp2 = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outExp2) { *out_outExp2 = _outExp2; }
return _outExp1;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expandFactorsWork2(threadData_t *threadData, modelica_metatype _inAcc, modelica_boolean _doInverseFactors)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
modelica_metatype _tmpExpLst = NULL;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta25;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outExpLst = tmpMeta1;
{
modelica_metatype _elem;
for (tmpMeta2 = _inAcc; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
{
_elem = MMC_CAR(tmpMeta2);
{
modelica_metatype tmp6_1;
tmp6_1 = _elem;
{
volatile mmc_switch_type tmp6;
int tmp7;
tmp6 = 0;
for (; tmp6 < 6; tmp6++) {
switch (MMC_SWITCH_CAST(tmp6)) {
case 0: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,7,3) == 0) goto tmp5_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,7,3) == 0) goto tmp5_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,1) == 0) goto tmp5_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,4,1) == 0) goto tmp5_end;
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = omc_Expression_expandFactorsWork(threadData, _elem, tmpMeta11, _doInverseFactors);
goto tmp5_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,7,3) == 0) goto tmp5_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,7,3) == 0) goto tmp5_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,2,1) == 0) goto tmp5_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,4,1) == 0) goto tmp5_end;
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = omc_Expression_expandFactorsWork(threadData, _elem, tmpMeta15, _doInverseFactors);
goto tmp5_done;
}
case 2: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,7,3) == 0) goto tmp5_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,7,3) == 0) goto tmp5_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,4,1) == 0) goto tmp5_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,4,1) == 0) goto tmp5_end;
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = omc_Expression_expandFactorsWork(threadData, _elem, tmpMeta19, _doInverseFactors);
goto tmp5_done;
}
case 3: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,8,2) == 0) goto tmp5_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,5,1) == 0) goto tmp5_end;
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = omc_Expression_expandFactorsWork(threadData, _elem, tmpMeta21, _doInverseFactors);
goto tmp5_done;
}
case 4: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,8,2) == 0) goto tmp5_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,6,1) == 0) goto tmp5_end;
tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = omc_Expression_expandFactorsWork(threadData, _elem, tmpMeta23, _doInverseFactors);
goto tmp5_done;
}
case 5: {
modelica_metatype tmpMeta24;
tmpMeta24 = mmc_mk_cons(_elem, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta3 = tmpMeta24;
goto tmp5_done;
}
}
goto tmp5_end;
tmp5_end: ;
}
goto goto_4;
goto_4:;
MMC_THROW_INTERNAL();
goto tmp5_done;
tmp5_done:;
}
}
_tmpExpLst = tmpMeta3;
_outExpLst = listAppend(_tmpExpLst, _outExpLst);
}
}
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expandFactorsWork2(threadData_t *threadData, modelica_metatype _inAcc, modelica_metatype _doInverseFactors)
{
modelica_integer tmp1;
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta2;
tmp1 = mmc_unbox_integer(_doInverseFactors);
_outExpLst = omc_Expression_expandFactorsWork2(threadData, _inAcc, tmp1);
return _outExpLst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expandFactorsWork3(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_boolean _doInverseFactors)
{
modelica_metatype _acc = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _op = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_acc = __omcQ_24in_5Facc;
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
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: {
tmpMeta1 = omc_Expression_factorsWork(threadData, _inExp, _acc, _doInverseFactors);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,2,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_e2 = tmpMeta8;
tmp4 += 2;
_acc = omc_Expression_expandFactorsWork(threadData, _e1, _acc, _doInverseFactors);
tmpMeta1 = omc_Expression_expandFactorsWork(threadData, _e2, _acc, _doInverseFactors);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,7,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,3,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,3,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e = tmpMeta10;
_op = tmpMeta11;
_e1 = tmpMeta12;
_e2 = tmpMeta14;
tmp4 += 1;
tmpMeta15 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e, _op, omc_Expression_expMul(threadData, _e1, _e2));
_e = tmpMeta15;
tmpMeta1 = omc_Expression_expandFactorsWork(threadData, _e, _acc, _doInverseFactors);
goto tmp3_done;
}
case 3: {
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_1,7,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,7,3) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta20,3,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e = tmpMeta17;
_e1 = tmpMeta19;
_op = tmpMeta20;
_e2 = tmpMeta21;
_acc = omc_Expression_expandFactorsWork(threadData, _e, _acc, _doInverseFactors);
tmpMeta22 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _op, _e2);
tmpMeta1 = omc_Expression_expandFactorsWork(threadData, tmpMeta22, _acc, _doInverseFactors);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta23;
tmpMeta23 = mmc_mk_cons(_inExp, _acc);
tmpMeta1 = tmpMeta23;
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:;
}
}
_acc = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _acc;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expandFactorsWork3(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_metatype _doInverseFactors)
{
modelica_integer tmp1;
modelica_metatype _acc = NULL;
tmp1 = mmc_unbox_integer(_doInverseFactors);
_acc = omc_Expression_expandFactorsWork3(threadData, _inExp, __omcQ_24in_5Facc, tmp1);
return _acc;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_expandFactorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_boolean _doInverseFactors)
{
modelica_metatype _acc = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_acc = __omcQ_24in_5Facc;
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _tp = NULL;
modelica_metatype _pow_acc = NULL;
modelica_metatype _pow_acc2 = NULL;
modelica_metatype _op = 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_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,7,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
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(tmpMeta6), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,4,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta7;
_e2 = tmpMeta9;
_e3 = tmpMeta11;
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
_pow_acc = omc_Expression_expandFactorsWork(threadData, _e1, tmpMeta12, _doInverseFactors);
_pow_acc = omc_Expression_expPowLst(threadData, _pow_acc, _e3);
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
_pow_acc2 = omc_Expression_expandFactorsWork(threadData, _e2, tmpMeta13, _doInverseFactors);
_pow_acc2 = omc_Expression_expPowLst(threadData, _pow_acc2, _e3);
_acc = listAppend(_pow_acc, _acc);
tmpMeta1 = listAppend(_pow_acc2, _acc);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,7,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,3,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 4));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,4,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta15;
_e2 = tmpMeta17;
_e3 = tmpMeta19;
tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
_pow_acc = omc_Expression_expandFactorsWork(threadData, _e1, tmpMeta20, _doInverseFactors);
_pow_acc = omc_Expression_expPowLst(threadData, _pow_acc, _e3);
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
_pow_acc2 = omc_Expression_expandFactorsWork(threadData, _e2, tmpMeta21, _doInverseFactors);
_pow_acc2 = omc_Expression_expPowLst(threadData, _pow_acc2, omc_Expression_negate(threadData, _e3));
_acc = listAppend(_pow_acc, _acc);
tmpMeta1 = listAppend(_pow_acc2, _acc);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,7,3) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,4,1) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 4));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,4,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta23;
_e2 = tmpMeta25;
_e3 = tmpMeta27;
_e = omc_Expression_expMul(threadData, _e2, _e3);
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
_pow_acc = omc_Expression_expandFactorsWork(threadData, _e1, tmpMeta28, _doInverseFactors);
_pow_acc = omc_Expression_expPowLst(threadData, _pow_acc, _e);
tmpMeta1 = listAppend(_pow_acc, _acc);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta30,3,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta29;
_op = tmpMeta30;
_tp = tmpMeta31;
_e2 = tmpMeta32;
if (!omc_Expression_isZero(threadData, _e2)) goto tmp3_end;
if(_doInverseFactors)
{
_e = _e2;
}
else
{
tmpMeta33 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, omc_Expression_makeConstOne(threadData, _tp), _op, _e2);
_e = tmpMeta33;
}
_acc = omc_Expression_expandFactorsWork(threadData, _e1, _acc, _doInverseFactors);
tmpMeta34 = mmc_mk_cons(_e, _acc);
tmpMeta1 = tmpMeta34;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,5,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta36;
_e1 = tmpMeta37;
_e = omc_Expression_makeConstOne(threadData, _tp);
_acc = omc_Expression_expandFactorsWork(threadData, _e1, _acc, _doInverseFactors);
_e = omc_Expression_negate(threadData, _e);
tmpMeta38 = mmc_mk_cons(_e, _acc);
tmpMeta1 = tmpMeta38;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,6,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta40;
_e1 = tmpMeta41;
_e = omc_Expression_makeConstOne(threadData, _tp);
_acc = omc_Expression_expandFactorsWork(threadData, _e1, _acc, _doInverseFactors);
_e = omc_Expression_negate(threadData, _e);
tmpMeta42 = mmc_mk_cons(_e, _acc);
tmpMeta1 = tmpMeta42;
goto tmp3_done;
}
case 6: {
_acc = omc_Expression_expandFactorsWork3(threadData, _inExp, _acc, _doInverseFactors);
tmpMeta1 = omc_Expression_expandFactorsWork2(threadData, _acc, _doInverseFactors);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_acc = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _acc;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_expandFactorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_metatype _doInverseFactors)
{
modelica_integer tmp1;
modelica_metatype _acc = NULL;
tmp1 = mmc_unbox_integer(_doInverseFactors);
_acc = omc_Expression_expandFactorsWork(threadData, _inExp, __omcQ_24in_5Facc, tmp1);
return _acc;
}
DLLExport
modelica_metatype omc_Expression_expandFactors(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outExpLst = listReverse(omc_Expression_expandFactorsWork(threadData, _inExp, tmpMeta1, 0));
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
DLLExport
modelica_metatype omc_Expression_inverseFactors(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _tp2 = NULL;
modelica_metatype _tp = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _op = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,4,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_tp = tmpMeta8;
_e2 = tmpMeta9;
tmp4 += 1;
_tp2 = omc_Expression_typeof(threadData, _e2);
tmpMeta10 = mmc_mk_box2(7, &DAE_Operator_POW__desc, _tp);
tmpMeta11 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _tp2);
tmpMeta12 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, tmpMeta11, _e2);
tmpMeta13 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta10, tmpMeta12);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,3,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta14;
_op = tmpMeta15;
_e2 = tmpMeta16;
tmp17 = omc_Expression_isZero(threadData, _e1);
if (0 != tmp17) goto goto_2;
tmpMeta18 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e2, _op, _e1);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 2: {
modelica_boolean tmp19;
modelica_metatype tmpMeta20;
_e = tmp4_1;
tmp19 = omc_Expression_isZero(threadData, _e);
if (0 != tmp19) goto goto_2;
_tp = omc_Expression_typeof(threadData, _e);
{
modelica_metatype tmp23_1;
tmp23_1 = _tp;
{
volatile mmc_switch_type tmp23;
int tmp24;
tmp23 = 0;
for (; tmp23 < 2; tmp23++) {
switch (MMC_SWITCH_CAST(tmp23)) {
case 0: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp23_1,1,1) == 0) goto tmp22_end;
tmpMeta25 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _OMC_LIT6, _OMC_LIT175, _e);
tmpMeta20 = tmpMeta25;
goto tmp22_done;
}
case 1: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp23_1,0,1) == 0) goto tmp22_end;
tmpMeta26 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _OMC_LIT4, _OMC_LIT177, _e);
tmpMeta20 = tmpMeta26;
goto tmp22_done;
}
}
goto tmp22_end;
tmp22_end: ;
}
goto goto_21;
goto_21:;
goto goto_2;
goto tmp22_done;
tmp22_done:;
}
}tmpMeta1 = tmpMeta20;
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 = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_factorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_boolean _doInverseFactors)
{
modelica_metatype _acc = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_acc = __omcQ_24in_5Facc;
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,2,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_e2 = tmpMeta8;
_acc = omc_Expression_factorsWork(threadData, _e1, _acc, _doInverseFactors);
_inExp = _e2;
__omcQ_24in_5Facc = _acc;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,3,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,1,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta9;
_e2 = tmpMeta12;
_acc = omc_Expression_factorsWork(threadData, _e1, _acc, _doInverseFactors);
_inExp = _e2;
__omcQ_24in_5Facc = _acc;
_doInverseFactors = (!_doInverseFactors);
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_integer tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
if (1 != tmp14) goto tmp3_end;
tmpMeta1 = _acc;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_real tmp16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp16 = mmc_unbox_real(tmpMeta15);
if (1.0 != tmp16) goto tmp3_end;
tmpMeta1 = _acc;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta17;
tmpMeta17 = mmc_mk_cons((_doInverseFactors?omc_Expression_inverseFactors(threadData, _inExp):_inExp), _acc);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_acc = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _acc;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_factorsWork(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype __omcQ_24in_5Facc, modelica_metatype _doInverseFactors)
{
modelica_integer tmp1;
modelica_metatype _acc = NULL;
tmp1 = mmc_unbox_integer(_doInverseFactors);
_acc = omc_Expression_factorsWork(threadData, _inExp, __omcQ_24in_5Facc, tmp1);
return _acc;
}
DLLExport
modelica_metatype omc_Expression_factors(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outExpLst = listReverse(omc_Expression_factorsWork(threadData, _inExp, tmpMeta1, 0));
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
DLLExport
modelica_metatype omc_Expression_quotient(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype *out_denom)
{
modelica_metatype _num = NULL;
modelica_metatype _denom = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _p = NULL;
modelica_metatype _q = NULL;
modelica_metatype _tp = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,3,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_e2 = tmpMeta8;
tmp4 += 2;
tmpMeta[0+0] = _e1;
tmpMeta[0+1] = _e2;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta9;
_e2 = tmpMeta11;
_p = omc_Expression_quotient(threadData, _e1 ,&_q);
_tp = omc_Expression_typeof(threadData, _p);
tmpMeta12 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta13 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e2, tmpMeta12, _p);
tmpMeta[0+0] = tmpMeta13;
tmpMeta[0+1] = _q;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,2,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta14;
_e2 = tmpMeta16;
_p = omc_Expression_quotient(threadData, _e2 ,&_q);
_tp = omc_Expression_typeof(threadData, _p);
tmpMeta17 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta18 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta17, _p);
tmpMeta[0+0] = tmpMeta18;
tmpMeta[0+1] = _q;
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:;
}
}
_num = tmpMeta[0+0];
_denom = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_denom) { *out_denom = _denom; }
return _num;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_terms2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inAcc, modelica_boolean _neg)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_boolean tmp4_3;
tmp4_1 = _inExp;
tmp4_2 = _inAcc;
tmp4_3 = _neg;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _acc = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_e2 = tmpMeta8;
_acc = tmp4_2;
_acc = omc_Expression_terms2(threadData, _e2, _acc, _neg);
_inExp = _e1;
_inAcc = _acc;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta9;
_e2 = tmpMeta11;
_acc = tmp4_2;
_acc = omc_Expression_terms2(threadData, _e2, _acc, (!_neg));
_inExp = _e1;
_inAcc = _acc;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
if (1 != tmp4_3) goto tmp3_end;
_e = tmp4_1;
_acc = tmp4_2;
_e = omc_Expression_negate(threadData, _e);
tmpMeta12 = mmc_mk_cons(_e, _acc);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta13;
_e = tmp4_1;
_acc = tmp4_2;
tmpMeta13 = mmc_mk_cons(_e, _acc);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExpLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_Expression_terms2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inAcc, modelica_metatype _neg)
{
modelica_integer tmp1;
modelica_metatype _outExpLst = NULL;
tmp1 = mmc_unbox_integer(_neg);
_outExpLst = omc_Expression_terms2(threadData, _inExp, _inAcc, tmp1);
return _outExpLst;
}
DLLExport
modelica_metatype omc_Expression_terms(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outExpLst = omc_Expression_terms2(threadData, _inExp, tmpMeta1, 0);
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
DLLExport
modelica_metatype omc_Expression_termsExpandUnary(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
tmpMeta1 = omc_List_map(threadData, omc_Expression_terms(threadData, _e), boxvar_Expression_negate);
goto tmp3_done;
}
case 1: {
tmpMeta1 = omc_Expression_terms(threadData, _inExp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExpLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
DLLExport
modelica_metatype omc_Expression_allTermsForCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _cr, modelica_fnptr _inFunc, modelica_metatype *out_outExpLstWithoutX)
{
modelica_metatype _outExpLstWithX = NULL;
modelica_metatype _outExpLstWithoutX = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _f1 = NULL;
modelica_metatype _f2 = NULL;
modelica_metatype _fx1 = NULL;
modelica_metatype _fx2 = NULL;
modelica_metatype _res = NULL;
modelica_metatype _resx = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_e2 = tmpMeta8;
tmp4 += 7;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx2 = omc_Expression_allTermsForCref(threadData, _e2, _cr, ((modelica_fnptr) _inFunc) ,&_f2);
_res = listAppend(_f1, _f2);
_resx = listAppend(_fx1, _fx2);
tmpMeta[0+0] = _resx;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta9;
_e2 = tmpMeta11;
tmp4 += 6;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx2 = omc_Expression_allTermsForCref(threadData, _e2, _cr, ((modelica_fnptr) _inFunc) ,&_f2);
_f2 = omc_List_map(threadData, _f2, boxvar_Expression_negate);
_fx2 = omc_List_map(threadData, _fx2, boxvar_Expression_negate);
_res = listAppend(_f1, _f2);
_resx = listAppend(_fx1, _fx2);
tmpMeta[0+0] = _resx;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,7,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta12;
_e2 = tmpMeta14;
tmp4 += 5;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx2 = omc_Expression_allTermsForCref(threadData, _e2, _cr, ((modelica_fnptr) _inFunc) ,&_f2);
_res = listAppend(_f1, _f2);
_resx = listAppend(_fx1, _fx2);
tmpMeta[0+0] = _resx;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,8,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta15;
_e2 = tmpMeta17;
tmp4 += 4;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx2 = omc_Expression_allTermsForCref(threadData, _e2, _cr, ((modelica_fnptr) _inFunc) ,&_f2);
_f2 = omc_List_map(threadData, _f2, boxvar_Expression_negate);
_fx2 = omc_List_map(threadData, _fx2, boxvar_Expression_negate);
_res = listAppend(_f1, _f2);
_resx = listAppend(_fx1, _fx2);
tmpMeta[0+0] = _resx;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,2,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta18;
_e2 = tmpMeta20;
if (!mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e2, _cr) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e2, _cr))) goto tmp3_end;
_fx1 = omc_Expression_allTermsForCref(threadData, _e2, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx1 = omc_List_split1OnTrue(threadData, _fx1, ((modelica_fnptr) _inFunc), _cr ,&_f2);
_res = listAppend(_f1, _f2);
_e = omc_Expression_makeSum1(threadData, _res, 0);
_e = omc_Expression_expMul(threadData, _e, _e1);
_fx1 = omc_List_map1(threadData, _fx1, boxvar_Expression_expMul, _e1);
if((!omc_Expression_isZero(threadData, _e)))
{
if(omc_Expression_expHasCrefNoPreOrStart(threadData, _e1, _cr))
{
tmpMeta21 = mmc_mk_cons(_e, _fx1);
_fx1 = tmpMeta21;
tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
_f1 = tmpMeta22;
}
else
{
tmpMeta23 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
_f1 = tmpMeta23;
}
}
tmpMeta[0+0] = _fx1;
tmpMeta[0+1] = _f1;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta25,2,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta24;
_e2 = tmpMeta26;
tmp4 += 2;
if (!mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e1, _cr) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e1, _cr))) goto tmp3_end;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx1 = omc_List_split1OnTrue(threadData, _fx1, ((modelica_fnptr) _inFunc), _cr ,&_f2);
_res = listAppend(_f1, _f2);
_e = omc_Expression_makeSum1(threadData, _res, 0);
_e = omc_Expression_expMul(threadData, _e, _e2);
_fx1 = omc_List_map1(threadData, _fx1, boxvar_Expression_expMul, _e2);
if((!omc_Expression_isZero(threadData, _e)))
{
if(omc_Expression_expHasCrefNoPreOrStart(threadData, _e1, _cr))
{
tmpMeta27 = mmc_mk_cons(_e, _fx1);
_fx1 = tmpMeta27;
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
_f1 = tmpMeta28;
}
else
{
tmpMeta29 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
_f1 = tmpMeta29;
}
}
tmpMeta[0+0] = _fx1;
tmpMeta[0+1] = _f1;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta31,3,1) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta30;
_e2 = tmpMeta32;
tmp4 += 1;
if (!mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _e1, _cr) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _e1, _cr))) goto tmp3_end;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_fx1 = omc_List_split1OnTrue(threadData, _fx1, ((modelica_fnptr) _inFunc), _cr ,&_f2);
_res = listAppend(_f1, _f2);
_e = omc_Expression_makeSum1(threadData, _res, 0);
_e = omc_Expression_makeDiv(threadData, _e, _e2);
_fx1 = omc_List_map1(threadData, _fx1, boxvar_Expression_makeDiv, _e2);
if((!omc_Expression_isZero(threadData, _e)))
{
if(omc_Expression_expHasCrefNoPreOrStart(threadData, _e1, _cr))
{
tmpMeta33 = mmc_mk_cons(_e, _fx1);
_fx1 = tmpMeta33;
tmpMeta34 = MMC_REFSTRUCTLIT(mmc_nil);
_f1 = tmpMeta34;
}
else
{
tmpMeta35 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
_f1 = tmpMeta35;
}
}
tmpMeta[0+0] = _fx1;
tmpMeta[0+1] = _f1;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,5,1) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta37;
_fx1 = omc_Expression_allTermsForCref(threadData, _e1, _cr, ((modelica_fnptr) _inFunc) ,&_f1);
_f1 = omc_List_map(threadData, _f1, boxvar_Expression_negate);
_fx1 = omc_List_map(threadData, _fx1, boxvar_Expression_negate);
tmpMeta[0+0] = _fx1;
tmpMeta[0+1] = _f1;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
if(mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 2))), _inExp, _cr) : ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inFunc), 1)))) (threadData, _inExp, _cr)))
{
tmpMeta38 = MMC_REFSTRUCTLIT(mmc_nil);
_res = tmpMeta38;
tmpMeta39 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
_resx = tmpMeta39;
}
else
{
tmpMeta40 = MMC_REFSTRUCTLIT(mmc_nil);
_resx = tmpMeta40;
tmpMeta41 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
_res = tmpMeta41;
}
tmpMeta[0+0] = _resx;
tmpMeta[0+1] = _res;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 9) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExpLstWithX = tmpMeta[0+0];
_outExpLstWithoutX = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outExpLstWithoutX) { *out_outExpLstWithoutX = _outExpLstWithoutX; }
return _outExpLstWithX;
}
DLLExport
modelica_metatype omc_Expression_allTerms(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _f1 = NULL;
modelica_metatype _f2 = NULL;
modelica_metatype _f2_1 = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 19; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_e2 = tmpMeta8;
tmp4 += 17;
_f1 = omc_Expression_allTerms(threadData, _e1);
_f2 = omc_Expression_allTerms(threadData, _e2);
tmpMeta1 = listAppend(_f1, _f2);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,1,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta9;
_e2 = tmpMeta11;
tmp4 += 16;
_f1 = omc_Expression_allTerms(threadData, _e1);
_f2 = omc_Expression_allTerms(threadData, _e2);
_f2_1 = omc_List_map(threadData, _f2, boxvar_Expression_negate);
tmpMeta1 = listAppend(_f1, _f2_1);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,7,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta12;
_e2 = tmpMeta14;
tmp4 += 15;
_f1 = omc_Expression_allTerms(threadData, _e1);
_f2 = omc_Expression_allTerms(threadData, _e2);
tmpMeta1 = listAppend(_f1, _f2);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,8,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta15;
_e2 = tmpMeta17;
tmp4 += 14;
_f1 = omc_Expression_allTerms(threadData, _e1);
_f2 = omc_Expression_allTerms(threadData, _e2);
_f2_1 = omc_List_map(threadData, _f2, boxvar_Expression_negate);
tmpMeta1 = listAppend(_f1, _f2_1);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,2,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta18;
_e2 = tmpMeta20;
tmp4 += 2;
tmpMeta21 = omc_Expression_allTerms(threadData, _e2);
if (listEmpty(tmpMeta21)) goto goto_2;
tmpMeta22 = MMC_CAR(tmpMeta21);
tmpMeta23 = MMC_CDR(tmpMeta21);
if (listEmpty(tmpMeta23)) goto goto_2;
tmpMeta24 = MMC_CAR(tmpMeta23);
tmpMeta25 = MMC_CDR(tmpMeta23);
_f1 = tmpMeta21;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeProduct, _e1);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,9,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta26;
_e2 = tmpMeta28;
tmp4 += 2;
tmpMeta29 = omc_Expression_allTerms(threadData, _e2);
if (listEmpty(tmpMeta29)) goto goto_2;
tmpMeta30 = MMC_CAR(tmpMeta29);
tmpMeta31 = MMC_CDR(tmpMeta29);
if (listEmpty(tmpMeta31)) goto goto_2;
tmpMeta32 = MMC_CAR(tmpMeta31);
tmpMeta33 = MMC_CDR(tmpMeta31);
_f1 = tmpMeta29;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeProduct, _e1);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,11,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta34;
_e2 = tmpMeta36;
tmp4 += 2;
tmpMeta37 = omc_Expression_allTerms(threadData, _e2);
if (listEmpty(tmpMeta37)) goto goto_2;
tmpMeta38 = MMC_CAR(tmpMeta37);
tmpMeta39 = MMC_CDR(tmpMeta37);
if (listEmpty(tmpMeta39)) goto goto_2;
tmpMeta40 = MMC_CAR(tmpMeta39);
tmpMeta41 = MMC_CDR(tmpMeta39);
_f1 = tmpMeta37;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeProduct, _e1);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,2,1) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta42;
_e2 = tmpMeta44;
tmp4 += 10;
tmpMeta45 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta45)) goto goto_2;
tmpMeta46 = MMC_CAR(tmpMeta45);
tmpMeta47 = MMC_CDR(tmpMeta45);
if (listEmpty(tmpMeta47)) goto goto_2;
tmpMeta48 = MMC_CAR(tmpMeta47);
tmpMeta49 = MMC_CDR(tmpMeta47);
_f1 = tmpMeta45;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeProduct, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta51,9,1) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta50;
_e2 = tmpMeta52;
tmp4 += 9;
tmpMeta53 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta53)) goto goto_2;
tmpMeta54 = MMC_CAR(tmpMeta53);
tmpMeta55 = MMC_CDR(tmpMeta53);
if (listEmpty(tmpMeta55)) goto goto_2;
tmpMeta56 = MMC_CAR(tmpMeta55);
tmpMeta57 = MMC_CDR(tmpMeta55);
_f1 = tmpMeta53;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeProduct, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta59,11,1) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta58;
_e2 = tmpMeta60;
tmp4 += 8;
tmpMeta61 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta61)) goto goto_2;
tmpMeta62 = MMC_CAR(tmpMeta61);
tmpMeta63 = MMC_CDR(tmpMeta61);
if (listEmpty(tmpMeta63)) goto goto_2;
tmpMeta64 = MMC_CAR(tmpMeta63);
tmpMeta65 = MMC_CDR(tmpMeta63);
_f1 = tmpMeta61;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeProduct, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta67,3,1) == 0) goto tmp3_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta66;
_e2 = tmpMeta68;
tmp4 += 7;
tmpMeta69 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta69)) goto goto_2;
tmpMeta70 = MMC_CAR(tmpMeta69);
tmpMeta71 = MMC_CDR(tmpMeta69);
if (listEmpty(tmpMeta71)) goto goto_2;
tmpMeta72 = MMC_CAR(tmpMeta71);
tmpMeta73 = MMC_CDR(tmpMeta71);
_f1 = tmpMeta69;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_expDiv, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
modelica_metatype tmpMeta81;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta74 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta75,10,1) == 0) goto tmp3_end;
tmpMeta76 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta74;
_e2 = tmpMeta76;
tmp4 += 6;
tmpMeta77 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta77)) goto goto_2;
tmpMeta78 = MMC_CAR(tmpMeta77);
tmpMeta79 = MMC_CDR(tmpMeta77);
if (listEmpty(tmpMeta79)) goto goto_2;
tmpMeta80 = MMC_CAR(tmpMeta79);
tmpMeta81 = MMC_CDR(tmpMeta79);
_f1 = tmpMeta77;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_expDiv, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_metatype tmpMeta87;
modelica_metatype tmpMeta88;
modelica_metatype tmpMeta89;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta83 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta83,16,1) == 0) goto tmp3_end;
tmpMeta84 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta82;
_e2 = tmpMeta84;
tmp4 += 5;
tmpMeta85 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta85)) goto goto_2;
tmpMeta86 = MMC_CAR(tmpMeta85);
tmpMeta87 = MMC_CDR(tmpMeta85);
if (listEmpty(tmpMeta87)) goto goto_2;
tmpMeta88 = MMC_CAR(tmpMeta87);
tmpMeta89 = MMC_CDR(tmpMeta87);
_f1 = tmpMeta85;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_expDiv, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta90;
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
modelica_metatype tmpMeta95;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta90 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta91 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta91,17,1) == 0) goto tmp3_end;
tmpMeta92 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta90;
_e2 = tmpMeta92;
tmp4 += 4;
tmpMeta93 = omc_Expression_allTerms(threadData, _e1);
if (listEmpty(tmpMeta93)) goto goto_2;
tmpMeta94 = MMC_CAR(tmpMeta93);
tmpMeta95 = MMC_CDR(tmpMeta93);
if (listEmpty(tmpMeta95)) goto goto_2;
tmpMeta96 = MMC_CAR(tmpMeta95);
tmpMeta97 = MMC_CDR(tmpMeta95);
_f1 = tmpMeta93;
_f1 = omc_List_map1(threadData, _f1, boxvar_Expression_expDiv, _e2);
tmpMeta1 = omc_List_flatten(threadData, omc_List_map(threadData, _f1, boxvar_Expression_allTerms));
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta98,5,1) == 0) goto tmp3_end;
tmpMeta99 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta99;
tmp4 += 3;
_f1 = omc_Expression_allTerms(threadData, _e1);
tmpMeta1 = omc_List_map(threadData, _f1, boxvar_Expression_negate);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta100;
modelica_metatype tmpMeta101;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta100 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta100,6,1) == 0) goto tmp3_end;
tmpMeta101 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta101;
tmp4 += 2;
_f1 = omc_Expression_allTerms(threadData, _e1);
tmpMeta1 = omc_List_map(threadData, _f1, boxvar_Expression_negate);
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta102;
modelica_metatype tmpMeta103;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta102 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta102,24,1) == 0) goto tmp3_end;
tmpMeta103 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta103;
tmp4 += 1;
_f1 = omc_Expression_allTerms(threadData, _e1);
tmpMeta1 = omc_List_map(threadData, _f1, boxvar_Expression_negate);
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta104 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta105 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta104;
_f2 = tmpMeta105;
_f1 = omc_Expression_allTerms(threadData, _e1);
tmpMeta1 = omc_List_map1(threadData, _f1, boxvar_Expression_makeASUB, _f2);
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta106;
tmpMeta106 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta106;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 19) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExpLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getAllCrefsExpanded2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefList, modelica_metatype *out_outCrefList)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outCrefList = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _crlst = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
_outCrefList = _inCrefList;
if(omc_Expression_isCref(threadData, _inExp))
{
tmpMeta1 = _inExp;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,6,2) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_cr = tmpMeta2;
_crlst = omc_ComponentReference_expandCref(threadData, _cr, 1);
{
modelica_metatype _c;
for (tmpMeta3 = _crlst; !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
{
_c = MMC_CAR(tmpMeta3);
if(((!omc_ComponentReference_crefEqual(threadData, _c, _OMC_LIT179)) && (!listMember(_c, _inCrefList))))
{
tmpMeta4 = mmc_mk_cons(_c, _outCrefList);
_outCrefList = tmpMeta4;
}
}
}
}
_return: OMC_LABEL_UNUSED
if (out_outCrefList) { *out_outCrefList = _outCrefList; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_getAllCrefsExpanded(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outCrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_getAllCrefsExpanded2, tmpMeta1 ,&_outCrefs);
_return: OMC_LABEL_UNUSED
return _outCrefs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getAllCrefs2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inCrefList, modelica_metatype *out_outCrefList)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outCrefList = NULL;
modelica_metatype _cr = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
_outCrefList = _inCrefList;
if(omc_Expression_isCref(threadData, _inExp))
{
tmpMeta1 = _inExp;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,6,2) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_cr = tmpMeta2;
if(((!omc_ComponentReference_crefEqual(threadData, _cr, _OMC_LIT179)) && (!listMember(_cr, _inCrefList))))
{
tmpMeta3 = mmc_mk_cons(_cr, _outCrefList);
_outCrefList = tmpMeta3;
}
}
_return: OMC_LABEL_UNUSED
if (out_outCrefList) { *out_outCrefList = _outCrefList; }
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_getAllCrefs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outCrefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Expression_traverseExpBottomUp(threadData, _inExp, boxvar_Expression_getAllCrefs2, tmpMeta1 ,&_outCrefs);
_return: OMC_LABEL_UNUSED
return _outCrefs;
}
DLLExport
modelica_metatype omc_Expression_getRelations(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _cond = NULL;
modelica_metatype _tb = NULL;
modelica_metatype _fb = NULL;
modelica_metatype _rellst1 = NULL;
modelica_metatype _rellst2 = NULL;
modelica_metatype _rellst3 = NULL;
modelica_metatype _rellst4 = NULL;
modelica_metatype _xs = NULL;
modelica_metatype _t = NULL;
modelica_boolean _sc;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 9; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
_e = tmp4_1;
tmpMeta6 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta7;
_e2 = tmpMeta8;
_rellst1 = omc_Expression_getRelations(threadData, _e1);
_rellst2 = omc_Expression_getRelations(threadData, _e2);
tmpMeta1 = listAppend(_rellst1, _rellst2);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta9;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta10;
_e2 = tmpMeta11;
_rellst1 = omc_Expression_getRelations(threadData, _e1);
_rellst2 = omc_Expression_getRelations(threadData, _e2);
tmpMeta1 = listAppend(_rellst1, _rellst2);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 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));
_cond = tmpMeta12;
_tb = tmpMeta13;
_fb = tmpMeta14;
_rellst1 = omc_Expression_getRelations(threadData, _cond);
_rellst2 = omc_Expression_getRelations(threadData, _tb);
_rellst3 = omc_Expression_getRelations(threadData, _fb);
_rellst4 = listAppend(_rellst1, _rellst2);
tmpMeta1 = listAppend(_rellst3, _rellst4);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta15)) goto tmp3_end;
tmpMeta16 = MMC_CAR(tmpMeta15);
tmpMeta17 = MMC_CDR(tmpMeta15);
if (!listEmpty(tmpMeta17)) goto tmp3_end;
_e = tmpMeta16;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_integer tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 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;
tmpMeta22 = MMC_CAR(tmpMeta21);
tmpMeta23 = MMC_CDR(tmpMeta21);
_t = tmpMeta18;
_sc = tmp20;
_e = tmpMeta22;
_xs = tmpMeta23;
tmpMeta24 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _t, mmc_mk_boolean(_sc), _xs);
_rellst1 = omc_Expression_getRelations(threadData, tmpMeta24);
_rellst2 = omc_Expression_getRelations(threadData, _e);
tmpMeta1 = listAppend(_rellst1, _rellst2);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta25;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta26;
tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta26;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExpLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
DLLExport
modelica_metatype omc_Expression_typeofOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperator;
{
modelica_metatype _t = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta5;
tmpMeta1 = _t;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta6;
tmpMeta1 = _t;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta7;
tmpMeta1 = _t;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta8;
tmpMeta1 = _t;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta9;
tmpMeta1 = _t;
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));
_t = tmpMeta10;
tmpMeta1 = _t;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta11;
tmpMeta1 = _t;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta12;
tmpMeta1 = _t;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta13;
tmpMeta1 = _t;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta14;
tmpMeta1 = _t;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta15;
tmpMeta1 = _t;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta16;
tmpMeta1 = _t;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta17;
tmpMeta1 = _t;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta18;
tmpMeta1 = _t;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,1) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta19;
tmpMeta1 = _t;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta20;
tmpMeta1 = _t;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta21;
tmpMeta1 = _t;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,1) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta22;
tmpMeta1 = _t;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta23;
tmpMeta1 = _t;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta24;
tmpMeta1 = _t;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,1) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta25;
tmpMeta1 = _t;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta26;
tmpMeta1 = _t;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta27;
tmpMeta1 = _t;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,23,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta28;
tmpMeta1 = _t;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta29;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,1) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta29;
tmpMeta1 = _t;
goto tmp3_done;
}
case 28: {
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta30;
tmpMeta1 = _t;
goto tmp3_done;
}
case 29: {
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,26,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta31;
tmpMeta1 = _t;
goto tmp3_done;
}
case 30: {
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,1) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta32;
tmpMeta1 = _t;
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta33;
tmpMeta1 = _t;
goto tmp3_done;
}
case 32: {
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,1) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta34;
tmpMeta1 = _t;
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta35;
tmpMeta1 = _t;
goto tmp3_done;
}
case 34: {
tmpMeta1 = _OMC_LIT42;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_typeofRelation(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _ty = NULL;
modelica_metatype _dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
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));
_ty = tmpMeta6;
_dims = tmpMeta7;
omc_Expression_typeofRelation(threadData, _ty);
tmpMeta8 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, _dims);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _OMC_LIT173;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_typeof(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _tp = NULL;
modelica_metatype _op = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _iterExp = NULL;
modelica_metatype _operExp = NULL;
modelica_metatype _explist = NULL;
modelica_metatype _exps = NULL;
modelica_metatype _p = NULL;
modelica_string _msg = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _iterTp = NULL;
modelica_metatype _operTp = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _typeVars = NULL;
modelica_integer _i;
modelica_metatype _dim = NULL;
modelica_metatype _iterdims = 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 < 40; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmp4 += 38;
tmpMeta1 = _OMC_LIT176;
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmp4 += 37;
tmpMeta1 = _OMC_LIT134;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmp4 += 36;
tmpMeta1 = _OMC_LIT180;
goto tmp3_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp4 += 35;
tmpMeta1 = _OMC_LIT173;
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,1) == 0) goto tmp3_end;
tmp4 += 34;
tmpMeta1 = _OMC_LIT181;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,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));
tmp8 = mmc_unbox_integer(tmpMeta7);
_p = tmpMeta6;
_i = tmp8;
tmp4 += 33;
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta12 = mmc_mk_box6(8, &DAE_Type_T__ENUMERATION__desc, mmc_mk_some(mmc_mk_integer(_i)), _p, tmpMeta9, tmpMeta10, tmpMeta11);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta13;
tmp4 += 32;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta14;
tmp4 += 31;
tmpMeta1 = omc_Expression_typeofOp(threadData, _op);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_op = tmpMeta15;
tmp4 += 30;
tmpMeta1 = omc_Expression_typeofOp(threadData, _op);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta16;
tmp4 += 29;
tmpMeta1 = omc_Expression_typeofOp(threadData, _op);
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_op = tmpMeta17;
tmp4 += 28;
tmpMeta1 = omc_Expression_typeofOp(threadData, _op);
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta18;
tmp4 += 27;
tmpMeta1 = omc_Expression_typeofRelation(threadData, omc_Expression_typeofOp(threadData, _op));
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e2 = tmpMeta19;
tmp4 += 26;
tmpMeta1 = omc_Expression_typeof(threadData, _e2);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta20), 2));
_tp = tmpMeta21;
tmp4 += 25;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_tp = tmpMeta22;
tmp4 += 24;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta23;
tmp4 += 23;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta24;
tmp4 += 22;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta25;
tmp4 += 21;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta26;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta26;
tmp4 += 20;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta27;
tmp4 += 19;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_integer tmp30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta28;
_explist = tmpMeta29;
tmp4 += 18;
{
modelica_integer __omcQ_24tmpVar21;
modelica_integer __omcQ_24tmpVar20;
modelica_integer tmp31;
modelica_metatype _e_loopVar = 0;
modelica_metatype _e;
_e_loopVar = _explist;
__omcQ_24tmpVar21 = ((modelica_integer) 0);
while(1) {
tmp31 = 1;
while (!listEmpty(_e_loopVar)) {
_e = MMC_CAR(_e_loopVar);
_e_loopVar = MMC_CDR(_e_loopVar);
if (omc_Expression_isScalar(threadData, _e)) {
tmp31--;
break;
}
}
if (tmp31 == 0) {
__omcQ_24tmpVar20 = ((modelica_integer) 1);
__omcQ_24tmpVar21 = __omcQ_24tmpVar21 + __omcQ_24tmpVar20;
} else if (tmp31 == 1) {
break;
} else {
goto goto_2;
}
}
tmp30 = __omcQ_24tmpVar21;
}
_i = tmp30;
tmpMeta1 = omc_Expression_unliftArrayX(threadData, omc_Expression_typeof(threadData, _e), _i);
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta32;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta32;
tmp4 += 17;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 22: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,23,4) == 0) goto tmp3_end;
tmp4 += 16;
tmpMeta1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 5)));
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta33;
tmp4 += 15;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_boolean tmp47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta35,1,1) == 0) goto tmp3_end;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 2));
if (5 != MMC_STRLEN(tmpMeta36) || strcmp(MMC_STRINGDATA(_OMC_LIT189), MMC_STRINGDATA(tmpMeta36)) != 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,6,2) == 0) goto tmp3_end;
tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 3));
if (listEmpty(tmpMeta38)) goto tmp3_end;
tmpMeta39 = MMC_CAR(tmpMeta38);
tmpMeta40 = MMC_CDR(tmpMeta38);
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta42)) goto tmp3_end;
tmpMeta43 = MMC_CAR(tmpMeta42);
tmpMeta44 = MMC_CDR(tmpMeta42);
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 3));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 4));
if (!optionNone(tmpMeta46)) goto tmp3_end;
if (!listEmpty(tmpMeta44)) goto tmp3_end;
_dim = tmpMeta39;
_operExp = tmpMeta41;
_iterExp = tmpMeta45;
tmp47 = omc_Expression_dimensionKnown(threadData, _dim);
if (0 != tmp47) goto goto_2;
_iterTp = omc_Expression_typeof(threadData, _iterExp);
_operTp = omc_Expression_typeof(threadData, _operExp);
tmpMeta48 = _iterTp;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta48,6,2) == 0) goto goto_2;
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta48), 3));
_iterdims = tmpMeta49;
tmpMeta1 = omc_Types_liftTypeWithDims(threadData, _operTp, _iterdims);
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta50), 4));
_ty = tmpMeta51;
tmp4 += 13;
tmpMeta1 = omc_Types_simplifyType(threadData, _ty);
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta52;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (!optionNone(tmpMeta52)) goto tmp3_end;
tmp4 += 12;
tmpMeta1 = _OMC_LIT183;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta53)) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta53), 1));
tmp4 += 11;
tmpMeta1 = _OMC_LIT176;
goto tmp3_done;
}
case 28: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmp4 += 10;
tmpMeta1 = _OMC_LIT185;
goto tmp3_done;
}
case 29: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,29,2) == 0) goto tmp3_end;
tmp4 += 9;
tmpMeta1 = _OMC_LIT185;
goto tmp3_done;
}
case 30: {
modelica_metatype tmpMeta55;
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,30,1) == 0) goto tmp3_end;
tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exps = tmpMeta55;
tmp4 += 8;
_tys = omc_List_map(threadData, _exps, boxvar_Expression_typeof);
tmpMeta56 = mmc_mk_box2(21, &DAE_Type_T__METATUPLE__desc, _tys);
tmpMeta57 = mmc_mk_box2(28, &DAE_Type_T__METATYPE__desc, tmpMeta56);
tmpMeta1 = tmpMeta57;
goto tmp3_done;
}
case 31: {
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exps = tmpMeta58;
tmp4 += 7;
_tys = omc_List_map(threadData, _exps, boxvar_Expression_typeof);
tmpMeta59 = mmc_mk_box3(17, &DAE_Type_T__TUPLE__desc, _tys, mmc_mk_none());
tmpMeta1 = tmpMeta59;
goto tmp3_done;
}
case 32: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,31,1) == 0) goto tmp3_end;
tmp4 += 6;
tmpMeta1 = _OMC_LIT187;
goto tmp3_done;
}
case 33: {
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_integer tmp62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,32,5) == 0) goto tmp3_end;
tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp62 = mmc_unbox_integer(tmpMeta61);
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_p = tmpMeta60;
_i = tmp62;
_typeVars = tmpMeta63;
tmp4 += 5;
tmpMeta64 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta65 = mmc_mk_box7(24, &DAE_Type_T__METARECORD__desc, _p, omc_AbsynUtil_stripLast(threadData, _p), _typeVars, mmc_mk_integer(_i), tmpMeta64, mmc_mk_boolean(0));
tmpMeta66 = mmc_mk_box2(28, &DAE_Type_T__METATYPE__desc, tmpMeta65);
tmpMeta1 = tmpMeta66;
goto tmp3_done;
}
case 34: {
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta67;
tmp4 += 4;
tmpMeta68 = mmc_mk_box2(26, &DAE_Type_T__METABOXED__desc, omc_Expression_typeof(threadData, _e));
tmpMeta69 = mmc_mk_box2(28, &DAE_Type_T__METATYPE__desc, tmpMeta68);
tmpMeta1 = tmpMeta69;
goto tmp3_done;
}
case 35: {
modelica_metatype tmpMeta70;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,33,6) == 0) goto tmp3_end;
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
_tp = tmpMeta70;
tmp4 += 3;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 36: {
modelica_metatype tmpMeta71;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,35,2) == 0) goto tmp3_end;
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_tp = tmpMeta71;
tmp4 += 2;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 37: {
modelica_metatype tmpMeta72;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,36,2) == 0) goto tmp3_end;
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta72;
tmp4 += 1;
tmpMeta1 = omc_Expression_typeof(threadData, _e);
goto tmp3_done;
}
case 38: {
modelica_metatype tmpMeta73;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,26,4) == 0) goto tmp3_end;
tmpMeta73 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta73;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 39: {
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
_e = tmp4_1;
tmpMeta74 = stringAppend(_OMC_LIT188,omc_ExpressionDump_printExpStr(threadData, _e));
_msg = tmpMeta74;
tmpMeta75 = mmc_mk_cons(_msg, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT31, tmpMeta75);
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 < 40) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_dimensionsSizes(threadData_t *threadData, modelica_metatype _inDims)
{
modelica_metatype _outValues = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outValues = omc_List_map(threadData, _inDims, boxvar_Expression_dimensionSizeAll);
_return: OMC_LABEL_UNUSED
return _outValues;
}
DLLExport
modelica_integer omc_Expression_dimensionSizeAll(threadData_t *threadData, modelica_metatype _dim)
{
modelica_integer _value;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
modelica_integer _i;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmp4 += 5;
tmp1 = _i;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp9 = mmc_unbox_integer(tmpMeta8);
_i = tmp9;
tmp4 += 4;
tmp1 = _i;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
tmp4 += 3;
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta10;
tmp1 = omc_Expression_expInt(threadData, _e);
goto tmp3_done;
}
case 4: {
modelica_boolean tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmp4 += 1;
tmp11 = omc_Flags_getConfigBool(threadData, _OMC_LIT195);
if (1 != tmp11) goto goto_2;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 5: {
modelica_boolean tmp12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,0) == 0) goto tmp3_end;
tmp12 = omc_Flags_getConfigBool(threadData, _OMC_LIT195);
if (1 != tmp12) goto goto_2;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 6) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_value = tmp1;
_return: OMC_LABEL_UNUSED
return _value;
}
modelica_metatype boxptr_Expression_dimensionSizeAll(threadData_t *threadData, modelica_metatype _dim)
{
modelica_integer _value;
modelica_metatype out_value;
_value = omc_Expression_dimensionSizeAll(threadData, _dim);
out_value = mmc_mk_icon(_value);
return out_value;
}
DLLExport
modelica_metatype omc_Expression_addDimensions(threadData_t *threadData, modelica_metatype _dim1, modelica_metatype _dim2)
{
modelica_metatype _dim = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_integer _i;
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;
_i = omc_Expression_dimensionSize(threadData, _dim1) + omc_Expression_dimensionSize(threadData, _dim2);
tmpMeta6 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _OMC_LIT117;
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:;
}
}
_dim = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _dim;
}
DLLExport
modelica_integer omc_Expression_dimensionSize(threadData_t *threadData, modelica_metatype _dim)
{
modelica_integer _value;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
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;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmp1 = _i;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp9 = mmc_unbox_integer(tmpMeta8);
_i = tmp9;
tmp1 = _i;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 2);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
_i = tmp12;
tmp1 = _i;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_integer tmp15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,5,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
tmp15 = mmc_unbox_integer(tmpMeta14);
_i = tmp15;
tmp1 = _i;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_value = tmp1;
_return: OMC_LABEL_UNUSED
return _value;
}
modelica_metatype boxptr_Expression_dimensionSize(threadData_t *threadData, modelica_metatype _dim)
{
modelica_integer _value;
modelica_metatype out_value;
_value = omc_Expression_dimensionSize(threadData, _dim);
out_value = mmc_mk_icon(_value);
return out_value;
}
DLLExport
modelica_integer omc_Expression_sizeOf(threadData_t *threadData, modelica_metatype _inType)
{
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _ad = NULL;
modelica_integer _nr;
modelica_metatype _lstInt = NULL;
modelica_metatype _varLst = NULL;
modelica_metatype _typs = 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 < 8; 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), 3));
_ad = tmpMeta6;
tmp4 += 6;
_nr = omc_Expression_dimensionSize(threadData, omc_List_reduce(threadData, _ad, boxvar_Expression_dimensionsMult));
tmp1 = (_nr) * (omc_Expression_sizeOf(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inType), 2)))));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,17,1) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_varLst = tmpMeta8;
tmp4 += 4;
_lstInt = omc_List_mapMap(threadData, _varLst, boxvar_Expression_varType, boxvar_Expression_sizeOf);
tmp1 = mmc_unbox_integer(omc_List_reduce(threadData, _lstInt, boxvar_intAdd));
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_typs = tmpMeta9;
tmp4 += 3;
tmp1 = mmc_unbox_integer(omc_List_applyAndFold(threadData, _typs, boxvar_intAdd, boxvar_Expression_sizeOf, mmc_mk_integer(((modelica_integer) 0))));
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,4) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_ty = tmpMeta10;
tmp4 += 2;
tmp1 = omc_Expression_sizeOf(threadData, _ty);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_ty = tmpMeta11;
tmp4 += 1;
tmp1 = omc_Expression_sizeOf(threadData, _ty);
goto tmp3_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,0) == 0) goto tmp3_end;
tmp1 = ((modelica_integer) 0);
goto tmp3_done;
}
case 7: {
tmp1 = ((modelica_integer) 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 < 8) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_i = tmp1;
_return: OMC_LABEL_UNUSED
return _i;
}
modelica_metatype boxptr_Expression_sizeOf(threadData_t *threadData, modelica_metatype _inType)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_Expression_sizeOf(threadData, _inType);
out_i = mmc_mk_icon(_i);
return out_i;
}
DLLExport
modelica_metatype omc_Expression_arrayEltType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _t = 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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_t = tmpMeta6;
_inType = _t;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inType;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_subscriptDimension(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_metatype _outDimension = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
modelica_integer _x;
modelica_metatype _e = NULL;
modelica_string _sub_str = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
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 (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
_x = tmp8;
tmpMeta9 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_x));
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta10;
tmpMeta11 = mmc_mk_box2(6, &DAE_Dimension_DIM__EXP__desc, _e);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT117;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_x = tmp14;
if (!(!omc_Config_splitArrays(threadData))) goto tmp3_end;
tmpMeta15 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_x));
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta16;
if (!(!omc_Config_splitArrays(threadData))) goto tmp3_end;
tmpMeta17 = mmc_mk_box2(6, &DAE_Dimension_DIM__EXP__desc, _e);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 5: {
modelica_boolean tmp18;
modelica_metatype tmpMeta19;
tmp18 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp18) goto goto_2;
_sub_str = omc_ExpressionDump_subscriptString(threadData, _inSubscript);
tmpMeta19 = stringAppend(_OMC_LIT196,_sub_str);
omc_Debug_traceln(threadData, tmpMeta19);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDimension = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDimension;
}
DLLExport
modelica_metatype omc_Expression_subscriptDimensions(threadData_t *threadData, modelica_metatype _inSubscripts)
{
modelica_metatype _outDimensions = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outDimensions = omc_List_map(threadData, _inSubscripts, boxvar_Expression_subscriptDimension);
_return: OMC_LABEL_UNUSED
return _outDimensions;
}
DLLExport
modelica_metatype omc_Expression_arrayTypeDimensions(threadData_t *threadData, modelica_metatype _tp)
{
modelica_metatype _dims = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _tp;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; 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), 3));
_dims = tmpMeta6;
tmpMeta1 = _dims;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_dims = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _dims;
}
DLLExport
modelica_metatype omc_Expression_arrayDimension(threadData_t *threadData, modelica_metatype _tp)
{
modelica_metatype _dims = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _tp;
{
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_dims = tmpMeta6;
tmpMeta1 = _dims;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_dims = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _dims;
}
DLLExport
modelica_metatype omc_Expression_expDimensions(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outDims = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _tp = NULL;
modelica_metatype _e = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 19: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta5;
tmpMeta1 = omc_Expression_arrayDimension(threadData, _tp);
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta6;
tmpMeta1 = omc_Expression_arrayDimension(threadData, _tp);
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta8;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_tp = tmpMeta10;
tmpMeta1 = omc_Expression_arrayDimension(threadData, _tp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDims = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDims;
}
DLLExport
modelica_metatype omc_Expression_expLastSubs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outSubscriptLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
tmpMeta1 = omc_ComponentReference_crefLastSubs(threadData, _cr);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscriptLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscriptLst;
}
DLLExport
modelica_metatype omc_Expression_nthArrayExp(threadData_t *threadData, modelica_metatype _inExp, modelica_integer _inInteger)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e_1 = NULL;
modelica_metatype _e_2 = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _op = 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: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta6;
_op = tmpMeta7;
_e2 = tmpMeta8;
tmp4 += 1;
_ty = omc_Expression_typeofOp(threadData, _op);
tmp9 = omc_Types_isArray(threadData, _ty);
if (1 != tmp9) goto goto_2;
_e_1 = omc_Expression_nthArrayExp(threadData, _e1, _inInteger);
_e_2 = omc_Expression_nthArrayExp(threadData, _e2, _inInteger);
tmpMeta10 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e_1, _op, _e_2);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta11;
tmpMeta1 = listGet(_expl, _inInteger);
goto tmp3_done;
}
case 2: {
tmpMeta1 = _inExp;
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 = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
modelica_metatype boxptr_Expression_nthArrayExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inInteger)
{
modelica_integer tmp1;
modelica_metatype _outExp = NULL;
tmp1 = mmc_unbox_integer(_inInteger);
_outExp = omc_Expression_nthArrayExp(threadData, _inExp, tmp1);
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_subscriptIsFirst(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_boolean _outIsFirst;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
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_integer tmp8;
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,0,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (1 != tmp8) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_integer tmp11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmp11 = mmc_unbox_integer(tmpMeta10);
if (0 != tmp11) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,5,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
tmp14 = mmc_unbox_integer(tmpMeta13);
if (1 != tmp14) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsFirst = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsFirst;
}
modelica_metatype boxptr_Expression_subscriptIsFirst(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_boolean _outIsFirst;
modelica_metatype out_outIsFirst;
_outIsFirst = omc_Expression_subscriptIsFirst(threadData, _inSubscript);
out_outIsFirst = mmc_mk_icon(_outIsFirst);
return out_outIsFirst;
}
DLLExport
modelica_metatype omc_Expression_subscriptNonExpandedExp(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta6;
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_getSubscriptExp(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscript;
{
modelica_metatype _e = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta5;
tmpMeta1 = _e;
goto tmp3_done;
}
case 5: {
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 = tmpMeta6;
tmpMeta1 = _e;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta7;
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_subscriptIndexExp(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inSubscript;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,2,1) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_outExp = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_boxExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
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,34,1) == 0) goto tmp3_end;
tmpMeta1 = _e;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_box2(37, &DAE_Exp_BOX__desc, _e);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_unboxExp(threadData_t *threadData, modelica_metatype _ie)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ie;
{
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,34,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta6;
_ie = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _ie;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_unboxExpType(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _ty = 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,23,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_ty = tmpMeta6;
tmpMeta1 = _ty;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inType;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_get2dArrayOrMatrixContent(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _es = NULL;
modelica_metatype _ess = 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,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_es = tmpMeta6;
tmpMeta1 = omc_List_map(threadData, _es, boxvar_Expression_getArrayContents);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ess = tmpMeta7;
tmpMeta1 = _ess;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExps = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExps;
}
DLLExport
modelica_metatype omc_Expression_getArrayOrRangeContents(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _es = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_boolean _bstart;
modelica_boolean _bstop;
modelica_integer _istart;
modelica_integer _istep;
modelica_integer _istop;
modelica_real _rstart;
modelica_real _rstep;
modelica_real _rstop;
modelica_metatype _matrix = NULL;
modelica_metatype _ty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 8; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_es = tmpMeta6;
tmpMeta1 = _es;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta7;
_matrix = tmpMeta8;
_ty = omc_Types_unliftArray(threadData, _ty);
tmpMeta1 = omc_List_map2(threadData, _matrix, boxvar_Expression_makeArray, _ty, mmc_mk_boolean((!omc_Types_arrayType(threadData, _ty))));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,6,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
if (listEmpty(tmpMeta10)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmpMeta10);
tmpMeta12 = MMC_CDR(tmpMeta10);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
_istop = tmp14;
_es = omc_List_map(threadData, omc_ExpressionSimplify_simplifyRange(threadData, ((modelica_integer) 1), ((modelica_integer) 1), _istop), boxvar_Expression_makeIntegerExp);
tmpMeta1 = omc_List_map1r(threadData, _es, boxvar_Expression_makeASUBSingleSub, _e);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_integer tmp17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,3,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmp17 = mmc_unbox_integer(tmpMeta16);
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta18)) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,3,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp21 = mmc_unbox_integer(tmpMeta20);
_bstart = tmp17;
_bstop = tmp21;
tmpMeta1 = omc_List_map(threadData, omc_ExpressionSimplify_simplifyRangeBool(threadData, _bstart, _bstop), boxvar_Expression_makeBoolExp);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_integer tmp24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_integer tmp28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,0,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
tmp24 = mmc_unbox_integer(tmpMeta23);
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta25)) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,0,1) == 0) goto tmp3_end;
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
tmp28 = mmc_unbox_integer(tmpMeta27);
_istart = tmp24;
_istop = tmp28;
tmpMeta1 = omc_List_map(threadData, omc_ExpressionSimplify_simplifyRange(threadData, _istart, ((modelica_integer) 1), _istop), boxvar_Expression_makeIntegerExp);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_integer tmp31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_integer tmp35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_integer tmp38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,0,1) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmp31 = mmc_unbox_integer(tmpMeta30);
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta32)) goto tmp3_end;
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta33,0,1) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
tmp35 = mmc_unbox_integer(tmpMeta34);
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,0,1) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 2));
tmp38 = mmc_unbox_integer(tmpMeta37);
_istart = tmp31;
_istep = tmp35;
_istop = tmp38;
tmpMeta1 = omc_List_map(threadData, omc_ExpressionSimplify_simplifyRange(threadData, _istart, _istep, _istop), boxvar_Expression_makeIntegerExp);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_real tmp41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_real tmp45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta39,1,1) == 0) goto tmp3_end;
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
tmp41 = mmc_unbox_real(tmpMeta40);
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta42)) goto tmp3_end;
tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,1,1) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 2));
tmp45 = mmc_unbox_real(tmpMeta44);
_rstart = tmp41;
_rstop = tmp45;
tmpMeta1 = omc_List_map(threadData, omc_ExpressionSimplify_simplifyRangeReal(threadData, _rstart, 1.0, _rstop), boxvar_Expression_makeRealExp);
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_real tmp48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_real tmp52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_real tmp55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,1,1) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
tmp48 = mmc_unbox_real(tmpMeta47);
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta49)) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta49), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta50,1,1) == 0) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta50), 2));
tmp52 = mmc_unbox_real(tmpMeta51);
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta53,1,1) == 0) goto tmp3_end;
tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta53), 2));
tmp55 = mmc_unbox_real(tmpMeta54);
_rstart = tmp48;
_rstep = tmp52;
_rstop = tmp55;
tmpMeta1 = omc_List_map(threadData, omc_ExpressionSimplify_simplifyRangeReal(threadData, _rstart, _rstep, _rstop), boxvar_Expression_makeRealExp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_es = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _es;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_getComplexContentsInCall(threadData_t *threadData, modelica_metatype _expIn)
{
modelica_metatype _expsOut = NULL;
modelica_metatype _expLst = NULL;
modelica_metatype tmpMeta1;
modelica_boolean tmp2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_expLst = omc_Expression_getComplexContents(threadData, _expIn);
tmp2 = (modelica_boolean)listEmpty(_expLst);
if(tmp2)
{
tmpMeta1 = mmc_mk_cons(_expIn, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta3 = tmpMeta1;
}
else
{
tmpMeta3 = _expLst;
}
_expsOut = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _expsOut;
}
static modelica_metatype closure1_Expression_makeBinaryExp(threadData_t *thData, modelica_metatype closure, modelica_metatype inLhs, modelica_metatype inRhs)
{
modelica_metatype inOp = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
return boxptr_Expression_makeBinaryExp(thData, inLhs, inOp, inRhs);
}
DLLExport
modelica_metatype omc_Expression_getComplexContents(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _es = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_boolean _noArr;
modelica_metatype _exp = NULL;
modelica_metatype _exp1 = NULL;
modelica_metatype _exp2 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _expLst = NULL;
modelica_metatype _expLst1 = NULL;
modelica_metatype _expLst2 = NULL;
modelica_metatype _expLstLst = 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 < 10; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_boolean tmp7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmp4 += 8;
_expLst = omc_Expression_arrayElements(threadData, _e);
_noArr = (listLength(_expLst) == ((modelica_integer) 1));
_exp = listHead(_expLst);
_noArr = (_noArr && omc_Expression_expEqual(threadData, _exp, _e));
tmp7 = (modelica_boolean)_noArr;
if(tmp7)
{
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta8 = tmpMeta6;
}
else
{
tmpMeta8 = _expLst;
}
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,7,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_exp1 = tmpMeta9;
_exp2 = tmpMeta11;
tmp4 += 7;
if(omc_Expression_isArray(threadData, _exp1))
{
_expLst1 = omc_Expression_getComplexContents(threadData, _exp1);
}
else
{
_expLst1 = omc_Expression_makeASUBsForDimension(threadData, _exp1);
}
if(omc_Expression_isArray(threadData, _exp2))
{
_expLst2 = omc_Expression_getComplexContents(threadData, _exp2);
}
else
{
_expLst2 = omc_Expression_makeASUBsForDimension(threadData, _exp2);
}
_ty = omc_Expression_typeof(threadData, listHead(_expLst1));
tmpMeta13 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _ty);
tmpMeta12 = mmc_mk_box1(0, tmpMeta13);
tmpMeta1 = omc_List_threadMap(threadData, _expLst1, _expLst2, (modelica_fnptr) mmc_mk_box2(0,closure1_Expression_makeBinaryExp,tmpMeta12));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_expLst = tmpMeta14;
tmp4 += 6;
_expLstLst = omc_List_map(threadData, _expLst, boxvar_Expression_getComplexContentsInCall);
tmpMeta1 = omc_List_flatten(threadData, _expLstLst);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_expLst = tmpMeta15;
tmp4 += 5;
_expLstLst = omc_List_map(threadData, _expLst, boxvar_Expression_getComplexContentsInCall);
tmpMeta1 = omc_List_flatten(threadData, _expLstLst);
goto tmp3_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmp4 += 4;
tmpMeta1 = omc_Expression_arrayElements(threadData, _e);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expLstLst = tmpMeta16;
tmp4 += 3;
tmpMeta1 = omc_List_flatten(threadData, _expLstLst);
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expLst = tmpMeta17;
tmp4 += 2;
tmpMeta1 = _expLst;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp = tmpMeta18;
tmp4 += 1;
tmpMeta1 = omc_Expression_getComplexContents(threadData, _exp);
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_exp = tmpMeta19;
tmpMeta1 = omc_Expression_getComplexContents(threadData, _exp);
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta20;
tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta20;
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 < 10) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_es = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _es;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeASUBsForDimension(threadData_t *threadData, modelica_metatype _eIn)
{
modelica_metatype _eLstOut = NULL;
modelica_metatype tmpMeta1;
modelica_integer _size;
modelica_metatype _dims = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_eLstOut = tmpMeta1;
_dims = omc_Expression_expDimensions(threadData, _eIn);
{
{
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_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_integer tmp13;
modelica_integer tmp14;
modelica_integer tmp15;
tmpMeta6 = _dims;
if (listEmpty(tmpMeta6)) goto goto_2;
tmpMeta7 = MMC_CAR(tmpMeta6);
tmpMeta8 = MMC_CDR(tmpMeta6);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmp10 = mmc_unbox_integer(tmpMeta9);
if (!listEmpty(tmpMeta8)) goto goto_2;
_size = tmp10;
tmp13 = _size; tmp14 = ((modelica_integer) -1); tmp15 = ((modelica_integer) 1);
if(!(((tmp14 > 0) && (tmp13 > tmp15)) || ((tmp14 < 0) && (tmp13 < tmp15))))
{
modelica_integer _i;
for(_i = _size; in_range_integer(_i, tmp13, tmp15); _i += tmp14)
{
tmpMeta12 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta11 = mmc_mk_cons(omc_Expression_makeASUBSingleSub(threadData, _eIn, tmpMeta12), _eLstOut);
_eLstOut = tmpMeta11;
}
}
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta16;
tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
_eLstOut = tmpMeta16;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return _eLstOut;
}
DLLExport
modelica_metatype omc_Expression_getArrayOrMatrixContents(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outContents = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _expl = NULL;
modelica_metatype _mat = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _el_ty = NULL;
modelica_metatype _dims = NULL;
modelica_boolean _sc;
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,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta6;
tmpMeta1 = _expl;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_el_ty = tmpMeta8;
_dims = tmpMeta11;
_mat = tmpMeta12;
tmpMeta13 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _el_ty, _dims);
_ty = tmpMeta13;
_sc = omc_Types_basicType(threadData, _el_ty);
tmpMeta1 = omc_List_map2(threadData, _mat, boxvar_Expression_makeArray, _ty, mmc_mk_boolean(_sc));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outContents = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outContents;
}
DLLExport
modelica_metatype omc_Expression_getArrayContents(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _es = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _e;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,16,3) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
_es = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _es;
}
DLLExport
modelica_metatype omc_Expression_expCrefInclIfExpFactors(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outComponentRefs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _tb = NULL;
modelica_metatype _fb = NULL;
modelica_metatype _f = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
tmpMeta7 = mmc_mk_cons(_cr, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tb = tmpMeta8;
_fb = tmpMeta9;
_f = omc_List_select(threadData, listAppend(omc_Expression_factors(threadData, _tb), omc_Expression_factors(threadData, _fb)), boxvar_Expression_isCref);
tmpMeta1 = omc_List_map(threadData, _f, boxvar_Expression_expCref);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outComponentRefs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComponentRefs;
}
DLLExport
modelica_metatype omc_Expression_expCrefTuple(threadData_t *threadData, modelica_metatype _inTuple)
{
modelica_metatype _outComponentRef = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTuple;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_cr = tmpMeta7;
tmpMeta1 = _cr;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outComponentRef = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComponentRef;
}
DLLExport
modelica_metatype omc_Expression_expCrefNegCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outComponentRef = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
tmpMeta1 = _cr;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,5,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_cr = tmpMeta9;
tmpMeta1 = _cr;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_cr = tmpMeta12;
tmpMeta1 = _cr;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outComponentRef = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComponentRef;
}
DLLExport
modelica_metatype omc_Expression_expCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outComponentRef = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; 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));
_cr = tmpMeta6;
tmpMeta1 = _cr;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outComponentRef = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outComponentRef;
}
DLLExport
modelica_metatype omc_Expression_expOrDerCref(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean *out_isDer)
{
modelica_metatype _outComponentRef = NULL;
modelica_boolean _isDer;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
tmpMeta[0+0] = _cr;
tmp1_c1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,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));
if (3 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (!listEmpty(tmpMeta11)) goto tmp3_end;
_cr = tmpMeta12;
tmpMeta[0+0] = _cr;
tmp1_c1 = 1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outComponentRef = tmpMeta[0+0];
_isDer = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_isDer) { *out_isDer = _isDer; }
return _outComponentRef;
}
modelica_metatype boxptr_Expression_expOrDerCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype *out_isDer)
{
modelica_boolean _isDer;
modelica_metatype _outComponentRef = NULL;
_outComponentRef = omc_Expression_expOrDerCref(threadData, _inExp, &_isDer);
if (out_isDer) { *out_isDer = mmc_mk_icon(_isDer); }
return _outComponentRef;
}
DLLExport
modelica_metatype omc_Expression_varType(threadData_t *threadData, modelica_metatype _v)
{
modelica_metatype _tp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _v;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_tp = tmpMeta6;
tmpMeta1 = _tp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_tp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _tp;
}
DLLExport
modelica_string omc_Expression_varName(threadData_t *threadData, modelica_metatype _v)
{
modelica_string _name = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _v;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_name = tmpMeta6;
tmp1 = _name;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_name = tmp1;
_return: OMC_LABEL_UNUSED
return _name;
}
DLLExport
modelica_string omc_Expression_sconstEnumNameString(threadData_t *threadData, modelica_metatype _exp)
{
modelica_string _str = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
modelica_string _s = NULL;
modelica_metatype _name = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_s = tmpMeta6;
tmp1 = _s;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_name = tmpMeta7;
tmp1 = omc_AbsynUtil_pathString(threadData, _name, _OMC_LIT47, 1, 0);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_str = tmp1;
_return: OMC_LABEL_UNUSED
return _str;
}
DLLExport
modelica_integer omc_Expression_expArrayIndex(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_integer _outIndex;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))));
goto tmp3_done;
}
case 8: {
tmp1 = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3))));
goto tmp3_done;
}
case 6: {
tmp1 = (mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))))?((modelica_integer) 2):((modelica_integer) 1));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIndex = tmp1;
_return: OMC_LABEL_UNUSED
return _outIndex;
}
modelica_metatype boxptr_Expression_expArrayIndex(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_integer _outIndex;
modelica_metatype out_outIndex;
_outIndex = omc_Expression_expArrayIndex(threadData, _inExp);
out_outIndex = mmc_mk_icon(_outIndex);
return out_outIndex;
}
DLLExport
modelica_metatype omc_Expression_getClockInterval(threadData_t *threadData, modelica_metatype _inClk)
{
modelica_metatype _outIntvl = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e2 = NULL;
modelica_integer _res;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inClk;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 5: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta5;
tmpMeta1 = _e;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,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));
_e = tmpMeta6;
_e2 = tmpMeta7;
tmpMeta8 = mmc_mk_box3(23, &DAE_Exp_CAST__desc, _OMC_LIT134, _e);
tmpMeta9 = mmc_mk_box3(23, &DAE_Exp_CAST__desc, _OMC_LIT134, _e2);
tmpMeta10 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, tmpMeta8, _OMC_LIT175, tmpMeta9);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
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));
_e = tmpMeta11;
_e2 = tmpMeta12;
tmpMeta1 = _e2;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _OMC_LIT135;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIntvl = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outIntvl;
}
DLLExport
modelica_integer omc_Expression_expInt(threadData_t *threadData, modelica_metatype _exp)
{
modelica_integer _i;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exp), 2))));
goto tmp3_done;
}
case 8: {
tmp1 = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exp), 3))));
goto tmp3_done;
}
case 6: {
tmp1 = (mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exp), 2))))?((modelica_integer) 1):((modelica_integer) 0));
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
return _i;
}
modelica_metatype boxptr_Expression_expInt(threadData_t *threadData, modelica_metatype _exp)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_Expression_expInt(threadData, _exp);
out_i = mmc_mk_icon(_i);
return out_i;
}
DLLExport
modelica_metatype omc_Expression_realExpIntLit(threadData_t *threadData, modelica_metatype _exp)
{
modelica_metatype _oi = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
modelica_real _r;
modelica_integer _i;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_real tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_real(tmpMeta6);
_r = tmp7;
_i = ((modelica_integer)floor(_r));
tmpMeta1 = ((_r == ((modelica_real)_i))?mmc_mk_some(mmc_mk_integer(_i)):mmc_mk_none());
goto tmp3_done;
}
case 1: {
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oi = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oi;
}
DLLExport
modelica_boolean omc_Expression_toBool(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBool;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inExp;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,3,1) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmp3 = mmc_unbox_integer(tmpMeta2);
_outBool = tmp3;
_return: OMC_LABEL_UNUSED
return _outBool;
}
modelica_metatype boxptr_Expression_toBool(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_boolean _outBool;
modelica_metatype out_outBool;
_outBool = omc_Expression_toBool(threadData, _inExp);
out_outBool = mmc_mk_icon(_outBool);
return out_outBool;
}
DLLExport
modelica_real omc_Expression_toReal(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_real _outReal;
modelica_real tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
tmp1 = mmc_unbox_real((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2))));
goto tmp3_done;
}
case 3: {
tmp1 = ((modelica_real)mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 2)))));
goto tmp3_done;
}
case 23: {
_inExp = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3)));
goto _tailrecursive;
goto tmp3_done;
}
case 8: {
tmp1 = ((modelica_real)mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExp), 3)))));
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outReal = tmp1;
_return: OMC_LABEL_UNUSED
return _outReal;
}
modelica_metatype boxptr_Expression_toReal(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_real _outReal;
modelica_metatype out_outReal;
_outReal = omc_Expression_toReal(threadData, _inExp);
out_outReal = mmc_mk_rcon(_outReal);
return out_outReal;
}
DLLExport
modelica_metatype omc_Expression_arrayDimensionSetFirst(threadData_t *threadData, modelica_metatype _inArrayType, modelica_metatype _dimension)
{
modelica_metatype _outArrayType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inArrayType;
{
modelica_metatype _ty = NULL;
modelica_metatype _rest_dims = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
_ty = tmpMeta6;
_rest_dims = tmpMeta9;
tmpMeta10 = mmc_mk_cons(_dimension, _rest_dims);
tmpMeta11 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta10);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArrayType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outArrayType;
}
DLLExport
modelica_metatype omc_Expression_arrayAppend(threadData_t *threadData, modelica_metatype _head, modelica_metatype _rest)
{
modelica_metatype _array = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _rest;
{
modelica_metatype _ty = NULL;
modelica_boolean _scalar;
modelica_metatype _expl = NULL;
modelica_integer _dim;
modelica_metatype _dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
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,16,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,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;
tmpMeta9 = MMC_CAR(tmpMeta8);
tmpMeta10 = MMC_CDR(tmpMeta8);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,0,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmp12 = mmc_unbox_integer(tmpMeta11);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp14 = mmc_unbox_integer(tmpMeta13);
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta7;
_dim = tmp12;
_dims = tmpMeta10;
_scalar = tmp14;
_expl = tmpMeta15;
_dim = ((modelica_integer) 1) + _dim;
tmpMeta17 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_dim));
tmpMeta16 = mmc_mk_cons(tmpMeta17, _dims);
_dims = tmpMeta16;
tmpMeta18 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, _dims);
tmpMeta19 = mmc_mk_cons(_head, _expl);
tmpMeta20 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, tmpMeta18, mmc_mk_boolean(_scalar), tmpMeta19);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 1: {
modelica_boolean tmp21;
tmp21 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp21) goto goto_2;
omc_Debug_traceln(threadData, _OMC_LIT197);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_array = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _array;
}
DLLExport
modelica_metatype omc_Expression_unliftArrayX(threadData_t *threadData, modelica_metatype _inType, modelica_integer _x)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_integer tmp4_1;
tmp4_1 = _x;
{
modelica_metatype _ty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (0 != tmp4_1) goto tmp3_end;
tmpMeta1 = _inType;
goto tmp3_done;
}
case 1: {
_ty = omc_Expression_unliftArray(threadData, _inType);
_inType = _ty;
_x = ((modelica_integer) -1) + _x;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
modelica_metatype boxptr_Expression_unliftArrayX(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _x)
{
modelica_integer tmp1;
modelica_metatype _outType = NULL;
tmp1 = mmc_unbox_integer(_x);
_outType = omc_Expression_unliftArrayX(threadData, _inType, tmp1);
return _outType;
}
DLLExport
modelica_metatype omc_Expression_unliftArrayTypeWithSubs(threadData_t *threadData, modelica_metatype _subs, modelica_metatype _ity)
{
modelica_metatype _oty = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _subs;
tmp4_2 = _ity;
{
modelica_metatype _rest = NULL;
modelica_metatype _ty = 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;
_ty = tmp4_2;
tmpMeta1 = _ty;
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);
_rest = tmpMeta7;
_ty = tmp4_2;
_ty = omc_Expression_unliftArray(threadData, _ty);
_subs = _rest;
_ity = _ty;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_oty = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _oty;
}
DLLExport
modelica_metatype omc_Expression_subscriptsReplaceSlice(threadData_t *threadData, modelica_metatype _inSubscripts, modelica_metatype _inSubscript)
{
modelica_metatype _outSubscripts = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscripts;
{
modelica_metatype _rest_subs = NULL;
modelica_metatype _sub = 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;
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;
_rest_subs = tmpMeta7;
tmpMeta8 = mmc_mk_cons(_inSubscript, _rest_subs);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmp4_1);
tmpMeta10 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,1) == 0) goto tmp3_end;
_rest_subs = tmpMeta10;
tmpMeta11 = mmc_mk_cons(_inSubscript, _rest_subs);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
_sub = tmpMeta12;
_rest_subs = tmpMeta13;
_rest_subs = omc_Expression_subscriptsReplaceSlice(threadData, _rest_subs, _inSubscript);
tmpMeta14 = mmc_mk_cons(_sub, _rest_subs);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscripts = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_subscriptsAppend(threadData_t *threadData, modelica_metatype _inSubscriptLst, modelica_metatype _inSubscript)
{
modelica_metatype _outSubscriptLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inSubscriptLst;
{
modelica_metatype _e_1 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _s = NULL;
modelica_metatype _ss_1 = NULL;
modelica_metatype _ss = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta7 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _inSubscript);
tmpMeta6 = mmc_mk_cons(tmpMeta7, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,0) == 0) goto tmp3_end;
_ss = tmpMeta9;
tmpMeta11 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _inSubscript);
tmpMeta10 = mmc_mk_cons(tmpMeta11, _ss);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmp4_1);
tmpMeta13 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,1,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
if (!listEmpty(tmpMeta13)) goto tmp3_end;
_e = tmpMeta14;
tmpMeta15 = mmc_mk_cons(_inSubscript, MMC_REFSTRUCTLIT(mmc_nil));
_e_1 = omc_ExpressionSimplify_simplify1(threadData, omc_Expression_makeASUB(threadData, _e, tmpMeta15), NULL);
tmpMeta17 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _e_1);
tmpMeta16 = mmc_mk_cons(tmpMeta17, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta18 = MMC_CAR(tmp4_1);
tmpMeta19 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,2,1) == 0) goto tmp3_end;
if (!listEmpty(tmpMeta19)) goto tmp3_end;
_s = tmpMeta18;
tmpMeta21 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, _inSubscript);
tmpMeta20 = mmc_mk_cons(_s, mmc_mk_cons(tmpMeta21, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta22 = MMC_CAR(tmp4_1);
tmpMeta23 = MMC_CDR(tmp4_1);
_s = tmpMeta22;
_ss = tmpMeta23;
_ss_1 = omc_Expression_subscriptsAppend(threadData, _ss, _inSubscript);
tmpMeta24 = mmc_mk_cons(_s, _ss_1);
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outSubscriptLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outSubscriptLst;
}
DLLExport
modelica_boolean omc_Expression_isArrayScalarOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _outIsArrayScalarOp;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperator;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 14: {
tmp1 = 1;
goto tmp3_done;
}
case 15: {
tmp1 = 1;
goto tmp3_done;
}
case 19: {
tmp1 = 1;
goto tmp3_done;
}
case 21: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsArrayScalarOp = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsArrayScalarOp;
}
modelica_metatype boxptr_Expression_isArrayScalarOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _outIsArrayScalarOp;
modelica_metatype out_outIsArrayScalarOp;
_outIsArrayScalarOp = omc_Expression_isArrayScalarOp(threadData, _inOperator);
out_outIsArrayScalarOp = mmc_mk_icon(_outIsArrayScalarOp);
return out_outIsArrayScalarOp;
}
DLLExport
modelica_boolean omc_Expression_isScalarArrayOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _outIsScalarArrayOp;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperator;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 16: {
tmp1 = 1;
goto tmp3_done;
}
case 20: {
tmp1 = 1;
goto tmp3_done;
}
case 22: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outIsScalarArrayOp = tmp1;
_return: OMC_LABEL_UNUSED
return _outIsScalarArrayOp;
}
modelica_metatype boxptr_Expression_isScalarArrayOp(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_boolean _outIsScalarArrayOp;
modelica_metatype out_outIsScalarArrayOp;
_outIsScalarArrayOp = omc_Expression_isScalarArrayOp(threadData, _inOperator);
out_outIsScalarArrayOp = mmc_mk_icon(_outIsScalarArrayOp);
return out_outIsScalarArrayOp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_makeScalarOpFromArrayOp(threadData_t *threadData, modelica_metatype _inOperator, modelica_metatype _inType)
{
modelica_metatype _outOperator = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOperator;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 14: {
modelica_metatype tmpMeta5;
tmpMeta5 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _inType);
tmpMeta1 = tmpMeta5;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _inType);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta7;
tmpMeta7 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _inType);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta8;
tmpMeta8 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _inType);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta9;
tmpMeta9 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _inType);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta10;
tmpMeta10 = mmc_mk_box2(7, &DAE_Operator_POW__desc, _inType);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta11;
tmpMeta11 = mmc_mk_box2(7, &DAE_Operator_POW__desc, _inType);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta12;
tmpMeta12 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _inType);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta13;
tmpMeta13 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _inType);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta14;
tmpMeta14 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _inType);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta15;
tmpMeta15 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _inType);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta16;
tmpMeta16 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _inType);
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _inOperator;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outOperator = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outOperator;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unliftOperator2(threadData_t *threadData, modelica_metatype _inOperator, modelica_metatype _inType)
{
modelica_metatype _outOperator = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta1 = omc_Expression_setOpType(threadData, _inOperator, _inType);
goto tmp3_done;
}
case 1: {
tmpMeta1 = omc_Expression_makeScalarOpFromArrayOp(threadData, _inOperator, _inType);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outOperator = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outOperator;
}
DLLExport
modelica_metatype omc_Expression_unliftOperatorX(threadData_t *threadData, modelica_metatype _inOperator, modelica_integer _inX)
{
modelica_metatype _outOperator = NULL;
modelica_metatype _ty = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ty = omc_Expression_typeofOp(threadData, _inOperator);
_ty = omc_Expression_unliftArrayX(threadData, _ty, _inX);
_outOperator = omc_Expression_unliftOperator2(threadData, _inOperator, _ty);
_return: OMC_LABEL_UNUSED
return _outOperator;
}
modelica_metatype boxptr_Expression_unliftOperatorX(threadData_t *threadData, modelica_metatype _inOperator, modelica_metatype _inX)
{
modelica_integer tmp1;
modelica_metatype _outOperator = NULL;
tmp1 = mmc_unbox_integer(_inX);
_outOperator = omc_Expression_unliftOperatorX(threadData, _inOperator, tmp1);
return _outOperator;
}
DLLExport
modelica_metatype omc_Expression_unliftOperator(threadData_t *threadData, modelica_metatype _inOperator)
{
modelica_metatype _outOperator = NULL;
modelica_metatype _ty = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ty = omc_Expression_typeofOp(threadData, _inOperator);
_ty = omc_Expression_unliftArray(threadData, _ty);
_outOperator = omc_Expression_unliftOperator2(threadData, _inOperator, _ty);
_return: OMC_LABEL_UNUSED
return _outOperator;
}
DLLExport
modelica_metatype omc_Expression_setOpType(threadData_t *threadData, modelica_metatype _inOp, modelica_metatype _inType)
{
modelica_metatype _outOp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inOp;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
tmpMeta5 = mmc_mk_box2(3, &DAE_Operator_ADD__desc, _inType);
tmpMeta1 = tmpMeta5;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_box2(4, &DAE_Operator_SUB__desc, _inType);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta7;
tmpMeta7 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _inType);
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta8;
tmpMeta8 = mmc_mk_box2(6, &DAE_Operator_DIV__desc, _inType);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta9;
tmpMeta9 = mmc_mk_box2(7, &DAE_Operator_POW__desc, _inType);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta10;
tmpMeta10 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _inType);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta11;
tmpMeta11 = mmc_mk_box2(9, &DAE_Operator_UMINUS__ARR__desc, _inType);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta12;
tmpMeta12 = mmc_mk_box2(10, &DAE_Operator_ADD__ARR__desc, _inType);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta13;
tmpMeta13 = mmc_mk_box2(11, &DAE_Operator_SUB__ARR__desc, _inType);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta14;
tmpMeta14 = mmc_mk_box2(12, &DAE_Operator_MUL__ARR__desc, _inType);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta15;
tmpMeta15 = mmc_mk_box2(13, &DAE_Operator_DIV__ARR__desc, _inType);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta16;
tmpMeta16 = mmc_mk_box2(14, &DAE_Operator_MUL__ARRAY__SCALAR__desc, _inType);
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta17;
tmpMeta17 = mmc_mk_box2(15, &DAE_Operator_ADD__ARRAY__SCALAR__desc, _inType);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta18;
tmpMeta18 = mmc_mk_box2(16, &DAE_Operator_SUB__SCALAR__ARRAY__desc, _inType);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta19;
tmpMeta19 = mmc_mk_box2(17, &DAE_Operator_MUL__SCALAR__PRODUCT__desc, _inType);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta20;
tmpMeta20 = mmc_mk_box2(18, &DAE_Operator_MUL__MATRIX__PRODUCT__desc, _inType);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta21;
tmpMeta21 = mmc_mk_box2(19, &DAE_Operator_DIV__ARRAY__SCALAR__desc, _inType);
tmpMeta1 = tmpMeta21;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta22;
tmpMeta22 = mmc_mk_box2(20, &DAE_Operator_DIV__SCALAR__ARRAY__desc, _inType);
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta23;
tmpMeta23 = mmc_mk_box2(21, &DAE_Operator_POW__ARRAY__SCALAR__desc, _inType);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 22: {
modelica_metatype tmpMeta24;
tmpMeta24 = mmc_mk_box2(22, &DAE_Operator_POW__SCALAR__ARRAY__desc, _inType);
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta25;
tmpMeta25 = mmc_mk_box2(23, &DAE_Operator_POW__ARR__desc, _inType);
tmpMeta1 = tmpMeta25;
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta26;
tmpMeta26 = mmc_mk_box2(24, &DAE_Operator_POW__ARR2__desc, _inType);
tmpMeta1 = tmpMeta26;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta27;
tmpMeta27 = mmc_mk_box2(25, &DAE_Operator_AND__desc, _inType);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta28;
tmpMeta28 = mmc_mk_box2(26, &DAE_Operator_OR__desc, _inType);
tmpMeta1 = tmpMeta28;
goto tmp3_done;
}
case 27: {
modelica_metatype tmpMeta29;
tmpMeta29 = mmc_mk_box2(27, &DAE_Operator_NOT__desc, _inType);
tmpMeta1 = tmpMeta29;
goto tmp3_done;
}
case 28: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
case 29: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
case 30: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
case 31: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
case 32: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
case 33: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
case 34: {
tmpMeta1 = _inOp;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
modelica_boolean tmp30;
tmp30 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp30) goto goto_2;
omc_Debug_traceln(threadData, _OMC_LIT198);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outOp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outOp;
}
DLLExport
modelica_metatype omc_Expression_liftArrayLeftList(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inDimensions)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inType;
tmp4_2 = _inDimensions;
{
modelica_metatype _ty = NULL;
modelica_metatype _dims = 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;
tmpMeta1 = _inType;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
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));
_ty = tmpMeta6;
_dims = tmpMeta7;
_dims = listAppend(_inDimensions, _dims);
tmpMeta8 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, _dims);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
tmpMeta9 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _inType, _inDimensions);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_liftArrayLeft(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inDimension)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inType;
tmp4_2 = _inDimension;
{
modelica_metatype _ty = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _dim = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_ty = tmpMeta6;
_dims = tmpMeta7;
_dim = tmp4_2;
tmpMeta8 = mmc_mk_cons(_dim, _dims);
tmpMeta9 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty, tmpMeta8);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
tmpMeta10 = mmc_mk_cons(_inDimension, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta11 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _inType, tmpMeta10);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_liftArrayRight(threadData_t *threadData, modelica_metatype _inType, modelica_metatype _inDimension)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inType;
tmp4_2 = _inDimension;
{
modelica_metatype _ty_1 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _dim = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
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));
_ty = tmpMeta6;
_dims = tmpMeta7;
_dim = tmp4_2;
_ty_1 = omc_Expression_liftArrayRight(threadData, _ty, _dim);
tmpMeta8 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _ty_1, _dims);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
tmpMeta9 = mmc_mk_cons(_inDimension, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta10 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _inType, tmpMeta9);
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_liftExpList(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inDimensions)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = _inExp;
{
modelica_metatype _dim;
for (tmpMeta1 = listReverse(_inDimensions); !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_dim = MMC_CAR(tmpMeta1);
_outExp = omc_Expression_liftExp(threadData, _outExp, _dim);
}
}
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_liftExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inDimension)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, omc_Types_liftArray(threadData, omc_Expression_typeof(threadData, _inExp), _inDimension), mmc_mk_boolean(0), omc_List_fill(threadData, _inExp, omc_Expression_dimensionSize(threadData, _inDimension)));
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_unliftExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _ty = NULL;
modelica_metatype _cr = NULL;
modelica_boolean _s;
modelica_metatype _a = NULL;
modelica_integer _i;
modelica_metatype _mat = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 9: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,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));
_cr = tmpMeta5;
_ty = tmpMeta6;
_ty = omc_Expression_unliftArray(threadData, _ty);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr, _ty);
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp9 = mmc_unbox_integer(tmpMeta8);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta7;
_s = tmp9;
_a = tmpMeta10;
_ty = omc_Expression_unliftArray(threadData, _ty);
tmpMeta11 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(_s), _a);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp14 = mmc_unbox_integer(tmpMeta13);
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_ty = tmpMeta12;
_i = tmp14;
_mat = tmpMeta15;
_ty = omc_Expression_unliftArray(threadData, _ty);
tmpMeta16 = mmc_mk_box4(20, &DAE_Exp_MATRIX__desc, _ty, mmc_mk_integer(_i), _mat);
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_unliftArrayIgnoreFirst(threadData_t *threadData, modelica_metatype _a, modelica_metatype _inType)
{
modelica_metatype _outType = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outType = omc_Expression_unliftArray(threadData, _inType);
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_unliftArray(threadData_t *threadData, modelica_metatype _inType)
{
modelica_metatype _outType = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inType;
{
modelica_metatype _tp = NULL;
modelica_metatype _ds = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (!listEmpty(tmpMeta9)) goto tmp3_end;
_tp = tmpMeta6;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta11)) goto tmp3_end;
tmpMeta12 = MMC_CAR(tmpMeta11);
tmpMeta13 = MMC_CDR(tmpMeta11);
_tp = tmpMeta10;
_ds = tmpMeta13;
tmpMeta14 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _tp, _ds);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta15;
tmpMeta1 = omc_Types_simplifyType(threadData, omc_Expression_unliftArray(threadData, _tp));
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_tp = tmpMeta16;
tmpMeta1 = _tp;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _inType;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outType = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outType;
}
DLLExport
modelica_metatype omc_Expression_applyExpSubscripts2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inSubs)
{
modelica_metatype _outArg = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inSubs;
{
modelica_metatype _cref = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _exp = 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;
tmpMeta1 = _inExp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
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));
_cref = tmpMeta6;
_ty = tmpMeta7;
{
{
volatile mmc_switch_type tmp10;
int tmp11;
tmp10 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp9_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp10 < 2; tmp10++) {
switch (MMC_SWITCH_CAST(tmp10)) {
case 0: {
modelica_metatype tmpMeta12;
_cref = omc_ComponentReference_subscriptCref(threadData, _cref, _inSubs);
_ty = omc_ComponentReference_crefTypeFull(threadData, _cref);
tmpMeta12 = mmc_mk_box3(9, &DAE_Exp_CREF__desc, _cref, _ty);
_exp = tmpMeta12;
goto tmp9_done;
}
case 1: {
_exp = omc_Expression_applyExpSubscriptsFoldCheckSimplify(threadData, _inExp, _inSubs, 0, NULL);
goto tmp9_done;
}
}
goto tmp9_end;
tmp9_end: ;
}
goto goto_8;
tmp9_done:
(void)tmp10;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp9_done2;
goto_8:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp10 < 2) {
goto tmp9_top;
}
goto goto_2;
tmp9_done2:;
}
}
;
tmpMeta1 = _exp;
goto tmp3_done;
}
case 2: {
tmpMeta1 = omc_Expression_applyExpSubscriptsFoldCheckSimplify(threadData, _inExp, _inSubs, 0, NULL);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outArg = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outArg;
}
DLLExport
modelica_metatype omc_Expression_applyExpSubscriptsFoldCheckSimplify(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype _inSubs, modelica_boolean __omcQ_24in_5FcheckSimplify, modelica_boolean *out_checkSimplify)
{
modelica_metatype _exp = NULL;
modelica_boolean _checkSimplify;
modelica_boolean _b;
modelica_metatype _s = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta7;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_exp = __omcQ_24in_5Fexp;
_checkSimplify = __omcQ_24in_5FcheckSimplify;
{
modelica_metatype _sub;
for (tmpMeta1 = _inSubs; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_sub = MMC_CAR(tmpMeta1);
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
_s = omc_Expression_getSubscriptExp(threadData, _sub);
tmpMeta6 = mmc_mk_cons(_s, MMC_REFSTRUCTLIT(mmc_nil));
_exp = omc_ExpressionSimplify_simplify(threadData, omc_Expression_makeASUB(threadData, _exp, tmpMeta6) ,&_b);
_checkSimplify = (_b || _checkSimplify);
goto tmp3_done;
}
case 1: {
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
;
}
}
_return: OMC_LABEL_UNUSED
if (out_checkSimplify) { *out_checkSimplify = _checkSimplify; }
return _exp;
}
modelica_metatype boxptr_Expression_applyExpSubscriptsFoldCheckSimplify(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype _inSubs, modelica_metatype __omcQ_24in_5FcheckSimplify, modelica_metatype *out_checkSimplify)
{
modelica_integer tmp1;
modelica_boolean _checkSimplify;
modelica_metatype _exp = NULL;
tmp1 = mmc_unbox_integer(__omcQ_24in_5FcheckSimplify);
_exp = omc_Expression_applyExpSubscriptsFoldCheckSimplify(threadData, __omcQ_24in_5Fexp, _inSubs, tmp1, &_checkSimplify);
if (out_checkSimplify) { *out_checkSimplify = mmc_mk_icon(_checkSimplify); }
return _exp;
}
DLLExport
modelica_metatype omc_Expression_applyExpSubscripts(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype _inSubs)
{
modelica_metatype _exp = NULL;
modelica_string _str = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_exp = __omcQ_24in_5Fexp;
{
{
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: {
_exp = omc_Expression_applyExpSubscripts2(threadData, _exp, _inSubs);
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
tmpMeta5 = stringAppend(_OMC_LIT199,omc_ExpressionDump_printSubscriptLstStr(threadData, _inSubs));
tmpMeta6 = stringAppend(tmpMeta5,_OMC_LIT200);
tmpMeta7 = stringAppend(tmpMeta6,omc_ExpressionDump_printExpStr(threadData, _exp));
tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT40);
_str = tmpMeta8;
tmpMeta9 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT31, tmpMeta9);
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 _exp;
}
DLLExport
modelica_metatype omc_Expression_prependSubscriptExp(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _subscr)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
modelica_metatype _t = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = NULL;
modelica_metatype _cr2 = NULL;
modelica_metatype _subs = 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;
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));
_cr = tmpMeta6;
_t = tmpMeta7;
_cr1 = omc_ComponentReference_crefStripLastSubs(threadData, _cr);
_subs = omc_ComponentReference_crefLastSubs(threadData, _cr);
tmpMeta8 = mmc_mk_cons(_subscr, _subs);
_cr2 = omc_ComponentReference_subscriptCref(threadData, _cr1, tmpMeta8);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr2, _t);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expStripLastIdent(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _cr_1 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _op1 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e_1 = NULL;
modelica_boolean _b;
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
_cr_1 = omc_ComponentReference_crefStripLastIdent(threadData, _cr);
_ty = omc_ComponentReference_crefLastType(threadData, _cr_1);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr_1, _ty);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
_e_1 = omc_Expression_expStripLastIdent(threadData, _e);
_ty = omc_Expression_typeof(threadData, _e_1);
_b = omc_DAEUtil_expTypeArray(threadData, _ty);
tmp10 = (modelica_boolean)_b;
if(tmp10)
{
tmpMeta8 = mmc_mk_box2(9, &DAE_Operator_UMINUS__ARR__desc, _ty);
tmpMeta11 = tmpMeta8;
}
else
{
tmpMeta9 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _ty);
tmpMeta11 = tmpMeta9;
}
_op1 = tmpMeta11;
tmpMeta12 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op1, _e_1);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expStripLastSubs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _cr_1 = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _op1 = NULL;
modelica_metatype _e = NULL;
modelica_metatype _e_1 = NULL;
modelica_boolean _b;
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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta6;
_ty = omc_ComponentReference_crefLastType(threadData, _cr);
_cr_1 = omc_ComponentReference_crefStripLastSubs(threadData, _cr);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr_1, _ty);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
_e_1 = omc_Expression_expStripLastSubs(threadData, _e);
_ty = omc_Expression_typeof(threadData, _e_1);
_b = omc_DAEUtil_expTypeArray(threadData, _ty);
tmp10 = (modelica_boolean)_b;
if(tmp10)
{
tmpMeta8 = mmc_mk_box2(9, &DAE_Operator_UMINUS__ARR__desc, _ty);
tmpMeta11 = tmpMeta8;
}
else
{
tmpMeta9 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _ty);
tmpMeta11 = tmpMeta9;
}
_op1 = tmpMeta11;
tmpMeta12 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op1, _e_1);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_addNoEventToEventTriggeringFunctionsExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
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,13,3) == 0) goto tmp3_end;
if (!omc_Expression_isEventTriggeringFunctionExp(threadData, _e)) goto tmp3_end;
tmpMeta1 = omc_Expression_makeNoEvent(threadData, _e);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_addNoEventToEventTriggeringFunctions(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outE = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outE = omc_Expression_traverseExpDummy(threadData, _e, boxvar_Expression_addNoEventToEventTriggeringFunctionsExp);
_return: OMC_LABEL_UNUSED
return _outE;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_addNoEventToRelationandCondExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 14: {
tmpMeta1 = omc_Expression_makeNoEvent(threadData, _e);
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,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));
_e1 = tmpMeta5;
_e2 = tmpMeta6;
_e3 = tmpMeta7;
tmpMeta8 = mmc_mk_box4(15, &DAE_Exp_IFEXP__desc, omc_Expression_makeNoEvent(threadData, _e1), _e2, _e3);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_addNoEventToRelationsAndConds(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outE = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outE = omc_Expression_traverseExpDummy(threadData, _e, boxvar_Expression_addNoEventToRelationandCondExp);
_return: OMC_LABEL_UNUSED
return _outE;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_addNoEventToRelationExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
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,11,5) == 0) goto tmp3_end;
tmpMeta1 = omc_Expression_makeNoEvent(threadData, _e);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_addNoEventToRelations(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outE = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outE = omc_Expression_traverseExpDummy(threadData, _e, boxvar_Expression_addNoEventToRelationExp);
_return: OMC_LABEL_UNUSED
return _outE;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_stripNoEventExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
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 (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
if (7 != MMC_STRLEN(tmpMeta7) || strcmp(MMC_STRINGDATA(_OMC_LIT104), MMC_STRINGDATA(tmpMeta7)) != 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta9 = MMC_CAR(tmpMeta8);
tmpMeta10 = MMC_CDR(tmpMeta8);
if (!listEmpty(tmpMeta10)) goto tmp3_end;
_outExp = tmpMeta9;
tmpMeta1 = _outExp;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_stripNoEvent(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outE = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outE = omc_Expression_traverseExpDummy(threadData, _e, boxvar_Expression_stripNoEventExp);
_return: OMC_LABEL_UNUSED
return _outE;
}
DLLExport
modelica_metatype omc_Expression_expAbs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _i2;
modelica_integer _i;
modelica_real _r2;
modelica_real _r;
modelica_metatype _e = NULL;
modelica_metatype _e1_1 = NULL;
modelica_metatype _e2_1 = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _op = 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_integer tmp7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
_i2 = labs(_i);
tmpMeta8 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i2));
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_real tmp10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp10 = mmc_unbox_real(tmpMeta9);
_r = tmp10;
_r2 = fabs(_r);
tmpMeta11 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r2));
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,5,1) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta13;
_inExp = _e;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta14;
_op = tmpMeta15;
_e2 = tmpMeta16;
_e1_1 = omc_Expression_expAbs(threadData, _e1);
_e2_1 = omc_Expression_expAbs(threadData, _e2);
tmpMeta17 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1_1, _op, _e2_1);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expDer(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_cons(_inExp, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta2 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT201, tmpMeta1, _OMC_LIT141);
_outExp = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_expand(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _outE = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _tp = NULL;
modelica_metatype _op = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e21 = NULL;
modelica_metatype _e22 = 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;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,2,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,7,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
_e1 = tmpMeta6;
_tp = tmpMeta8;
_e2 = tmpMeta9;
_e21 = tmpMeta10;
_op = tmpMeta11;
_e22 = tmpMeta12;
if (!omc_Expression_isAddOrSub(threadData, _op)) goto tmp3_end;
tmpMeta13 = omc_Expression_expand(threadData, _e2);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,7,3) == 0) goto goto_2;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 4));
_e21 = tmpMeta14;
_op = tmpMeta15;
_e22 = tmpMeta16;
tmpMeta17 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta18 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta17, _e21);
tmpMeta19 = mmc_mk_box2(5, &DAE_Operator_MUL__desc, _tp);
tmpMeta20 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, tmpMeta19, _e22);
tmpMeta21 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, tmpMeta18, _op, tmpMeta20);
tmpMeta1 = tmpMeta21;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outE = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outE;
}
DLLExport
modelica_metatype omc_Expression_negateReal(threadData_t *threadData, modelica_metatype _inReal)
{
modelica_metatype _outNegatedReal = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _OMC_LIT202, _inReal);
_outNegatedReal = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outNegatedReal;
}
DLLExport
modelica_metatype omc_Expression_negate(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _t = NULL;
modelica_metatype _op = NULL;
modelica_boolean _b;
modelica_boolean _b_1;
modelica_real _r;
modelica_real _r_1;
modelica_integer _i;
modelica_integer _i_1;
modelica_metatype _e = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 10; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,5,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta7;
tmpMeta1 = _e;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,6,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta9;
tmpMeta1 = _e;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,24,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e = tmpMeta11;
tmpMeta1 = _e;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 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));
_e1 = tmpMeta12;
_op = tmpMeta13;
_e2 = tmpMeta14;
if (!omc_Expression_isMulOrDiv(threadData, _op)) goto tmp3_end;
tmpMeta15 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, omc_Expression_negate(threadData, _e1), _op, _e2);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta16;
_op = tmpMeta17;
_e2 = tmpMeta18;
if (!omc_Expression_isSub(threadData, _op)) goto tmp3_end;
tmpMeta19 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e2, _op, _e1);
tmpMeta1 = tmpMeta19;
goto tmp3_done;
}
case 5: {
_e = tmp4_1;
if (!omc_Expression_isZero(threadData, _e)) goto tmp3_end;
tmpMeta1 = _e;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta20;
modelica_integer tmp21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp21 = mmc_unbox_integer(tmpMeta20);
_i = tmp21;
_i_1 = (-_i);
tmpMeta22 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i_1));
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta23;
modelica_real tmp24;
modelica_metatype tmpMeta25;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp24 = mmc_unbox_real(tmpMeta23);
_r = tmp24;
_r_1 = (-_r);
tmpMeta25 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_r_1));
tmpMeta1 = tmpMeta25;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta26;
modelica_integer tmp27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp27 = mmc_unbox_integer(tmpMeta26);
_b = tmp27;
_b_1 = (!_b);
tmpMeta28 = mmc_mk_box2(6, &DAE_Exp_BCONST__desc, mmc_mk_boolean(_b_1));
tmpMeta1 = tmpMeta28;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta29;
_e = tmp4_1;
_t = omc_Expression_typeof(threadData, _e);
{
modelica_metatype tmp32_1;
tmp32_1 = _t;
{
volatile mmc_switch_type tmp32;
int tmp33;
tmp32 = 0;
for (; tmp32 < 2; tmp32++) {
switch (MMC_SWITCH_CAST(tmp32)) {
case 0: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (mmc__uniontype__metarecord__typedef__equal(tmp32_1,3,1) == 0) goto tmp31_end;
tmpMeta34 = mmc_mk_box2(27, &DAE_Operator_NOT__desc, _t);
tmpMeta35 = mmc_mk_box3(13, &DAE_Exp_LUNARY__desc, tmpMeta34, _e);
tmpMeta29 = tmpMeta35;
goto tmp31_done;
}
case 1: {
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_boolean tmp38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
_b = omc_DAEUtil_expTypeArray(threadData, _t);
tmp38 = (modelica_boolean)_b;
if(tmp38)
{
tmpMeta36 = mmc_mk_box2(9, &DAE_Operator_UMINUS__ARR__desc, _t);
tmpMeta39 = tmpMeta36;
}
else
{
tmpMeta37 = mmc_mk_box2(8, &DAE_Operator_UMINUS__desc, _t);
tmpMeta39 = tmpMeta37;
}
_op = tmpMeta39;
tmpMeta40 = mmc_mk_box3(11, &DAE_Exp_UNARY__desc, _op, _e);
tmpMeta29 = tmpMeta40;
goto tmp31_done;
}
}
goto tmp31_end;
tmp31_end: ;
}
goto goto_30;
goto_30:;
goto goto_2;
goto tmp31_done;
tmp31_done:;
}
}tmpMeta1 = tmpMeta29;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_dimensionSubscript(threadData_t *threadData, modelica_metatype _dim)
{
modelica_metatype _sub = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
modelica_integer _i;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmpMeta7 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta8 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, tmpMeta7);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp10 = mmc_unbox_integer(tmpMeta9);
_i = tmp10;
tmpMeta11 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta12 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, tmpMeta11);
tmpMeta1 = tmpMeta12;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT204;
goto tmp3_done;
}
case 7: {
tmpMeta1 = _OMC_LIT91;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_sub = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _sub;
}
DLLExport
modelica_metatype omc_Expression_intDimension(threadData_t *threadData, modelica_integer _value)
{
modelica_metatype _dim = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(3, &DAE_Dimension_DIM__INTEGER__desc, mmc_mk_integer(_value));
_dim = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _dim;
}
modelica_metatype boxptr_Expression_intDimension(threadData_t *threadData, modelica_metatype _value)
{
modelica_integer tmp1;
modelica_metatype _dim = NULL;
tmp1 = mmc_unbox_integer(_value);
_dim = omc_Expression_intDimension(threadData, tmp1);
return _dim;
}
DLLExport
modelica_metatype omc_Expression_dimensionSizeExpHandleUnkown(threadData_t *threadData, modelica_metatype _dim)
{
modelica_metatype _exp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
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,4,0) == 0) goto tmp3_end;
tmpMeta1 = _OMC_LIT205;
goto tmp3_done;
}
case 1: {
tmpMeta1 = omc_Expression_dimensionSizeExp(threadData, _dim);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _exp;
}
DLLExport
modelica_metatype omc_Expression_dimensionSizeExp(threadData_t *threadData, modelica_metatype _dim)
{
modelica_metatype _exp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
modelica_integer _i;
modelica_metatype _e = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmpMeta7 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp9 = mmc_unbox_integer(tmpMeta8);
_i = tmp9;
tmpMeta10 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT203;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta11;
tmpMeta1 = _e;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _exp;
}
DLLExport
modelica_metatype omc_Expression_dimensionSizeConstantExp(threadData_t *threadData, modelica_metatype _dim)
{
modelica_metatype _exp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _dim;
{
modelica_integer _i;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmpMeta7 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp9 = mmc_unbox_integer(tmpMeta8);
_i = tmp9;
tmpMeta10 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT203;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_exp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _exp;
}
DLLExport
modelica_metatype omc_Expression_liftArrayR(threadData_t *threadData, modelica_metatype _tp, modelica_metatype _n)
{
modelica_metatype _outTp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _tp;
{
modelica_metatype _elt_tp = NULL;
modelica_metatype _dims = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_elt_tp = tmpMeta6;
_dims = tmpMeta7;
tmpMeta8 = mmc_mk_cons(_n, _dims);
_dims = tmpMeta8;
tmpMeta9 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _elt_tp, _dims);
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
tmpMeta10 = mmc_mk_cons(_n, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta11 = mmc_mk_box3(9, &DAE_Type_T__ARRAY__desc, _tp, tmpMeta10);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outTp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outTp;
}
DLLExport
modelica_metatype omc_Expression_realToIntIfPossible(threadData_t *threadData, modelica_real _inVal)
{
modelica_metatype _outVal = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 2; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
tmpMeta5 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(((modelica_integer)floor(_inVal))));
_outVal = tmpMeta5;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_box2(4, &DAE_Exp_RCONST__desc, mmc_mk_real(_inVal));
_outVal = tmpMeta6;
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 _outVal;
}
modelica_metatype boxptr_Expression_realToIntIfPossible(threadData_t *threadData, modelica_metatype _inVal)
{
modelica_real tmp1;
modelica_metatype _outVal = NULL;
tmp1 = mmc_unbox_real(_inVal);
_outVal = omc_Expression_realToIntIfPossible(threadData, tmp1);
return _outVal;
}
DLLExport
modelica_metatype omc_Expression_CodeVarToCref(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _e_cref = NULL;
modelica_metatype _cref = NULL;
modelica_metatype _e = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_cref = tmpMeta7;
omc_Static_elabUntypedCref(threadData, omc_FCore_emptyCache(threadData), omc_FGraph_empty(threadData), _cref, 0, _OMC_LIT206, _OMC_LIT26 ,&_e_cref);
tmpMeta1 = omc_Expression_crefExp(threadData, _e_cref);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,6,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,11,3) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,2) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (3 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT38), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
if (!listEmpty(tmpMeta12)) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (listEmpty(tmpMeta14)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmpMeta14);
tmpMeta16 = MMC_CDR(tmpMeta14);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,2,1) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
if (!listEmpty(tmpMeta16)) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
if (!listEmpty(tmpMeta18)) goto tmp3_end;
_cref = tmpMeta17;
omc_Static_elabUntypedCref(threadData, omc_FCore_emptyCache(threadData), omc_FGraph_empty(threadData), _cref, 0, _OMC_LIT206, _OMC_LIT26 ,&_e_cref);
_e = omc_Expression_crefExp(threadData, _e_cref);
tmpMeta19 = mmc_mk_cons(_e, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta20 = mmc_mk_box4(16, &DAE_Exp_CALL__desc, _OMC_LIT201, tmpMeta19, _OMC_LIT141);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_traversingstringifyCrefFinder(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _crs = NULL;
modelica_metatype _ty = 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,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,12,1) == 0) goto tmp3_end;
tmpMeta1 = _inExp;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,13,2) == 0) goto tmp3_end;
tmpMeta1 = _inExp;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
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));
_cr = tmpMeta8;
_ty = tmpMeta9;
_crs = omc_ComponentReference_stringifyComponentRef(threadData, _cr);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _crs, _ty);
goto tmp3_done;
}
case 3: {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_stringifyCrefs(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outExp = omc_Expression_traverseExpDummy(threadData, _inExp, boxvar_Expression_traversingstringifyCrefFinder);
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unelabOperator(threadData_t *threadData, modelica_metatype _op)
{
modelica_metatype _aop = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _op;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT207;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT208;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT209;
goto tmp3_done;
}
case 6: {
tmpMeta1 = _OMC_LIT210;
goto tmp3_done;
}
case 7: {
tmpMeta1 = _OMC_LIT211;
goto tmp3_done;
}
case 8: {
tmpMeta1 = _OMC_LIT212;
goto tmp3_done;
}
case 9: {
tmpMeta1 = _OMC_LIT212;
goto tmp3_done;
}
case 10: {
tmpMeta1 = _OMC_LIT207;
goto tmp3_done;
}
case 11: {
tmpMeta1 = _OMC_LIT208;
goto tmp3_done;
}
case 12: {
tmpMeta1 = _OMC_LIT209;
goto tmp3_done;
}
case 13: {
tmpMeta1 = _OMC_LIT210;
goto tmp3_done;
}
case 14: {
tmpMeta1 = _OMC_LIT209;
goto tmp3_done;
}
case 15: {
tmpMeta1 = _OMC_LIT207;
goto tmp3_done;
}
case 16: {
tmpMeta1 = _OMC_LIT208;
goto tmp3_done;
}
case 17: {
tmpMeta1 = _OMC_LIT209;
goto tmp3_done;
}
case 18: {
tmpMeta1 = _OMC_LIT209;
goto tmp3_done;
}
case 20: {
tmpMeta1 = _OMC_LIT210;
goto tmp3_done;
}
case 19: {
tmpMeta1 = _OMC_LIT210;
goto tmp3_done;
}
case 22: {
tmpMeta1 = _OMC_LIT211;
goto tmp3_done;
}
case 21: {
tmpMeta1 = _OMC_LIT211;
goto tmp3_done;
}
case 23: {
tmpMeta1 = _OMC_LIT211;
goto tmp3_done;
}
case 24: {
tmpMeta1 = _OMC_LIT211;
goto tmp3_done;
}
case 25: {
tmpMeta1 = _OMC_LIT213;
goto tmp3_done;
}
case 26: {
tmpMeta1 = _OMC_LIT214;
goto tmp3_done;
}
case 27: {
tmpMeta1 = _OMC_LIT215;
goto tmp3_done;
}
case 28: {
tmpMeta1 = _OMC_LIT216;
goto tmp3_done;
}
case 29: {
tmpMeta1 = _OMC_LIT217;
goto tmp3_done;
}
case 30: {
tmpMeta1 = _OMC_LIT218;
goto tmp3_done;
}
case 31: {
tmpMeta1 = _OMC_LIT219;
goto tmp3_done;
}
case 32: {
tmpMeta1 = _OMC_LIT220;
goto tmp3_done;
}
case 33: {
tmpMeta1 = _OMC_LIT221;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_aop = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _aop;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unelabReductionIterator(threadData_t *threadData, modelica_metatype _riter)
{
modelica_metatype _aiter = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _riter;
{
modelica_string _id = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _gexp = NULL;
modelica_metatype _aexp = NULL;
modelica_metatype _agexp = 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;
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));
_id = tmpMeta6;
_exp = tmpMeta7;
_gexp = tmpMeta8;
_aexp = omc_Expression_unelabExp(threadData, _exp);
_agexp = omc_Util_applyOption(threadData, _gexp, boxvar_Expression_unelabExp);
tmpMeta9 = mmc_mk_box4(3, &Absyn_ForIterator_ITERATOR__desc, _id, _agexp, mmc_mk_some(_aexp));
tmpMeta1 = tmpMeta9;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_aiter = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _aiter;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unelabDimensionToFillExp(threadData_t *threadData, modelica_metatype _inDim)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDim;
{
modelica_integer _i;
modelica_metatype _e = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmpMeta7 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta7;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta8;
tmpMeta1 = omc_Expression_unelabExp(threadData, _e);
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta1 = _OMC_LIT222;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_Expression_unleabZeroExpFromType(threadData_t *threadData, modelica_metatype _ty)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ty;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 6: {
tmpMeta1 = _OMC_LIT223;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT224;
goto tmp3_done;
}
case 3: {
tmpMeta1 = _OMC_LIT225;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT227;
goto tmp3_done;
}
case 11: {
tmpMeta1 = _OMC_LIT227;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_Expression_unelabDimension(threadData_t *threadData, modelica_metatype _inDim)
{
modelica_metatype _outDim = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDim;
{
modelica_integer _i;
modelica_metatype _p = NULL;
modelica_metatype _c = NULL;
modelica_metatype _e = NULL;
modelica_metatype _ae = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_integer tmp6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp6 = mmc_unbox_integer(tmpMeta5);
_i = tmp6;
tmpMeta7 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i));
tmpMeta8 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta7);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT231;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_p = tmpMeta9;
_c = omc_AbsynUtil_pathToCref(threadData, _p);
tmpMeta10 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, _c);
tmpMeta11 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, tmpMeta10);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e = tmpMeta12;
_ae = omc_Expression_unelabExp(threadData, _e);
tmpMeta13 = mmc_mk_box2(4, &Absyn_Subscript_SUBSCRIPT__desc, _ae);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 7: {
tmpMeta1 = _OMC_LIT232;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outDim = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDim;
}
DLLExport
modelica_metatype omc_Expression_unelabExp(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_integer _i;
modelica_real _r;
modelica_string _s = NULL;
modelica_boolean _b;
modelica_metatype _cr_1 = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _expl_1 = NULL;
modelica_metatype _aexpl = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _e3 = NULL;
modelica_metatype _op = NULL;
modelica_metatype _ae1 = NULL;
modelica_metatype _ae2 = NULL;
modelica_metatype _ae3 = NULL;
modelica_metatype _aop = NULL;
modelica_metatype _mexpl2 = NULL;
modelica_metatype _amexpl = NULL;
modelica_metatype _acref = NULL;
modelica_metatype _path = NULL;
modelica_metatype _code = NULL;
modelica_metatype _riters = NULL;
modelica_metatype _aiters = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _dims = NULL;
modelica_metatype _iterType = 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 < 28; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp7 = mmc_unbox_integer(tmpMeta6);
_i = tmp7;
tmp4 += 26;
tmpMeta8 = mmc_mk_box2(3, &Absyn_Exp_INTEGER__desc, mmc_mk_integer(_i));
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_real tmp10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp10 = mmc_unbox_real(tmpMeta9);
_r = tmp10;
tmp4 += 25;
_s = realString(_r);
tmpMeta11 = mmc_mk_box2(4, &Absyn_Exp_REAL__desc, _s);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_s = tmpMeta12;
tmp4 += 24;
tmpMeta13 = mmc_mk_box2(6, &Absyn_Exp_STRING__desc, _s);
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_integer tmp15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmp15 = mmc_unbox_integer(tmpMeta14);
_b = tmp15;
tmp4 += 23;
tmpMeta16 = mmc_mk_box2(7, &Absyn_Exp_BOOL__desc, mmc_mk_boolean(_b));
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_path = tmpMeta17;
tmp4 += 22;
_cr_1 = omc_AbsynUtil_pathToCref(threadData, _path);
tmpMeta18 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, _cr_1);
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cr = tmpMeta19;
tmp4 += 21;
_cr_1 = omc_ComponentReference_unelabCref(threadData, _cr);
tmpMeta20 = mmc_mk_box2(5, &Absyn_Exp_CREF__desc, _cr_1);
tmpMeta1 = tmpMeta20;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 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));
_e1 = tmpMeta21;
_op = tmpMeta22;
_e2 = tmpMeta23;
tmp4 += 20;
_aop = omc_Expression_unelabOperator(threadData, _op);
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae2 = omc_Expression_unelabExp(threadData, _e2);
tmpMeta24 = mmc_mk_box4(8, &Absyn_Exp_BINARY__desc, _ae1, _aop, _ae2);
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,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));
_op = tmpMeta25;
_e1 = tmpMeta26;
tmp4 += 19;
_aop = omc_Expression_unelabOperator(threadData, _op);
_ae1 = omc_Expression_unelabExp(threadData, _e1);
tmpMeta27 = mmc_mk_box3(9, &Absyn_Exp_UNARY__desc, _aop, _ae1);
tmpMeta1 = tmpMeta27;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta28;
_op = tmpMeta29;
_e2 = tmpMeta30;
tmp4 += 18;
_aop = omc_Expression_unelabOperator(threadData, _op);
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae2 = omc_Expression_unelabExp(threadData, _e2);
tmpMeta31 = mmc_mk_box4(10, &Absyn_Exp_LBINARY__desc, _ae1, _aop, _ae2);
tmpMeta1 = tmpMeta31;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,2) == 0) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_op = tmpMeta32;
_e1 = tmpMeta33;
tmp4 += 17;
_aop = omc_Expression_unelabOperator(threadData, _op);
_ae1 = omc_Expression_unelabExp(threadData, _e1);
tmpMeta34 = mmc_mk_box3(11, &Absyn_Exp_LUNARY__desc, _aop, _ae1);
tmpMeta1 = tmpMeta34;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,5) == 0) goto tmp3_end;
tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta35;
_op = tmpMeta36;
_e2 = tmpMeta37;
tmp4 += 16;
_aop = omc_Expression_unelabOperator(threadData, _op);
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae2 = omc_Expression_unelabExp(threadData, _e2);
tmpMeta38 = mmc_mk_box4(12, &Absyn_Exp_RELATION__desc, _ae1, _aop, _ae2);
tmpMeta1 = tmpMeta38;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_e1 = tmpMeta39;
_e2 = tmpMeta40;
_e3 = tmpMeta41;
tmp4 += 15;
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae2 = omc_Expression_unelabExp(threadData, _e2);
_ae3 = omc_Expression_unelabExp(threadData, _e3);
tmpMeta42 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta43 = mmc_mk_box5(13, &Absyn_Exp_IFEXP__desc, _ae1, _ae2, _ae3, tmpMeta42);
tmpMeta1 = tmpMeta43;
goto tmp3_done;
}
case 12: {
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta44;
_expl = tmpMeta45;
tmp4 += 14;
_aexpl = omc_List_map(threadData, _expl, boxvar_Expression_unelabExp);
_acref = omc_AbsynUtil_pathToCref(threadData, _path);
tmpMeta46 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta47 = mmc_mk_box3(3, &Absyn_FunctionArgs_FUNCTIONARGS__desc, _aexpl, tmpMeta46);
tmpMeta48 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta49 = mmc_mk_box4(14, &Absyn_Exp_CALL__desc, _acref, tmpMeta47, tmpMeta48);
tmpMeta1 = tmpMeta49;
goto tmp3_done;
}
case 13: {
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta55;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,4) == 0) goto tmp3_end;
tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta50;
_expl = tmpMeta51;
tmp4 += 13;
_aexpl = omc_List_map(threadData, _expl, boxvar_Expression_unelabExp);
_acref = omc_AbsynUtil_pathToCref(threadData, _path);
tmpMeta52 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta53 = mmc_mk_box3(3, &Absyn_FunctionArgs_FUNCTIONARGS__desc, _aexpl, tmpMeta52);
tmpMeta54 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta55 = mmc_mk_box4(14, &Absyn_Exp_CALL__desc, _acref, tmpMeta53, tmpMeta54);
tmpMeta1 = tmpMeta55;
goto tmp3_done;
}
case 14: {
modelica_metatype tmpMeta56;
modelica_metatype tmpMeta57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta56;
_expl = tmpMeta57;
tmp4 += 12;
_aexpl = omc_List_map(threadData, _expl, boxvar_Expression_unelabExp);
_acref = omc_AbsynUtil_pathToCref(threadData, _path);
tmpMeta58 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta59 = mmc_mk_box3(3, &Absyn_FunctionArgs_FUNCTIONARGS__desc, _aexpl, tmpMeta58);
tmpMeta60 = mmc_mk_box3(15, &Absyn_Exp_PARTEVALFUNCTION__desc, _acref, tmpMeta59);
tmpMeta1 = tmpMeta60;
goto tmp3_done;
}
case 15: {
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!listEmpty(tmpMeta62)) goto tmp3_end;
_ty = tmpMeta61;
_ty = omc_Types_flattenArrayType(threadData, _ty ,&_dims);
_ae1 = omc_Expression_unleabZeroExpFromType(threadData, _ty);
_expl_1 = omc_List_map(threadData, _dims, boxvar_Expression_unelabDimensionToFillExp);
tmpMeta63 = mmc_mk_cons(_ae1, _expl_1);
tmpMeta64 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta65 = mmc_mk_box3(3, &Absyn_FunctionArgs_FUNCTIONARGS__desc, tmpMeta63, tmpMeta64);
tmpMeta66 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta67 = mmc_mk_box4(14, &Absyn_Exp_CALL__desc, _OMC_LIT234, tmpMeta65, tmpMeta66);
tmpMeta1 = tmpMeta67;
goto tmp3_done;
}
case 16: {
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_expl = tmpMeta68;
tmp4 += 10;
_expl_1 = omc_List_map(threadData, _expl, boxvar_Expression_unelabExp);
tmpMeta69 = mmc_mk_box2(16, &Absyn_Exp_ARRAY__desc, _expl_1);
tmpMeta1 = tmpMeta69;
goto tmp3_done;
}
case 17: {
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_mexpl2 = tmpMeta70;
tmp4 += 9;
_amexpl = omc_List_mapList(threadData, _mexpl2, boxvar_Expression_unelabExp);
tmpMeta71 = mmc_mk_box2(17, &Absyn_Exp_MATRIX__desc, _amexpl);
tmpMeta1 = tmpMeta71;
goto tmp3_done;
}
case 18: {
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta73 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (optionNone(tmpMeta73)) goto tmp3_end;
tmpMeta74 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta73), 1));
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta72;
_e2 = tmpMeta74;
_e3 = tmpMeta75;
tmp4 += 8;
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae2 = omc_Expression_unelabExp(threadData, _e2);
_ae3 = omc_Expression_unelabExp(threadData, _e3);
tmpMeta76 = mmc_mk_box4(18, &Absyn_Exp_RANGE__desc, _ae1, mmc_mk_some(_ae2), _ae3);
tmpMeta1 = tmpMeta76;
goto tmp3_done;
}
case 19: {
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,4) == 0) goto tmp3_end;
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (!optionNone(tmpMeta78)) goto tmp3_end;
tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_e1 = tmpMeta77;
_e3 = tmpMeta79;
tmp4 += 7;
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae3 = omc_Expression_unelabExp(threadData, _e3);
tmpMeta80 = mmc_mk_box4(18, &Absyn_Exp_RANGE__desc, _ae1, mmc_mk_none(), _ae3);
tmpMeta1 = tmpMeta80;
goto tmp3_done;
}
case 20: {
modelica_metatype tmpMeta81;
modelica_metatype tmpMeta82;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,19,1) == 0) goto tmp3_end;
tmpMeta81 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_expl = tmpMeta81;
tmp4 += 6;
_expl_1 = omc_List_map(threadData, _expl, boxvar_Expression_unelabExp);
tmpMeta82 = mmc_mk_box2(19, &Absyn_Exp_TUPLE__desc, _expl_1);
tmpMeta1 = tmpMeta82;
goto tmp3_done;
}
case 21: {
modelica_metatype tmpMeta83;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
tmpMeta83 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_e1 = tmpMeta83;
tmp4 += 5;
tmpMeta1 = omc_Expression_unelabExp(threadData, _e1);
goto tmp3_done;
}
case 22: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,2) == 0) goto tmp3_end;
tmp4 += 4;
fputs(MMC_STRINGDATA(_OMC_LIT235),stdout);
goto goto_2;
goto tmp3_done;
}
case 23: {
modelica_metatype tmpMeta84;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,22,3) == 0) goto tmp3_end;
tmpMeta84 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_e1 = tmpMeta84;
tmp4 += 3;
tmpMeta1 = omc_Expression_unelabExp(threadData, _e1);
goto tmp3_done;
}
case 24: {
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_metatype tmpMeta87;
modelica_metatype tmpMeta88;
modelica_metatype tmpMeta89;
modelica_metatype tmpMeta90;
modelica_metatype tmpMeta91;
modelica_metatype tmpMeta92;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,24,2) == 0) goto tmp3_end;
tmpMeta85 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta86 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta86)) goto tmp3_end;
tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta86), 1));
_e1 = tmpMeta85;
_e2 = tmpMeta87;
tmp4 += 2;
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_ae2 = omc_Expression_unelabExp(threadData, _e2);
tmpMeta88 = mmc_mk_cons(_ae1, mmc_mk_cons(_ae2, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta89 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta90 = mmc_mk_box3(3, &Absyn_FunctionArgs_FUNCTIONARGS__desc, tmpMeta88, tmpMeta89);
tmpMeta91 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta92 = mmc_mk_box4(14, &Absyn_Exp_CALL__desc, _OMC_LIT237, tmpMeta90, tmpMeta91);
tmpMeta1 = tmpMeta92;
goto tmp3_done;
}
case 25: {
modelica_metatype tmpMeta93;
modelica_metatype tmpMeta94;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,25,2) == 0) goto tmp3_end;
tmpMeta93 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_code = tmpMeta93;
tmp4 += 1;
tmpMeta94 = mmc_mk_box2(21, &Absyn_Exp_CODE__desc, _code);
tmpMeta1 = tmpMeta94;
goto tmp3_done;
}
case 26: {
modelica_metatype tmpMeta95;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
modelica_metatype tmpMeta98;
modelica_metatype tmpMeta99;
modelica_metatype tmpMeta100;
modelica_metatype tmpMeta101;
modelica_metatype tmpMeta102;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta95 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta96 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta95), 2));
tmpMeta97 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta95), 3));
tmpMeta98 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta99 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_path = tmpMeta96;
_iterType = tmpMeta97;
_e1 = tmpMeta98;
_riters = tmpMeta99;
_acref = omc_AbsynUtil_pathToCref(threadData, _path);
_ae1 = omc_Expression_unelabExp(threadData, _e1);
_aiters = omc_List_map(threadData, _riters, boxvar_Expression_unelabReductionIterator);
tmpMeta100 = mmc_mk_box4(4, &Absyn_FunctionArgs_FOR__ITER__FARG__desc, _ae1, _iterType, _aiters);
tmpMeta101 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta102 = mmc_mk_box4(14, &Absyn_Exp_CALL__desc, _acref, tmpMeta100, tmpMeta101);
tmpMeta1 = tmpMeta102;
goto tmp3_done;
}
case 27: {
modelica_boolean tmp103;
modelica_metatype tmpMeta104;
modelica_metatype tmpMeta105;
tmp103 = omc_Flags_isSet(threadData, _OMC_LIT60);
if (1 != tmp103) goto goto_2;
tmpMeta104 = stringAppend(_OMC_LIT238,omc_ExpressionDump_printExpStr(threadData, _inExp));
tmpMeta105 = stringAppend(tmpMeta104,_OMC_LIT40);
fputs(MMC_STRINGDATA(tmpMeta105),stdout);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 28) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_boolean omc_Expression_dimensionIsZero(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_boolean _outIsZero;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outIsZero = (((modelica_integer) 0) == omc_Expression_dimensionSize(threadData, _inDimension));
_return: OMC_LABEL_UNUSED
return _outIsZero;
}
modelica_metatype boxptr_Expression_dimensionIsZero(threadData_t *threadData, modelica_metatype _inDimension)
{
modelica_boolean _outIsZero;
modelica_metatype out_outIsZero;
_outIsZero = omc_Expression_dimensionIsZero(threadData, _inDimension);
out_outIsZero = mmc_mk_icon(_outIsZero);
return out_outIsZero;
}
DLLExport
modelica_metatype omc_Expression_subscriptsInt(threadData_t *threadData, modelica_metatype _inSubscripts)
{
modelica_metatype _outIntegers = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outIntegers = omc_List_map(threadData, _inSubscripts, boxvar_Expression_subscriptInt);
_return: OMC_LABEL_UNUSED
return _outIntegers;
}
DLLExport
modelica_integer omc_Expression_subscriptInt(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_integer _outInteger;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outInteger = omc_Expression_expArrayIndex(threadData, omc_Expression_subscriptIndexExp(threadData, _inSubscript));
_return: OMC_LABEL_UNUSED
return _outInteger;
}
modelica_metatype boxptr_Expression_subscriptInt(threadData_t *threadData, modelica_metatype _inSubscript)
{
modelica_integer _outInteger;
modelica_metatype out_outInteger;
_outInteger = omc_Expression_subscriptInt(threadData, _inSubscript);
out_outInteger = mmc_mk_icon(_outInteger);
return out_outInteger;
}
DLLExport
modelica_metatype omc_Expression_intSubscripts(threadData_t *threadData, modelica_metatype _inIntegers)
{
modelica_metatype _outSubscripts = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outSubscripts = omc_List_map(threadData, _inIntegers, boxvar_Expression_intSubscript);
_return: OMC_LABEL_UNUSED
return _outSubscripts;
}
DLLExport
modelica_metatype omc_Expression_intSubscript(threadData_t *threadData, modelica_integer _inInteger)
{
modelica_metatype _outSubscript = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(3, &DAE_Exp_ICONST__desc, mmc_mk_integer(_inInteger));
tmpMeta2 = mmc_mk_box2(5, &DAE_Subscript_INDEX__desc, tmpMeta1);
_outSubscript = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _outSubscript;
}
modelica_metatype boxptr_Expression_intSubscript(threadData_t *threadData, modelica_metatype _inInteger)
{
modelica_integer tmp1;
modelica_metatype _outSubscript = NULL;
tmp1 = mmc_unbox_integer(_inInteger);
_outSubscript = omc_Expression_intSubscript(threadData, tmp1);
return _outSubscript;
}
