#include "omc_simulation_settings.h"
#include "UnitAbsynBuilder.h"
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT0,3,3) {&MMath_Rational_RATIONAL__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT0 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT0)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT1,3,3) {&MMath_Rational_RATIONAL__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT1 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT1)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT2,3,3) {&MMath_Rational_RATIONAL__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT2 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT2)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT3,3,3) {&MMath_Rational_RATIONAL__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(-2)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT3 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT3)
#define _OMC_LIT4_data "1"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,1,_OMC_LIT4_data);
#define _OMC_LIT4 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT4)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT5,2,5) {&DAE_Exp_SCONST__desc,_OMC_LIT4}};
#define _OMC_LIT5 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT5)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT6,3,8) {&UnitAbsyn_UnitTerm_LOC__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT5}};
#define _OMC_LIT6 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT6)
#define _OMC_LIT7_data "4"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,1,_OMC_LIT7_data);
#define _OMC_LIT7 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT8,2,5) {&DAE_Exp_SCONST__desc,_OMC_LIT7}};
#define _OMC_LIT8 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT8)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT9,3,8) {&UnitAbsyn_UnitTerm_LOC__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT8}};
#define _OMC_LIT9 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT9)
#define _OMC_LIT10_data "1==4"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT10,4,_OMC_LIT10_data);
#define _OMC_LIT10 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT10)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT11,2,5) {&DAE_Exp_SCONST__desc,_OMC_LIT10}};
#define _OMC_LIT11 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT11)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT12,4,7) {&UnitAbsyn_UnitTerm_EQN__desc,_OMC_LIT6,_OMC_LIT9,_OMC_LIT11}};
#define _OMC_LIT12 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT12)
#define _OMC_LIT13_data "2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT13,1,_OMC_LIT13_data);
#define _OMC_LIT13 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT13)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT14,2,5) {&DAE_Exp_SCONST__desc,_OMC_LIT13}};
#define _OMC_LIT14 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT14)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT15,3,8) {&UnitAbsyn_UnitTerm_LOC__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),_OMC_LIT14}};
#define _OMC_LIT15 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT15)
#define _OMC_LIT16_data "5"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT16,1,_OMC_LIT16_data);
#define _OMC_LIT16 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT16)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT17,2,5) {&DAE_Exp_SCONST__desc,_OMC_LIT16}};
#define _OMC_LIT17 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT17)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT18,3,8) {&UnitAbsyn_UnitTerm_LOC__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5)),_OMC_LIT17}};
#define _OMC_LIT18 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT18)
#define _OMC_LIT19_data "2==5"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT19,4,_OMC_LIT19_data);
#define _OMC_LIT19 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT19)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT20,2,5) {&DAE_Exp_SCONST__desc,_OMC_LIT19}};
#define _OMC_LIT20 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT20)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT21,4,7) {&UnitAbsyn_UnitTerm_EQN__desc,_OMC_LIT15,_OMC_LIT18,_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_LIT12,_OMC_LIT22}};
#define _OMC_LIT23 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT23)
#define _OMC_LIT24_data "unspecified"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT24,11,_OMC_LIT24_data);
#define _OMC_LIT24 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT24)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT25,1,4) {&UnitAbsyn_Unit_UNSPECIFIED__desc,}};
#define _OMC_LIT25 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT25)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT26,1,11) {&DAE_Type_T__UNKNOWN__desc,}};
#define _OMC_LIT26 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT26)
#define _OMC_LIT27_data "buildFormal2ActualParamTerms failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT27,36,_OMC_LIT27_data);
#define _OMC_LIT27 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT27)
#define _OMC_LIT28_data "unit"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT28,4,_OMC_LIT28_data);
#define _OMC_LIT28 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,0,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
#define _OMC_LIT30_data "getUnitStr for type "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT30,20,_OMC_LIT30_data);
#define _OMC_LIT30 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT30)
#define _OMC_LIT31_data " failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT31,8,_OMC_LIT31_data);
#define _OMC_LIT31 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT31)
#define _OMC_LIT32_data "buildFuncTypeStores failed, tp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT32,30,_OMC_LIT32_data);
#define _OMC_LIT32 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT32)
#define _OMC_LIT33_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT33,1,_OMC_LIT33_data);
#define _OMC_LIT33 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT33)
#define _OMC_LIT34_data "buildTermExpList failed for exp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT34,31,_OMC_LIT34_data);
#define _OMC_LIT34 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "buildResultTerms failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,24,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
#define _OMC_LIT36_data "$"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT36,1,_OMC_LIT36_data);
#define _OMC_LIT36 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT36)
#define _OMC_LIT37_data "_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT37,1,_OMC_LIT37_data);
#define _OMC_LIT37 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT37)
#define _OMC_LIT38_data "vector ="
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT38,8,_OMC_LIT38_data);
#define _OMC_LIT38 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT38)
#define _OMC_LIT39_data "Matrix ="
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT39,8,_OMC_LIT39_data);
#define _OMC_LIT39 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data "buildTermDAE.CALL failed exp: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,30,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT41,2,4) {&DAE_Type_T__REAL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT41 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,2,4) {&DAE_Operator_SUB__desc,_OMC_LIT41}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
#define _OMC_LIT43_data "createTypeParameterLocations4 failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT43,37,_OMC_LIT43_data);
#define _OMC_LIT43 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT43)
#define _OMC_LIT44_data "addUnspecifiedStores n < 0!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT44,28,_OMC_LIT44_data);
#define _OMC_LIT44 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT44)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT45,1,4) {&UnitAbsyn_InstStore_NOSTORE__desc,}};
#define _OMC_LIT45 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT45)
#define _OMC_LIT46_data "instBuildUnitTerms failed!!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT46,28,_OMC_LIT46_data);
#define _OMC_LIT46 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT46)
#define _OMC_LIT47_data "[indx ="
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT47,7,_OMC_LIT47_data);
#define _OMC_LIT47 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT47)
#define _OMC_LIT48_data "]"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT48,1,_OMC_LIT48_data);
#define _OMC_LIT48 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT48)
#define _OMC_LIT49_data "^"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT49,1,_OMC_LIT49_data);
#define _OMC_LIT49 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT49)
#define _OMC_LIT50_data "[indx="
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT50,6,_OMC_LIT50_data);
#define _OMC_LIT50 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT50)
#define _OMC_LIT51_data "^("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT51,2,_OMC_LIT51_data);
#define _OMC_LIT51 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data "/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,1,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
#define _OMC_LIT53_data ")"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT53,1,_OMC_LIT53_data);
#define _OMC_LIT53 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT53)
#define _OMC_LIT54_data "m^("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT54,3,_OMC_LIT54_data);
#define _OMC_LIT54 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT54)
#define _OMC_LIT55_data "s^("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT55,3,_OMC_LIT55_data);
#define _OMC_LIT55 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT55)
#define _OMC_LIT56_data "printBaseUnitsStr failed len:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT56,29,_OMC_LIT56_data);
#define _OMC_LIT56 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT56)
#define _OMC_LIT57_data " ["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,2,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
#define _OMC_LIT58_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT58,1,_OMC_LIT58_data);
#define _OMC_LIT58 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data "Unspecified"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,11,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data "->"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,2,_OMC_LIT60_data);
#define _OMC_LIT60 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT60)
#define _OMC_LIT61_data "instStore, s:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT61,13,_OMC_LIT61_data);
#define _OMC_LIT61 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT61)
#define _OMC_LIT62_data "\nht:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT62,4,_OMC_LIT62_data);
#define _OMC_LIT62 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data "{"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,1,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
#define _OMC_LIT64_data "}"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT64,1,_OMC_LIT64_data);
#define _OMC_LIT64 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT64)
#define _OMC_LIT65_data " finding store at index "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT65,24,_OMC_LIT65_data);
#define _OMC_LIT65 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT65)
#define _OMC_LIT66_data "storing unit at index "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT66,22,_OMC_LIT66_data);
#define _OMC_LIT66 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT66)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT67,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT67 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT67)
#define _OMC_LIT68_data "registerDefineunits failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT68,27,_OMC_LIT68_data);
#define _OMC_LIT68 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT68)
#define _OMC_LIT69_data "m"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT69,1,_OMC_LIT69_data);
#define _OMC_LIT69 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT69)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT70,0.0);
#define _OMC_LIT70 MMC_REFREALLIT(_OMC_LIT_STRUCT70)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT71,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT29,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT70}};
#define _OMC_LIT71 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT71)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT72,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT69,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT72 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT72)
#define _OMC_LIT73_data "kg"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT73,2,_OMC_LIT73_data);
#define _OMC_LIT73 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT73)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT74,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT73,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT74 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT74)
#define _OMC_LIT75_data "s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT75,1,_OMC_LIT75_data);
#define _OMC_LIT75 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT75)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT76,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT75,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT76 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "A"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,1,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT78,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT77,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT78 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT78)
#define _OMC_LIT79_data "k"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT79,1,_OMC_LIT79_data);
#define _OMC_LIT79 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT79)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT80,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT79,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT80 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT80)
#define _OMC_LIT81_data "mol"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT81,3,_OMC_LIT81_data);
#define _OMC_LIT81 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT81)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT82,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT81,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT82 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT82)
#define _OMC_LIT83_data "cd"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT83,2,_OMC_LIT83_data);
#define _OMC_LIT83 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT83)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT84,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT83,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT71}};
#define _OMC_LIT84 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT84)
#define _OMC_LIT85_data "rad"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT85,3,_OMC_LIT85_data);
#define _OMC_LIT85 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT85)
#define _OMC_LIT86_data "exp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT86,3,_OMC_LIT86_data);
#define _OMC_LIT86 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT86)
#define _OMC_LIT87_data "m/m"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT87,3,_OMC_LIT87_data);
#define _OMC_LIT87 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT87)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT88,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT87}};
#define _OMC_LIT88 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT88)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT89,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT88}};
#define _OMC_LIT89 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT89)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT90,2,1) {_OMC_LIT89,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT90 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT90)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT91,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT85,_OMC_LIT90,_OMC_LIT71}};
#define _OMC_LIT91 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data "sr"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,2,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
#define _OMC_LIT93_data "m2/m2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT93,5,_OMC_LIT93_data);
#define _OMC_LIT93 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT93)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT94,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT93}};
#define _OMC_LIT94 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT94)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT95,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT94}};
#define _OMC_LIT95 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT95)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT96,2,1) {_OMC_LIT95,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT96 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT96)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT97,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT92,_OMC_LIT96,_OMC_LIT71}};
#define _OMC_LIT97 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "Hz"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,2,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
#define _OMC_LIT99_data "s-1"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT99,3,_OMC_LIT99_data);
#define _OMC_LIT99 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT99)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT100,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT99}};
#define _OMC_LIT100 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT100)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT101,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT100}};
#define _OMC_LIT101 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT101)
#define _OMC_LIT102_data "weight"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT102,6,_OMC_LIT102_data);
#define _OMC_LIT102 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data "0.8"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,3,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT104,2,4) {&Absyn_Exp_REAL__desc,_OMC_LIT103}};
#define _OMC_LIT104 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT104)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT105,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT102,_OMC_LIT104}};
#define _OMC_LIT105 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT105)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT106,2,1) {_OMC_LIT105,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT106 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT106)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT107,2,1) {_OMC_LIT101,_OMC_LIT106}};
#define _OMC_LIT107 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT107)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT108,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT98,_OMC_LIT107,_OMC_LIT71}};
#define _OMC_LIT108 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT108)
#define _OMC_LIT109_data "N"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT109,1,_OMC_LIT109_data);
#define _OMC_LIT109 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT109)
#define _OMC_LIT110_data "m.kg.s-2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT110,8,_OMC_LIT110_data);
#define _OMC_LIT110 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT110)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT111,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT110}};
#define _OMC_LIT111 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT111)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT112,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT111}};
#define _OMC_LIT112 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT112)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT113,2,1) {_OMC_LIT112,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT113 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT113)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT114,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT109,_OMC_LIT113,_OMC_LIT71}};
#define _OMC_LIT114 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT114)
#define _OMC_LIT115_data "Pa"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT115,2,_OMC_LIT115_data);
#define _OMC_LIT115 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT115)
#define _OMC_LIT116_data "N/m2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT116,4,_OMC_LIT116_data);
#define _OMC_LIT116 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT116)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT117,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT116}};
#define _OMC_LIT117 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT117}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT119,2,1) {_OMC_LIT118,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT119 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT115,_OMC_LIT119,_OMC_LIT71}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
#define _OMC_LIT121_data "W"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT121,1,_OMC_LIT121_data);
#define _OMC_LIT121 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT121)
#define _OMC_LIT122_data "J/s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT122,3,_OMC_LIT122_data);
#define _OMC_LIT122 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT122}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT123}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT125,2,1) {_OMC_LIT124,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT125 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT121,_OMC_LIT125,_OMC_LIT71}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
#define _OMC_LIT127_data "J"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT127,1,_OMC_LIT127_data);
#define _OMC_LIT127 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "N.m"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,3,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT129,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT128}};
#define _OMC_LIT129 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT129)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT130,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT129}};
#define _OMC_LIT130 MMC_REFSTRUCTLIT(_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)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT132,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT127,_OMC_LIT131,_OMC_LIT71}};
#define _OMC_LIT132 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT132)
#define _OMC_LIT133_data "C"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT133,1,_OMC_LIT133_data);
#define _OMC_LIT133 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT133)
#define _OMC_LIT134_data "s.A"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT134,3,_OMC_LIT134_data);
#define _OMC_LIT134 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT134}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT136,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT135}};
#define _OMC_LIT136 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT136)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT137,2,1) {_OMC_LIT136,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT137 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT137)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT138,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT133,_OMC_LIT137,_OMC_LIT71}};
#define _OMC_LIT138 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT138)
#define _OMC_LIT139_data "V"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT139,1,_OMC_LIT139_data);
#define _OMC_LIT139 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT139)
#define _OMC_LIT140_data "W/A"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT140,3,_OMC_LIT140_data);
#define _OMC_LIT140 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT140)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT141,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT140}};
#define _OMC_LIT141 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT141)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT142,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT141}};
#define _OMC_LIT142 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT142)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT143,2,1) {_OMC_LIT142,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT143 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT143)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT144,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT139,_OMC_LIT143,_OMC_LIT71}};
#define _OMC_LIT144 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "F"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,1,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
#define _OMC_LIT146_data "C/V"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT146,3,_OMC_LIT146_data);
#define _OMC_LIT146 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT146)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT147,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT146}};
#define _OMC_LIT147 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT147)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT148,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT147}};
#define _OMC_LIT148 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT148)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT149,2,1) {_OMC_LIT148,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT149 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT149)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT150,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT145,_OMC_LIT149,_OMC_LIT71}};
#define _OMC_LIT150 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT150)
#define _OMC_LIT151_data "Ohm"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT151,3,_OMC_LIT151_data);
#define _OMC_LIT151 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "V/A"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,3,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT152}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT154,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT153}};
#define _OMC_LIT154 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT154)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT155,2,1) {_OMC_LIT154,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT155 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT155)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT156,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT151,_OMC_LIT155,_OMC_LIT71}};
#define _OMC_LIT156 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT156)
#define _OMC_LIT157_data "S"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT157,1,_OMC_LIT157_data);
#define _OMC_LIT157 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT157)
#define _OMC_LIT158_data "A/V"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT158,3,_OMC_LIT158_data);
#define _OMC_LIT158 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT158)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT159,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT158}};
#define _OMC_LIT159 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT159)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT160,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT159}};
#define _OMC_LIT160 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT160)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT161,2,1) {_OMC_LIT160,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT161 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT161)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT162,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT157,_OMC_LIT161,_OMC_LIT71}};
#define _OMC_LIT162 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT162)
#define _OMC_LIT163_data "Wb"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT163,2,_OMC_LIT163_data);
#define _OMC_LIT163 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT163)
#define _OMC_LIT164_data "V.s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT164,3,_OMC_LIT164_data);
#define _OMC_LIT164 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT164}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT166,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT165}};
#define _OMC_LIT166 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT166)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT167,2,1) {_OMC_LIT166,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT167 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT167)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT168,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT163,_OMC_LIT167,_OMC_LIT71}};
#define _OMC_LIT168 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT168)
#define _OMC_LIT169_data "T"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT169,1,_OMC_LIT169_data);
#define _OMC_LIT169 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT169)
#define _OMC_LIT170_data "Wb/m2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT170,5,_OMC_LIT170_data);
#define _OMC_LIT170 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT170)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT171,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT170}};
#define _OMC_LIT171 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT171}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT173,2,1) {_OMC_LIT172,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT173 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT173)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT174,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT169,_OMC_LIT173,_OMC_LIT71}};
#define _OMC_LIT174 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT174)
#define _OMC_LIT175_data "H"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT175,1,_OMC_LIT175_data);
#define _OMC_LIT175 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT175)
#define _OMC_LIT176_data "Wb/A"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT176,4,_OMC_LIT176_data);
#define _OMC_LIT176 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT176)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT177,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT176}};
#define _OMC_LIT177 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT177)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT178,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT177}};
#define _OMC_LIT178 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,2,1) {_OMC_LIT178,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT180,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT175,_OMC_LIT179,_OMC_LIT71}};
#define _OMC_LIT180 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT180)
#define _OMC_LIT181_data "lm"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT181,2,_OMC_LIT181_data);
#define _OMC_LIT181 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT181)
#define _OMC_LIT182_data "cd.sr"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT182,5,_OMC_LIT182_data);
#define _OMC_LIT182 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT182}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT184,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT183}};
#define _OMC_LIT184 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT184)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT185,2,1) {_OMC_LIT184,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT185 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT181,_OMC_LIT185,_OMC_LIT71}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
#define _OMC_LIT187_data "lx"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT187,2,_OMC_LIT187_data);
#define _OMC_LIT187 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT187)
#define _OMC_LIT188_data "lm/m2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT188,5,_OMC_LIT188_data);
#define _OMC_LIT188 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT188)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT189,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT188}};
#define _OMC_LIT189 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT189)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT190,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT189}};
#define _OMC_LIT190 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT190)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT191,2,1) {_OMC_LIT190,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT191 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT191)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT192,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT187,_OMC_LIT191,_OMC_LIT71}};
#define _OMC_LIT192 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT192)
#define _OMC_LIT193_data "Bq"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT193,2,_OMC_LIT193_data);
#define _OMC_LIT193 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT193)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT194,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT193,_OMC_LIT107,_OMC_LIT71}};
#define _OMC_LIT194 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT194)
#define _OMC_LIT195_data "Gy"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT195,2,_OMC_LIT195_data);
#define _OMC_LIT195 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT195)
#define _OMC_LIT196_data "J/kg"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT196,4,_OMC_LIT196_data);
#define _OMC_LIT196 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT196)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT197,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT196}};
#define _OMC_LIT197 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT197)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT198,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT197}};
#define _OMC_LIT198 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT198)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT199,2,1) {_OMC_LIT198,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT199 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT195,_OMC_LIT199,_OMC_LIT71}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
#define _OMC_LIT201_data "Sv"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT201,2,_OMC_LIT201_data);
#define _OMC_LIT201 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT201)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT202,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT201,_OMC_LIT185,_OMC_LIT71}};
#define _OMC_LIT202 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT202)
#define _OMC_LIT203_data "kat"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT203,3,_OMC_LIT203_data);
#define _OMC_LIT203 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT203)
#define _OMC_LIT204_data "s-1.mol"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT204,7,_OMC_LIT204_data);
#define _OMC_LIT204 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT204)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT205,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT204}};
#define _OMC_LIT205 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT205)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT206,3,3) {&Absyn_NamedArg_NAMEDARG__desc,_OMC_LIT86,_OMC_LIT205}};
#define _OMC_LIT206 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT206)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT207,2,1) {_OMC_LIT206,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT207 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT207)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT208,4,4) {&Absyn_Element_DEFINEUNIT__desc,_OMC_LIT203,_OMC_LIT207,_OMC_LIT71}};
#define _OMC_LIT208 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT208)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_1,2,1) {_OMC_LIT208,MMC_REFSTRUCTLIT(mmc_nil)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_2,2,1) {_OMC_LIT202,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_1)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_3,2,1) {_OMC_LIT200,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_2)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_4,2,1) {_OMC_LIT194,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_3)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_5,2,1) {_OMC_LIT192,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_4)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_6,2,1) {_OMC_LIT186,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_5)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_7,2,1) {_OMC_LIT180,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_6)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_8,2,1) {_OMC_LIT174,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_7)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_9,2,1) {_OMC_LIT168,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_8)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_10,2,1) {_OMC_LIT162,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_9)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_11,2,1) {_OMC_LIT156,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_10)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_12,2,1) {_OMC_LIT150,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_11)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_13,2,1) {_OMC_LIT144,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_12)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_14,2,1) {_OMC_LIT138,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_13)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_15,2,1) {_OMC_LIT132,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_14)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_16,2,1) {_OMC_LIT126,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_15)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_17,2,1) {_OMC_LIT120,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_16)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_18,2,1) {_OMC_LIT114,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_17)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_19,2,1) {_OMC_LIT108,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_18)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_20,2,1) {_OMC_LIT97,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_19)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_21,2,1) {_OMC_LIT91,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_20)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_22,2,1) {_OMC_LIT84,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_21)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_23,2,1) {_OMC_LIT82,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_22)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_24,2,1) {_OMC_LIT80,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_23)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_25,2,1) {_OMC_LIT78,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_24)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_26,2,1) {_OMC_LIT76,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_25)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_27,2,1) {_OMC_LIT74,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_26)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_28,2,1) {_OMC_LIT72,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_27)}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209_cons_28)
#define _OMC_LIT210_data "unitChecking"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT210,12,_OMC_LIT210_data);
#define _OMC_LIT210 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT210)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT211,1,4) {&Flags_FlagVisibility_EXTERNAL__desc,}};
#define _OMC_LIT211 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT211)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT212,2,4) {&Flags_FlagData_BOOL__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT212 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT212)
#define _OMC_LIT213_data "Enable unit checking."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT213,21,_OMC_LIT213_data);
#define _OMC_LIT213 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(31)),_OMC_LIT210,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT211,_OMC_LIT212,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT213}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT69,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT216,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT73,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT216 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT216)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT217,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT75,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT217 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT217)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT218,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT77,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT218 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT218)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT219,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT79,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT219 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT219)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT220,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT81,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT220 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT220)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT221,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT83,_OMC_LIT67,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT221 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT221)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT222,1,1) {_OMC_LIT87}};
#define _OMC_LIT222 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT222)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT223,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT85,_OMC_LIT67,_OMC_LIT222,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT223 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT223)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT224,1,1) {_OMC_LIT93}};
#define _OMC_LIT224 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT224)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT225,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT92,_OMC_LIT67,_OMC_LIT224,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT225 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT225)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT226,1,1) {_OMC_LIT99}};
#define _OMC_LIT226 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT226)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT227,0.8);
#define _OMC_LIT227 MMC_REFREALLIT(_OMC_LIT_STRUCT227)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT228,1,1) {_OMC_LIT227}};
#define _OMC_LIT228 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT228)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT229,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT98,_OMC_LIT67,_OMC_LIT226,_OMC_LIT228,_OMC_LIT71}};
#define _OMC_LIT229 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT229)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT230,1,1) {_OMC_LIT110}};
#define _OMC_LIT230 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT230)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT231,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT109,_OMC_LIT67,_OMC_LIT230,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT231 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,1,1) {_OMC_LIT116}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT233,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT115,_OMC_LIT67,_OMC_LIT232,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT233 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT233)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT234,1,1) {_OMC_LIT122}};
#define _OMC_LIT234 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT234)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT235,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT121,_OMC_LIT67,_OMC_LIT234,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT235 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT235)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT236,1,1) {_OMC_LIT128}};
#define _OMC_LIT236 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT236)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT237,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT127,_OMC_LIT67,_OMC_LIT236,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT237 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT237)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT238,1,1) {_OMC_LIT134}};
#define _OMC_LIT238 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT238)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT239,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT133,_OMC_LIT67,_OMC_LIT238,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT239 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT239)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT240,1,1) {_OMC_LIT140}};
#define _OMC_LIT240 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT240)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT241,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT139,_OMC_LIT67,_OMC_LIT240,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT241 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT241)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT242,1,1) {_OMC_LIT146}};
#define _OMC_LIT242 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT242)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT243,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT145,_OMC_LIT67,_OMC_LIT242,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT243 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT243)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT244,1,1) {_OMC_LIT152}};
#define _OMC_LIT244 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT244)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT245,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT151,_OMC_LIT67,_OMC_LIT244,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT245 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT245)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT246,1,1) {_OMC_LIT158}};
#define _OMC_LIT246 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT246)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT247,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT157,_OMC_LIT67,_OMC_LIT246,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT247 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT247)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT248,1,1) {_OMC_LIT164}};
#define _OMC_LIT248 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT248)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT249,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT163,_OMC_LIT67,_OMC_LIT248,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT249 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT249)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT250,1,1) {_OMC_LIT170}};
#define _OMC_LIT250 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT250)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT251,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT169,_OMC_LIT67,_OMC_LIT250,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT251 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT251)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT252,1,1) {_OMC_LIT176}};
#define _OMC_LIT252 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT252)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT253,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT175,_OMC_LIT67,_OMC_LIT252,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT253 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT253)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT254,1,1) {_OMC_LIT182}};
#define _OMC_LIT254 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT254)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT255,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT181,_OMC_LIT67,_OMC_LIT254,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT255 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT255)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT256,1,1) {_OMC_LIT188}};
#define _OMC_LIT256 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT256)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT257,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT187,_OMC_LIT67,_OMC_LIT256,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT257 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT257)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT258,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT193,_OMC_LIT67,_OMC_LIT226,_OMC_LIT228,_OMC_LIT71}};
#define _OMC_LIT258 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT258)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT259,1,1) {_OMC_LIT196}};
#define _OMC_LIT259 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT259)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT260,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT195,_OMC_LIT67,_OMC_LIT259,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT260 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT260)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT261,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT201,_OMC_LIT67,_OMC_LIT254,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT261 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT261)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT262,1,1) {_OMC_LIT204}};
#define _OMC_LIT262 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT262)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT263,6,7) {&SCode_Element_DEFINEUNIT__desc,_OMC_LIT203,_OMC_LIT67,_OMC_LIT262,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT71}};
#define _OMC_LIT263 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT263)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_1,2,1) {_OMC_LIT263,MMC_REFSTRUCTLIT(mmc_nil)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_2,2,1) {_OMC_LIT261,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_1)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_3,2,1) {_OMC_LIT260,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_2)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_4,2,1) {_OMC_LIT258,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_3)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_5,2,1) {_OMC_LIT257,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_4)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_6,2,1) {_OMC_LIT255,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_5)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_7,2,1) {_OMC_LIT253,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_6)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_8,2,1) {_OMC_LIT251,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_7)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_9,2,1) {_OMC_LIT249,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_8)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_10,2,1) {_OMC_LIT247,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_9)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_11,2,1) {_OMC_LIT245,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_10)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_12,2,1) {_OMC_LIT243,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_11)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_13,2,1) {_OMC_LIT241,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_12)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_14,2,1) {_OMC_LIT239,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_13)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_15,2,1) {_OMC_LIT237,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_14)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_16,2,1) {_OMC_LIT235,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_15)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_17,2,1) {_OMC_LIT233,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_16)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_18,2,1) {_OMC_LIT231,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_17)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_19,2,1) {_OMC_LIT229,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_18)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_20,2,1) {_OMC_LIT225,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_19)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_21,2,1) {_OMC_LIT223,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_20)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_22,2,1) {_OMC_LIT221,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_21)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_23,2,1) {_OMC_LIT220,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_22)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_24,2,1) {_OMC_LIT219,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_23)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_25,2,1) {_OMC_LIT218,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_24)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_26,2,1) {_OMC_LIT217,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_25)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_27,2,1) {_OMC_LIT216,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_26)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_28,2,1) {_OMC_LIT215,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_27)}};
#define _OMC_LIT264 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264_cons_28)
#define _OMC_LIT265_data "$definedUnits"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT265,13,_OMC_LIT265_data);
#define _OMC_LIT265 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT265)
#include "util/modelica.h"

#include "UnitAbsynBuilder_includes.h"


/* default, do not make protected functions static */
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_getDerivedUnitsHelper(threadData_t *threadData, modelica_metatype _baseUnit, modelica_string _baseUnitStr, modelica_metatype _inUnits);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_getDerivedUnitsHelper,2,0) {(void*) boxptr_UnitAbsynBuilder_getDerivedUnitsHelper,0}};
#define boxvar_UnitAbsynBuilder_getDerivedUnitsHelper MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_getDerivedUnitsHelper)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_selectConstantUnit(threadData_t *threadData, modelica_metatype _op);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_selectConstantUnit,2,0) {(void*) boxptr_UnitAbsynBuilder_selectConstantUnit,0}};
#define boxvar_UnitAbsynBuilder_selectConstantUnit MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_selectConstantUnit)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStoreExp(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _inStore, modelica_metatype _inHt, modelica_metatype _parentOp, modelica_metatype *out_outHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStoreExp,2,0) {(void*) boxptr_UnitAbsynBuilder_buildStoreExp,0}};
#define boxvar_UnitAbsynBuilder_buildStoreExp MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStoreExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStores3(threadData_t *threadData, modelica_metatype _dae, modelica_metatype _inStore, modelica_metatype _inHt, modelica_metatype *out_outHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStores3,2,0) {(void*) boxptr_UnitAbsynBuilder_buildStores3,0}};
#define boxvar_UnitAbsynBuilder_buildStores3 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStores3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStores2(threadData_t *threadData, modelica_metatype _dae, modelica_metatype _inStore, modelica_metatype _inHt, modelica_metatype *out_outHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStores2,2,0) {(void*) boxptr_UnitAbsynBuilder_buildStores2,0}};
#define boxvar_UnitAbsynBuilder_buildStores2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStores2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermOp(threadData_t *threadData, modelica_metatype _ut1, modelica_metatype _ut2, modelica_metatype _op, modelica_metatype _origExp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermOp,2,0) {(void*) boxptr_UnitAbsynBuilder_buildTermOp,0}};
#define boxvar_UnitAbsynBuilder_buildTermOp MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermOp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_origExpInTerm(threadData_t *threadData, modelica_metatype _ut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_origExpInTerm,2,0) {(void*) boxptr_UnitAbsynBuilder_origExpInTerm,0}};
#define boxvar_UnitAbsynBuilder_origExpInTerm MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_origExpInTerm)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildFormal2ActualParamTerms(threadData_t *threadData, modelica_metatype _iformalParamIndxs, modelica_metatype _iactualParamIndxs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildFormal2ActualParamTerms,2,0) {(void*) boxptr_UnitAbsynBuilder_buildFormal2ActualParamTerms,0}};
#define boxvar_UnitAbsynBuilder_buildFormal2ActualParamTerms MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildFormal2ActualParamTerms)
PROTECTED_FUNCTION_STATIC modelica_string omc_UnitAbsynBuilder_getUnitStr(threadData_t *threadData, modelica_metatype _itp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_getUnitStr,2,0) {(void*) boxptr_UnitAbsynBuilder_getUnitStr,0}};
#define boxvar_UnitAbsynBuilder_getUnitStr MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_getUnitStr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildFuncTypeStores2(threadData_t *threadData, modelica_metatype _ifargs, modelica_integer _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildFuncTypeStores2(threadData_t *threadData, modelica_metatype _ifargs, modelica_metatype _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildFuncTypeStores2,2,0) {(void*) boxptr_UnitAbsynBuilder_buildFuncTypeStores2,0}};
#define boxvar_UnitAbsynBuilder_buildFuncTypeStores2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildFuncTypeStores2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildFuncTypeStores(threadData_t *threadData, modelica_metatype _funcType, modelica_integer _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildFuncTypeStores(threadData_t *threadData, modelica_metatype _funcType, modelica_metatype _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildFuncTypeStores,2,0) {(void*) boxptr_UnitAbsynBuilder_buildFuncTypeStores,0}};
#define boxvar_UnitAbsynBuilder_buildFuncTypeStores MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildFuncTypeStores)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermExpList(threadData_t *threadData, modelica_metatype _env, modelica_metatype _iexpl, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermExpList,2,0) {(void*) boxptr_UnitAbsynBuilder_buildTermExpList,0}};
#define boxvar_UnitAbsynBuilder_buildTermExpList MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermExpList)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTupleResultTerms(threadData_t *threadData, modelica_metatype _ifunctps, modelica_integer _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildTupleResultTerms(threadData_t *threadData, modelica_metatype _ifunctps, modelica_metatype _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTupleResultTerms,2,0) {(void*) boxptr_UnitAbsynBuilder_buildTupleResultTerms,0}};
#define boxvar_UnitAbsynBuilder_buildTupleResultTerms MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTupleResultTerms)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildResultTerms(threadData_t *threadData, modelica_metatype _ifunctp, modelica_integer _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildResultTerms(threadData_t *threadData, modelica_metatype _ifunctp, modelica_metatype _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildResultTerms,2,0) {(void*) boxptr_UnitAbsynBuilder_buildResultTerms,0}};
#define boxvar_UnitAbsynBuilder_buildResultTerms MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildResultTerms)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermCall(threadData_t *threadData, modelica_metatype _env, modelica_metatype _path, modelica_metatype _funcCallExp, modelica_metatype _expl, modelica_boolean _divOrMul, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildTermCall(threadData_t *threadData, modelica_metatype _env, modelica_metatype _path, modelica_metatype _funcCallExp, modelica_metatype _expl, modelica_metatype _divOrMul, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermCall,2,0) {(void*) boxptr_UnitAbsynBuilder_buildTermCall,0}};
#define boxvar_UnitAbsynBuilder_buildTermCall MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermCall)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildArrayElementTerms(threadData_t *threadData, modelica_metatype _iuts, modelica_metatype _iexpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildArrayElementTerms,2,0) {(void*) boxptr_UnitAbsynBuilder_buildArrayElementTerms,0}};
#define boxvar_UnitAbsynBuilder_buildArrayElementTerms MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildArrayElementTerms)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermExp(threadData_t *threadData, modelica_metatype _env, modelica_metatype _exp, modelica_boolean _idivOrMul, modelica_metatype _iht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildTermExp(threadData_t *threadData, modelica_metatype _env, modelica_metatype _exp, modelica_metatype _idivOrMul, modelica_metatype _iht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermExp,2,0) {(void*) boxptr_UnitAbsynBuilder_buildTermExp,0}};
#define boxvar_UnitAbsynBuilder_buildTermExp MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTermExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTerms(threadData_t *threadData, modelica_metatype _env, modelica_metatype _dae, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_outStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTerms,2,0) {(void*) boxptr_UnitAbsynBuilder_buildTerms,0}};
#define boxvar_UnitAbsynBuilder_buildTerms MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildTerms)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStores(threadData_t *threadData, modelica_metatype _dae, modelica_metatype *out_ht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStores,2,0) {(void*) boxptr_UnitAbsynBuilder_buildStores,0}};
#define boxvar_UnitAbsynBuilder_buildStores MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_buildStores)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData_t *threadData, modelica_metatype _iparams, modelica_metatype _iht, modelica_integer _inextElt, modelica_metatype *out_outHt, modelica_integer *out_outNextElt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_createTypeParameterLocations4(threadData_t *threadData, modelica_metatype _iparams, modelica_metatype _iht, modelica_metatype _inextElt, modelica_metatype *out_outHt, modelica_metatype *out_outNextElt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations4,2,0) {(void*) boxptr_UnitAbsynBuilder_createTypeParameterLocations4,0}};
#define boxvar_UnitAbsynBuilder_createTypeParameterLocations4 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations4)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations3(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _iht, modelica_integer _inextElt, modelica_metatype *out_outHt, modelica_integer *out_outNextElt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_createTypeParameterLocations3(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _iht, modelica_metatype _inextElt, modelica_metatype *out_outHt, modelica_metatype *out_outNextElt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations3,2,0) {(void*) boxptr_UnitAbsynBuilder_createTypeParameterLocations3,0}};
#define boxvar_UnitAbsynBuilder_createTypeParameterLocations3 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations3)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations2(threadData_t *threadData, modelica_metatype _istore, modelica_metatype _iht, modelica_integer _i, modelica_integer _inextElt, modelica_metatype *out_outHt, modelica_integer *out_outNextElt);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_createTypeParameterLocations2(threadData_t *threadData, modelica_metatype _istore, modelica_metatype _iht, modelica_metatype _i, modelica_metatype _inextElt, modelica_metatype *out_outHt, modelica_metatype *out_outNextElt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations2,2,0) {(void*) boxptr_UnitAbsynBuilder_createTypeParameterLocations2,0}};
#define boxvar_UnitAbsynBuilder_createTypeParameterLocations2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_addUnspecifiedStores(threadData_t *threadData, modelica_integer _n, modelica_metatype _istore);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_addUnspecifiedStores(threadData_t *threadData, modelica_metatype _n, modelica_metatype _istore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_addUnspecifiedStores,2,0) {(void*) boxptr_UnitAbsynBuilder_addUnspecifiedStores,0}};
#define boxvar_UnitAbsynBuilder_addUnspecifiedStores MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_addUnspecifiedStores)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations(threadData_t *threadData, modelica_metatype _store);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations,2,0) {(void*) boxptr_UnitAbsynBuilder_createTypeParameterLocations,0}};
#define boxvar_UnitAbsynBuilder_createTypeParameterLocations MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_createTypeParameterLocations)
PROTECTED_FUNCTION_STATIC modelica_string omc_UnitAbsynBuilder_printTypeParameterStr(threadData_t *threadData, modelica_metatype _typeParam);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printTypeParameterStr,2,0) {(void*) boxptr_UnitAbsynBuilder_printTypeParameterStr,0}};
#define boxvar_UnitAbsynBuilder_printTypeParameterStr MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printTypeParameterStr)
PROTECTED_FUNCTION_STATIC modelica_string omc_UnitAbsynBuilder_printBaseUnitsStr(threadData_t *threadData, modelica_metatype _lst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printBaseUnitsStr,2,0) {(void*) boxptr_UnitAbsynBuilder_printBaseUnitsStr,0}};
#define boxvar_UnitAbsynBuilder_printBaseUnitsStr MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printBaseUnitsStr)
PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_printUnit(threadData_t *threadData, modelica_metatype _unit);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printUnit,2,0) {(void*) boxptr_UnitAbsynBuilder_printUnit,0}};
#define boxvar_UnitAbsynBuilder_printUnit MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printUnit)
PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_printStore2(threadData_t *threadData, modelica_metatype _lst, modelica_integer _indx);
PROTECTED_FUNCTION_STATIC void boxptr_UnitAbsynBuilder_printStore2(threadData_t *threadData, modelica_metatype _lst, modelica_metatype _indx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printStore2,2,0) {(void*) boxptr_UnitAbsynBuilder_printStore2,0}};
#define boxvar_UnitAbsynBuilder_printStore2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_printStore2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_emptyInstStore2(threadData_t *threadData, modelica_boolean _wantInstStore);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_emptyInstStore2(threadData_t *threadData, modelica_metatype _wantInstStore);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_emptyInstStore2,2,0) {(void*) boxptr_UnitAbsynBuilder_emptyInstStore2,0}};
#define boxvar_UnitAbsynBuilder_emptyInstStore2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_emptyInstStore2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_expandStore(threadData_t *threadData, modelica_metatype _st);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_expandStore,2,0) {(void*) boxptr_UnitAbsynBuilder_expandStore,0}};
#define boxvar_UnitAbsynBuilder_expandStore MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_expandStore)
PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerDefineunits2(threadData_t *threadData, modelica_metatype _elts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerDefineunits2,2,0) {(void*) boxptr_UnitAbsynBuilder_registerDefineunits2,0}};
#define boxvar_UnitAbsynBuilder_registerDefineunits2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerDefineunits2)
PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerDefineunits(threadData_t *threadData, modelica_metatype _elts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerDefineunits,2,0) {(void*) boxptr_UnitAbsynBuilder_registerDefineunits,0}};
#define boxvar_UnitAbsynBuilder_registerDefineunits MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerDefineunits)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_registerUnitInClass(threadData_t *threadData, modelica_metatype _inTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerUnitInClass,2,0) {(void*) boxptr_UnitAbsynBuilder_registerUnitInClass,0}};
#define boxvar_UnitAbsynBuilder_registerUnitInClass MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerUnitInClass)
PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerUnitWeightDefineunits2(threadData_t *threadData, modelica_metatype _idu);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerUnitWeightDefineunits2,2,0) {(void*) boxptr_UnitAbsynBuilder_registerUnitWeightDefineunits2,0}};
#define boxvar_UnitAbsynBuilder_registerUnitWeightDefineunits2 MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerUnitWeightDefineunits2)
PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerUnitWeightDefineunits(threadData_t *threadData, modelica_metatype _du);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerUnitWeightDefineunits,2,0) {(void*) boxptr_UnitAbsynBuilder_registerUnitWeightDefineunits,0}};
#define boxvar_UnitAbsynBuilder_registerUnitWeightDefineunits MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_registerUnitWeightDefineunits)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_retrieveUnitsFromEnv(threadData_t *threadData, modelica_metatype _p, modelica_metatype _tpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_retrieveUnitsFromEnv,2,0) {(void*) boxptr_UnitAbsynBuilder_retrieveUnitsFromEnv,0}};
#define boxvar_UnitAbsynBuilder_retrieveUnitsFromEnv MMC_REFSTRUCTLIT(boxvar_lit_UnitAbsynBuilder_retrieveUnitsFromEnv)

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_buildTest1(threadData_t *threadData, modelica_metatype *out_sigma)
{
  modelica_metatype _ut = NULL;
  modelica_metatype _sigma = NULL;
  modelica_metatype _r0 = NULL;
  modelica_metatype _r1 = NULL;
  modelica_metatype _nr1 = NULL;
  modelica_metatype _nr2 = NULL;
  modelica_metatype _unitderx = NULL;
  modelica_metatype _unitderv = NULL;
  modelica_metatype _unitx = NULL;
  modelica_metatype _unitv = NULL;
  modelica_metatype _unita = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ut has no default value.
  // _sigma has no default value.
  // _r0 has no default value.
  // _r1 has no default value.
  // _nr1 has no default value.
  // _nr2 has no default value.
  // _unitderx has no default value.
  // _unitderv has no default value.
  // _unitx has no default value.
  // _unitv has no default value.
  // _unita has no default value.
  _r0 = _OMC_LIT0;

  _r1 = _OMC_LIT1;

  _nr1 = _OMC_LIT2;

  _nr2 = _OMC_LIT3;

  _ut = _OMC_LIT23;

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta2 = mmc_mk_cons(_r1, mmc_mk_cons(_nr1, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, MMC_REFSTRUCTLIT(mmc_nil))))))));
  tmpMeta3 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, tmpMeta1, tmpMeta2);
  tmpMeta4 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta3);
  _unitderx = tmpMeta4;

  tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta6 = mmc_mk_cons(_r1, mmc_mk_cons(_nr2, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, MMC_REFSTRUCTLIT(mmc_nil))))))));
  tmpMeta7 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, tmpMeta5, tmpMeta6);
  tmpMeta8 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta7);
  _unitderv = tmpMeta8;

  tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta10 = mmc_mk_cons(_r1, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, MMC_REFSTRUCTLIT(mmc_nil))))))));
  tmpMeta11 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, tmpMeta9, tmpMeta10);
  tmpMeta12 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta11);
  _unitx = tmpMeta12;

  tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta14 = mmc_mk_cons(_r1, mmc_mk_cons(_nr1, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, MMC_REFSTRUCTLIT(mmc_nil))))))));
  tmpMeta15 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, tmpMeta13, tmpMeta14);
  tmpMeta16 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta15);
  _unitv = tmpMeta16;

  tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta18 = mmc_mk_cons(_r1, mmc_mk_cons(_nr2, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, mmc_mk_cons(_r0, MMC_REFSTRUCTLIT(mmc_nil))))))));
  tmpMeta19 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, tmpMeta17, tmpMeta18);
  tmpMeta20 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta19);
  _unita = tmpMeta20;

  _sigma = omc_UnitAbsynBuilder_emptyStore(threadData);

  _sigma = omc_UnitAbsynBuilder_add(threadData, _unitderx, _sigma, NULL);

  _sigma = omc_UnitAbsynBuilder_add(threadData, _unitderv, _sigma, NULL);

  _sigma = omc_UnitAbsynBuilder_add(threadData, _unitx, _sigma, NULL);

  _sigma = omc_UnitAbsynBuilder_add(threadData, _unitv, _sigma, NULL);

  _sigma = omc_UnitAbsynBuilder_add(threadData, _unita, _sigma, NULL);

  omc_UnitAbsynBuilder_printStore(threadData, _sigma);
  _return: OMC_LABEL_UNUSED
  if (out_sigma) { *out_sigma = _sigma; }
  return _ut;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_getDerivedUnits(threadData_t *threadData, modelica_metatype _baseUnit, modelica_string _baseUnitStr)
{
  modelica_metatype _derivedUnits = NULL;
  modelica_metatype _unitSymbols = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _derivedUnits has no default value.
  // _unitSymbols has no default value.
  _unitSymbols = omc_UnitParserExt_allUnitSymbols(threadData);

  _derivedUnits = omc_UnitAbsynBuilder_getDerivedUnitsHelper(threadData, _baseUnit, _baseUnitStr, _unitSymbols);
  _return: OMC_LABEL_UNUSED
  return _derivedUnits;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_getDerivedUnitsHelper(threadData_t *threadData, modelica_metatype _baseUnit, modelica_string _baseUnitStr, modelica_metatype _inUnits)
{
  modelica_metatype _outUnits = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _unit = NULL;
  modelica_boolean _b;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _outUnits = tmpMeta1;
  // _unit has no default value.
  // _b has no default value.
  {
    modelica_metatype _unitStr;
    for (tmpMeta2 = _inUnits; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _unitStr = MMC_CAR(tmpMeta2);
      if((!(stringEqual(_baseUnitStr, _unitStr))))
      {
        _unit = omc_UnitAbsynBuilder_str2unit(threadData, _unitStr, mmc_mk_none());

        _b = valueEq(_baseUnit, _unit);

        if(_b)
        {
          tmpMeta3 = mmc_mk_cons(_unitStr, _outUnits);
          _outUnits = tmpMeta3;
        }
      }
    }
  }
  _return: OMC_LABEL_UNUSED
  return _outUnits;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_str2unitWithScaleFactor(threadData_t *threadData, modelica_string _res, modelica_metatype _funcInstIdOpt, modelica_real *out_scaleFactor, modelica_real *out_offset)
{
  modelica_metatype _unit = NULL;
  modelica_real _scaleFactor;
  modelica_real _offset;
  modelica_metatype _nums = NULL;
  modelica_metatype _denoms = NULL;
  modelica_metatype _tpnoms = NULL;
  modelica_metatype _tpdenoms = NULL;
  modelica_metatype _tpstrs = NULL;
  modelica_metatype _typeParams = NULL;
  modelica_metatype _units = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _unit has no default value.
  // _scaleFactor has no default value.
  // _offset has no default value.
  // _nums has no default value.
  // _denoms has no default value.
  // _tpnoms has no default value.
  // _tpdenoms has no default value.
  // _tpstrs has no default value.
  // _typeParams has no default value.
  // _units has no default value.
  _nums = omc_UnitParserExt_str2unit(threadData, _res ,&_denoms ,&_tpnoms ,&_tpdenoms ,&_tpstrs ,&_scaleFactor ,&_offset);

  _units = omc_UnitAbsynBuilder_joinRationals(threadData, _nums, _denoms);

  _typeParams = omc_UnitAbsynBuilder_joinTypeParams(threadData, _tpnoms, _tpdenoms, _tpstrs, _funcInstIdOpt);

  tmpMeta1 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, _typeParams, _units);
  tmpMeta2 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta1);
  _unit = tmpMeta2;
  _return: OMC_LABEL_UNUSED
  if (out_scaleFactor) { *out_scaleFactor = _scaleFactor; }
  if (out_offset) { *out_offset = _offset; }
  return _unit;
}
modelica_metatype boxptr_UnitAbsynBuilder_str2unitWithScaleFactor(threadData_t *threadData, modelica_metatype _res, modelica_metatype _funcInstIdOpt, modelica_metatype *out_scaleFactor, modelica_metatype *out_offset)
{
  modelica_real _scaleFactor;
  modelica_real _offset;
  modelica_metatype _unit = NULL;
  _unit = omc_UnitAbsynBuilder_str2unitWithScaleFactor(threadData, _res, _funcInstIdOpt, &_scaleFactor, &_offset);
  /* skip box _unit; UnitAbsyn.Unit */
  if (out_scaleFactor) { *out_scaleFactor = mmc_mk_rcon(_scaleFactor); }
  if (out_offset) { *out_offset = mmc_mk_rcon(_offset); }
  return _unit;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_str2unit(threadData_t *threadData, modelica_string _res, modelica_metatype _funcInstIdOpt)
{
  modelica_metatype _unit = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _unit has no default value.
  _unit = omc_UnitAbsynBuilder_str2unitWithScaleFactor(threadData, _res, _funcInstIdOpt, NULL, NULL);
  _return: OMC_LABEL_UNUSED
  return _unit;
}

DLLDirection
modelica_string omc_UnitAbsynBuilder_unit2str(threadData_t *threadData, modelica_metatype _unit)
{
  modelica_string _res = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _res has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _unit;
    {
      modelica_metatype _nums = NULL;
      modelica_metatype _denoms = NULL;
      modelica_metatype _tpnoms = NULL;
      modelica_metatype _tpdenoms = NULL;
      modelica_metatype _tpstrs = NULL;
      modelica_metatype _typeParams = NULL;
      modelica_metatype _units = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _nums has no default value.
      // _denoms has no default value.
      // _tpnoms has no default value.
      // _tpdenoms has no default value.
      // _tpstrs has no default value.
      // _typeParams has no default value.
      // _units has no default value.
      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,0,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          _typeParams = tmpMeta7;
          _units = tmpMeta8;
          /* Pattern matching succeeded */
          _nums = omc_UnitAbsynBuilder_splitRationals(threadData, _units ,&_denoms);

          _tpnoms = omc_UnitAbsynBuilder_splitTypeParams(threadData, _typeParams ,&_tpdenoms ,&_tpstrs);
          tmp1 = omc_UnitParserExt_unit2str(threadData, _nums, _denoms, _tpnoms, _tpdenoms, _tpstrs, 1.0, 0.0);
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1 = _OMC_LIT24;
          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;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_selectConstantUnit(threadData_t *threadData, modelica_metatype _op)
{
  modelica_metatype _unit = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _unit has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _op;
    {
      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;
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT25;
          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));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT25;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta7;
          if (optionNone(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT25;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta8;
          if (optionNone(tmp4_1)) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          /* Pattern matching succeeded */
          tmpMeta1 = omc_UnitAbsynBuilder_str2unit(threadData, _OMC_LIT4, mmc_mk_none());
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _unit = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _unit;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_unitMultiply(threadData_t *threadData, modelica_metatype _u1, modelica_metatype _u2)
{
  modelica_metatype _u = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _u has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _u1;
    tmp4_2 = _u2;
    {
      modelica_metatype _tparams1 = NULL;
      modelica_metatype _tparams2 = NULL;
      modelica_metatype _tparams = NULL;
      modelica_metatype _units = NULL;
      modelica_metatype _units1 = NULL;
      modelica_metatype _units2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _tparams1 has no default value.
      // _tparams2 has no default value.
      // _tparams has no default value.
      // _units has no default value.
      // _units1 has no default value.
      // _units2 has no default value.
      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;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,1) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
          _tparams1 = tmpMeta7;
          _units1 = tmpMeta8;
          _tparams2 = tmpMeta10;
          _units2 = tmpMeta11;
          /* Pattern matching succeeded */
          _tparams = listAppend(_tparams1, _tparams2);

          _units = omc_List_threadMap(threadData, _units1, _units2, boxvar_MMath_addRational);
          tmpMeta12 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, _tparams, _units);
          tmpMeta13 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta12);
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _u = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _u;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStoreExp(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _inStore, modelica_metatype _inHt, modelica_metatype _parentOp, modelica_metatype *out_outHt)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _outHt = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _outHt has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
    tmp4_1 = _exp;
    tmp4_2 = _inStore;
    tmp4_3 = _inHt;
    {
      modelica_real _r;
      modelica_string _s1 = NULL;
      modelica_integer _i;
      modelica_integer _indx;
      modelica_metatype _unit = NULL;
      modelica_metatype _e1 = NULL;
      modelica_metatype _e2 = NULL;
      modelica_metatype _op = NULL;
      modelica_metatype _cref_ = NULL;
      modelica_metatype _store = NULL;
      modelica_metatype _ht = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _r has no default value.
      // _s1 has no default value.
      // _i has no default value.
      // _indx has no default value.
      // _unit has no default value.
      // _e1 has no default value.
      // _e2 has no default value.
      // _op has no default value.
      // _cref_ has no default value.
      // _store has no default value.
      // _ht has no default value.
      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_real tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          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  /* pattern as ty=Real */;
          _store = tmp4_2;
          _ht = tmp4_3;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          _unit = omc_UnitAbsynBuilder_selectConstantUnit(threadData, _parentOp);

          _store = omc_UnitAbsynBuilder_add(threadData, _unit, _store ,&_indx);

          _s1 = realString(_r);

          tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
          _cref_ = omc_ComponentReferenceBasics_makeCrefIdent(threadData, _s1, _OMC_LIT26, tmpMeta8);

          tmpMeta9 = mmc_mk_box2(0, _cref_, mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta9, _ht);
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = _ht;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          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  /* pattern as ty=Integer */;
          _store = tmp4_2;
          _ht = tmp4_3;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          _unit = omc_UnitAbsynBuilder_selectConstantUnit(threadData, _parentOp);

          _store = omc_UnitAbsynBuilder_add(threadData, _unit, _store ,&_indx);

          _s1 = intString(_i);

          tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
          _cref_ = omc_ComponentReferenceBasics_makeCrefIdent(threadData, _s1, _OMC_LIT26, tmpMeta13);

          tmpMeta14 = mmc_mk_box2(0, _cref_, mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta14, _ht);
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = _ht;
          goto tmp3_done;
        }
        case 2: {
          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;
          _store = tmp4_2;
          _ht = tmp4_3;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          _store = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e1, _store, _ht, mmc_mk_some(_op) ,&_ht);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e2, _store, _ht, mmc_mk_some(_op), &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta18;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _e1 = tmpMeta18;
          _store = tmp4_2;
          _ht = tmp4_3;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e1, _store, _ht, _parentOp, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _e1 = tmpMeta19;
          _e2 = tmpMeta20;
          _store = tmp4_2;
          _ht = tmp4_3;
          /* Pattern matching succeeded */
          _store = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e1, _store, _ht, _parentOp ,&_ht);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e2, _store, _ht, _parentOp, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 5: {
          
          _store = tmp4_2;
          _ht = tmp4_3;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = _ht;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 6) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outStore = tmpMeta[0+0];
  _outHt = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_outHt) { *out_outHt = _outHt; }
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStores3(threadData_t *threadData, modelica_metatype _dae, modelica_metatype _inStore, modelica_metatype _inHt, modelica_metatype *out_outHt)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _outHt = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _outHt has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
    tmp4_1 = _dae;
    tmp4_2 = _inStore;
    tmp4_3 = _inHt;
    {
      modelica_metatype _e1 = NULL;
      modelica_metatype _e2 = NULL;
      modelica_metatype _elts = NULL;
      modelica_metatype _store = NULL;
      modelica_metatype _ht = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _e1 has no default value.
      // _e2 has no default value.
      // _elts has no default value.
      // _store has no default value.
      // _ht has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (!listEmpty(tmpMeta6)) goto tmp3_end;
          
          _store = tmp4_2;
          _ht = tmp4_3;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = _ht;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta8 = MMC_CAR(tmpMeta7);
          tmpMeta9 = MMC_CDR(tmpMeta7);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,3) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
          
          _e1 = tmpMeta10;
          _e2 = tmpMeta11;
          _elts = tmpMeta9;
          _store = tmp4_2;
          _ht = tmp4_3;
          /* Pattern matching succeeded */
          _store = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e1, _store, _ht, mmc_mk_none() ,&_ht);

          _store = omc_UnitAbsynBuilder_buildStoreExp(threadData, _e2, _store, _ht, mmc_mk_none() ,&_ht);
          tmpMeta12 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStores3(threadData, tmpMeta12, _store, _ht, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta13)) goto tmp3_end;
          tmpMeta14 = MMC_CAR(tmpMeta13);
          tmpMeta15 = MMC_CDR(tmpMeta13);
          
          _elts = tmpMeta15;
          _store = tmp4_2;
          _ht = tmp4_3;
          /* Pattern matching succeeded */
          tmpMeta16 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStores3(threadData, tmpMeta16, _store, _ht, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outStore = tmpMeta[0+0];
  _outHt = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_outHt) { *out_outHt = _outHt; }
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStores2(threadData_t *threadData, modelica_metatype _dae, modelica_metatype _inStore, modelica_metatype _inHt, modelica_metatype *out_outHt)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _outHt = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _outHt has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _dae;
    {
      modelica_metatype _cr = NULL;
      modelica_metatype _attropt = NULL;
      modelica_integer _indx;
      modelica_string _unitStr = NULL;
      modelica_metatype _unit = NULL;
      modelica_metatype _elts = NULL;
      modelica_metatype _store = NULL;
      modelica_metatype _ht = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _cr has no default value.
      // _attropt has no default value.
      // _indx has no default value.
      // _unitStr has no default value.
      // _unit has no default value.
      // _elts has no default value.
      // _store has no default value.
      // _ht has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (!listEmpty(tmpMeta6)) goto tmp3_end;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = _inStore;
          tmpMeta[0+1] = _inHt;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta8 = MMC_CAR(tmpMeta7);
          tmpMeta9 = MMC_CDR(tmpMeta7);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,14) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 12));
          
          _cr = tmpMeta10;
          _attropt = tmpMeta11;
          _elts = tmpMeta9;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta12 = omc_DAEUtil_getUnitAttr(threadData, _attropt);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,2,1) == 0) goto goto_2;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
          _unitStr = tmpMeta13;

          _unit = omc_UnitAbsynBuilder_str2unit(threadData, _unitStr, mmc_mk_none());

          _store = omc_UnitAbsynBuilder_add(threadData, _unit, _inStore ,&_indx);

          tmpMeta14 = mmc_mk_box2(0, _cr, mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta14, _inHt);
          tmpMeta15 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStores2(threadData, tmpMeta15, _store, _ht, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta16)) goto tmp3_end;
          tmpMeta17 = MMC_CAR(tmpMeta16);
          tmpMeta18 = MMC_CDR(tmpMeta16);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,14) == 0) goto tmp3_end;
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
          
          _cr = tmpMeta19;
          /* Pattern matching succeeded */
          _store = omc_UnitAbsynBuilder_add(threadData, _OMC_LIT25, _inStore ,&_indx);

          tmpMeta20 = mmc_mk_box2(0, _cr, mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta20, _inHt);
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = _ht;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta21)) goto tmp3_end;
          tmpMeta22 = MMC_CAR(tmpMeta21);
          tmpMeta23 = MMC_CDR(tmpMeta21);
          _elts = tmpMeta23;
          /* Pattern matching succeeded */
          tmpMeta24 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildStores2(threadData, tmpMeta24, _inStore, _inHt, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outStore = tmpMeta[0+0];
  _outHt = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_outHt) { *out_outHt = _outHt; }
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermOp(threadData_t *threadData, modelica_metatype _ut1, modelica_metatype _ut2, modelica_metatype _op, modelica_metatype _origExp)
{
  modelica_metatype _ut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ut has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _op;
    {
      int tmp4;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 3: {
          modelica_metatype tmpMeta5;
          
          /* Pattern matching succeeded */
          tmpMeta5 = mmc_mk_box4(3, &UnitAbsyn_UnitTerm_ADD__desc, _ut1, _ut2, _origExp);
          tmpMeta1 = tmpMeta5;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta6;
          
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_box4(4, &UnitAbsyn_UnitTerm_SUB__desc, _ut1, _ut2, _origExp);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta7;
          
          /* Pattern matching succeeded */
          tmpMeta7 = mmc_mk_box4(5, &UnitAbsyn_UnitTerm_MUL__desc, _ut1, _ut2, _origExp);
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_box4(6, &UnitAbsyn_UnitTerm_DIV__desc, _ut1, _ut2, _origExp);
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _ut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _ut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_origExpInTerm(threadData_t *threadData, modelica_metatype _ut)
{
  modelica_metatype _origExp = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _origExp has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _ut;
    {
      modelica_metatype _e = NULL;
      int tmp4;
      // _e has no default value.
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 3: {
          modelica_metatype tmpMeta5;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,3) == 0) goto tmp3_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta5;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta7;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,3) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta8;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,3) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta9;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _e = tmpMeta10;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,3) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta11;
          /* Pattern matching succeeded */
          tmpMeta1 = _e;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _origExp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _origExp;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildFormal2ActualParamTerms(threadData_t *threadData, modelica_metatype _iformalParamIndxs, modelica_metatype _iactualParamIndxs)
{
  modelica_metatype _terms = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _terms has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iformalParamIndxs;
    tmp4_2 = _iactualParamIndxs;
    {
      modelica_integer _loc1;
      modelica_metatype _ut = NULL;
      modelica_metatype _e = NULL;
      modelica_metatype _formalParamIndxs = NULL;
      modelica_metatype _actualParamIndxs = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _loc1 has no default value.
      // _ut has no default value.
      // _e has no default value.
      // _formalParamIndxs has no default value.
      // _actualParamIndxs has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          if (!listEmpty(tmp4_2)) goto tmp3_end;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          tmp9 = mmc_unbox_integer(tmpMeta7);
          if (listEmpty(tmp4_2)) goto tmp3_end;
          tmpMeta10 = MMC_CAR(tmp4_2);
          tmpMeta11 = MMC_CDR(tmp4_2);
          _loc1 = tmp9  /* pattern as ty=Integer */;
          _formalParamIndxs = tmpMeta8;
          _ut = tmpMeta10;
          _actualParamIndxs = tmpMeta11;
          /* Pattern matching succeeded */
          _terms = omc_UnitAbsynBuilder_buildFormal2ActualParamTerms(threadData, _formalParamIndxs, _actualParamIndxs);

          _e = omc_UnitAbsynBuilder_origExpInTerm(threadData, _ut);
          tmpMeta13 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_loc1), _e);
          tmpMeta14 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, tmpMeta13, _ut, _e);
          tmpMeta12 = mmc_mk_cons(tmpMeta14, _terms);
          tmpMeta1 = tmpMeta12;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT27),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _terms = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _terms;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_UnitAbsynBuilder_getUnitStr(threadData_t *threadData, modelica_metatype _itp)
{
  jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
  modelica_string _str = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _str has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _itp;
    {
      modelica_metatype _varLst = NULL;
      modelica_metatype _tp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _varLst has no default value.
      // _tp has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta16;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          _varLst = tmpMeta6;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          {
            modelica_metatype _v;
            for (tmpMeta7 = _varLst; !listEmpty(tmpMeta7); tmpMeta7=MMC_CDR(tmpMeta7))
            {
              _v = MMC_CAR(tmpMeta7);
              { /* match expression */
                modelica_metatype tmp10_1;
                tmp10_1 = _v;
                {
                  volatile mmc_switch_type tmp10;
                  int tmp11;
                  tmp10 = 0;
                  for (; tmp10 < 2; tmp10++) {
                    switch (MMC_SWITCH_CAST(tmp10)) {
                    case 0: {
                      modelica_metatype tmpMeta12;
                      modelica_metatype tmpMeta13;
                      modelica_metatype tmpMeta14;
                      modelica_metatype tmpMeta15;
                      tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp10_1), 2));
                      if (4 != MMC_STRLEN(tmpMeta12) || strcmp(MMC_STRINGDATA(_OMC_LIT28), MMC_STRINGDATA(tmpMeta12)) != 0) goto tmp9_end;
                      tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp10_1), 5));
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,4) == 0) goto tmp9_end;
                      tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,2,1) == 0) goto tmp9_end;
                      tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
                      
                      _str = tmpMeta15;
                      /* Pattern matching succeeded */
                      goto _return;
                      goto tmp9_done;
                    }
                    case 1: {
                      
                      /* Pattern matching succeeded */
                      goto tmp9_done;
                    }
                    }
                    goto tmp9_end;
                    tmp9_end: ;
                  }
                  goto goto_8;
                  goto_8:;
                  goto goto_2;
                  goto tmp9_done;
                  tmp9_done:;
                }
              }
              ;
            }
          }
          tmp1 = _OMC_LIT29;
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
          
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmp1 = _OMC_LIT29;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta17;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _tp = tmpMeta17;
          /* Pattern matching succeeded */
          tmp1 = omc_UnitAbsynBuilder_getUnitStr(threadData, _tp);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          
          _tp = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta18 = stringAppend(_OMC_LIT30,omc_TypesDump_unparseType(threadData, _tp));
          tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT31);
          fputs(MMC_STRINGDATA(tmpMeta19),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 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _str = tmp1;
  _return: OMC_LABEL_UNUSED
  threadData->mmc_jumper = old_mmc_jumper;
  return _str;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildFuncTypeStores2(threadData_t *threadData, modelica_metatype _ifargs, modelica_integer _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _indxs = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _indxs has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _ifargs;
    tmp4_2 = _istore;
    {
      modelica_string _unitStr = NULL;
      modelica_integer _indx;
      modelica_metatype _tp = NULL;
      modelica_metatype _unit = NULL;
      modelica_metatype _fargs = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _unitStr has no default value.
      // _indx has no default value.
      // _tp has no default value.
      // _unit has no default value.
      // _fargs has no default value.
      // _store has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          
          _store = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
          
          _tp = tmpMeta9;
          _fargs = tmpMeta8;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          _unitStr = omc_UnitAbsynBuilder_getUnitStr(threadData, _tp);

          _unit = omc_UnitAbsynBuilder_str2unit(threadData, _unitStr, mmc_mk_some(mmc_mk_integer(_funcInstId)));

          _unit = ((((modelica_integer) 0) == stringCompare(_unitStr, _OMC_LIT29))?_OMC_LIT25:_unit);

          _store = omc_UnitAbsynBuilder_add(threadData, _unit, _store ,&_indx);

          _store = omc_UnitAbsynBuilder_buildFuncTypeStores2(threadData, _fargs, _funcInstId, _store ,&_indxs);
          tmpMeta10 = mmc_mk_cons(mmc_mk_integer(_indx), _indxs);
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = tmpMeta10;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outStore = tmpMeta[0+0];
  _indxs = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_indxs) { *out_indxs = _indxs; }
  return _outStore;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildFuncTypeStores2(threadData_t *threadData, modelica_metatype _ifargs, modelica_metatype _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs)
{
  modelica_integer tmp1;
  modelica_metatype _outStore = NULL;
  tmp1 = mmc_unbox_integer(_funcInstId);
  _outStore = omc_UnitAbsynBuilder_buildFuncTypeStores2(threadData, _ifargs, tmp1, _istore, out_indxs);
  /* skip box _outStore; UnitAbsyn.Store */
  /* skip box _indxs; list<#Integer> */
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildFuncTypeStores(threadData_t *threadData, modelica_metatype _funcType, modelica_integer _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _indxs = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _indxs has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _funcType;
    tmp4_2 = _istore;
    {
      modelica_metatype _args = NULL;
      modelica_metatype _tp = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _args has no default value.
      // _tp has no default value.
      // _store has no default value.
      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;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,4) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _args = tmpMeta6;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildFuncTypeStores2(threadData, _args, _funcInstId, _store, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          
          _tp = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta7 = stringAppend(_OMC_LIT32,omc_TypesDump_unparseType(threadData, _tp));
          tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT33);
          fputs(MMC_STRINGDATA(tmpMeta8),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outStore = tmpMeta[0+0];
  _indxs = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_indxs) { *out_indxs = _indxs; }
  return _outStore;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildFuncTypeStores(threadData_t *threadData, modelica_metatype _funcType, modelica_metatype _funcInstId, modelica_metatype _istore, modelica_metatype *out_indxs)
{
  modelica_integer tmp1;
  modelica_metatype _outStore = NULL;
  tmp1 = mmc_unbox_integer(_funcInstId);
  _outStore = omc_UnitAbsynBuilder_buildFuncTypeStores(threadData, _funcType, tmp1, _istore, out_indxs);
  /* skip box _outStore; UnitAbsyn.Store */
  /* skip box _indxs; list<#Integer> */
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermExpList(threadData_t *threadData, modelica_metatype _env, modelica_metatype _iexpl, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_metatype _terms = NULL;
  modelica_metatype _extraTerms = NULL;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _terms has no default value.
  // _extraTerms has no default value.
  // _outStore has no default value.
  
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iexpl;
    tmp4_2 = _istore;
    {
      modelica_metatype _e = NULL;
      modelica_metatype _eterms1 = NULL;
      modelica_metatype _eterms2 = NULL;
      modelica_metatype _ut = NULL;
      modelica_metatype _expl = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _e has no default value.
      // _eterms1 has no default value.
      // _eterms2 has no default value.
      // _ut has no default value.
      // _expl has no default value.
      // _store has no default value.
      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;
          
          _store = tmp4_2;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta6;
          tmpMeta[0+1] = tmpMeta7;
          tmpMeta[0+2] = _store;
          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);
          
          _e = tmpMeta8;
          _expl = tmpMeta9;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          _ut = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e, 0 /* false */, _ht, _store ,&_eterms1 ,&_store);

          _terms = omc_UnitAbsynBuilder_buildTermExpList(threadData, _env, _expl, _ht, _store ,&_eterms2 ,&_store);

          _extraTerms = listAppend(_eterms1, _eterms2);
          tmpMeta10 = mmc_mk_cons(_ut, _terms);
          tmpMeta[0+0] = tmpMeta10;
          tmpMeta[0+1] = _extraTerms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta11 = MMC_CAR(tmp4_1);
          tmpMeta12 = MMC_CDR(tmp4_1);
          
          _e = tmpMeta11;
          /* Pattern matching succeeded */
          tmpMeta13 = stringAppend(_OMC_LIT34,omc_ExpressionBasics_printExpStr(threadData, _e));
          tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT33);
          fputs(MMC_STRINGDATA(tmpMeta14),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _terms = tmpMeta[0+0];
  _extraTerms = tmpMeta[0+1];
  _outStore = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_extraTerms) { *out_extraTerms = _extraTerms; }
  if (out_outStore) { *out_outStore = _outStore; }
  return _terms;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTupleResultTerms(threadData_t *threadData, modelica_metatype _ifunctps, modelica_integer _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_metatype _terms = NULL;
  modelica_metatype _extraTerms = NULL;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _terms has no default value.
  // _extraTerms has no default value.
  // _outStore has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _ifunctps;
    tmp4_2 = _istore;
    {
      modelica_metatype _terms1 = NULL;
      modelica_metatype _terms2 = NULL;
      modelica_metatype _extraTerms1 = NULL;
      modelica_metatype _extraTerms2 = NULL;
      modelica_metatype _tp = NULL;
      modelica_metatype _functps = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _terms1 has no default value.
      // _terms2 has no default value.
      // _extraTerms1 has no default value.
      // _extraTerms2 has no default value.
      // _tp has no default value.
      // _functps has no default value.
      // _store has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          
          _store = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta6;
          tmpMeta[0+1] = tmpMeta7;
          tmpMeta[0+2] = _store;
          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);
          
          _tp = tmpMeta8;
          _functps = tmpMeta9;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          _terms1 = omc_UnitAbsynBuilder_buildResultTerms(threadData, _tp, _funcInstId, _funcCallExp, _store ,&_extraTerms1 ,&_store);

          _terms2 = omc_UnitAbsynBuilder_buildTupleResultTerms(threadData, _functps, _funcInstId, _funcCallExp, _store ,&_extraTerms2 ,&_store);

          _terms = listAppend(_terms1, _terms2);

          _extraTerms = listAppend(_extraTerms1, _extraTerms2);
          tmpMeta[0+0] = _terms;
          tmpMeta[0+1] = _extraTerms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _terms = tmpMeta[0+0];
  _extraTerms = tmpMeta[0+1];
  _outStore = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_extraTerms) { *out_extraTerms = _extraTerms; }
  if (out_outStore) { *out_outStore = _outStore; }
  return _terms;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildTupleResultTerms(threadData_t *threadData, modelica_metatype _ifunctps, modelica_metatype _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_integer tmp1;
  modelica_metatype _terms = NULL;
  tmp1 = mmc_unbox_integer(_funcInstId);
  _terms = omc_UnitAbsynBuilder_buildTupleResultTerms(threadData, _ifunctps, tmp1, _funcCallExp, _istore, out_extraTerms, out_outStore);
  /* skip box _terms; list<UnitAbsyn.UnitTerm> */
  /* skip box _extraTerms; list<UnitAbsyn.UnitTerm> */
  /* skip box _outStore; UnitAbsyn.Store */
  return _terms;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildResultTerms(threadData_t *threadData, modelica_metatype _ifunctp, modelica_integer _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_metatype _terms = NULL;
  modelica_metatype _extraTerms = NULL;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _terms has no default value.
  // _extraTerms has no default value.
  // _outStore has no default value.
  
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _ifunctp;
    tmp4_2 = _istore;
    {
      modelica_string _unitStr = NULL;
      modelica_metatype _unit = NULL;
      modelica_integer _indx;
      modelica_integer _indx2;
      modelica_boolean _unspec;
      modelica_metatype _typeLst = NULL;
      modelica_metatype _functp = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _unitStr has no default value.
      // _unit has no default value.
      // _indx has no default value.
      // _indx2 has no default value.
      // _unspec has no default value.
      // _typeLst has no default value.
      // _functp has no default value.
      // _store has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,4) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _functp = tmpMeta6;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          _unitStr = omc_UnitAbsynBuilder_getUnitStr(threadData, _functp);

          _unspec = (((modelica_integer) 0) == stringCompare(_unitStr, _OMC_LIT29));

          _unit = omc_UnitAbsynBuilder_str2unit(threadData, _unitStr, mmc_mk_some(mmc_mk_integer(_funcInstId)));

          _unit = (_unspec?_OMC_LIT25:_unit);

          _store = omc_UnitAbsynBuilder_add(threadData, _unit, _store ,&_indx);

          _store = omc_UnitAbsynBuilder_add(threadData, _OMC_LIT25, _store ,&_indx2);
          tmpMeta8 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_indx2), _funcCallExp);
          tmpMeta7 = mmc_mk_cons(tmpMeta8, MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta10 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_indx2), _funcCallExp);
          tmpMeta11 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_indx), _funcCallExp);
          tmpMeta12 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, tmpMeta10, tmpMeta11, _funcCallExp);
          tmpMeta9 = mmc_mk_cons(tmpMeta12, MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta[0+0] = tmpMeta7;
          tmpMeta[0+1] = tmpMeta9;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,11,4) == 0) goto tmp3_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,14,2) == 0) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
          
          _typeLst = tmpMeta14;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildTupleResultTerms(threadData, _typeLst, _funcInstId, _funcCallExp, _store, &tmpMeta[0+1], &tmpMeta[0+2]);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT35),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _terms = tmpMeta[0+0];
  _extraTerms = tmpMeta[0+1];
  _outStore = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_extraTerms) { *out_extraTerms = _extraTerms; }
  if (out_outStore) { *out_outStore = _outStore; }
  return _terms;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildResultTerms(threadData_t *threadData, modelica_metatype _ifunctp, modelica_metatype _funcInstId, modelica_metatype _funcCallExp, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_integer tmp1;
  modelica_metatype _terms = NULL;
  tmp1 = mmc_unbox_integer(_funcInstId);
  _terms = omc_UnitAbsynBuilder_buildResultTerms(threadData, _ifunctp, tmp1, _funcCallExp, _istore, out_extraTerms, out_outStore);
  /* skip box _terms; list<UnitAbsyn.UnitTerm> */
  /* skip box _extraTerms; list<UnitAbsyn.UnitTerm> */
  /* skip box _outStore; UnitAbsyn.Store */
  return _terms;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermCall(threadData_t *threadData, modelica_metatype _env, modelica_metatype _path, modelica_metatype _funcCallExp, modelica_metatype _expl, modelica_boolean _divOrMul, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_metatype _ut = NULL;
  modelica_metatype _extraTerms = NULL;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ut has no default value.
  // _extraTerms has no default value.
  // _outStore has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _istore;
    {
      modelica_metatype _formalParamIndxs = NULL;
      modelica_integer _funcInstId;
      modelica_metatype _actTermLst = NULL;
      modelica_metatype _terms = NULL;
      modelica_metatype _extraTerms2 = NULL;
      modelica_metatype _functp = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _formalParamIndxs has no default value.
      // _funcInstId has no default value.
      // _actTermLst has no default value.
      // _terms has no default value.
      // _extraTerms2 has no default value.
      // _functp has no default value.
      // _store has no default value.
      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;
          
          _store = tmp4_1;
          /* Pattern matching succeeded */
          omc_Lookup_lookupType(threadData, omc_FCore_noCache(threadData), _env, _path, mmc_mk_none() ,&_functp ,NULL);

          _funcInstId = tick();

          _store = omc_UnitAbsynBuilder_buildFuncTypeStores(threadData, _functp, _funcInstId, _store ,&_formalParamIndxs);

          _actTermLst = omc_UnitAbsynBuilder_buildTermExpList(threadData, _env, _expl, _ht, _store ,&_extraTerms ,&_store);

          _terms = omc_UnitAbsynBuilder_buildFormal2ActualParamTerms(threadData, _formalParamIndxs, _actTermLst);

          /* Pattern-matching tuple assignment */
          tmpMeta8 = omc_UnitAbsynBuilder_buildResultTerms(threadData, _functp, _funcInstId, _funcCallExp, _store, &tmpMeta6, &tmpMeta7);
          if (listEmpty(tmpMeta8)) goto goto_2;
          tmpMeta9 = MMC_CAR(tmpMeta8);
          tmpMeta10 = MMC_CDR(tmpMeta8);
          if (!listEmpty(tmpMeta10)) goto goto_2;
          _ut = tmpMeta9;
          _extraTerms2 = tmpMeta6;
          _store = tmpMeta7;

          tmpMeta11 = mmc_mk_cons(_extraTerms, mmc_mk_cons(_extraTerms2, mmc_mk_cons(_terms, MMC_REFSTRUCTLIT(mmc_nil))));
          _extraTerms = omc_List_flatten(threadData, tmpMeta11);
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _extraTerms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _ut = tmpMeta[0+0];
  _extraTerms = tmpMeta[0+1];
  _outStore = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_extraTerms) { *out_extraTerms = _extraTerms; }
  if (out_outStore) { *out_outStore = _outStore; }
  return _ut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildTermCall(threadData_t *threadData, modelica_metatype _env, modelica_metatype _path, modelica_metatype _funcCallExp, modelica_metatype _expl, modelica_metatype _divOrMul, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_integer tmp1;
  modelica_metatype _ut = NULL;
  tmp1 = mmc_unbox_integer(_divOrMul);
  _ut = omc_UnitAbsynBuilder_buildTermCall(threadData, _env, _path, _funcCallExp, _expl, tmp1, _ht, _istore, out_extraTerms, out_outStore);
  /* skip box _ut; UnitAbsyn.UnitTerm */
  /* skip box _extraTerms; list<UnitAbsyn.UnitTerm> */
  /* skip box _outStore; UnitAbsyn.Store */
  return _ut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildArrayElementTerms(threadData_t *threadData, modelica_metatype _iuts, modelica_metatype _iexpl)
{
  modelica_metatype _outUts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _rest_ut = NULL;
  modelica_metatype _ut1 = NULL;
  modelica_metatype _ut2 = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _rest_expl = NULL;
  modelica_metatype _e1 = NULL;
  modelica_metatype _e2 = NULL;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _outUts = tmpMeta1;
  _rest_ut = _iuts;
  // _ut1 has no default value.
  // _ut2 has no default value.
  // _ty has no default value.
  _rest_expl = _iexpl;
  // _e1 has no default value.
  // _e2 has no default value.
  while(1)
  {
    if(!(!listEmpty(_rest_ut))) break;
    /* Pattern-matching assignment */
    tmpMeta2 = _rest_ut;
    if (listEmpty(tmpMeta2)) MMC_THROW_INTERNAL();
    tmpMeta3 = MMC_CAR(tmpMeta2);
    tmpMeta4 = MMC_CDR(tmpMeta2);
    if (listEmpty(tmpMeta4)) MMC_THROW_INTERNAL();
    tmpMeta5 = MMC_CAR(tmpMeta4);
    tmpMeta6 = MMC_CDR(tmpMeta4);
    _ut1 = tmpMeta3;
    _ut2 = tmpMeta5;
    _rest_ut = tmpMeta6;

    /* Pattern-matching assignment */
    tmpMeta7 = _rest_expl;
    if (listEmpty(tmpMeta7)) MMC_THROW_INTERNAL();
    tmpMeta8 = MMC_CAR(tmpMeta7);
    tmpMeta9 = MMC_CDR(tmpMeta7);
    if (listEmpty(tmpMeta9)) MMC_THROW_INTERNAL();
    tmpMeta10 = MMC_CAR(tmpMeta9);
    tmpMeta11 = MMC_CDR(tmpMeta9);
    _e1 = tmpMeta8;
    _e2 = tmpMeta10;
    _rest_expl = tmpMeta11;

    _ty = omc_Expression_typeof(threadData, _e1);

    tmpMeta13 = mmc_mk_cons(_e1, mmc_mk_cons(_e2, MMC_REFSTRUCTLIT(mmc_nil)));
    tmpMeta14 = mmc_mk_box4(19, &DAE_Exp_ARRAY__desc, _ty, mmc_mk_boolean(1 /* true */), tmpMeta13);
    tmpMeta15 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, _ut1, _ut2, tmpMeta14);
    tmpMeta12 = mmc_mk_cons(tmpMeta15, _outUts);
    _outUts = tmpMeta12;
  }

  _outUts = listReverse(_outUts);
  _return: OMC_LABEL_UNUSED
  return _outUts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTermExp(threadData_t *threadData, modelica_metatype _env, modelica_metatype _exp, modelica_boolean _idivOrMul, modelica_metatype _iht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_metatype _ut = NULL;
  modelica_metatype _extraTerms = NULL;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ut has no default value.
  // _extraTerms has no default value.
  // _outStore has no default value.
  
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_boolean tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;
    tmp4_1 = _exp;
    tmp4_2 = _idivOrMul;
    tmp4_3 = _iht;
    tmp4_4 = _istore;
    {
      modelica_real _r;
      modelica_metatype _op = NULL;
      modelica_integer _indx;
      modelica_integer _i;
      modelica_metatype _ut1 = NULL;
      modelica_metatype _ut2 = NULL;
      modelica_string _s1 = NULL;
      modelica_metatype _cr = NULL;
      modelica_metatype _e = NULL;
      modelica_metatype _e1 = NULL;
      modelica_metatype _e2 = NULL;
      modelica_metatype _path = NULL;
      modelica_metatype _mexpl = NULL;
      modelica_metatype _terms1 = NULL;
      modelica_metatype _terms2 = NULL;
      modelica_metatype _terms = NULL;
      modelica_metatype _uts = NULL;
      modelica_metatype _expl = NULL;
      modelica_metatype _u = NULL;
      modelica_metatype _ht = NULL;
      modelica_metatype _store = NULL;
      modelica_boolean _divOrMul;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _r has no default value.
      // _op has no default value.
      // _indx has no default value.
      // _i has no default value.
      // _ut1 has no default value.
      // _ut2 has no default value.
      // _s1 has no default value.
      // _cr has no default value.
      // _e has no default value.
      // _e1 has no default value.
      // _e2 has no default value.
      // _path has no default value.
      // _mexpl has no default value.
      // _terms1 has no default value.
      // _terms2 has no default value.
      // _terms has no default value.
      // _uts has no default value.
      // _expl has no default value.
      // _u has no default value.
      // _ht has no default value.
      // _store has no default value.
      // _divOrMul has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 15; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          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,0,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          
          _e = tmp4_1;
          _i = tmp7  /* pattern as ty=Integer */;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 14; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta8 = stringAppend(_OMC_LIT36,intString(tick()));
          tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT37);
          tmpMeta10 = stringAppend(tmpMeta9,intString(_i));
          _s1 = tmpMeta10;

          _u = (_divOrMul?omc_UnitAbsynBuilder_str2unit(threadData, _OMC_LIT4, mmc_mk_none()):_OMC_LIT25);

          _store = omc_UnitAbsynBuilder_add(threadData, _u, _store ,&_indx);

          tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta12 = mmc_mk_box2(0, omc_ComponentReferenceBasics_makeCrefIdent(threadData, _s1, _OMC_LIT26, tmpMeta11), mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta12, _ht);
          tmpMeta13 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_indx), _e);
          tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta13;
          tmpMeta[0+1] = tmpMeta14;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta15;
          modelica_real tmp16;
          modelica_metatype tmpMeta17;
          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,1,1) == 0) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp16 = mmc_unbox_real(tmpMeta15);
          
          _e = tmp4_1;
          _r = tmp16  /* pattern as ty=Real */;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 13; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta17 = stringAppend(_OMC_LIT36,intString(tick()));
          tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT37);
          tmpMeta19 = stringAppend(tmpMeta18,realString(_r));
          _s1 = tmpMeta19;

          _u = (_divOrMul?omc_UnitAbsynBuilder_str2unit(threadData, _OMC_LIT4, mmc_mk_none()):_OMC_LIT25);

          _store = omc_UnitAbsynBuilder_add(threadData, _u, _store ,&_indx);

          tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta21 = mmc_mk_box2(0, omc_ComponentReferenceBasics_makeCrefIdent(threadData, _s1, _OMC_LIT26, tmpMeta20), mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta21, _ht);
          tmpMeta22 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_indx), _e);
          tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta22;
          tmpMeta[0+1] = tmpMeta23;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta24;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,20,2) == 0) goto tmp3_end;
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _e1 = tmpMeta24;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 12; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store, &tmpMeta[0+1], &tmpMeta[0+2]);
          goto tmp3_done;
        }
        case 3: {
          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));
          
          _e = tmp4_1;
          _cr = tmpMeta25;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 11; /* Pattern matching succeeded; we may skip some cases if we fail */
          _indx = mmc_unbox_integer(omc_BaseHashTable_get(threadData, _cr, _ht));
          tmpMeta26 = mmc_mk_box3(8, &UnitAbsyn_UnitTerm_LOC__desc, mmc_mk_integer(_indx), _e);
          tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta26;
          tmpMeta[0+1] = tmpMeta27;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_integer tmp32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          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,0,1) == 0) goto tmp3_end;
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
          tmp32 = mmc_unbox_integer(tmpMeta31);
          
          _e = tmp4_1;
          _e1 = tmpMeta28;
          _e2 = tmpMeta30;
          _i = tmp32  /* pattern as ty=Integer */;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store ,&_terms1 ,&_store);

          omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e2, _divOrMul, _ht, _store ,&_terms2 ,&_store);

          _terms = listAppend(_terms1, _terms2);

          tmpMeta33 = mmc_mk_box3(3, &MMath_Rational_RATIONAL__desc, mmc_mk_integer(_i), mmc_mk_integer(((modelica_integer) 1)));
          tmpMeta34 = mmc_mk_box4(9, &UnitAbsyn_UnitTerm_POW__desc, _ut1, tmpMeta33, _e);
          _ut = tmpMeta34;
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _terms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta35;
          modelica_metatype tmpMeta36;
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_real tmp39;
          modelica_boolean tmp40;
          modelica_metatype tmpMeta41;
          modelica_metatype tmpMeta42;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
          tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,4,1) == 0) goto tmp3_end;
          tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,1,1) == 0) goto tmp3_end;
          tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
          tmp39 = mmc_unbox_real(tmpMeta38);
          
          _e = tmp4_1;
          _e1 = tmpMeta35;
          _e2 = tmpMeta37;
          _r = tmp39  /* pattern as ty=Real */;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          /* Pattern matching succeeded */
          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store ,&_terms1 ,&_store);

          omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e2, _divOrMul, _ht, _store ,&_terms2 ,&_store);

          _terms = listAppend(_terms1, _terms2);

          _i = ((modelica_integer)floor(_r));

          /* Pattern-matching assignment */
          tmp40 = (((modelica_real)_i) - _r == 0.0);
          if (1 /* true */ != tmp40) goto goto_2;

          tmpMeta41 = mmc_mk_box3(3, &MMath_Rational_RATIONAL__desc, mmc_mk_integer(_i), mmc_mk_integer(((modelica_integer) 1)));
          tmpMeta42 = mmc_mk_box4(9, &UnitAbsyn_UnitTerm_POW__desc, _ut1, tmpMeta41, _e);
          _ut = tmpMeta42;
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _terms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta43;
          modelica_metatype tmpMeta44;
          modelica_metatype tmpMeta45;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,3) == 0) goto tmp3_end;
          tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _e = tmp4_1;
          _e1 = tmpMeta43;
          _op = tmpMeta44;
          _e2 = tmpMeta45;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          /* Pattern matching succeeded */
          _divOrMul = omc_Expression_operatorDivOrMul(threadData, _op);

          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store ,&_terms1 ,&_store);

          _ut2 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e2, _divOrMul, _ht, _store ,&_terms2 ,&_store);

          _terms = listAppend(_terms1, _terms2);

          _ut = omc_UnitAbsynBuilder_buildTermOp(threadData, _ut1, _ut2, _op, _e);
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _terms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta46;
          modelica_metatype tmpMeta47;
          modelica_boolean tmp48;
          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));
          
          _e1 = tmpMeta46;
          _op = tmpMeta47;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          /* Pattern matching succeeded */
          _divOrMul = omc_Expression_operatorDivOrMul(threadData, _op);

          _ut = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store ,&_terms ,&_store);

          tmp48 = 0; /* begin failure */
          MMC_TRY_INTERNAL(mmc_jumper)
            omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store, NULL, NULL);
            tmp48 = 1;
          goto goto_49;
          goto_49:;
          MMC_CATCH_INTERNAL(mmc_jumper)
          if (tmp48) {goto goto_2;} /* end failure */
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _terms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta50;
          modelica_metatype tmpMeta51;
          modelica_metatype tmpMeta52;
          modelica_boolean tmp53;
          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));
          tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _e1 = tmpMeta50;
          _op = tmpMeta51;
          _e2 = tmpMeta52;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 6; /* Pattern matching succeeded; we may skip some cases if we fail */
          _divOrMul = omc_Expression_operatorDivOrMul(threadData, _op);

          tmp53 = 0; /* begin failure */
          MMC_TRY_INTERNAL(mmc_jumper)
            omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store, NULL, NULL);
            tmp53 = 1;
          goto goto_54;
          goto_54:;
          MMC_CATCH_INTERNAL(mmc_jumper)
          if (tmp53) {goto goto_2;} /* end failure */
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e2, _divOrMul, _ht, _store, &tmpMeta[0+1], &tmpMeta[0+2]);
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta55;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,8,2) == 0) goto tmp3_end;
          tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _e1 = tmpMeta55;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 5; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store, &tmpMeta[0+1], &tmpMeta[0+2]);
          goto tmp3_done;
        }
        case 10: {
          modelica_metatype tmpMeta56;
          modelica_metatype tmpMeta57;
          modelica_metatype tmpMeta58;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
          tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _e = tmp4_1;
          _e1 = tmpMeta56;
          _e2 = tmpMeta57;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          _divOrMul = 0 /* false */;

          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, _divOrMul, _ht, _store ,&_terms1 ,&_store);

          _ut2 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e2, _divOrMul, _ht, _store ,&_terms2 ,&_store);

          _terms = listAppend(_terms1, _terms2);
          tmpMeta58 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, _ut1, _ut2, _e);
          tmpMeta[0+0] = tmpMeta58;
          tmpMeta[0+1] = _terms;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 11: {
          modelica_metatype tmpMeta59;
          modelica_metatype tmpMeta60;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 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 = tmp4_1;
          _path = tmpMeta59;
          _expl = tmpMeta60;
          _divOrMul = tmp4_2;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          _divOrMul = 0 /* false */;
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildTermCall(threadData, _env, _path, _e, _expl, _divOrMul, _ht, _store, &tmpMeta[0+1], &tmpMeta[0+2]);
          goto tmp3_done;
        }
        case 12: {
          modelica_metatype tmpMeta61;
          modelica_metatype tmpMeta62;
          modelica_metatype tmpMeta63;
          modelica_metatype tmpMeta64;
          modelica_metatype tmpMeta65;
          modelica_metatype tmpMeta66;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
          tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _e = tmp4_1;
          _expl = tmpMeta61;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta62 = stringAppend(_OMC_LIT38,omc_ExpressionBasics_printExpStr(threadData, _e));
          tmpMeta63 = stringAppend(tmpMeta62,_OMC_LIT33);
          fputs(MMC_STRINGDATA(tmpMeta63),stdout);

          _uts = omc_UnitAbsynBuilder_buildTermExpList(threadData, _env, _expl, _ht, _store ,&_terms ,&_store);

          /* Pattern-matching assignment */
          tmpMeta64 = omc_UnitAbsynBuilder_buildArrayElementTerms(threadData, _uts, _expl);
          if (listEmpty(tmpMeta64)) goto goto_2;
          tmpMeta65 = MMC_CAR(tmpMeta64);
          tmpMeta66 = MMC_CDR(tmpMeta64);
          _ut = tmpMeta65;
          _uts = tmpMeta66;

          _uts = listAppend(_terms, _uts);
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _uts;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 13: {
          modelica_metatype tmpMeta67;
          modelica_metatype tmpMeta68;
          modelica_metatype tmpMeta69;
          modelica_metatype tmpMeta70;
          modelica_metatype tmpMeta71;
          modelica_metatype tmpMeta72;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
          tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _e = tmp4_1;
          _mexpl = tmpMeta67;
          _ht = tmp4_3;
          _store = tmp4_4;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta68 = stringAppend(_OMC_LIT39,omc_ExpressionBasics_printExpStr(threadData, _e));
          tmpMeta69 = stringAppend(tmpMeta68,_OMC_LIT33);
          fputs(MMC_STRINGDATA(tmpMeta69),stdout);

          _expl = omc_List_flatten(threadData, _mexpl);

          _uts = omc_UnitAbsynBuilder_buildTermExpList(threadData, _env, _expl, _ht, _store ,&_terms ,&_store);

          /* Pattern-matching assignment */
          tmpMeta70 = omc_UnitAbsynBuilder_buildArrayElementTerms(threadData, _uts, _expl);
          if (listEmpty(tmpMeta70)) goto goto_2;
          tmpMeta71 = MMC_CAR(tmpMeta70);
          tmpMeta72 = MMC_CDR(tmpMeta70);
          _ut = tmpMeta71;
          _uts = tmpMeta72;

          _uts = listAppend(_terms, _uts);
          tmpMeta[0+0] = _ut;
          tmpMeta[0+1] = _uts;
          tmpMeta[0+2] = _store;
          goto tmp3_done;
        }
        case 14: {
          modelica_metatype tmpMeta73;
          modelica_metatype tmpMeta74;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
          
          _e = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta73 = stringAppend(_OMC_LIT40,omc_ExpressionBasics_printExpStr(threadData, _e));
          tmpMeta74 = stringAppend(tmpMeta73,_OMC_LIT33);
          fputs(MMC_STRINGDATA(tmpMeta74),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 < 15) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _ut = tmpMeta[0+0];
  _extraTerms = tmpMeta[0+1];
  _outStore = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_extraTerms) { *out_extraTerms = _extraTerms; }
  if (out_outStore) { *out_outStore = _outStore; }
  return _ut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_buildTermExp(threadData_t *threadData, modelica_metatype _env, modelica_metatype _exp, modelica_metatype _idivOrMul, modelica_metatype _iht, modelica_metatype _istore, modelica_metatype *out_extraTerms, modelica_metatype *out_outStore)
{
  modelica_integer tmp1;
  modelica_metatype _ut = NULL;
  tmp1 = mmc_unbox_integer(_idivOrMul);
  _ut = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _exp, tmp1, _iht, _istore, out_extraTerms, out_outStore);
  /* skip box _ut; UnitAbsyn.UnitTerm */
  /* skip box _extraTerms; list<UnitAbsyn.UnitTerm> */
  /* skip box _outStore; UnitAbsyn.Store */
  return _ut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildTerms(threadData_t *threadData, modelica_metatype _env, modelica_metatype _dae, modelica_metatype _ht, modelica_metatype _istore, modelica_metatype *out_outStore)
{
  modelica_metatype _terms = NULL;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _terms has no default value.
  // _outStore has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _dae;
    tmp4_2 = _istore;
    {
      modelica_metatype _e1 = NULL;
      modelica_metatype _e2 = NULL;
      modelica_metatype _crefExp1 = NULL;
      modelica_metatype _crefExp2 = NULL;
      modelica_metatype _ut1 = NULL;
      modelica_metatype _ut2 = NULL;
      modelica_metatype _terms1 = NULL;
      modelica_metatype _terms2 = NULL;
      modelica_metatype _cr1 = NULL;
      modelica_metatype _cr2 = NULL;
      modelica_metatype _elts = NULL;
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _e1 has no default value.
      // _e2 has no default value.
      // _crefExp1 has no default value.
      // _crefExp2 has no default value.
      // _ut1 has no default value.
      // _ut2 has no default value.
      // _terms1 has no default value.
      // _terms2 has no default value.
      // _cr1 has no default value.
      // _cr2 has no default value.
      // _elts has no default value.
      // _store has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 6; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (!listEmpty(tmpMeta6)) goto tmp3_end;
          
          _store = tmp4_2;
          tmp4 += 5; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta7;
          tmpMeta[0+1] = _store;
          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;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta8)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmpMeta8);
          tmpMeta10 = MMC_CDR(tmpMeta8);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,3) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
          
          _e1 = tmpMeta11;
          _e2 = tmpMeta12;
          _elts = tmpMeta10;
          _store = tmp4_2;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, 0 /* false */, _ht, _store ,&_terms1 ,&_store);

          _ut2 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e2, 0 /* false */, _ht, _store ,&_terms2 ,&_store);

          tmpMeta13 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          _terms = omc_UnitAbsynBuilder_buildTerms(threadData, _env, tmpMeta13, _ht, _store ,&_store);

          _terms = listAppend(_terms1, listAppend(_terms2, _terms));
          tmpMeta15 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _e1, _OMC_LIT42, _e2);
          tmpMeta16 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, _ut1, _ut2, tmpMeta15);
          tmpMeta14 = mmc_mk_cons(tmpMeta16, _terms);
          tmpMeta[0+0] = tmpMeta14;
          tmpMeta[0+1] = _store;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta17)) goto tmp3_end;
          tmpMeta18 = MMC_CAR(tmpMeta17);
          tmpMeta19 = MMC_CDR(tmpMeta17);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,4,3) == 0) goto tmp3_end;
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 3));
          
          _cr1 = tmpMeta20;
          _cr2 = tmpMeta21;
          _elts = tmpMeta19;
          _store = tmp4_2;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          _crefExp1 = omc_Expression_crefExp(threadData, _cr1);

          _crefExp2 = omc_Expression_crefExp(threadData, _cr2);

          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _crefExp1, 0 /* false */, _ht, _store ,&_terms1 ,&_store);

          _ut2 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _crefExp2, 0 /* false */, _ht, _store ,&_terms2 ,&_store);

          tmpMeta22 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          _terms = omc_UnitAbsynBuilder_buildTerms(threadData, _env, tmpMeta22, _ht, _store ,&_store);

          _terms = listAppend(_terms1, listAppend(_terms2, _terms));
          tmpMeta24 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _crefExp1, _OMC_LIT42, _crefExp2);
          tmpMeta25 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, _ut1, _ut2, tmpMeta24);
          tmpMeta23 = mmc_mk_cons(tmpMeta25, _terms);
          tmpMeta[0+0] = tmpMeta23;
          tmpMeta[0+1] = _store;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta26)) goto tmp3_end;
          tmpMeta27 = MMC_CAR(tmpMeta26);
          tmpMeta28 = MMC_CDR(tmpMeta26);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta27,0,14) == 0) goto tmp3_end;
          tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,1,3) == 0) goto tmp3_end;
          tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 8));
          if (optionNone(tmpMeta30)) goto tmp3_end;
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 1));
          
          _cr1 = tmpMeta29;
          _e1 = tmpMeta31;
          _elts = tmpMeta28;
          _store = tmp4_2;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          _crefExp1 = omc_Expression_crefExp(threadData, _cr1);

          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _crefExp1, 0 /* false */, _ht, _store ,&_terms1 ,&_store);

          _ut2 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, 0 /* false */, _ht, _store ,&_terms2 ,&_store);

          tmpMeta32 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          _terms = omc_UnitAbsynBuilder_buildTerms(threadData, _env, tmpMeta32, _ht, _store ,&_store);

          _terms = listAppend(_terms1, listAppend(_terms2, _terms));
          tmpMeta34 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _crefExp1, _OMC_LIT42, _e1);
          tmpMeta35 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, _ut1, _ut2, tmpMeta34);
          tmpMeta33 = mmc_mk_cons(tmpMeta35, _terms);
          tmpMeta[0+0] = tmpMeta33;
          tmpMeta[0+1] = _store;
          goto tmp3_done;
        }
        case 4: {
          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;
          tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta36)) goto tmp3_end;
          tmpMeta37 = MMC_CAR(tmpMeta36);
          tmpMeta38 = MMC_CDR(tmpMeta36);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,1,3) == 0) goto tmp3_end;
          tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 3));
          
          _cr1 = tmpMeta39;
          _e1 = tmpMeta40;
          _elts = tmpMeta38;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          _crefExp1 = omc_Expression_crefExp(threadData, _cr1);

          _ut1 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _crefExp1, 0 /* false */, _ht, _store ,&_terms1 ,&_store);

          _ut2 = omc_UnitAbsynBuilder_buildTermExp(threadData, _env, _e1, 0 /* false */, _ht, _store ,&_terms2 ,&_store);

          tmpMeta41 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          _terms = omc_UnitAbsynBuilder_buildTerms(threadData, _env, tmpMeta41, _ht, _store ,&_store);

          _terms = listAppend(_terms1, listAppend(_terms2, _terms));
          tmpMeta43 = mmc_mk_box4(10, &DAE_Exp_BINARY__desc, _crefExp1, _OMC_LIT42, _e1);
          tmpMeta44 = mmc_mk_box4(7, &UnitAbsyn_UnitTerm_EQN__desc, _ut1, _ut2, tmpMeta43);
          tmpMeta42 = mmc_mk_cons(tmpMeta44, _terms);
          tmpMeta[0+0] = tmpMeta42;
          tmpMeta[0+1] = _store;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta45;
          modelica_metatype tmpMeta46;
          modelica_metatype tmpMeta47;
          modelica_metatype tmpMeta48;
          tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta45)) goto tmp3_end;
          tmpMeta46 = MMC_CAR(tmpMeta45);
          tmpMeta47 = MMC_CDR(tmpMeta45);
          
          _elts = tmpMeta47;
          _store = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta48 = mmc_mk_box2(3, &DAE_DAElist_DAE__desc, _elts);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_buildTerms(threadData, _env, tmpMeta48, _ht, _store, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 6) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _terms = tmpMeta[0+0];
  _outStore = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_outStore) { *out_outStore = _outStore; }
  return _terms;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_buildStores(threadData_t *threadData, modelica_metatype _dae, modelica_metatype *out_ht)
{
  modelica_metatype _store = NULL;
  modelica_metatype _ht = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _store has no default value.
  // _ht has no default value.
  _store = omc_UnitAbsynBuilder_buildStores2(threadData, _dae, omc_UnitAbsynBuilder_emptyStore(threadData), omc_HashTable_emptyHashTable(threadData) ,&_ht);

  _store = omc_UnitAbsynBuilder_buildStores3(threadData, _dae, _store, _ht ,&_ht);
  _return: OMC_LABEL_UNUSED
  if (out_ht) { *out_ht = _ht; }
  return _store;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData_t *threadData, modelica_metatype _iparams, modelica_metatype _iht, modelica_integer _inextElt, modelica_metatype *out_outHt, modelica_integer *out_outNextElt)
{
  modelica_metatype _outParams = NULL;
  modelica_metatype _outHt = NULL;
  modelica_integer _outNextElt;
  modelica_integer tmp1_c2 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outParams has no default value.
  // _outHt has no default value.
  // _outNextElt has no default value.
  
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_integer tmp4_3;
    tmp4_1 = _iparams;
    tmp4_2 = _iht;
    tmp4_3 = _inextElt;
    {
      modelica_integer _indx;
      modelica_string _name = NULL;
      modelica_metatype _r = NULL;
      modelica_metatype _param = NULL;
      modelica_metatype _cref_ = NULL;
      modelica_metatype _params = NULL;
      modelica_metatype _ht = NULL;
      modelica_integer _nextElt;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _indx has no default value.
      // _name has no default value.
      // _r has no default value.
      // _param has no default value.
      // _cref_ has no default value.
      // _params has no default value.
      // _ht has no default value.
      // _nextElt has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta6;
          tmpMeta[0+1] = _ht;
          tmp1_c2 = _nextElt;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          if (0 != tmp13) goto tmp3_end;
          
          _r = tmpMeta9;
          _name = tmpMeta11;
          _params = tmpMeta8;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
          _cref_ = omc_ComponentReferenceBasics_makeCrefIdent(threadData, _name, _OMC_LIT26, tmpMeta14);

          _indx = mmc_unbox_integer(omc_BaseHashTable_get(threadData, _cref_, _ht));

          _params = omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData, _params, _ht, _nextElt ,&_ht ,&_nextElt);
          tmpMeta16 = mmc_mk_box3(3, &UnitAbsyn_TypeParameter_TYPEPARAMETER__desc, _name, mmc_mk_integer(_indx));
          tmpMeta17 = mmc_mk_box2(0, _r, tmpMeta16);
          tmpMeta15 = mmc_mk_cons(tmpMeta17, _params);
          tmpMeta[0+0] = tmpMeta15;
          tmpMeta[0+1] = _ht;
          tmp1_c2 = _nextElt;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_integer tmp24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta18 = MMC_CAR(tmp4_1);
          tmpMeta19 = MMC_CDR(tmp4_1);
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 1));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 3));
          tmp24 = mmc_unbox_integer(tmpMeta23);
          if (0 != tmp24) goto tmp3_end;
          
          _r = tmpMeta20;
          _name = tmpMeta22;
          _params = tmpMeta19;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
          _cref_ = omc_ComponentReferenceBasics_makeCrefIdent(threadData, _name, _OMC_LIT26, tmpMeta25);

          tmpMeta26 = mmc_mk_box2(0, _cref_, mmc_mk_integer(_nextElt));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta26, _ht);

          _params = omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData, _params, _ht, _nextElt ,&_ht ,&_nextElt);
          tmpMeta28 = mmc_mk_box3(3, &UnitAbsyn_TypeParameter_TYPEPARAMETER__desc, _name, mmc_mk_integer(_nextElt));
          tmpMeta29 = mmc_mk_box2(0, _r, tmpMeta28);
          tmpMeta27 = mmc_mk_cons(tmpMeta29, _params);
          tmpMeta[0+0] = tmpMeta27;
          tmpMeta[0+1] = _ht;
          tmp1_c2 = ((modelica_integer) 1) + _nextElt;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta30 = MMC_CAR(tmp4_1);
          tmpMeta31 = MMC_CDR(tmp4_1);
          
          _param = tmpMeta30;
          _params = tmpMeta31;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          _params = omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData, _params, _ht, _nextElt ,&_ht ,&_nextElt);
          tmpMeta32 = mmc_mk_cons(_param, _params);
          tmpMeta[0+0] = tmpMeta32;
          tmpMeta[0+1] = _ht;
          tmp1_c2 = _nextElt;
          goto tmp3_done;
        }
        case 4: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT43),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 5) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outParams = tmpMeta[0+0];
  _outHt = tmpMeta[0+1];
  _outNextElt = tmp1_c2;
  _return: OMC_LABEL_UNUSED
  if (out_outHt) { *out_outHt = _outHt; }
  if (out_outNextElt) { *out_outNextElt = _outNextElt; }
  return _outParams;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_createTypeParameterLocations4(threadData_t *threadData, modelica_metatype _iparams, modelica_metatype _iht, modelica_metatype _inextElt, modelica_metatype *out_outHt, modelica_metatype *out_outNextElt)
{
  modelica_integer tmp1;
  modelica_integer _outNextElt;
  modelica_metatype _outParams = NULL;
  tmp1 = mmc_unbox_integer(_inextElt);
  _outParams = omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData, _iparams, _iht, tmp1, out_outHt, &_outNextElt);
  /* skip box _outParams; list<tuple<MMath.Rational, UnitAbsyn.TypeParameter>> */
  /* skip box _outHt; tuple<array<list<tuple<DAE.ComponentRef, #Integer>>>, tuple<#Integer, #Integer, array<Option<tuple<DAE.ComponentRef, #Integer>>>>, #Integer, tuple<.HashTable.FuncHashCref<function>(DAE.ComponentRef cr) => #Integer, .HashTable.FuncCrefEqual<function>(DAE.ComponentRef cr1, DAE.ComponentRef cr2) => #Boolean, .HashTable.FuncCrefStr<function>(DAE.ComponentRef cr) => String, .HashTable.FuncExpStr<function>(#Integer exp) => String>> */
  if (out_outNextElt) { *out_outNextElt = mmc_mk_icon(_outNextElt); }
  return _outParams;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations3(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _iht, modelica_integer _inextElt, modelica_metatype *out_outHt, modelica_integer *out_outNextElt)
{
  modelica_metatype _outUnit = NULL;
  modelica_metatype _outHt = NULL;
  modelica_integer _outNextElt;
  modelica_integer tmp1_c2 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outUnit has no default value.
  // _outHt has no default value.
  // _outNextElt has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_integer tmp4_3;
    tmp4_1 = _unit;
    tmp4_2 = _iht;
    tmp4_3 = _inextElt;
    {
      modelica_metatype _params = NULL;
      modelica_metatype _units = NULL;
      modelica_metatype _ht = NULL;
      modelica_integer _nextElt;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _params has no default value.
      // _units has no default value.
      // _ht has no default value.
      // _nextElt has no default value.
      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;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          if (listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta8 = MMC_CAR(tmpMeta7);
          tmpMeta9 = MMC_CDR(tmpMeta7);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          
          _params = tmpMeta7;
          _units = tmpMeta10;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          _params = omc_UnitAbsynBuilder_createTypeParameterLocations4(threadData, _params, _ht, _nextElt ,&_ht ,&_nextElt);
          tmpMeta11 = mmc_mk_box3(3, &UnitAbsyn_SpecUnit_SPECUNIT__desc, _params, _units);
          tmpMeta12 = mmc_mk_box2(3, &UnitAbsyn_Unit_SPECIFIED__desc, tmpMeta11);
          tmpMeta[0+0] = tmpMeta12;
          tmpMeta[0+1] = _ht;
          tmp1_c2 = _nextElt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outUnit = tmpMeta[0+0];
  _outHt = tmpMeta[0+1];
  _outNextElt = tmp1_c2;
  _return: OMC_LABEL_UNUSED
  if (out_outHt) { *out_outHt = _outHt; }
  if (out_outNextElt) { *out_outNextElt = _outNextElt; }
  return _outUnit;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_createTypeParameterLocations3(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _iht, modelica_metatype _inextElt, modelica_metatype *out_outHt, modelica_metatype *out_outNextElt)
{
  modelica_integer tmp1;
  modelica_integer _outNextElt;
  modelica_metatype _outUnit = NULL;
  tmp1 = mmc_unbox_integer(_inextElt);
  _outUnit = omc_UnitAbsynBuilder_createTypeParameterLocations3(threadData, _unit, _iht, tmp1, out_outHt, &_outNextElt);
  /* skip box _outUnit; UnitAbsyn.Unit */
  /* skip box _outHt; tuple<array<list<tuple<DAE.ComponentRef, #Integer>>>, tuple<#Integer, #Integer, array<Option<tuple<DAE.ComponentRef, #Integer>>>>, #Integer, tuple<.HashTable.FuncHashCref<function>(DAE.ComponentRef cr) => #Integer, .HashTable.FuncCrefEqual<function>(DAE.ComponentRef cr1, DAE.ComponentRef cr2) => #Boolean, .HashTable.FuncCrefStr<function>(DAE.ComponentRef cr) => String, .HashTable.FuncExpStr<function>(#Integer exp) => String>> */
  if (out_outNextElt) { *out_outNextElt = mmc_mk_icon(_outNextElt); }
  return _outUnit;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations2(threadData_t *threadData, modelica_metatype _istore, modelica_metatype _iht, modelica_integer _i, modelica_integer _inextElt, modelica_metatype *out_outHt, modelica_integer *out_outNextElt)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _outHt = NULL;
  modelica_integer _outNextElt;
  modelica_integer tmp1_c2 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _outHt has no default value.
  // _outNextElt has no default value.
  
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_integer tmp4_3;
    tmp4_1 = _istore;
    tmp4_2 = _iht;
    tmp4_3 = _inextElt;
    {
      modelica_integer _numElts;
      modelica_metatype _vect = NULL;
      modelica_metatype _unit = NULL;
      modelica_metatype _store = NULL;
      modelica_metatype _ht = NULL;
      modelica_integer _nextElt;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _numElts has no default value.
      // _vect has no default value.
      // _unit has no default value.
      // _store has no default value.
      // _ht has no default value.
      // _nextElt has no default value.
      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_integer tmp7;
          modelica_boolean tmp8;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          
          _store = tmp4_1;
          _numElts = tmp7  /* pattern as ty=Integer */;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = (_i > _numElts);
          if (1 /* true */ != tmp8) goto goto_2;
          tmpMeta[0+0] = _store;
          tmpMeta[0+1] = _ht;
          tmp1_c2 = _nextElt;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          
          _vect = tmpMeta9;
          _numElts = tmp11  /* pattern as ty=Integer */;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta12 = arrayGet(_vect,_i) /* DAE.ASUB */;
          if (optionNone(tmpMeta12)) goto goto_2;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
          _unit = tmpMeta13;

          _unit = omc_UnitAbsynBuilder_createTypeParameterLocations3(threadData, _unit, _ht, _nextElt ,&_ht ,&_nextElt);

          _vect = arrayUpdate(_vect, _i, mmc_mk_some(_unit));
          tmpMeta14 = mmc_mk_box3(3, &UnitAbsyn_Store_STORE__desc, _vect, mmc_mk_integer(_numElts));
          tmpMeta[0+0] = omc_UnitAbsynBuilder_createTypeParameterLocations2(threadData, tmpMeta14, _ht, ((modelica_integer) 1) + _i, _nextElt, &tmpMeta[0+1], &tmp1_c2);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_integer tmp17;
          modelica_metatype tmpMeta18;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          
          _vect = tmpMeta15;
          _numElts = tmp17  /* pattern as ty=Integer */;
          _ht = tmp4_2;
          _nextElt = tmp4_3;
          /* Pattern matching succeeded */
          tmpMeta18 = mmc_mk_box3(3, &UnitAbsyn_Store_STORE__desc, _vect, mmc_mk_integer(_numElts));
          tmpMeta[0+0] = omc_UnitAbsynBuilder_createTypeParameterLocations2(threadData, tmpMeta18, _ht, ((modelica_integer) 1) + _i, _nextElt, &tmpMeta[0+1], &tmp1_c2);
          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:;
    }
  }
  _outStore = tmpMeta[0+0];
  _outHt = tmpMeta[0+1];
  _outNextElt = tmp1_c2;
  _return: OMC_LABEL_UNUSED
  if (out_outHt) { *out_outHt = _outHt; }
  if (out_outNextElt) { *out_outNextElt = _outNextElt; }
  return _outStore;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_createTypeParameterLocations2(threadData_t *threadData, modelica_metatype _istore, modelica_metatype _iht, modelica_metatype _i, modelica_metatype _inextElt, modelica_metatype *out_outHt, modelica_metatype *out_outNextElt)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer _outNextElt;
  modelica_metatype _outStore = NULL;
  tmp1 = mmc_unbox_integer(_i);
  tmp2 = mmc_unbox_integer(_inextElt);
  _outStore = omc_UnitAbsynBuilder_createTypeParameterLocations2(threadData, _istore, _iht, tmp1, tmp2, out_outHt, &_outNextElt);
  /* skip box _outStore; UnitAbsyn.Store */
  /* skip box _outHt; tuple<array<list<tuple<DAE.ComponentRef, #Integer>>>, tuple<#Integer, #Integer, array<Option<tuple<DAE.ComponentRef, #Integer>>>>, #Integer, tuple<.HashTable.FuncHashCref<function>(DAE.ComponentRef cr) => #Integer, .HashTable.FuncCrefEqual<function>(DAE.ComponentRef cr1, DAE.ComponentRef cr2) => #Boolean, .HashTable.FuncCrefStr<function>(DAE.ComponentRef cr) => String, .HashTable.FuncExpStr<function>(#Integer exp) => String>> */
  if (out_outNextElt) { *out_outNextElt = mmc_mk_icon(_outNextElt); }
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_addUnspecifiedStores(threadData_t *threadData, modelica_integer _n, modelica_metatype _istore)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  { /* matchcontinue expression */
    volatile modelica_integer tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _n;
    tmp4_2 = _istore;
    {
      modelica_metatype _store = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _store has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_1) goto tmp3_end;
          
          _store = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta1 = _store;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp6;
          
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_n < ((modelica_integer) 0));
          if (1 /* true */ != tmp6) goto goto_2;

          fputs(MMC_STRINGDATA(_OMC_LIT44),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        case 2: {
          modelica_boolean tmp7;
          
          _store = tmp4_2;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp7 = (_n > ((modelica_integer) 0));
          if (1 /* true */ != tmp7) goto goto_2;

          _store = omc_UnitAbsynBuilder_add(threadData, _OMC_LIT25, _store, NULL);
          tmpMeta1 = omc_UnitAbsynBuilder_addUnspecifiedStores(threadData, ((modelica_integer) -1) + _n, _store);
          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:;
    }
  }
  _outStore = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outStore;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_addUnspecifiedStores(threadData_t *threadData, modelica_metatype _n, modelica_metatype _istore)
{
  modelica_integer tmp1;
  modelica_metatype _outStore = NULL;
  tmp1 = mmc_unbox_integer(_n);
  _outStore = omc_UnitAbsynBuilder_addUnspecifiedStores(threadData, tmp1, _istore);
  /* skip box _outStore; UnitAbsyn.Store */
  return _outStore;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_createTypeParameterLocations(threadData_t *threadData, modelica_metatype _store)
{
  modelica_metatype _outStore = NULL;
  modelica_integer _nextElement;
  modelica_integer _storeSz;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _nextElement has no default value.
  // _storeSz has no default value.
  _storeSz = omc_UnitAbsynBuilder_storeSize(threadData, _store);

  _outStore = omc_UnitAbsynBuilder_createTypeParameterLocations2(threadData, _store, omc_HashTable_emptyHashTable(threadData), ((modelica_integer) 1), ((modelica_integer) 1) + _storeSz ,NULL ,&_nextElement);

  _outStore = omc_UnitAbsynBuilder_addUnspecifiedStores(threadData, ((modelica_integer) -1) + _nextElement - _storeSz, _outStore);
  _return: OMC_LABEL_UNUSED
  return _outStore;
}

DLLDirection
modelica_integer omc_UnitAbsynBuilder_storeSize(threadData_t *threadData, modelica_metatype _store)
{
  modelica_integer _size;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _size has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _store;
    {
      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;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          _size = tmp7  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1 = _size;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _size = tmp1;
  _return: OMC_LABEL_UNUSED
  return _size;
}
modelica_metatype boxptr_UnitAbsynBuilder_storeSize(threadData_t *threadData, modelica_metatype _store)
{
  modelica_integer _size;
  modelica_metatype out_size;
  _size = omc_UnitAbsynBuilder_storeSize(threadData, _store);
  out_size = mmc_mk_icon(_size);
  return out_size;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_instAddStore(threadData_t *threadData, modelica_metatype _istore, modelica_metatype _itp, modelica_metatype _cr)
{
  jmp_buf *old_mmc_jumper = threadData->mmc_jumper;
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _istore;
    tmp4_2 = _itp;
    {
      modelica_metatype _st = NULL;
      modelica_metatype _ht = NULL;
      modelica_string _unitStr = NULL;
      modelica_metatype _unit = NULL;
      modelica_integer _indx;
      modelica_metatype _varLst = NULL;
      modelica_metatype _res = NULL;
      modelica_metatype _store = NULL;
      modelica_metatype _tp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _st has no default value.
      // _ht has no default value.
      // _unitStr has no default value.
      // _unit has no default value.
      // _indx has no default value.
      // _varLst has no default value.
      // _res has no default value.
      // _store has no default value.
      // _tp has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
          
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta1 = _istore;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,3) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          _st = tmpMeta6;
          _ht = tmpMeta7;
          _res = tmpMeta8;
          _varLst = tmpMeta9;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          {
            modelica_metatype _v;
            for (tmpMeta10 = _varLst; !listEmpty(tmpMeta10); tmpMeta10=MMC_CDR(tmpMeta10))
            {
              _v = MMC_CAR(tmpMeta10);
              { /* match expression */
                modelica_metatype tmp13_1;
                tmp13_1 = _v;
                {
                  volatile mmc_switch_type tmp13;
                  int tmp14;
                  tmp13 = 0;
                  for (; tmp13 < 2; tmp13++) {
                    switch (MMC_SWITCH_CAST(tmp13)) {
                    case 0: {
                      modelica_metatype tmpMeta15;
                      modelica_metatype tmpMeta16;
                      modelica_metatype tmpMeta17;
                      modelica_metatype tmpMeta18;
                      modelica_metatype tmpMeta19;
                      modelica_metatype tmpMeta20;
                      tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp13_1), 2));
                      if (4 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT28), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp12_end;
                      tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp13_1), 5));
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,1,4) == 0) goto tmp12_end;
                      tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,2,1) == 0) goto tmp12_end;
                      tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
                      
                      _unitStr = tmpMeta18;
                      /* Pattern matching succeeded */
                      _unit = omc_UnitAbsynBuilder_str2unit(threadData, _unitStr, mmc_mk_none());

                      _unit = ((((modelica_integer) 0) == stringCompare(_unitStr, _OMC_LIT29))?_OMC_LIT25:_unit);

                      _st = omc_UnitAbsynBuilder_add(threadData, _unit, _st ,&_indx);

                      tmpMeta19 = mmc_mk_box2(0, _cr, mmc_mk_integer(_indx));
                      _ht = omc_BaseHashTable_add(threadData, tmpMeta19, _ht);

                      tmpMeta20 = mmc_mk_box4(3, &UnitAbsyn_InstStore_INSTSTORE__desc, _st, _ht, _res);
                      _outStore = tmpMeta20;

                      goto _return;
                      goto tmp12_done;
                    }
                    case 1: {
                      
                      /* Pattern matching succeeded */
                      goto tmp12_done;
                    }
                    }
                    goto tmp12_end;
                    tmp12_end: ;
                  }
                  goto goto_11;
                  goto_11:;
                  goto goto_2;
                  goto tmp12_done;
                  tmp12_done:;
                }
              }
              ;
            }
          }

          _st = omc_UnitAbsynBuilder_add(threadData, _OMC_LIT25, _st ,&_indx);

          tmpMeta22 = mmc_mk_box2(0, _cr, mmc_mk_integer(_indx));
          _ht = omc_BaseHashTable_add(threadData, tmpMeta22, _ht);
          tmpMeta23 = mmc_mk_box4(3, &UnitAbsyn_InstStore_INSTSTORE__desc, _st, _ht, _res);
          tmpMeta1 = tmpMeta23;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta24;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,10,4) == 0) goto tmp3_end;
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          
          _tp = tmpMeta24;
          _store = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_UnitAbsynBuilder_instAddStore(threadData, _store, _tp, _cr);
          goto tmp3_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _istore;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outStore = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  threadData->mmc_jumper = old_mmc_jumper;
  return _outStore;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_buildUnitTerms(threadData_t *threadData, modelica_metatype _env, modelica_metatype _dae, modelica_metatype *out_store, modelica_metatype *out_ht)
{
  modelica_metatype _terms = NULL;
  modelica_metatype _store = NULL;
  modelica_metatype _ht = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _terms has no default value.
  // _store has no default value.
  // _ht has no default value.
  _store = omc_UnitAbsynBuilder_buildStores(threadData, _dae ,&_ht);

  _terms = omc_UnitAbsynBuilder_buildTerms(threadData, _env, _dae, _ht, _store ,&_store);

  _store = omc_UnitAbsynBuilder_createTypeParameterLocations(threadData, _store);
  _return: OMC_LABEL_UNUSED
  if (out_store) { *out_store = _store; }
  if (out_ht) { *out_ht = _ht; }
  return _terms;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_instBuildUnitTerms(threadData_t *threadData, modelica_metatype _env, modelica_metatype _dae, modelica_metatype _compDae, modelica_metatype _store, modelica_metatype *out_terms)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype _terms = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  // _terms has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _store;
    {
      modelica_metatype _st = NULL;
      modelica_metatype _ht = NULL;
      modelica_metatype _terms2 = NULL;
      modelica_metatype _res = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _st has no default value.
      // _ht has no default value.
      // _terms2 has no default value.
      // _res has no default value.
      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,1,0) == 0) goto tmp3_end;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = _OMC_LIT45;
          tmpMeta[0+1] = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,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));
          _st = tmpMeta7;
          _ht = tmpMeta8;
          _res = tmpMeta9;
          /* Pattern matching succeeded */
          _terms = omc_UnitAbsynBuilder_buildTerms(threadData, _env, _dae, _ht, _st ,&_st);

          _terms2 = omc_UnitAbsynBuilder_buildTerms(threadData, _env, _compDae, _ht, _st ,&_st);

          _terms = listReverse(_terms);

          _terms = omc_List_append__reverse(threadData, _terms2, _terms);

          _st = omc_UnitAbsynBuilder_createTypeParameterLocations(threadData, _st);
          tmpMeta10 = mmc_mk_box4(3, &UnitAbsyn_InstStore_INSTSTORE__desc, _st, _ht, _res);
          tmpMeta[0+0] = tmpMeta10;
          tmpMeta[0+1] = _terms;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT46),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outStore = tmpMeta[0+0];
  _terms = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_terms) { *out_terms = _terms; }
  return _outStore;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_splitTypeParams(threadData_t *threadData, modelica_metatype _iTypeParams, modelica_metatype *out_denoms, modelica_metatype *out_tpstrs)
{
  modelica_metatype _nums = NULL;
  modelica_metatype _denoms = NULL;
  modelica_metatype _tpstrs = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nums has no default value.
  // _denoms has no default value.
  // _tpstrs has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iTypeParams;
    {
      modelica_string _tpParam = NULL;
      modelica_integer _i1;
      modelica_integer _i2;
      modelica_metatype _typeParams = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _tpParam has no default value.
      // _i1 has no default value.
      // _i2 has no default value.
      // _typeParams has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta6;
          tmpMeta[0+1] = tmpMeta7;
          tmpMeta[0+2] = tmpMeta8;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmp4_1);
          tmpMeta10 = MMC_CDR(tmp4_1);
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 3));
          tmp15 = mmc_unbox_integer(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
          
          _i1 = tmp13  /* pattern as ty=Integer */;
          _i2 = tmp15  /* pattern as ty=Integer */;
          _tpParam = tmpMeta17;
          _typeParams = tmpMeta10;
          /* Pattern matching succeeded */
          _nums = omc_UnitAbsynBuilder_splitTypeParams(threadData, _typeParams ,&_denoms ,&_tpstrs);
          tmpMeta18 = mmc_mk_cons(mmc_mk_integer(_i1), _nums);
          tmpMeta19 = mmc_mk_cons(mmc_mk_integer(_i2), _denoms);
          tmpMeta20 = mmc_mk_cons(_tpParam, _tpstrs);
          tmpMeta[0+0] = tmpMeta18;
          tmpMeta[0+1] = tmpMeta19;
          tmpMeta[0+2] = tmpMeta20;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _nums = tmpMeta[0+0];
  _denoms = tmpMeta[0+1];
  _tpstrs = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_denoms) { *out_denoms = _denoms; }
  if (out_tpstrs) { *out_tpstrs = _tpstrs; }
  return _nums;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_joinTypeParams(threadData_t *threadData, modelica_metatype _inums, modelica_metatype _idenoms, modelica_metatype _itpstrs, modelica_metatype _funcInstIdOpt)
{
  modelica_metatype _typeParams = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _typeParams has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
    tmp4_1 = _inums;
    tmp4_2 = _idenoms;
    tmp4_3 = _itpstrs;
    {
      modelica_integer _i1;
      modelica_integer _i2;
      modelica_string _tpParam = NULL;
      modelica_string _s = NULL;
      modelica_metatype _nums = NULL;
      modelica_metatype _denoms = NULL;
      modelica_metatype _tpstrs = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _i1 has no default value.
      // _i2 has no default value.
      // _tpParam has no default value.
      // _s has no default value.
      // _nums has no default value.
      // _denoms has no default value.
      // _tpstrs has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          if (!listEmpty(tmp4_2)) goto tmp3_end;
          if (!listEmpty(tmp4_3)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          tmp9 = mmc_unbox_integer(tmpMeta7);
          if (listEmpty(tmp4_2)) goto tmp3_end;
          tmpMeta10 = MMC_CAR(tmp4_2);
          tmpMeta11 = MMC_CDR(tmp4_2);
          tmp12 = mmc_unbox_integer(tmpMeta10);
          if (listEmpty(tmp4_3)) goto tmp3_end;
          tmpMeta13 = MMC_CAR(tmp4_3);
          tmpMeta14 = MMC_CDR(tmp4_3);
          _i1 = tmp9  /* pattern as ty=Integer */;
          _nums = tmpMeta8;
          _i2 = tmp12  /* pattern as ty=Integer */;
          _denoms = tmpMeta11;
          _tpParam = tmpMeta13;
          _tpstrs = tmpMeta14;
          /* Pattern matching succeeded */
          _typeParams = omc_UnitAbsynBuilder_joinTypeParams(threadData, _nums, _denoms, _tpstrs, _funcInstIdOpt);

          _s = omc_Util_applyOptionOrDefault(threadData, _funcInstIdOpt, boxvar_intString, _OMC_LIT29);

          tmpMeta15 = stringAppend(_tpParam,_s);
          _tpParam = tmpMeta15;
          tmpMeta17 = mmc_mk_box3(3, &MMath_Rational_RATIONAL__desc, mmc_mk_integer(_i1), mmc_mk_integer(_i2));
          tmpMeta18 = mmc_mk_box3(3, &UnitAbsyn_TypeParameter_TYPEPARAMETER__desc, _tpParam, mmc_mk_integer(((modelica_integer) 0)));
          tmpMeta19 = mmc_mk_box2(0, tmpMeta17, tmpMeta18);
          tmpMeta16 = mmc_mk_cons(tmpMeta19, _typeParams);
          tmpMeta1 = tmpMeta16;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _typeParams = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _typeParams;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_joinRationals(threadData_t *threadData, modelica_metatype _inums, modelica_metatype _idenoms)
{
  modelica_metatype _rationals = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _rationals has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _inums;
    tmp4_2 = _idenoms;
    {
      modelica_integer _i1;
      modelica_integer _i2;
      modelica_metatype _nums = NULL;
      modelica_metatype _denoms = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _i1 has no default value.
      // _i2 has no default value.
      // _nums has no default value.
      // _denoms has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          if (!listEmpty(tmp4_2)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          tmp9 = mmc_unbox_integer(tmpMeta7);
          if (listEmpty(tmp4_2)) goto tmp3_end;
          tmpMeta10 = MMC_CAR(tmp4_2);
          tmpMeta11 = MMC_CDR(tmp4_2);
          tmp12 = mmc_unbox_integer(tmpMeta10);
          _i1 = tmp9  /* pattern as ty=Integer */;
          _nums = tmpMeta8;
          _i2 = tmp12  /* pattern as ty=Integer */;
          _denoms = tmpMeta11;
          /* Pattern matching succeeded */
          _rationals = omc_UnitAbsynBuilder_joinRationals(threadData, _nums, _denoms);
          tmpMeta14 = mmc_mk_box3(3, &MMath_Rational_RATIONAL__desc, mmc_mk_integer(_i1), mmc_mk_integer(_i2));
          tmpMeta13 = mmc_mk_cons(tmpMeta14, _rationals);
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _rationals = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _rationals;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_splitRationals(threadData_t *threadData, modelica_metatype _inRationals, modelica_metatype *out_denoms)
{
  modelica_metatype _nums = NULL;
  modelica_metatype _denoms = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nums has no default value.
  // _denoms has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inRationals;
    {
      modelica_integer _i1;
      modelica_integer _i2;
      modelica_metatype _rationals = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _i1 has no default value.
      // _i2 has no default value.
      // _rationals has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta6;
          tmpMeta[0+1] = tmpMeta7;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta8 = MMC_CAR(tmp4_1);
          tmpMeta9 = MMC_CDR(tmp4_1);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          _i1 = tmp11  /* pattern as ty=Integer */;
          _i2 = tmp13  /* pattern as ty=Integer */;
          _rationals = tmpMeta9;
          /* Pattern matching succeeded */
          _nums = omc_UnitAbsynBuilder_splitRationals(threadData, _rationals ,&_denoms);
          tmpMeta14 = mmc_mk_cons(mmc_mk_integer(_i1), _nums);
          tmpMeta15 = mmc_mk_cons(mmc_mk_integer(_i2), _denoms);
          tmpMeta[0+0] = tmpMeta14;
          tmpMeta[0+1] = tmpMeta15;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _nums = tmpMeta[0+0];
  _denoms = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_denoms) { *out_denoms = _denoms; }
  return _nums;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_UnitAbsynBuilder_printTypeParameterStr(threadData_t *threadData, modelica_metatype _typeParam)
{
  modelica_string _str = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _str has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _typeParam;
    {
      modelica_string _name = NULL;
      modelica_integer _i1;
      modelica_integer _i2;
      modelica_integer _indx;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _name has no default value.
      // _i1 has no default value.
      // _i2 has no default value.
      // _indx has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_integer tmp10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          if (0 != tmp8) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          tmp10 = mmc_unbox_integer(tmpMeta9);
          if (0 != tmp10) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 3));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          _name = tmpMeta12;
          _indx = tmp14  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta15 = stringAppend(_name,_OMC_LIT47);
          tmpMeta16 = stringAppend(tmpMeta15,intString(_indx));
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT48);
          tmp1 = tmpMeta17;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          modelica_integer tmp22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_integer tmp26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
          tmp20 = mmc_unbox_integer(tmpMeta19);
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 3));
          tmp22 = mmc_unbox_integer(tmpMeta21);
          if (1 != tmp22) goto tmp3_end;
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 2));
          tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta23), 3));
          tmp26 = mmc_unbox_integer(tmpMeta25);
          _i1 = tmp20  /* pattern as ty=Integer */;
          _name = tmpMeta24;
          _indx = tmp26  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta27 = stringAppend(_name,_OMC_LIT49);
          tmpMeta28 = stringAppend(tmpMeta27,intString(_i1));
          tmpMeta29 = stringAppend(tmpMeta28,_OMC_LIT50);
          tmpMeta30 = stringAppend(tmpMeta29,intString(_indx));
          tmpMeta31 = stringAppend(tmpMeta30,_OMC_LIT48);
          tmp1 = tmpMeta31;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          modelica_integer tmp34;
          modelica_metatype tmpMeta35;
          modelica_integer tmp36;
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_metatype tmpMeta39;
          modelica_integer tmp40;
          modelica_metatype tmpMeta41;
          modelica_metatype tmpMeta42;
          modelica_metatype tmpMeta43;
          modelica_metatype tmpMeta44;
          modelica_metatype tmpMeta45;
          modelica_metatype tmpMeta46;
          modelica_metatype tmpMeta47;
          modelica_metatype tmpMeta48;
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 2));
          tmp34 = mmc_unbox_integer(tmpMeta33);
          tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta32), 3));
          tmp36 = mmc_unbox_integer(tmpMeta35);
          tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
          tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 3));
          tmp40 = mmc_unbox_integer(tmpMeta39);
          _i1 = tmp34  /* pattern as ty=Integer */;
          _i2 = tmp36  /* pattern as ty=Integer */;
          _name = tmpMeta38;
          _indx = tmp40  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta41 = stringAppend(_name,_OMC_LIT51);
          tmpMeta42 = stringAppend(tmpMeta41,intString(_i1));
          tmpMeta43 = stringAppend(tmpMeta42,_OMC_LIT52);
          tmpMeta44 = stringAppend(tmpMeta43,intString(_i2));
          tmpMeta45 = stringAppend(tmpMeta44,_OMC_LIT53);
          tmpMeta46 = stringAppend(tmpMeta45,_OMC_LIT50);
          tmpMeta47 = stringAppend(tmpMeta46,intString(_indx));
          tmpMeta48 = stringAppend(tmpMeta47,_OMC_LIT48);
          tmp1 = tmpMeta48;
          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;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_UnitAbsynBuilder_printBaseUnitsStr(threadData_t *threadData, modelica_metatype _lst)
{
  modelica_string _str = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _str has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _lst;
    {
      modelica_integer _i1;
      modelica_integer _i2;
      modelica_integer _i3;
      modelica_integer _i4;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _i1 has no default value.
      // _i2 has no default value.
      // _i3 has no default value.
      // _i4 has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_integer tmp17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          if (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));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          if (listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta12 = MMC_CAR(tmpMeta7);
          tmpMeta13 = MMC_CDR(tmpMeta7);
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
          tmp15 = mmc_unbox_integer(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          _i1 = tmp9  /* pattern as ty=Integer */;
          _i2 = tmp11  /* pattern as ty=Integer */;
          _i3 = tmp15  /* pattern as ty=Integer */;
          _i4 = tmp17  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta18 = stringAppend(_OMC_LIT54,intString(_i1));
          tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT52);
          tmpMeta20 = stringAppend(tmpMeta19,intString(_i2));
          tmpMeta21 = stringAppend(tmpMeta20,_OMC_LIT53);
          tmpMeta22 = stringAppend(tmpMeta21,_OMC_LIT55);
          tmpMeta23 = stringAppend(tmpMeta22,intString(_i3));
          tmpMeta24 = stringAppend(tmpMeta23,_OMC_LIT52);
          tmpMeta25 = stringAppend(tmpMeta24,intString(_i4));
          tmpMeta26 = stringAppend(tmpMeta25,_OMC_LIT53);
          tmp1 = tmpMeta26;
          goto tmp3_done;
        }
        case 1: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1 = _OMC_LIT29;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          
          /* Pattern matching succeeded */
          tmpMeta27 = stringAppend(_OMC_LIT56,intString(listLength(_lst)));
          tmpMeta28 = stringAppend(tmpMeta27,_OMC_LIT33);
          tmp1 = tmpMeta28;
          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;
}

PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_printUnit(threadData_t *threadData, modelica_metatype _unit)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* matchcontinue expression */
    volatile modelica_metatype tmp3_1;
    tmp3_1 = _unit;
    {
      modelica_metatype _typeparams = NULL;
      modelica_metatype _baseunits = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _typeparams has no default value.
      // _baseunits has no default value.
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 3; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,1) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
          if (!listEmpty(tmpMeta6)) goto tmp2_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 3));
          _baseunits = tmpMeta7;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(omc_UnitAbsynBuilder_printBaseUnitsStr(threadData, _baseunits)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT57),stdout);

          fputs(MMC_STRINGDATA(omc_UnitAbsynBuilder_unit2str(threadData, _unit)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT48),stdout);
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,1) == 0) goto tmp2_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
          _typeparams = tmpMeta9;
          _baseunits = tmpMeta10;
          tmp3 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          fputs(MMC_STRINGDATA(stringDelimitList(omc_List_map(threadData, _typeparams, boxvar_UnitAbsynBuilder_printTypeParameterStr), _OMC_LIT58)),stdout);

          fputs(MMC_STRINGDATA(omc_UnitAbsynBuilder_printBaseUnitsStr(threadData, _baseunits)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT57),stdout);

          fputs(MMC_STRINGDATA(omc_UnitAbsynBuilder_unit2str(threadData, _unit)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT48),stdout);
          goto tmp2_done;
        }
        case 2: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,0) == 0) goto tmp2_end;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT59),stdout);
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 3) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_printStore2(threadData_t *threadData, modelica_metatype _lst, modelica_integer _indx)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _lst;
    {
      modelica_metatype _unit = NULL;
      modelica_metatype _rest = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _unit has no default value.
      // _rest has no default value.
      tmp3 = 0;
      for (; tmp3 < 3; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta5 = MMC_CAR(tmp3_1);
          tmpMeta6 = MMC_CDR(tmp3_1);
          if (optionNone(tmpMeta5)) goto tmp2_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
          _unit = tmpMeta7;
          _rest = tmpMeta6;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(intString(_indx)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT60),stdout);

          omc_UnitAbsynBuilder_printUnit(threadData, _unit);

          fputs(MMC_STRINGDATA(_OMC_LIT33),stdout);

          /* Tail recursive call */
          _lst = _rest;
          _indx = ((modelica_integer) 1) + _indx;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta8 = MMC_CAR(tmp3_1);
          tmpMeta9 = MMC_CDR(tmp3_1);
          if (!optionNone(tmpMeta8)) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_UnitAbsynBuilder_printStore2(threadData_t *threadData, modelica_metatype _lst, modelica_metatype _indx)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_indx);
  omc_UnitAbsynBuilder_printStore2(threadData, _lst, tmp1);
  return;
}

DLLDirection
void omc_UnitAbsynBuilder_printStore(threadData_t *threadData, modelica_metatype _st)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _st;
    {
      modelica_metatype _vector = NULL;
      modelica_metatype _lst = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _vector has no default value.
      // _lst has no default value.
      tmp3 = 0;
      for (; tmp3 < 1; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          
          _vector = tmpMeta5;
          /* Pattern matching succeeded */
          _lst = arrayList(_vector);

          omc_UnitAbsynBuilder_printStore2(threadData, _lst, ((modelica_integer) 1));
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_UnitAbsynBuilder_printInstStore(threadData_t *threadData, modelica_metatype _st)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _st;
    {
      modelica_metatype _s = NULL;
      modelica_metatype _h = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _s has no default value.
      // _h has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,3) == 0) goto tmp2_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
          
          _s = tmpMeta5;
          _h = tmpMeta6;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT61),stdout);

          omc_UnitAbsynBuilder_printStore(threadData, _s);

          fputs(MMC_STRINGDATA(_OMC_LIT62),stdout);

          omc_BaseHashTable_dumpHashTable(threadData, _h);
          goto tmp2_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,0) == 0) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_string omc_UnitAbsynBuilder_printTermStr(threadData_t *threadData, modelica_metatype _term)
{
  modelica_string _str = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _str has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _term;
    {
      modelica_metatype _e = NULL;
      int tmp4;
      // _e has no default value.
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 3: {
          modelica_metatype tmpMeta5;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,3) == 0) goto tmp3_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta5;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta6;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta7;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,3) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta8;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,3) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta9;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _e = tmpMeta10;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,3) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          _e = tmpMeta12;
          /* Pattern matching succeeded */
          tmp1 = omc_ExpressionBasics_printExpStr(threadData, _e);
          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;
}

DLLDirection
modelica_string omc_UnitAbsynBuilder_printTermsStr(threadData_t *threadData, modelica_metatype _terms)
{
  modelica_string _str = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _str has no default value.
  tmpMeta1 = stringAppend(_OMC_LIT63,stringDelimitList(omc_List_map(threadData, _terms, boxvar_UnitAbsynBuilder_printTermStr), _OMC_LIT58));
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT64);
  _str = tmpMeta2;
  _return: OMC_LABEL_UNUSED
  return _str;
}

DLLDirection
void omc_UnitAbsynBuilder_printTerms(threadData_t *threadData, modelica_metatype _terms)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  fputs(MMC_STRINGDATA(omc_UnitAbsynBuilder_printTermsStr(threadData, _terms)),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_emptyStore(threadData_t *threadData)
{
  modelica_metatype _st = NULL;
  modelica_metatype _vector = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _st has no default value.
  // _vector has no default value.
  _vector = arrayCreate(((modelica_integer) 10), mmc_mk_none());

  tmpMeta1 = mmc_mk_box3(3, &UnitAbsyn_Store_STORE__desc, _vector, mmc_mk_integer(((modelica_integer) 0)));
  _st = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _st;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_emptyInstStore2(threadData_t *threadData, modelica_boolean _wantInstStore)
{
  modelica_metatype _st = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _st has no default value.
  { /* match expression */
    modelica_boolean tmp4_1;
    tmp4_1 = _wantInstStore;
    {
      modelica_metatype _s = NULL;
      modelica_metatype _ht = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _s has no default value.
      // _ht has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (1 /* true */ != tmp4_1) goto tmp3_end;
          /* Pattern matching succeeded */
          _s = omc_UnitAbsynBuilder_emptyStore(threadData);

          _ht = omc_HashTable_emptyHashTable(threadData);
          tmpMeta6 = mmc_mk_box4(3, &UnitAbsyn_InstStore_INSTSTORE__desc, _s, _ht, mmc_mk_none());
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT45;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _st = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _st;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_UnitAbsynBuilder_emptyInstStore2(threadData_t *threadData, modelica_metatype _wantInstStore)
{
  modelica_integer tmp1;
  modelica_metatype _st = NULL;
  tmp1 = mmc_unbox_integer(_wantInstStore);
  _st = omc_UnitAbsynBuilder_emptyInstStore2(threadData, tmp1);
  /* skip box _st; UnitAbsyn.InstStore */
  return _st;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_emptyInstStore(threadData_t *threadData)
{
  modelica_metatype _st = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _st has no default value.
  _st = omc_UnitAbsynBuilder_emptyInstStore2(threadData, 0 /* false */);
  _return: OMC_LABEL_UNUSED
  return _st;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_instGetStore(threadData_t *threadData, modelica_metatype _store)
{
  modelica_metatype _st = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _st has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _store;
    {
      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,3) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _st = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _st;
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_UnitAbsynBuilder_emptyStore(threadData);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _st = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _st;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_find(threadData_t *threadData, modelica_integer _index, modelica_metatype _st)
{
  modelica_metatype _unit = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _unit has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _st;
    {
      modelica_metatype _vector = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _vector has no default value.
      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;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _vector = tmpMeta6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta7 = arrayGet(_vector,_index) /* DAE.ASUB */;
          if (optionNone(tmpMeta7)) goto goto_2;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
          _unit = tmpMeta8;
          tmpMeta1 = _unit;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT65),stdout);

          fputs(MMC_STRINGDATA(intString(_index)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT31),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _unit = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _unit;
}
modelica_metatype boxptr_UnitAbsynBuilder_find(threadData_t *threadData, modelica_metatype _index, modelica_metatype _st)
{
  modelica_integer tmp1;
  modelica_metatype _unit = NULL;
  tmp1 = mmc_unbox_integer(_index);
  _unit = omc_UnitAbsynBuilder_find(threadData, tmp1, _st);
  /* skip box _unit; UnitAbsyn.Unit */
  return _unit;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_update(threadData_t *threadData, modelica_metatype _unit, modelica_integer _index, modelica_metatype _st)
{
  modelica_metatype _outSt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outSt has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _st;
    {
      modelica_metatype _vector = NULL;
      modelica_integer _indx;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _vector has no default value.
      // _indx has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          _vector = tmpMeta6;
          _indx = tmp8  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _vector = arrayUpdate(_vector, _index, mmc_mk_some(_unit));
          tmpMeta9 = mmc_mk_box3(3, &UnitAbsyn_Store_STORE__desc, _vector, mmc_mk_integer(_indx));
          tmpMeta1 = tmpMeta9;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT66),stdout);

          fputs(MMC_STRINGDATA(intString(_index)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT31),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outSt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outSt;
}
modelica_metatype boxptr_UnitAbsynBuilder_update(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _index, modelica_metatype _st)
{
  modelica_integer tmp1;
  modelica_metatype _outSt = NULL;
  tmp1 = mmc_unbox_integer(_index);
  _outSt = omc_UnitAbsynBuilder_update(threadData, _unit, tmp1, _st);
  /* skip box _outSt; UnitAbsyn.Store */
  return _outSt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_expandStore(threadData_t *threadData, modelica_metatype _st)
{
  modelica_metatype _outSt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outSt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _st;
    {
      modelica_metatype _vector = NULL;
      modelica_integer _indx;
      modelica_integer _incr;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _vector has no default value.
      // _indx has no default value.
      // _incr has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          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);
          _vector = tmpMeta6;
          _indx = tmp8  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _incr = modelica_integer_min((modelica_integer)(((modelica_integer) 1)),(modelica_integer)(((modelica_integer)floor((0.4) * (((modelica_real)_indx))))));

          _vector = omc_Array_expand(threadData, _incr, _vector, mmc_mk_none());
          tmpMeta9 = mmc_mk_box3(3, &UnitAbsyn_Store_STORE__desc, _vector, mmc_mk_integer(_indx));
          tmpMeta1 = tmpMeta9;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outSt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outSt;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_updateInstStore(threadData_t *threadData, modelica_metatype _store, modelica_metatype _st)
{
  modelica_metatype _outStore = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStore has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _store;
    {
      modelica_metatype _ht = NULL;
      modelica_metatype _res = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _ht has no default value.
      // _res has no default value.
      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,0,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));
          _ht = tmpMeta6;
          _res = tmpMeta7;
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_box4(3, &UnitAbsyn_InstStore_INSTSTORE__desc, _st, _ht, _res);
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,0) == 0) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT45;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outStore = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outStore;
}

DLLDirection
modelica_metatype omc_UnitAbsynBuilder_add(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _ist, modelica_integer *out_index)
{
  modelica_metatype _outSt = NULL;
  modelica_integer _index;
  modelica_integer tmp1_c1 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outSt has no default value.
  // _index has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _ist;
    {
      modelica_metatype _vector = NULL;
      modelica_integer _newIndx;
      modelica_integer _numElts;
      modelica_metatype _st = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _vector has no default value.
      // _newIndx has no default value.
      // _numElts has no default value.
      // _st has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_boolean tmp9;
          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);
          _st = tmp4_1;
          _vector = tmpMeta6;
          _numElts = tmp8  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp9 = (_numElts == arrayLength(_vector));
          if (1 /* true */ != tmp9) goto goto_2;

          _st = omc_UnitAbsynBuilder_expandStore(threadData, _st);
          tmpMeta[0+0] = omc_UnitAbsynBuilder_add(threadData, _unit, _st, &tmp1_c1);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp12 = mmc_unbox_integer(tmpMeta11);
          _vector = tmpMeta10;
          _numElts = tmp12  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _newIndx = ((modelica_integer) 1) + _numElts;

          _vector = arrayUpdate(_vector, _newIndx, mmc_mk_some(_unit));
          tmpMeta13 = mmc_mk_box3(3, &UnitAbsyn_Store_STORE__desc, _vector, mmc_mk_integer(_newIndx));
          tmpMeta[0+0] = tmpMeta13;
          tmp1_c1 = _newIndx;
          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:;
    }
  }
  _outSt = tmpMeta[0+0];
  _index = tmp1_c1;
  _return: OMC_LABEL_UNUSED
  if (out_index) { *out_index = _index; }
  return _outSt;
}
modelica_metatype boxptr_UnitAbsynBuilder_add(threadData_t *threadData, modelica_metatype _unit, modelica_metatype _ist, modelica_metatype *out_index)
{
  modelica_integer _index;
  modelica_metatype _outSt = NULL;
  _outSt = omc_UnitAbsynBuilder_add(threadData, _unit, _ist, &_index);
  /* skip box _outSt; UnitAbsyn.Store */
  if (out_index) { *out_index = mmc_mk_icon(_index); }
  return _outSt;
}

PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerDefineunits2(threadData_t *threadData, modelica_metatype _elts)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* matchcontinue expression */
    volatile modelica_metatype tmp3_1;
    tmp3_1 = _elts;
    {
      modelica_string _exp = NULL;
      modelica_string _name = NULL;
      modelica_metatype _du = NULL;
      modelica_metatype _rest = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _exp has no default value.
      // _name has no default value.
      // _du has no default value.
      // _rest has no default value.
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 4; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          tmp3 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta5 = MMC_CAR(tmp3_1);
          tmpMeta6 = MMC_CDR(tmp3_1);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,1,3) == 0) goto tmp2_end;
          
          _du = tmpMeta5;
          _rest = tmpMeta6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta7 = omc_AbsynToSCode_translateElement(threadData, _du, _OMC_LIT67);
          if (listEmpty(tmpMeta7)) goto goto_1;
          tmpMeta8 = MMC_CAR(tmpMeta7);
          tmpMeta9 = MMC_CDR(tmpMeta7);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,4,5) == 0) goto goto_1;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
          if (optionNone(tmpMeta11)) goto goto_1;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
          if (!listEmpty(tmpMeta9)) goto goto_1;
          _name = tmpMeta10;
          _exp = tmpMeta12;

          omc_UnitParserExt_addDerived(threadData, _name, _exp);

          omc_UnitAbsynBuilder_registerDefineunits2(threadData, _rest);
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta13 = MMC_CAR(tmp3_1);
          tmpMeta14 = MMC_CDR(tmp3_1);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,1,3) == 0) goto tmp2_end;
          
          _du = tmpMeta13;
          _rest = tmpMeta14;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta15 = omc_AbsynToSCode_translateElement(threadData, _du, _OMC_LIT67);
          if (listEmpty(tmpMeta15)) goto goto_1;
          tmpMeta16 = MMC_CAR(tmpMeta15);
          tmpMeta17 = MMC_CDR(tmpMeta15);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,4,5) == 0) goto goto_1;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 4));
          if (!optionNone(tmpMeta19)) goto goto_1;
          if (!listEmpty(tmpMeta17)) goto goto_1;
          _name = tmpMeta18;

          omc_UnitParserExt_addBase(threadData, _name);

          omc_UnitAbsynBuilder_registerDefineunits2(threadData, _rest);
          goto tmp2_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT68),stdout);
          goto goto_1;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 4) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerDefineunits(threadData_t *threadData, modelica_metatype _elts)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* matchcontinue expression */
    volatile modelica_metatype tmp3_1;
    tmp3_1 = _elts;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          omc_UnitAbsynBuilder_registerDefineunits2(threadData, _OMC_LIT209);
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          omc_UnitAbsynBuilder_registerDefineunits2(threadData, _elts);
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 2) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_registerUnitInClass(threadData_t *threadData, modelica_metatype _inTpl)
{
  modelica_metatype _outTpl = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outTpl has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _inTpl;
    {
      modelica_metatype _cl = NULL;
      modelica_metatype _pa = NULL;
      modelica_integer _i;
      modelica_metatype _defunits = NULL;
      modelica_metatype _elts = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _cl has no default value.
      // _pa has no default value.
      // _i has no default value.
      // _defunits has no default value.
      // _elts has no default value.
      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_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);
          _cl = tmpMeta6;
          _pa = tmpMeta7;
          _i = tmp9  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _elts = omc_AbsynUtil_getElementItemsInClass(threadData, _cl);

          _defunits = omc_AbsynUtil_getDefineUnitsInElements(threadData, _elts);

          omc_UnitAbsynBuilder_registerDefineunits(threadData, _defunits);
          tmpMeta10 = mmc_mk_box3(0, _cl, _pa, mmc_mk_integer(_i));
          tmpMeta1 = tmpMeta10;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          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);
          _cl = tmpMeta11;
          _pa = tmpMeta12;
          _i = tmp14  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta15 = mmc_mk_box3(0, _cl, _pa, mmc_mk_integer(_i));
          tmpMeta1 = tmpMeta15;
          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:;
    }
  }
  _outTpl = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outTpl;
}

DLLDirection
void omc_UnitAbsynBuilder_registerUnits(threadData_t *threadData, modelica_metatype _prg)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          modelica_boolean tmp5;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp5 = omc_Flags_getConfigBool(threadData, _OMC_LIT214);
          if (0 /* false */ != tmp5) goto goto_1;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerUnitWeightDefineunits2(threadData_t *threadData, modelica_metatype _idu)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _idu;
    {
      modelica_string _n = NULL;
      modelica_real _w;
      modelica_metatype _du = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _n has no default value.
      // _w has no default value.
      // _du has no default value.
      tmp3 = 0;
      for (; tmp3 < 4; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_real tmp10;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta5 = MMC_CAR(tmp3_1);
          tmpMeta6 = MMC_CDR(tmp3_1);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,4,5) == 0) goto tmp2_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 5));
          if (optionNone(tmpMeta8)) goto tmp2_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
          tmp10 = mmc_unbox_real(tmpMeta9);
          
          _n = tmpMeta7;
          _w = tmp10  /* pattern as ty=Real */;
          _du = tmpMeta6;
          /* Pattern matching succeeded */
          omc_UnitParserExt_registerWeight(threadData, _n, _w);

          /* Tail recursive call */
          _idu = _du;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta11 = MMC_CAR(tmp3_1);
          tmpMeta12 = MMC_CDR(tmp3_1);
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,4,5) == 0) goto tmp2_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 5));
          if (!optionNone(tmpMeta13)) goto tmp2_end;
          
          _du = tmpMeta12;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _idu = _du;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta14 = MMC_CAR(tmp3_1);
          tmpMeta15 = MMC_CDR(tmp3_1);
          _du = tmpMeta15;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _idu = _du;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 3: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_UnitAbsynBuilder_registerUnitWeightDefineunits(threadData_t *threadData, modelica_metatype _du)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _du;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          omc_UnitAbsynBuilder_registerUnitWeightDefineunits2(threadData, _OMC_LIT264);
          goto tmp2_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          omc_UnitAbsynBuilder_registerUnitWeightDefineunits2(threadData, _du);
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_UnitAbsynBuilder_retrieveUnitsFromEnv(threadData_t *threadData, modelica_metatype _p, modelica_metatype _tpl)
{
  modelica_metatype _du = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _du has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _env = NULL;
      modelica_metatype _r = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _env has no default value.
      // _r has no default value.
      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;
          /* Pattern matching succeeded */
          omc_Lookup_lookupClass(threadData, omc_Util_tuple21(threadData, _tpl), omc_Util_tuple22(threadData, _tpl), _p, mmc_mk_none() ,NULL ,&_env);

          _r = omc_FGraph_lastScopeRef(threadData, _env);

          _r = omc_FNode_child(threadData, _r, _OMC_LIT265);

          /* Pattern-matching assignment */
          tmpMeta6 = omc_FNode_fromRef(threadData, _r);
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,1) == 0) goto goto_2;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
          _du = tmpMeta8;
          tmpMeta1 = _du;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          /* Pattern matching succeeded */
          tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta9;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _du = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _du;
}

DLLDirection
void omc_UnitAbsynBuilder_registerUnitWeights(threadData_t *threadData, modelica_metatype _cache, modelica_metatype _env, modelica_metatype _dae)
{
  modelica_metatype _paths = NULL;
  modelica_metatype _du = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _paths has no default value.
  // _du has no default value.
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _dae;
    {
      modelica_metatype _elts = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _elts has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
          _elts = tmpMeta5;
          /* Pattern matching succeeded */
          _paths = omc_List_unionList(threadData, omc_List_map(threadData, _elts, boxvar_DAEUtil_getClassList));

          tmpMeta6 = mmc_mk_box2(0, _cache, _env);
          _du = omc_List_unionList(threadData, omc_List_map1(threadData, _paths, boxvar_UnitAbsynBuilder_retrieveUnitsFromEnv, tmpMeta6));

          omc_UnitAbsynBuilder_registerUnitWeightDefineunits(threadData, _du);
          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;
}

