#ifdef OMC_BASE_FILE
#define OMC_FILE OMC_BASE_FILE
#else
#define OMC_FILE "SimCodeFunctionUtil.c"
#endif
#include "omc_simulation_settings.h"
#include "SimCodeFunctionUtil.h"
#define _OMC_LIT0_data "Tried to append cref prefix from a non FUNCTION_CONTEXT() context. cref_pref is only avaiable in FUNCTION_CONTEXT."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,114,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data "SimCodeFunctionUtil.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,22,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT2_6,0.0);
#define _OMC_LIT2_6 MMC_REFREALLIT(_OMC_LIT_STRUCT2_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT2,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2787)),MMC_IMMEDIATE(MMC_TAGFIXNUM(20)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2787)),MMC_IMMEDIATE(MMC_TAGFIXNUM(174)),_OMC_LIT2_6}};
#define _OMC_LIT2 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT2)
#define _OMC_LIT3_data "Tried to get cref prefix from a non FUNCTION_CONTEXT() context. cref_pref is only avaiable in FUNCTION_CONTEXT."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,111,_OMC_LIT3_data);
#define _OMC_LIT3 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT3)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT4_6,0.0);
#define _OMC_LIT4_6 MMC_REFREALLIT(_OMC_LIT_STRUCT4_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT4,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2773)),MMC_IMMEDIATE(MMC_TAGFIXNUM(20)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2773)),MMC_IMMEDIATE(MMC_TAGFIXNUM(171)),_OMC_LIT4_6}};
#define _OMC_LIT4 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT4)
#define _OMC_LIT5_data "i_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,2,_OMC_LIT5_data);
#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
#define _OMC_LIT6_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,1,_OMC_LIT6_data);
#define _OMC_LIT6 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)
#define _OMC_LIT7_data "0"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,1,_OMC_LIT7_data);
#define _OMC_LIT7 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)
#define _OMC_LIT8_data "JavaScript"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT8,10,_OMC_LIT8_data);
#define _OMC_LIT8 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "emcc"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,4,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
#define _OMC_LIT10_data "hpcom"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT10,5,_OMC_LIT10_data);
#define _OMC_LIT10 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT10)
#define _OMC_LIT11_data "Enables parallel calculation based on task-graphs."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT11,50,_OMC_LIT11_data);
#define _OMC_LIT11 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT11)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT12,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT11}};
#define _OMC_LIT12 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT12)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT13,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(85)),_OMC_LIT10,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT12}};
#define _OMC_LIT13 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT13)
#define _OMC_LIT14_data ".js"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT14,3,_OMC_LIT14_data);
#define _OMC_LIT14 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT14)
#define _OMC_LIT15_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT15,0,_OMC_LIT15_data);
#define _OMC_LIT15 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT15)
#define _OMC_LIT16_data "\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT16,1,_OMC_LIT16_data);
#define _OMC_LIT16 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT16)
#define _OMC_LIT17_data " "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT17,1,_OMC_LIT17_data);
#define _OMC_LIT17 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT17)
#define _OMC_LIT18_data "-fopenmp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT18,8,_OMC_LIT18_data);
#define _OMC_LIT18 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT18)
#define _OMC_LIT19_data "-Os -Wno-warn-absolute-paths"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT19,28,_OMC_LIT19_data);
#define _OMC_LIT19 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT19)
#define _OMC_LIT20_data " -lParModelicaAuto -ltbb_static -lboost_system "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT20,47,_OMC_LIT20_data);
#define _OMC_LIT20 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT20)
#define _OMC_LIT21_data "parmodauto"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT21,10,_OMC_LIT21_data);
#define _OMC_LIT21 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT21)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT22,1,4) {&Flags_FlagVisibility_EXTERNAL__desc,}};
#define _OMC_LIT22 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT22)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT23,2,4) {&Flags_FlagData_BOOL__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT23 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT23)
#define _OMC_LIT24_data "Experimental: Enable parallelization of independent systems of equations in the translated model."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT24,97,_OMC_LIT24_data);
#define _OMC_LIT24 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT24)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT25,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT24}};
#define _OMC_LIT25 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT25)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT26,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(144)),_OMC_LIT21,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT22,_OMC_LIT23,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT25}};
#define _OMC_LIT26 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT26)
#define _OMC_LIT27_data "/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT27,1,_OMC_LIT27_data);
#define _OMC_LIT27 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT27)
#define _OMC_LIT28_data "modelica_fnptr "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT28,15,_OMC_LIT28_data);
#define _OMC_LIT28 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data "_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,1,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
#define _OMC_LIT30_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT30,1,_OMC_LIT30_data);
#define _OMC_LIT30 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT30)
#define _OMC_LIT31_data "list"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT31,4,_OMC_LIT31_data);
#define _OMC_LIT31 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT31)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT32,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT31}};
#define _OMC_LIT32 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT32)
#define _OMC_LIT33_data "listReverse"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT33,11,_OMC_LIT33_data);
#define _OMC_LIT33 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT33)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT34,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT33}};
#define _OMC_LIT34 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "array"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,5,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT36,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT35}};
#define _OMC_LIT36 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT36)
#define _OMC_LIT37_data "min"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT37,3,_OMC_LIT37_data);
#define _OMC_LIT37 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT37)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT38,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT37}};
#define _OMC_LIT38 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT38)
#define _OMC_LIT39_data "max"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT39,3,_OMC_LIT39_data);
#define _OMC_LIT39 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT39)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT40,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT39}};
#define _OMC_LIT40 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT40)
#define _OMC_LIT41_data "sum"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT41,3,_OMC_LIT41_data);
#define _OMC_LIT41 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT41}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
#define _OMC_LIT43_data "product"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT43,7,_OMC_LIT43_data);
#define _OMC_LIT43 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT43)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT44,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT43}};
#define _OMC_LIT44 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT44)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT45,2,1) {_OMC_LIT44,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT45 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT45)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT46,2,1) {_OMC_LIT42,_OMC_LIT45}};
#define _OMC_LIT46 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT46)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT47,2,1) {_OMC_LIT40,_OMC_LIT46}};
#define _OMC_LIT47 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT47)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT48,2,1) {_OMC_LIT38,_OMC_LIT47}};
#define _OMC_LIT48 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT48)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT49,2,1) {_OMC_LIT36,_OMC_LIT48}};
#define _OMC_LIT49 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT49)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT50,2,1) {_OMC_LIT34,_OMC_LIT49}};
#define _OMC_LIT50 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT50)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT51,2,1) {_OMC_LIT32,_OMC_LIT50}};
#define _OMC_LIT51 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data "destructor"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,10,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT53,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT52}};
#define _OMC_LIT53 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT53)
#define _OMC_LIT54_data "."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT54,1,_OMC_LIT54_data);
#define _OMC_LIT54 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT54)
#define _OMC_LIT55_data "function getCalledFunctionsInFunction2: Class "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT55,46,_OMC_LIT55_data);
#define _OMC_LIT55 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT55)
#define _OMC_LIT56_data " not found in global scope."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT56,27,_OMC_LIT56_data);
#define _OMC_LIT56 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT56)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT57_6,0.0);
#define _OMC_LIT57_6 MMC_REFREALLIT(_OMC_LIT_STRUCT57_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT57,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2512)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2512)),MMC_IMMEDIATE(MMC_TAGFIXNUM(50)),_OMC_LIT57_6}};
#define _OMC_LIT57 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT57)
#define _OMC_LIT58_data "DynamicLoad"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT58,11,_OMC_LIT58_data);
#define _OMC_LIT58 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data "Include"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,7,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data "#line "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,6,_OMC_LIT60_data);
#define _OMC_LIT60 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT60)
#define _OMC_LIT61_data " \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT61,2,_OMC_LIT61_data);
#define _OMC_LIT61 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT61)
#define _OMC_LIT62_data "gendebugsymbols"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT62,15,_OMC_LIT62_data);
#define _OMC_LIT62 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data "Generate code with debugging symbols."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,37,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT64,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT63}};
#define _OMC_LIT64 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT64)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT65,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(69)),_OMC_LIT62,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT64}};
#define _OMC_LIT65 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT65)
#define _OMC_LIT66_data "Library"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT66,7,_OMC_LIT66_data);
#define _OMC_LIT66 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT66)
#define _OMC_LIT67_data "msvc"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT67,4,_OMC_LIT67_data);
#define _OMC_LIT67 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT67)
#define _OMC_LIT68_data "pthreads library is already available. It is not linked from the external library resource directory.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT68,102,_OMC_LIT68_data);
#define _OMC_LIT68 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT68)
#define _OMC_LIT69_data "rt library is not needed under Windows. It is not linked from the external library resource directory.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT69,103,_OMC_LIT69_data);
#define _OMC_LIT69 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT69)
#define _OMC_LIT70_data "Ws2_32 library is not needed under Windows. It is not linked from the external library resource directory.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT70,107,_OMC_LIT70_data);
#define _OMC_LIT70 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT70)
#define _OMC_LIT71_data "User32 library is already available. It is not linked from the external library resource directory.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT71,100,_OMC_LIT71_data);
#define _OMC_LIT71 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT71)
#define _OMC_LIT72_data "-l"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT72,2,_OMC_LIT72_data);
#define _OMC_LIT72 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT72)
#define _OMC_LIT73_data "Winmm library is a windows system library. It is not linked from the external library resource directory.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT73,106,_OMC_LIT73_data);
#define _OMC_LIT73 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT73)
#define _OMC_LIT74_data "X11 library is not needed under Windows. It is not linked from the external library resource directory.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT74,104,_OMC_LIT74_data);
#define _OMC_LIT74 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT74)
#define _OMC_LIT75_data "-lfmilib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT75,8,_OMC_LIT75_data);
#define _OMC_LIT75 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT75)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT76,2,1) {_OMC_LIT75,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT76 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "ModelicaIO"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,10,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT78,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT77}};
#define _OMC_LIT78 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT78)
#define _OMC_LIT79_data "ModelicaMatIO"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT79,13,_OMC_LIT79_data);
#define _OMC_LIT79 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT79)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT80,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT79}};
#define _OMC_LIT80 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT80)
#define _OMC_LIT81_data "zlib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT81,4,_OMC_LIT81_data);
#define _OMC_LIT81 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT81)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT82,2,6) {&Absyn_Exp_STRING__desc,_OMC_LIT81}};
#define _OMC_LIT82 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT82)
#define _OMC_LIT83_data "ModelicaStandardTables"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT83,22,_OMC_LIT83_data);
#define _OMC_LIT83 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT83)
#define _OMC_LIT84_data "-"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT84,1,_OMC_LIT84_data);
#define _OMC_LIT84 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT84)
#define _OMC_LIT85_data "Failed to process Library annotation for external function"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT85,58,_OMC_LIT85_data);
#define _OMC_LIT85 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT85)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT86_6,0.0);
#define _OMC_LIT86_6 MMC_REFREALLIT(_OMC_LIT_STRUCT86_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT86,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2327)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2327)),MMC_IMMEDIATE(MMC_TAGFIXNUM(107)),_OMC_LIT86_6}};
#define _OMC_LIT86 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT86)
#define _OMC_LIT87_data "lapack"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT87,6,_OMC_LIT87_data);
#define _OMC_LIT87 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT87)
#define _OMC_LIT88_data "Lapack"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT88,6,_OMC_LIT88_data);
#define _OMC_LIT88 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data "pthread"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,7,_OMC_LIT89_data);
#define _OMC_LIT89 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT89)
#define _OMC_LIT90_data "rt"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT90,2,_OMC_LIT90_data);
#define _OMC_LIT90 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT90)
#define _OMC_LIT91_data "Ws2_32"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT91,6,_OMC_LIT91_data);
#define _OMC_LIT91 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data "User32"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,6,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
#define _OMC_LIT93_data "Winmm"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT93,5,_OMC_LIT93_data);
#define _OMC_LIT93 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT93)
#define _OMC_LIT94_data "X11"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT94,3,_OMC_LIT94_data);
#define _OMC_LIT94 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT94)
#define _OMC_LIT95_data "omcruntime"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT95,10,_OMC_LIT95_data);
#define _OMC_LIT95 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT95)
#define _OMC_LIT96_data "OpenModelicaCorba"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT96,17,_OMC_LIT96_data);
#define _OMC_LIT96 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT96)
#define _OMC_LIT97_data "fmilib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT97,6,_OMC_LIT97_data);
#define _OMC_LIT97 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "lapack_win32_MT.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,19,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
#define _OMC_LIT99_data "f2c.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT99,7,_OMC_LIT99_data);
#define _OMC_LIT99 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT99)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT100,2,1) {_OMC_LIT99,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT100 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT100)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT101,2,1) {_OMC_LIT98,_OMC_LIT100}};
#define _OMC_LIT101 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT101)
#define _OMC_LIT102_data "initialization.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT102,18,_OMC_LIT102_data);
#define _OMC_LIT102 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data "libexpat.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,12,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
#define _OMC_LIT104_data "math-support.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT104,16,_OMC_LIT104_data);
#define _OMC_LIT104 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT104)
#define _OMC_LIT105_data "meta.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT105,8,_OMC_LIT105_data);
#define _OMC_LIT105 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT105)
#define _OMC_LIT106_data "ModelicaExternalC.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT106,21,_OMC_LIT106_data);
#define _OMC_LIT106 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT106)
#define _OMC_LIT107_data "results.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT107,11,_OMC_LIT107_data);
#define _OMC_LIT107 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT107)
#define _OMC_LIT108_data "simulation.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT108,14,_OMC_LIT108_data);
#define _OMC_LIT108 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT108)
#define _OMC_LIT109_data "solver.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT109,10,_OMC_LIT109_data);
#define _OMC_LIT109 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT109)
#define _OMC_LIT110_data "sundials_kinsol.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT110,19,_OMC_LIT110_data);
#define _OMC_LIT110 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT110)
#define _OMC_LIT111_data "sundials_nvecserial.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT111,23,_OMC_LIT111_data);
#define _OMC_LIT111 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT111)
#define _OMC_LIT112_data "sundials_sunlinsolklu"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT112,21,_OMC_LIT112_data);
#define _OMC_LIT112 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data "util.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,8,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT114,2,1) {_OMC_LIT98,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT114 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT114)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT115,2,1) {_OMC_LIT113,_OMC_LIT114}};
#define _OMC_LIT115 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT115)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT116,2,1) {_OMC_LIT112,_OMC_LIT115}};
#define _OMC_LIT116 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT116)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT117,2,1) {_OMC_LIT111,_OMC_LIT116}};
#define _OMC_LIT117 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,2,1) {_OMC_LIT110,_OMC_LIT117}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT119,2,1) {_OMC_LIT109,_OMC_LIT118}};
#define _OMC_LIT119 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,2,1) {_OMC_LIT108,_OMC_LIT119}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,2,1) {_OMC_LIT107,_OMC_LIT120}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT122,2,1) {_OMC_LIT106,_OMC_LIT121}};
#define _OMC_LIT122 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,2,1) {_OMC_LIT105,_OMC_LIT122}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,2,1) {_OMC_LIT104,_OMC_LIT123}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT125,2,1) {_OMC_LIT103,_OMC_LIT124}};
#define _OMC_LIT125 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,2,1) {_OMC_LIT102,_OMC_LIT125}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT127,2,1) {_OMC_LIT99,_OMC_LIT126}};
#define _OMC_LIT127 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "fmilib.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,10,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
#define _OMC_LIT129_data "shlwapi.lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT129,11,_OMC_LIT129_data);
#define _OMC_LIT129 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT129)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT130,2,1) {_OMC_LIT129,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT130 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT130)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT131,2,1) {_OMC_LIT128,_OMC_LIT130}};
#define _OMC_LIT131 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT131)
#define _OMC_LIT132_data ".lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT132,4,_OMC_LIT132_data);
#define _OMC_LIT132 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT132)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT133_6,0.0);
#define _OMC_LIT133_6 MMC_REFREALLIT(_OMC_LIT_STRUCT133_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT133,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2220)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2220)),MMC_IMMEDIATE(MMC_TAGFIXNUM(107)),_OMC_LIT133_6}};
#define _OMC_LIT133 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT133)
#define _OMC_LIT134_data "LibraryDirectory"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT134,16,_OMC_LIT134_data);
#define _OMC_LIT134 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT134)
#define _OMC_LIT135_data "modelica://"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT135,11,_OMC_LIT135_data);
#define _OMC_LIT135 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT135)
#define _OMC_LIT136_data "/Resources/Library"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT136,18,_OMC_LIT136_data);
#define _OMC_LIT136 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT136)
#define _OMC_LIT137_data "/.openmodelica/binaries/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT137,24,_OMC_LIT137_data);
#define _OMC_LIT137 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT137)
#define _OMC_LIT138_data "-Wl,-rpath=\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT138,12,_OMC_LIT138_data);
#define _OMC_LIT138 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT138)
#define _OMC_LIT139_data "/LIBPATH:\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT139,10,_OMC_LIT139_data);
#define _OMC_LIT139 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT139)
#define _OMC_LIT140_data "\"-L"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT140,3,_OMC_LIT140_data);
#define _OMC_LIT140 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT140)
#define _OMC_LIT141_data "/Resources"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT141,10,_OMC_LIT141_data);
#define _OMC_LIT141 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT141)
#define _OMC_LIT142_data "target"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT142,6,_OMC_LIT142_data);
#define _OMC_LIT142 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT142)
#define _OMC_LIT143_data "gcc"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT143,3,_OMC_LIT143_data);
#define _OMC_LIT143 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT143)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT144,2,8) {&Flags_FlagData_STRING__FLAG__desc,_OMC_LIT143}};
#define _OMC_LIT144 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "msvc10"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,6,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
#define _OMC_LIT146_data "msvc12"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT146,6,_OMC_LIT146_data);
#define _OMC_LIT146 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT146)
#define _OMC_LIT147_data "msvc13"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT147,6,_OMC_LIT147_data);
#define _OMC_LIT147 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT147)
#define _OMC_LIT148_data "msvc15"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT148,6,_OMC_LIT148_data);
#define _OMC_LIT148 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT148)
#define _OMC_LIT149_data "msvc19"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT149,6,_OMC_LIT149_data);
#define _OMC_LIT149 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT149)
#define _OMC_LIT150_data "vxworks69"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT150,9,_OMC_LIT150_data);
#define _OMC_LIT150 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT150)
#define _OMC_LIT151_data "debugrt"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT151,7,_OMC_LIT151_data);
#define _OMC_LIT151 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT151)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT152,2,1) {_OMC_LIT151,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT152 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,2,1) {_OMC_LIT150,_OMC_LIT152}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT154,2,1) {_OMC_LIT149,_OMC_LIT153}};
#define _OMC_LIT154 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT154)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT155,2,1) {_OMC_LIT148,_OMC_LIT154}};
#define _OMC_LIT155 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT155)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT156,2,1) {_OMC_LIT147,_OMC_LIT155}};
#define _OMC_LIT156 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT156)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT157,2,1) {_OMC_LIT146,_OMC_LIT156}};
#define _OMC_LIT157 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT157)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT158,2,1) {_OMC_LIT145,_OMC_LIT157}};
#define _OMC_LIT158 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT158)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT159,2,1) {_OMC_LIT67,_OMC_LIT158}};
#define _OMC_LIT159 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT159)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT160,2,1) {_OMC_LIT143,_OMC_LIT159}};
#define _OMC_LIT160 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT160)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT161,2,3) {&Flags_ValidOptions_STRING__OPTION__desc,_OMC_LIT160}};
#define _OMC_LIT161 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT161)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT162,1,1) {_OMC_LIT161}};
#define _OMC_LIT162 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT162)
#define _OMC_LIT163_data "Sets the target compiler to use."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT163,32,_OMC_LIT163_data);
#define _OMC_LIT163 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT163)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT164,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT163}};
#define _OMC_LIT164 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5)),_OMC_LIT142,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT22,_OMC_LIT144,_OMC_LIT162,_OMC_LIT164}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
#define _OMC_LIT166_data "/lib/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT166,5,_OMC_LIT166_data);
#define _OMC_LIT166 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT166)
#define _OMC_LIT167_data "/omc"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT167,4,_OMC_LIT167_data);
#define _OMC_LIT167 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT167)
#define _OMC_LIT168_data "-lWinmm"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT168,7,_OMC_LIT168_data);
#define _OMC_LIT168 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT168)
#define _OMC_LIT169_data "IncludeDirectory"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT169,16,_OMC_LIT169_data);
#define _OMC_LIT169 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT169)
#define _OMC_LIT170_data "\"-I"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT170,3,_OMC_LIT170_data);
#define _OMC_LIT170 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT170)
#define _OMC_LIT171_data "/Resources/Include"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT171,18,_OMC_LIT171_data);
#define _OMC_LIT171 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT171)
#define _OMC_LIT172_data "/usr/lib/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT172,9,_OMC_LIT172_data);
#define _OMC_LIT172 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT172)
#define _OMC_LIT173_data "/omc_compile_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT173,13,_OMC_LIT173_data);
#define _OMC_LIT173 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT173)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT174,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT174 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT174)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT175,1,6) {&ErrorTypes_Severity_NOTIFICATION__desc,}};
#define _OMC_LIT175 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT175)
#define _OMC_LIT176_data "%s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT176,2,_OMC_LIT176_data);
#define _OMC_LIT176 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT176)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT177,2,4) {&Gettext_TranslatableContent_notrans__desc,_OMC_LIT176}};
#define _OMC_LIT177 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT177)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT178,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(6001)),_OMC_LIT174,_OMC_LIT175,_OMC_LIT177}};
#define _OMC_LIT178 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT178)
#define _OMC_LIT179_data "Created directory "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT179,18,_OMC_LIT179_data);
#define _OMC_LIT179 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT179)
#define _OMC_LIT180_data "cp -a \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT180,7,_OMC_LIT180_data);
#define _OMC_LIT180 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT180)
#define _OMC_LIT181_data "\"/* \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT181,5,_OMC_LIT181_data);
#define _OMC_LIT181 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT181)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT182,1,5) {&ErrorTypes_Severity_WARNING__desc,}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(6000)),_OMC_LIT174,_OMC_LIT182,_OMC_LIT177}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
#define _OMC_LIT184_data "Failed to change directory to "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT184,30,_OMC_LIT184_data);
#define _OMC_LIT184 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT184)
#define _OMC_LIT185_data "/BuildProjects/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT185,15,_OMC_LIT185_data);
#define _OMC_LIT185 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT185)
#define _OMC_LIT186_data "Changed directory to "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT186,21,_OMC_LIT186_data);
#define _OMC_LIT186 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT186)
#define _OMC_LIT187_data "sh ./autogen.sh && ./configure --libdir='"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT187,41,_OMC_LIT187_data);
#define _OMC_LIT187 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT187)
#define _OMC_LIT188_data "' && make && make install"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT188,25,_OMC_LIT188_data);
#define _OMC_LIT188 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT188)
#define _OMC_LIT189_data "log"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT189,3,_OMC_LIT189_data);
#define _OMC_LIT189 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT189)
#define _OMC_LIT190_data "Succeeded with compilation and installation of the library using:\ncommand: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT190,75,_OMC_LIT190_data);
#define _OMC_LIT190 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT190)
#define _OMC_LIT191_data "Could not find library %s despite compilation command %s in directory %s returning success."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT191,91,_OMC_LIT191_data);
#define _OMC_LIT191 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT191)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT192,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT191}};
#define _OMC_LIT192 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT192)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT193,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(283)),_OMC_LIT174,_OMC_LIT182,_OMC_LIT192}};
#define _OMC_LIT193 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT193)
#define _OMC_LIT194_data "Compiled "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT194,9,_OMC_LIT194_data);
#define _OMC_LIT194 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT194)
#define _OMC_LIT195_data " by running build project "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT195,26,_OMC_LIT195_data);
#define _OMC_LIT195 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT195)
#define _OMC_LIT196_data "Failed to run "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT196,14,_OMC_LIT196_data);
#define _OMC_LIT196 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT196)
#define _OMC_LIT197_data ": "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT197,2,_OMC_LIT197_data);
#define _OMC_LIT197 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT197)
#define _OMC_LIT198_data "Removed directory "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT198,18,_OMC_LIT198_data);
#define _OMC_LIT198 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT198)
#define _OMC_LIT199_data "/BuildProjects"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT199,14,_OMC_LIT199_data);
#define _OMC_LIT199 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT199)
#define _OMC_LIT200_data "/autogen.sh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT200,11,_OMC_LIT200_data);
#define _OMC_LIT200 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT200)
#define _OMC_LIT201_data "Could not find library %s in either of:%s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT201,41,_OMC_LIT201_data);
#define _OMC_LIT201 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT201)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT202,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT201}};
#define _OMC_LIT202 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT202)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT203,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(282)),_OMC_LIT174,_OMC_LIT182,_OMC_LIT202}};
#define _OMC_LIT203 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT203)
#define _OMC_LIT204_data "\n  "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT204,3,_OMC_LIT204_data);
#define _OMC_LIT204 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT204)
#define _OMC_LIT205_data "lib"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT205,3,_OMC_LIT205_data);
#define _OMC_LIT205 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT205)
#define _OMC_LIT206_data ".a"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT206,2,_OMC_LIT206_data);
#define _OMC_LIT206 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT206)
#define _OMC_LIT207_data "buildExternalLibs"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT207,17,_OMC_LIT207_data);
#define _OMC_LIT207 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT207)
#define _OMC_LIT208_data "Use the autotools project in the Resources folder of the library to build missing external libraries."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT208,101,_OMC_LIT208_data);
#define _OMC_LIT208 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT208)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT208}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT210,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(124)),_OMC_LIT207,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT209}};
#define _OMC_LIT210 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT210)
#define _OMC_LIT211_data "NULL"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT211,4,_OMC_LIT211_data);
#define _OMC_LIT211 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT211)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT212,1,3) {&DAE_VarParallelism_PARGLOBAL__desc,}};
#define _OMC_LIT212 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT212)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT213,1,4) {&DAE_VarParallelism_PARLOCAL__desc,}};
#define _OMC_LIT213 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,1,5) {&DAE_VarParallelism_NON__PARALLEL__desc,}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,1,3) {&DAE_VarKind_VARIABLE__desc,}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
#define _OMC_LIT216_data "SourceInfo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT216,10,_OMC_LIT216_data);
#define _OMC_LIT216 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT216)
#define _OMC_LIT217_data "function getCrefFromExp failed: input was not of type DAE.CREF"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT217,62,_OMC_LIT217_data);
#define _OMC_LIT217 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT217)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT218_6,0.0);
#define _OMC_LIT218_6 MMC_REFREALLIT(_OMC_LIT_STRUCT218_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT218,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1592)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1592)),MMC_IMMEDIATE(MMC_TAGFIXNUM(111)),_OMC_LIT218_6}};
#define _OMC_LIT218 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT218)
#define _OMC_LIT219_data "events"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT219,6,_OMC_LIT219_data);
#define _OMC_LIT219 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT219)
#define _OMC_LIT220_data "Turns on/off events handling."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT220,29,_OMC_LIT220_data);
#define _OMC_LIT220 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT220)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT221,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT220}};
#define _OMC_LIT221 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT221)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT222,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5)),_OMC_LIT219,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT221}};
#define _OMC_LIT222 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT222)
#define _OMC_LIT223_data "listArrayLiteral"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT223,16,_OMC_LIT223_data);
#define _OMC_LIT223 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT223)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT224,2,31) {&DAE_Exp_LIST__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT224 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT224)
#define _OMC_LIT225_data "function replaceLiteralExp failed. Falling back to not replacing "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT225,65,_OMC_LIT225_data);
#define _OMC_LIT225 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT225)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT226_6,0.0);
#define _OMC_LIT226_6 MMC_REFREALLIT(_OMC_LIT_STRUCT226_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT226,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1258)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1258)),MMC_IMMEDIATE(MMC_TAGFIXNUM(50)),_OMC_LIT226_6}};
#define _OMC_LIT226 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT226)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT227,1,6) {&ErrorTypes_MessageType_SYMBOLIC__desc,}};
#define _OMC_LIT227 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT227)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT228,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT228 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT228)
#define _OMC_LIT229_data "%s has a function pointer as input. OpenModelica does not support this feature in the interactive environment. Suggested workaround: Call this function with the arguments you want from another function (that does not have function pointer input). Then call that function from the interactive environment instead."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT229,312,_OMC_LIT229_data);
#define _OMC_LIT229 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT229)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT230,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT229}};
#define _OMC_LIT230 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT230)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT231,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(142)),_OMC_LIT227,_OMC_LIT228,_OMC_LIT230}};
#define _OMC_LIT231 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,1,6) {&SimCodeFunction_SimExtArg_SIMNOEXTARG__desc,}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT233,1,5) {&DAE_Const_C__VAR__desc,}};
#define _OMC_LIT233 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT233)
#define _OMC_LIT234_data "function daeInOutSimVar failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT234,31,_OMC_LIT234_data);
#define _OMC_LIT234 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT234)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT235_6,0.0);
#define _OMC_LIT235_6 MMC_REFREALLIT(_OMC_LIT_STRUCT235_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT235,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(896)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(896)),MMC_IMMEDIATE(MMC_TAGFIXNUM(81)),_OMC_LIT235_6}};
#define _OMC_LIT235 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT235)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT236,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT236 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT236)
#define _OMC_LIT237_data "function elaborateFunction failed for function: \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT237,49,_OMC_LIT237_data);
#define _OMC_LIT237 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT237)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT238_6,0.0);
#define _OMC_LIT238_6 MMC_REFREALLIT(_OMC_LIT_STRUCT238_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT238,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT1,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(807)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(807)),MMC_IMMEDIATE(MMC_TAGFIXNUM(129)),_OMC_LIT238_6}};
#define _OMC_LIT238 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT238)
#define _OMC_LIT239_data "sin"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT239,3,_OMC_LIT239_data);
#define _OMC_LIT239 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT239)
#define _OMC_LIT240_data "cos"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT240,3,_OMC_LIT240_data);
#define _OMC_LIT240 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT240)
#define _OMC_LIT241_data "tan"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT241,3,_OMC_LIT241_data);
#define _OMC_LIT241 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT241)
#define _OMC_LIT242_data "asin"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT242,4,_OMC_LIT242_data);
#define _OMC_LIT242 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT242)
#define _OMC_LIT243_data "acos"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT243,4,_OMC_LIT243_data);
#define _OMC_LIT243 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT243)
#define _OMC_LIT244_data "atan"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT244,4,_OMC_LIT244_data);
#define _OMC_LIT244 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT244)
#define _OMC_LIT245_data "atan2"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT245,5,_OMC_LIT245_data);
#define _OMC_LIT245 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT245)
#define _OMC_LIT246_data "sinh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT246,4,_OMC_LIT246_data);
#define _OMC_LIT246 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT246)
#define _OMC_LIT247_data "cosh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT247,4,_OMC_LIT247_data);
#define _OMC_LIT247 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT247)
#define _OMC_LIT248_data "tanh"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT248,4,_OMC_LIT248_data);
#define _OMC_LIT248 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT248)
#define _OMC_LIT249_data "exp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT249,3,_OMC_LIT249_data);
#define _OMC_LIT249 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT249)
#define _OMC_LIT250_data "log10"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT250,5,_OMC_LIT250_data);
#define _OMC_LIT250 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT250)
#define _OMC_LIT251_data "sqrt"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT251,4,_OMC_LIT251_data);
#define _OMC_LIT251 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT251)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT252,2,1) {_OMC_LIT251,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT252 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT252)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT253,2,1) {_OMC_LIT250,_OMC_LIT252}};
#define _OMC_LIT253 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT253)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT254,2,1) {_OMC_LIT189,_OMC_LIT253}};
#define _OMC_LIT254 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT254)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT255,2,1) {_OMC_LIT249,_OMC_LIT254}};
#define _OMC_LIT255 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT255)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT256,2,1) {_OMC_LIT248,_OMC_LIT255}};
#define _OMC_LIT256 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT256)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT257,2,1) {_OMC_LIT247,_OMC_LIT256}};
#define _OMC_LIT257 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT257)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT258,2,1) {_OMC_LIT246,_OMC_LIT257}};
#define _OMC_LIT258 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT258)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT259,2,1) {_OMC_LIT245,_OMC_LIT258}};
#define _OMC_LIT259 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT259)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT260,2,1) {_OMC_LIT244,_OMC_LIT259}};
#define _OMC_LIT260 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT260)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT261,2,1) {_OMC_LIT243,_OMC_LIT260}};
#define _OMC_LIT261 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT261)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT262,2,1) {_OMC_LIT242,_OMC_LIT261}};
#define _OMC_LIT262 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT262)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT263,2,1) {_OMC_LIT241,_OMC_LIT262}};
#define _OMC_LIT263 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT263)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT264,2,1) {_OMC_LIT240,_OMC_LIT263}};
#define _OMC_LIT264 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT264)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT265,2,1) {_OMC_LIT239,_OMC_LIT264}};
#define _OMC_LIT265 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT265)
#define _OMC_LIT266_data "builtin"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT266,7,_OMC_LIT266_data);
#define _OMC_LIT266 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT266)
#define _OMC_LIT267_data "C"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT267,1,_OMC_LIT267_data);
#define _OMC_LIT267 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT267)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT268,2,19) {&DAE_Type_T__ANYTYPE__desc,MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT268 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT268)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT269,2,4) {&DAE_Type_T__REAL__desc,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT269 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT269)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT270,2,31) {&DAE_Operator_GREATEREQ__desc,_OMC_LIT269}};
#define _OMC_LIT270 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT270)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT271,0.0);
#define _OMC_LIT271 MMC_REFREALLIT(_OMC_LIT_STRUCT271)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT272,2,4) {&DAE_Exp_RCONST__desc,_OMC_LIT271}};
#define _OMC_LIT272 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT272)
#define _OMC_LIT273_data "NO_LIB"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT273,6,_OMC_LIT273_data);
#define _OMC_LIT273 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT273)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT274,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT15,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT271}};
#define _OMC_LIT274 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT274)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT275,1,4) {&DAE_ComponentPrefix_NOCOMPPRE__desc,}};
#define _OMC_LIT275 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT275)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT276,8,3) {&DAE_ElementSource_SOURCE__desc,_OMC_LIT274,MMC_REFSTRUCTLIT(mmc_nil),_OMC_LIT275,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT276 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT276)
#define _OMC_LIT277_data "nfScalarize"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT277,11,_OMC_LIT277_data);
#define _OMC_LIT277 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT277)
#define _OMC_LIT278_data "Run scalarization in NF, default true."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT278,38,_OMC_LIT278_data);
#define _OMC_LIT278 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT278)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT279,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT278}};
#define _OMC_LIT279 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT279)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT280,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(168)),_OMC_LIT277,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT279}};
#define _OMC_LIT280 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT280)
#include "util/modelica.h"
#include "SimCodeFunctionUtil_includes.h"
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_variableString(threadData_t *threadData, modelica_metatype _var);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_variableString,2,0) {(void*) boxptr_SimCodeFunctionUtil_variableString,0}};
#define boxvar_SimCodeFunctionUtil_variableString MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_variableString)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_aliasRecordDeclarations2(threadData_t *threadData, modelica_string _str, modelica_metatype _path, modelica_metatype _inHt, modelica_metatype *out_ht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_aliasRecordDeclarations2,2,0) {(void*) boxptr_SimCodeFunctionUtil_aliasRecordDeclarations2,0}};
#define boxvar_SimCodeFunctionUtil_aliasRecordDeclarations2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_aliasRecordDeclarations2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_aliasRecordDeclarations(threadData_t *threadData, modelica_metatype _inDecl, modelica_metatype _inHt, modelica_metatype *out_ht);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_aliasRecordDeclarations,2,0) {(void*) boxptr_SimCodeFunctionUtil_aliasRecordDeclarations,0}};
#define boxvar_SimCodeFunctionUtil_aliasRecordDeclarations MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_aliasRecordDeclarations)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _itpl, modelica_metatype *out_otpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths,2,0) {(void*) boxptr_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths,0}};
#define boxvar_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_addDestructor2(threadData_t *threadData, modelica_metatype _path, modelica_string _pathstr, modelica_metatype _inHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_addDestructor2,2,0) {(void*) boxptr_SimCodeFunctionUtil_addDestructor2,0}};
#define boxvar_SimCodeFunctionUtil_addDestructor2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_addDestructor2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_addDestructor(threadData_t *threadData, modelica_metatype _func, modelica_metatype _inHt);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_addDestructor,2,0) {(void*) boxptr_SimCodeFunctionUtil_addDestructor,0}};
#define boxvar_SimCodeFunctionUtil_addDestructor MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_addDestructor)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getCalledFunctionsInFunctions(threadData_t *threadData, modelica_metatype _paths, modelica_metatype _inHt, modelica_metatype _funcs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getCalledFunctionsInFunctions,2,0) {(void*) boxptr_SimCodeFunctionUtil_getCalledFunctionsInFunctions,0}};
#define boxvar_SimCodeFunctionUtil_getCalledFunctionsInFunctions MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getCalledFunctionsInFunctions)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_generateExtFunctionDynamicLoad(threadData_t *threadData, modelica_metatype _inMod);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionDynamicLoad(threadData_t *threadData, modelica_metatype _inMod);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionDynamicLoad,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionDynamicLoad,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionDynamicLoad MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionDynamicLoad)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr(threadData_t *threadData, modelica_metatype _inMod);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr(threadData_t *threadData, modelica_string _target, modelica_metatype _inMod, modelica_metatype *out_names);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getLibraryStringInGccFormat(threadData_t *threadData, modelica_metatype _exp, modelica_metatype *out_names);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getLibraryStringInGccFormat,2,0) {(void*) boxptr_SimCodeFunctionUtil_getLibraryStringInGccFormat,0}};
#define boxvar_SimCodeFunctionUtil_getLibraryStringInGccFormat MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getLibraryStringInGccFormat)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getLibraryStringInMSVCFormat(threadData_t *threadData, modelica_metatype _exp, modelica_metatype *out_names);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getLibraryStringInMSVCFormat,2,0) {(void*) boxptr_SimCodeFunctionUtil_getLibraryStringInMSVCFormat,0}};
#define boxvar_SimCodeFunctionUtil_getLibraryStringInMSVCFormat MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getLibraryStringInMSVCFormat)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData_t *threadData, modelica_boolean _add, modelica_string _dir, modelica_boolean _isLinux, modelica_metatype _inLibs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData_t *threadData, modelica_metatype _add, modelica_metatype _dir, modelica_metatype _isLinux, modelica_metatype _inLibs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inMod);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths)
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_userCompiledBinariesDirectory(threadData_t *threadData, modelica_metatype _path);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_userCompiledBinariesDirectory,2,0) {(void*) boxptr_SimCodeFunctionUtil_userCompiledBinariesDirectory,0}};
#define boxvar_SimCodeFunctionUtil_userCompiledBinariesDirectory MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_userCompiledBinariesDirectory)
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_getGerneralTarget(threadData_t *threadData, modelica_string _target);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getGerneralTarget,2,0) {(void*) boxptr_SimCodeFunctionUtil_getGerneralTarget,0}};
#define boxvar_SimCodeFunctionUtil_getGerneralTarget MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getGerneralTarget)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2(threadData_t *threadData, modelica_string _dir, modelica_boolean _isLinux, modelica_string _target, modelica_metatype _inLibs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2(threadData_t *threadData, modelica_metatype _dir, modelica_metatype _isLinux, modelica_metatype _target, modelica_metatype _inLibs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inMod, modelica_metatype _inLibs, modelica_metatype *out_installDirs, modelica_metatype *out_resources);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getLinkerLibraryPaths(threadData_t *threadData, modelica_string _uri, modelica_metatype _path, modelica_metatype _inLibs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getLinkerLibraryPaths,2,0) {(void*) boxptr_SimCodeFunctionUtil_getLinkerLibraryPaths,0}};
#define boxvar_SimCodeFunctionUtil_getLinkerLibraryPaths MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getLinkerLibraryPaths)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inMod, modelica_metatype _includes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags)
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_lookForExtFunctionLibrary(threadData_t *threadData, modelica_metatype _names, modelica_metatype _dirs, modelica_string _name, modelica_metatype _resources, modelica_metatype _path, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_lookForExtFunctionLibrary,2,0) {(void*) boxptr_SimCodeFunctionUtil_lookForExtFunctionLibrary,0}};
#define boxvar_SimCodeFunctionUtil_lookForExtFunctionLibrary MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_lookForExtFunctionLibrary)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludes(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inAbsynAnnotationOption, modelica_metatype _info, modelica_metatype *out_includeDirs, modelica_metatype *out_libs, modelica_metatype *out_paths, modelica_boolean *out_dynamcLoad);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionIncludes(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inAbsynAnnotationOption, modelica_metatype _info, modelica_metatype *out_includeDirs, modelica_metatype *out_libs, modelica_metatype *out_paths, modelica_metatype *out_dynamcLoad);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludes,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateExtFunctionIncludes,0}};
#define boxvar_SimCodeFunctionUtil_generateExtFunctionIncludes MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateExtFunctionIncludes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords(threadData_t *threadData, modelica_metatype _inExpl, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords,0}};
#define boxvar_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateNestedRecordDeclarations(threadData_t *threadData, modelica_metatype _inRecordTypes, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateNestedRecordDeclarations,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateNestedRecordDeclarations,0}};
#define boxvar_SimCodeFunctionUtil_elaborateNestedRecordDeclarations MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateNestedRecordDeclarations)
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_generateVarName(threadData_t *threadData, modelica_metatype _inVar);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateVarName,2,0) {(void*) boxptr_SimCodeFunctionUtil_generateVarName,0}};
#define boxvar_SimCodeFunctionUtil_generateVarName MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_generateVarName)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_compareVariable(threadData_t *threadData, modelica_metatype _v1, modelica_metatype _v2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_compareVariable(threadData_t *threadData, modelica_metatype _v1, modelica_metatype _v2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_compareVariable,2,0) {(void*) boxptr_SimCodeFunctionUtil_compareVariable,0}};
#define boxvar_SimCodeFunctionUtil_compareVariable MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_compareVariable)
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_variableName(threadData_t *threadData, modelica_metatype _v);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_variableName,2,0) {(void*) boxptr_SimCodeFunctionUtil_variableName,0}};
#define boxvar_SimCodeFunctionUtil_variableName MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_variableName)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_scodeParallelismToDAEParallelism(threadData_t *threadData, modelica_metatype _inParallelism);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_scodeParallelismToDAEParallelism,2,0) {(void*) boxptr_SimCodeFunctionUtil_scodeParallelismToDAEParallelism,0}};
#define boxvar_SimCodeFunctionUtil_scodeParallelismToDAEParallelism MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_scodeParallelismToDAEParallelism)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_checkSourceAndGetBindingExp(threadData_t *threadData, modelica_metatype _inBinding);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_checkSourceAndGetBindingExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_checkSourceAndGetBindingExp,0}};
#define boxvar_SimCodeFunctionUtil_checkSourceAndGetBindingExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_checkSourceAndGetBindingExp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration(threadData_t *threadData, modelica_metatype _bind);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration(threadData_t *threadData, modelica_metatype _bind);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration,2,0) {(void*) boxptr_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration,0}};
#define boxvar_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration)
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_checkBindingsandGetConstructorName(threadData_t *threadData, modelica_string _rec_name, modelica_metatype _vars, modelica_boolean *out_is_default);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_checkBindingsandGetConstructorName(threadData_t *threadData, modelica_metatype _rec_name, modelica_metatype _vars, modelica_metatype *out_is_default);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_checkBindingsandGetConstructorName,2,0) {(void*) boxptr_SimCodeFunctionUtil_checkBindingsandGetConstructorName,0}};
#define boxvar_SimCodeFunctionUtil_checkBindingsandGetConstructorName MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_checkBindingsandGetConstructorName)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_typesVar(threadData_t *threadData, modelica_metatype _inTypesVar);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_typesVar,2,0) {(void*) boxptr_SimCodeFunctionUtil_typesVar,0}};
#define boxvar_SimCodeFunctionUtil_typesVar MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_typesVar)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_typesVarNoBinding(threadData_t *threadData, modelica_metatype _inTypesVar);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_typesVarNoBinding,2,0) {(void*) boxptr_SimCodeFunctionUtil_typesVarNoBinding,0}};
#define boxvar_SimCodeFunctionUtil_typesVarNoBinding MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_typesVarNoBinding)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord(threadData_t *threadData, modelica_metatype _inRecordType, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord,0}};
#define boxvar_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getCrefFromExp(threadData_t *threadData, modelica_metatype _e);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getCrefFromExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_getCrefFromExp,0}};
#define boxvar_SimCodeFunctionUtil_getCrefFromExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getCrefFromExp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_useZerocrossing(threadData_t *threadData);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_useZerocrossing(threadData_t *threadData);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_useZerocrossing,2,0) {(void*) boxptr_SimCodeFunctionUtil_useZerocrossing,0}};
#define boxvar_SimCodeFunctionUtil_useZerocrossing MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_useZerocrossing)
PROTECTED_FUNCTION_STATIC modelica_integer omc_SimCodeFunctionUtil_filterNg(threadData_t *threadData, modelica_integer _ng);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_filterNg(threadData_t *threadData, modelica_metatype _ng);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_filterNg,2,0) {(void*) boxptr_SimCodeFunctionUtil_filterNg,0}};
#define boxvar_SimCodeFunctionUtil_filterNg MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_filterNg)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isDirectionNotInputNotOutput(threadData_t *threadData, modelica_metatype _inVarDirection);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isDirectionNotInputNotOutput(threadData_t *threadData, modelica_metatype _inVarDirection);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isDirectionNotInputNotOutput,2,0) {(void*) boxptr_SimCodeFunctionUtil_isDirectionNotInputNotOutput,0}};
#define boxvar_SimCodeFunctionUtil_isDirectionNotInputNotOutput MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isDirectionNotInputNotOutput)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isDirectionNotInput(threadData_t *threadData, modelica_metatype _inVarDirection);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isDirectionNotInput(threadData_t *threadData, modelica_metatype _inVarDirection);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isDirectionNotInput,2,0) {(void*) boxptr_SimCodeFunctionUtil_isDirectionNotInput,0}};
#define boxvar_SimCodeFunctionUtil_isDirectionNotInput MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isDirectionNotInput)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData_t *threadData, modelica_metatype _inVarKind);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData_t *threadData, modelica_metatype _inVarKind);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isVarKindVarOrParameter,2,0) {(void*) boxptr_SimCodeFunctionUtil_isVarKindVarOrParameter,0}};
#define boxvar_SimCodeFunctionUtil_isVarKindVarOrParameter MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isVarKindVarOrParameter)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isVarNotInputNotOutput(threadData_t *threadData, modelica_metatype _inElement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isVarNotInputNotOutput(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isVarNotInputNotOutput,2,0) {(void*) boxptr_SimCodeFunctionUtil_isVarNotInputNotOutput,0}};
#define boxvar_SimCodeFunctionUtil_isVarNotInputNotOutput MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isVarNotInputNotOutput)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isVarQ(threadData_t *threadData, modelica_metatype _inElement);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isVarQ(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isVarQ,2,0) {(void*) boxptr_SimCodeFunctionUtil_isVarQ,0}};
#define boxvar_SimCodeFunctionUtil_isVarQ MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isVarQ)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_matchMetarecordCalls(threadData_t *threadData, modelica_metatype _e, modelica_metatype _acc, modelica_metatype *out_outExps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_matchMetarecordCalls,2,0) {(void*) boxptr_SimCodeFunctionUtil_matchMetarecordCalls,0}};
#define boxvar_SimCodeFunctionUtil_matchMetarecordCalls MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_matchMetarecordCalls)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData_t *threadData, modelica_metatype _inVars, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarations,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateRecordDeclarations,0}};
#define boxvar_SimCodeFunctionUtil_elaborateRecordDeclarations MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarations)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes(threadData_t *threadData, modelica_metatype _inTypes, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes,0}};
#define boxvar_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes)
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isLiteralExp(threadData_t *threadData, modelica_metatype _iexp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isLiteralExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_isLiteralExp,0}};
#define boxvar_SimCodeFunctionUtil_isLiteralExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isLiteralExp)
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isLiteralArrayExp(threadData_t *threadData, modelica_metatype _iexp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isLiteralArrayExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_isLiteralArrayExp,0}};
#define boxvar_SimCodeFunctionUtil_isLiteralArrayExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isLiteralArrayExp)
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isTrivialLiteralExp(threadData_t *threadData, modelica_metatype _exp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isTrivialLiteralExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_isTrivialLiteralExp,0}};
#define boxvar_SimCodeFunctionUtil_isTrivialLiteralExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isTrivialLiteralExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_listToCons2(threadData_t *threadData, modelica_metatype _ies);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_listToCons2,2,0) {(void*) boxptr_SimCodeFunctionUtil_listToCons2,0}};
#define boxvar_SimCodeFunctionUtil_listToCons2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_listToCons2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_listToCons(threadData_t *threadData, modelica_metatype _e);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_listToCons,2,0) {(void*) boxptr_SimCodeFunctionUtil_listToCons,0}};
#define boxvar_SimCodeFunctionUtil_listToCons MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_listToCons)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_replaceLiteralExp2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_replaceLiteralExp2,2,0) {(void*) boxptr_SimCodeFunctionUtil_replaceLiteralExp2,0}};
#define boxvar_SimCodeFunctionUtil_replaceLiteralExp2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_replaceLiteralExp2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_replaceLiteralExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_replaceLiteralExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_replaceLiteralExp,0}};
#define boxvar_SimCodeFunctionUtil_replaceLiteralExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_replaceLiteralExp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_replaceLiteralArrayExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_replaceLiteralArrayExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_replaceLiteralArrayExp,2,0) {(void*) boxptr_SimCodeFunctionUtil_replaceLiteralArrayExp,0}};
#define boxvar_SimCodeFunctionUtil_replaceLiteralArrayExp MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_replaceLiteralArrayExp)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isParallelArrayVar(threadData_t *threadData, modelica_metatype _var);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isParallelArrayVar(threadData_t *threadData, modelica_metatype _var);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isParallelArrayVar,2,0) {(void*) boxptr_SimCodeFunctionUtil_isParallelArrayVar,0}};
#define boxvar_SimCodeFunctionUtil_isParallelArrayVar MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isParallelArrayVar)
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isBoxedArg(threadData_t *threadData, modelica_metatype _var);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isBoxedArg,2,0) {(void*) boxptr_SimCodeFunctionUtil_isBoxedArg,0}};
#define boxvar_SimCodeFunctionUtil_isBoxedArg MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isBoxedArg)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isFunctionPtr(threadData_t *threadData, modelica_metatype _var);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isFunctionPtr(threadData_t *threadData, modelica_metatype _var);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isFunctionPtr,2,0) {(void*) boxptr_SimCodeFunctionUtil_isFunctionPtr,0}};
#define boxvar_SimCodeFunctionUtil_isFunctionPtr MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isFunctionPtr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateStatement(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateStatement,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateStatement,0}};
#define boxvar_SimCodeFunctionUtil_elaborateStatement MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateStatement)
PROTECTED_FUNCTION_STATIC modelica_integer omc_SimCodeFunctionUtil_findIndexInList(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _outVars, modelica_integer _inCurrentIndex, modelica_boolean *out_hasBinding);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_findIndexInList(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _outVars, modelica_metatype _inCurrentIndex, modelica_metatype *out_hasBinding);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_findIndexInList,2,0) {(void*) boxptr_SimCodeFunctionUtil_findIndexInList,0}};
#define boxvar_SimCodeFunctionUtil_findIndexInList MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_findIndexInList)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_assignOutputIndex(threadData_t *threadData, modelica_metatype _simExtArgIn, modelica_metatype _outVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_assignOutputIndex,2,0) {(void*) boxptr_SimCodeFunctionUtil_assignOutputIndex,0}};
#define boxvar_SimCodeFunctionUtil_assignOutputIndex MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_assignOutputIndex)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_fixOutputIndex(threadData_t *threadData, modelica_metatype _outVars, modelica_metatype _simExtArgsIn, modelica_metatype _extReturnIn, modelica_metatype *out_extReturnOut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_fixOutputIndex,2,0) {(void*) boxptr_SimCodeFunctionUtil_fixOutputIndex,0}};
#define boxvar_SimCodeFunctionUtil_fixOutputIndex MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_fixOutputIndex)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_extArgsToSimExtArgs(threadData_t *threadData, modelica_metatype _extArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_extArgsToSimExtArgs,2,0) {(void*) boxptr_SimCodeFunctionUtil_extArgsToSimExtArgs,0}};
#define boxvar_SimCodeFunctionUtil_extArgsToSimExtArgs MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_extArgsToSimExtArgs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_daeInOutSimVar(threadData_t *threadData, modelica_metatype _inElement);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_daeInOutSimVar,2,0) {(void*) boxptr_SimCodeFunctionUtil_daeInOutSimVar,0}};
#define boxvar_SimCodeFunctionUtil_daeInOutSimVar MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_daeInOutSimVar)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_typesSimFunctionArg(threadData_t *threadData, modelica_metatype _inFuncArg, modelica_metatype _binding);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_typesSimFunctionArg,2,0) {(void*) boxptr_SimCodeFunctionUtil_typesSimFunctionArg,0}};
#define boxvar_SimCodeFunctionUtil_typesSimFunctionArg MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_typesSimFunctionArg)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateFunction(threadData_t *threadData, modelica_metatype _program, modelica_metatype _inElement, modelica_metatype _inRecordTypes, modelica_metatype _inRecordDecls, modelica_metatype _inIncludes, modelica_metatype _inIncludeDirs, modelica_metatype _inLibs, modelica_metatype _inLibPaths, modelica_metatype *out_outRecordTypes, modelica_metatype *out_outRecordDecls, modelica_metatype *out_outIncludes, modelica_metatype *out_outIncludeDirs, modelica_metatype *out_outLibs, modelica_metatype *out_outLibPaths);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateFunction,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateFunction,0}};
#define boxvar_SimCodeFunctionUtil_elaborateFunction MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateFunction)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateFunctions2(threadData_t *threadData, modelica_metatype _program, modelica_metatype _daeElements, modelica_metatype _inFunctions, modelica_metatype _inRecordTypes, modelica_metatype _inDecls, modelica_metatype _inIncludes, modelica_metatype _inIncludeDirs, modelica_metatype _inLibs, modelica_metatype _inPaths, modelica_metatype *out_outRecordTypes, modelica_metatype *out_outDecls, modelica_metatype *out_outIncludes, modelica_metatype *out_outIncludeDirs, modelica_metatype *out_outLibs, modelica_metatype *out_outLibsPaths);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateFunctions2,2,0) {(void*) boxptr_SimCodeFunctionUtil_elaborateFunctions2,0}};
#define boxvar_SimCodeFunctionUtil_elaborateFunctions2 MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_elaborateFunctions2)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isRecordDeclEqual(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isRecordDeclEqual(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isRecordDeclEqual,2,0) {(void*) boxptr_SimCodeFunctionUtil_isRecordDeclEqual,0}};
#define boxvar_SimCodeFunctionUtil_isRecordDeclEqual MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isRecordDeclEqual)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isRecordDecl(threadData_t *threadData, modelica_metatype _decl, modelica_string _name);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isRecordDecl(threadData_t *threadData, modelica_metatype _decl, modelica_metatype _name);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isRecordDecl,2,0) {(void*) boxptr_SimCodeFunctionUtil_isRecordDecl,0}};
#define boxvar_SimCodeFunctionUtil_isRecordDecl MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isRecordDecl)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getRecordDependenciesFromType(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _allDecls);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getRecordDependenciesFromType,2,0) {(void*) boxptr_SimCodeFunctionUtil_getRecordDependenciesFromType,0}};
#define boxvar_SimCodeFunctionUtil_getRecordDependenciesFromType MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getRecordDependenciesFromType)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getVarType(threadData_t *threadData, modelica_metatype _var);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getVarType,2,0) {(void*) boxptr_SimCodeFunctionUtil_getVarType,0}};
#define boxvar_SimCodeFunctionUtil_getVarType MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getVarType)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getRecordDependencies(threadData_t *threadData, modelica_metatype _decl, modelica_metatype _allDecls);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getRecordDependencies,2,0) {(void*) boxptr_SimCodeFunctionUtil_getRecordDependencies,0}};
#define boxvar_SimCodeFunctionUtil_getRecordDependencies MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_getRecordDependencies)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_orderRecordDecls(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_orderRecordDecls(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_orderRecordDecls,2,0) {(void*) boxptr_SimCodeFunctionUtil_orderRecordDecls,0}};
#define boxvar_SimCodeFunctionUtil_orderRecordDecls MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_orderRecordDecls)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isMatrixExpansion(threadData_t *threadData, modelica_metatype _rows, modelica_metatype _inCref, modelica_integer _rowIndex, modelica_integer _colIndex);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isMatrixExpansion(threadData_t *threadData, modelica_metatype _rows, modelica_metatype _inCref, modelica_metatype _rowIndex, modelica_metatype _colIndex);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isMatrixExpansion,2,0) {(void*) boxptr_SimCodeFunctionUtil_isMatrixExpansion,0}};
#define boxvar_SimCodeFunctionUtil_isMatrixExpansion MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isMatrixExpansion)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isArrayExpansion(threadData_t *threadData, modelica_metatype _inArrayElems, modelica_metatype _inCref, modelica_integer _index);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isArrayExpansion(threadData_t *threadData, modelica_metatype _inArrayElems, modelica_metatype _inCref, modelica_metatype _index);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isArrayExpansion,2,0) {(void*) boxptr_SimCodeFunctionUtil_isArrayExpansion,0}};
#define boxvar_SimCodeFunctionUtil_isArrayExpansion MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isArrayExpansion)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isNotProtected(threadData_t *threadData, modelica_metatype _simVar);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isNotProtected(threadData_t *threadData, modelica_metatype _simVar);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isNotProtected,2,0) {(void*) boxptr_SimCodeFunctionUtil_isNotProtected,0}};
#define boxvar_SimCodeFunctionUtil_isNotProtected MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_isNotProtected)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_subsToScalar(threadData_t *threadData, modelica_metatype _inExpSubscriptLst);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_subsToScalar(threadData_t *threadData, modelica_metatype _inExpSubscriptLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_subsToScalar,2,0) {(void*) boxptr_SimCodeFunctionUtil_subsToScalar,0}};
#define boxvar_SimCodeFunctionUtil_subsToScalar MMC_REFSTRUCTLIT(boxvar_lit_SimCodeFunctionUtil_subsToScalar)
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_appendCurrentCrefPrefix(threadData_t *threadData, modelica_metatype _context, modelica_string _in_cref_pref)
{
modelica_metatype _out_context = NULL;
modelica_string _cref_pref = NULL;
modelica_boolean _prl;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _context;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp8 = mmc_unbox_integer(tmpMeta7);
_cref_pref = tmpMeta6;
_prl = tmp8;
tmpMeta9 = stringAppend(_cref_pref,_in_cref_pref);
tmpMeta10 = mmc_mk_box3(4, &SimCodeFunction_Context_FUNCTION__CONTEXT__desc, tmpMeta9, mmc_mk_boolean(_prl));
tmpMeta1 = tmpMeta10;
goto tmp3_done;
}
case 1: {
omc_Error_addInternalError(threadData, _OMC_LIT0, _OMC_LIT2);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_out_context = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _out_context;
}
DLLExport
modelica_string omc_SimCodeFunctionUtil_getCurrentCrefPrefix(threadData_t *threadData, modelica_metatype _context)
{
modelica_string _cref_pref = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _context;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_cref_pref = tmpMeta6;
tmp1 = _cref_pref;
goto tmp3_done;
}
case 1: {
omc_Error_addInternalError(threadData, _OMC_LIT3, _OMC_LIT4);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_cref_pref = tmp1;
_return: OMC_LABEL_UNUSED
return _cref_pref;
}
DLLExport
modelica_string omc_SimCodeFunctionUtil_generateSubPalceholders(threadData_t *threadData, modelica_metatype _cr)
{
modelica_string _outdef = NULL;
modelica_metatype _dims = NULL;
modelica_integer _nrdims;
modelica_metatype _idxstrlst = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_dims = omc_ComponentReference_crefDims(threadData, _cr);
_nrdims = listLength(_dims);
_idxstrlst = omc_List_map(threadData, omc_List_intRange(threadData, _nrdims), boxvar_intString);
_outdef = stringDelimitList(omc_List_threadMap(threadData, omc_List_fill(threadData, _OMC_LIT5, _nrdims), _idxstrlst, boxvar_stringAppend), _OMC_LIT6);
_return: OMC_LABEL_UNUSED
return _outdef;
}
DLLExport
modelica_string omc_SimCodeFunctionUtil_twodigit(threadData_t *threadData, modelica_integer _i)
{
modelica_string _outS = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _s = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if((!(_i < ((modelica_integer) 10))))
{
goto goto_2;
}
_s = intString(_i);
tmpMeta6 = stringAppend(_OMC_LIT7,_s);
tmp1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
tmp1 = intString(_i);
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:;
}
}
_outS = tmp1;
_return: OMC_LABEL_UNUSED
return _outS;
}
modelica_metatype boxptr_SimCodeFunctionUtil_twodigit(threadData_t *threadData, modelica_metatype _i)
{
modelica_integer tmp1;
modelica_string _outS = NULL;
tmp1 = mmc_unbox_integer(_i);
_outS = omc_SimCodeFunctionUtil_twodigit(threadData, tmp1);
return _outS;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_isParallelFunctionContext(threadData_t *threadData, modelica_metatype _context)
{
modelica_boolean _outBool;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _context;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmp1 = mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_context), 3))));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBool = tmp1;
_return: OMC_LABEL_UNUSED
return _outBool;
}
modelica_metatype boxptr_SimCodeFunctionUtil_isParallelFunctionContext(threadData_t *threadData, modelica_metatype _context)
{
modelica_boolean _outBool;
modelica_metatype out_outBool;
_outBool = omc_SimCodeFunctionUtil_isParallelFunctionContext(threadData, _context);
out_outBool = mmc_mk_icon(_outBool);
return out_outBool;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_varName(threadData_t *threadData, modelica_metatype _var)
{
modelica_metatype _name = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _var;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
_name = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _name;
}
DLLExport
modelica_integer omc_SimCodeFunctionUtil_varIndex(threadData_t *threadData, modelica_metatype _var)
{
modelica_integer _index;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _var;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
tmp3 = mmc_unbox_integer(tmpMeta2);
_index = tmp3;
_return: OMC_LABEL_UNUSED
return _index;
}
modelica_metatype boxptr_SimCodeFunctionUtil_varIndex(threadData_t *threadData, modelica_metatype _var)
{
modelica_integer _index;
modelica_metatype out_index;
_index = omc_SimCodeFunctionUtil_varIndex(threadData, _var);
out_index = mmc_mk_icon(_index);
return out_index;
}
DLLExport
modelica_integer omc_SimCodeFunctionUtil_codegenPeekTryThrowIndex(threadData_t *threadData)
{
modelica_integer _i;
modelica_metatype _lst = NULL;
modelica_integer tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_lst = getGlobalRoot(((modelica_integer) 1));
{
modelica_metatype tmp4_1;
tmp4_1 = _lst;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmp8 = mmc_unbox_integer(tmpMeta6);
_i = tmp8;
tmp1 = _i;
goto tmp3_done;
}
case 1: {
tmp1 = ((modelica_integer) -1);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_i = tmp1;
_return: OMC_LABEL_UNUSED
return _i;
}
modelica_metatype boxptr_SimCodeFunctionUtil_codegenPeekTryThrowIndex(threadData_t *threadData)
{
modelica_integer _i;
modelica_metatype out_i;
_i = omc_SimCodeFunctionUtil_codegenPeekTryThrowIndex(threadData);
out_i = mmc_mk_icon(_i);
return out_i;
}
DLLExport
void omc_SimCodeFunctionUtil_codegenPopTryThrowIndex(threadData_t *threadData)
{
modelica_metatype _lst = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_lst = getGlobalRoot(((modelica_integer) 1));
tmpMeta1 = _lst;
if (listEmpty(tmpMeta1)) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_CAR(tmpMeta1);
tmpMeta3 = MMC_CDR(tmpMeta1);
_lst = tmpMeta3;
setGlobalRoot(((modelica_integer) 1), _lst);
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
void omc_SimCodeFunctionUtil_codegenPushTryThrowIndex(threadData_t *threadData, modelica_integer _i)
{
modelica_metatype _lst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_lst = getGlobalRoot(((modelica_integer) 1));
tmpMeta1 = mmc_mk_cons(mmc_mk_integer(_i), _lst);
setGlobalRoot(((modelica_integer) 1), tmpMeta1);
_return: OMC_LABEL_UNUSED
return;
}
void boxptr_SimCodeFunctionUtil_codegenPushTryThrowIndex(threadData_t *threadData, modelica_metatype _i)
{
modelica_integer tmp1;
tmp1 = mmc_unbox_integer(_i);
omc_SimCodeFunctionUtil_codegenPushTryThrowIndex(threadData, tmp1);
return;
}
DLLExport
void omc_SimCodeFunctionUtil_codegenResetTryThrowIndex(threadData_t *threadData)
{
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
setGlobalRoot(((modelica_integer) 1), tmpMeta1);
_return: OMC_LABEL_UNUSED
return;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_createMakefileParams(threadData_t *threadData, modelica_metatype _includes, modelica_metatype _libs, modelica_metatype _libPaths, modelica_boolean _isFunction, modelica_boolean _isFMU)
{
modelica_metatype _makefileParams = NULL;
modelica_string _omhome = NULL;
modelica_string _ccompiler = NULL;
modelica_string _cxxcompiler = NULL;
modelica_string _linker = NULL;
modelica_string _exeext = NULL;
modelica_string _dllext = NULL;
modelica_string _cflags = NULL;
modelica_string _ldflags = NULL;
modelica_string _rtlibs = NULL;
modelica_string _platform = NULL;
modelica_string _fopenmp = NULL;
modelica_string _compileDir = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ccompiler = ((stringEqual(omc_Config_simCodeTarget(threadData), _OMC_LIT8))?_OMC_LIT9:(omc_Flags_isSet(threadData, _OMC_LIT13)?omc_System_getOMPCCompiler(threadData):omc_System_getCCompiler(threadData)));
_cxxcompiler = ((stringEqual(omc_Config_simCodeTarget(threadData), _OMC_LIT8))?_OMC_LIT9:omc_System_getCXXCompiler(threadData));
_linker = ((stringEqual(omc_Config_simCodeTarget(threadData), _OMC_LIT8))?_OMC_LIT9:omc_System_getLinker(threadData));
_exeext = ((stringEqual(omc_Config_simCodeTarget(threadData), _OMC_LIT8))?_OMC_LIT14:_OMC_LIT15);
_dllext = _OMC_LIT15;
_omhome = omc_Settings_getInstallationDirectoryPath(threadData);
_omhome = omc_System_trim(threadData, _omhome, _OMC_LIT16);
tmpMeta1 = stringAppend(omc_System_getCFlags(threadData),_OMC_LIT17);
tmpMeta2 = stringAppend(tmpMeta1,(omc_Flags_isSet(threadData, _OMC_LIT13)?_OMC_LIT18:_OMC_LIT15));
_cflags = tmpMeta2;
_cflags = ((stringEqual(omc_Config_simCodeTarget(threadData), _OMC_LIT8))?_OMC_LIT19:_cflags);
_ldflags = omc_System_getLDFlags(threadData);
if(omc_Flags_getConfigBool(threadData, _OMC_LIT26))
{
tmpMeta3 = stringAppend(_OMC_LIT20,_ldflags);
_ldflags = tmpMeta3;
}
_rtlibs = _OMC_LIT15;
_platform = omc_System_modelicaPlatform(threadData);
tmpMeta4 = stringAppend(omc_System_pwd(threadData),_OMC_LIT27);
_compileDir = tmpMeta4;
tmpMeta5 = mmc_mk_box15(3, &SimCodeFunction_MakefileParams_MAKEFILE__PARAMS__desc, _ccompiler, _cxxcompiler, _linker, _exeext, _dllext, _omhome, _cflags, _ldflags, _rtlibs, _includes, _libs, _libPaths, _platform, _compileDir);
_makefileParams = tmpMeta5;
_return: OMC_LABEL_UNUSED
return _makefileParams;
}
modelica_metatype boxptr_SimCodeFunctionUtil_createMakefileParams(threadData_t *threadData, modelica_metatype _includes, modelica_metatype _libs, modelica_metatype _libPaths, modelica_metatype _isFunction, modelica_metatype _isFMU)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _makefileParams = NULL;
tmp1 = mmc_unbox_integer(_isFunction);
tmp2 = mmc_unbox_integer(_isFMU);
_makefileParams = omc_SimCodeFunctionUtil_createMakefileParams(threadData, _includes, _libs, _libPaths, tmp1, tmp2);
return _makefileParams;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_variableString(threadData_t *threadData, modelica_metatype _var)
{
modelica_string _str = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _var;
{
modelica_metatype _name = NULL;
modelica_metatype _ty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,7) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_name = tmpMeta6;
_ty = tmpMeta7;
tmpMeta8 = stringAppend(omc_Types_unparseType(threadData, _ty),_OMC_LIT17);
tmpMeta9 = stringAppend(tmpMeta8,omc_ComponentReference_printComponentRefStr(threadData, _name));
tmp1 = tmpMeta9;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_str = tmpMeta10;
tmpMeta11 = stringAppend(_OMC_LIT28,_str);
tmp1 = tmpMeta11;
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_metatype omc_SimCodeFunctionUtil_aliasRecordDeclarations2(threadData_t *threadData, modelica_string _str, modelica_metatype _path, modelica_metatype _inHt, modelica_metatype *out_ht)
{
modelica_metatype _alias = NULL;
modelica_metatype _ht = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _aliasStr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_aliasStr = omc_AbsynUtil_pathStringUnquoteReplaceDot(threadData, omc_BaseHashTable_get(threadData, _str, _inHt), _OMC_LIT29);
tmpMeta[0+0] = mmc_mk_some(_aliasStr);
tmpMeta[0+1] = _inHt;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
tmpMeta6 = mmc_mk_box2(0, _str, _path);
_ht = omc_BaseHashTable_add(threadData, tmpMeta6, _inHt);
tmpMeta[0+0] = mmc_mk_none();
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 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_alias = tmpMeta[0+0];
_ht = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_ht) { *out_ht = _ht; }
return _alias;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_aliasRecordDeclarations(threadData_t *threadData, modelica_metatype _inDecl, modelica_metatype _inHt, modelica_metatype *out_ht)
{
modelica_metatype _decl = NULL;
modelica_metatype _ht = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inDecl;
{
modelica_metatype _vars = NULL;
modelica_metatype _name = NULL;
modelica_string _str = NULL;
modelica_string _sname = NULL;
modelica_metatype _alias = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_sname = tmpMeta6;
_name = tmpMeta7;
_vars = tmpMeta8;
_str = stringDelimitList(omc_List_map(threadData, _vars, boxvar_SimCodeFunctionUtil_variableString), _OMC_LIT30);
_alias = omc_SimCodeFunctionUtil_aliasRecordDeclarations2(threadData, _str, _name, _inHt ,&_ht);
tmpMeta9 = mmc_mk_box5(3, &SimCodeFunction_RecordDeclaration_RECORD__DECL__FULL__desc, _sname, _alias, _name, _vars);
tmpMeta[0+0] = tmpMeta9;
tmpMeta[0+1] = _ht;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _inDecl;
tmpMeta[0+1] = _inHt;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_decl = tmpMeta[0+0];
_ht = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_ht) { *out_ht = _ht; }
return _decl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _itpl, modelica_metatype *out_otpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _otpl = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _itpl;
{
modelica_metatype _path = NULL;
modelica_metatype _acc = NULL;
modelica_metatype _filter = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_boolean tmp12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 4));
tmp9 = mmc_unbox_integer(tmpMeta8);
if (0 != tmp9) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_path = tmpMeta6;
_acc = tmpMeta10;
_filter = tmpMeta11;
tmp4 += 3;
_path = omc_AbsynUtil_makeNotFullyQualified(threadData, _path);
tmp12 = omc_List_isMemberOnTrue(threadData, _path, _filter, boxvar_AbsynUtil_pathEqual);
if (0 != tmp12) goto goto_2;
tmpMeta13 = mmc_mk_cons(_path, _acc);
tmpMeta14 = mmc_mk_box2(0, tmpMeta13, _filter);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta14;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_boolean tmp19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,27,3) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_path = tmpMeta16;
_acc = tmpMeta17;
_filter = tmpMeta18;
tmp4 += 2;
tmp19 = omc_List_isMemberOnTrue(threadData, _path, _OMC_LIT51, boxvar_AbsynUtil_pathEqual);
if (0 != tmp19) goto goto_2;
tmp20 = omc_List_isMemberOnTrue(threadData, _path, _filter, boxvar_AbsynUtil_pathEqual);
if (0 != tmp20) goto goto_2;
tmpMeta21 = mmc_mk_cons(_path, _acc);
tmpMeta22 = mmc_mk_box2(0, tmpMeta21, _filter);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta22;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_boolean tmp26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,4) == 0) goto tmp3_end;
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_path = tmpMeta23;
_acc = tmpMeta24;
_filter = tmpMeta25;
tmp4 += 1;
_path = omc_AbsynUtil_makeNotFullyQualified(threadData, _path);
tmp26 = omc_List_isMemberOnTrue(threadData, _path, _filter, boxvar_AbsynUtil_pathEqual);
if (0 != tmp26) goto goto_2;
tmpMeta27 = mmc_mk_cons(_path, _acc);
tmpMeta28 = mmc_mk_box2(0, tmpMeta27, _filter);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta28;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_integer tmp31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_boolean tmp34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,13,2) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmp31 = mmc_unbox_integer(tmpMeta30);
if (0 != tmp31) goto tmp3_end;
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_acc = tmpMeta32;
_filter = tmpMeta33;
_path = omc_AbsynUtil_crefToPath(threadData, omc_SimCodeFunctionUtil_getCrefFromExp(threadData, _inExp));
tmp34 = omc_List_isMemberOnTrue(threadData, _path, _filter, boxvar_AbsynUtil_pathEqual);
if (0 != tmp34) goto goto_2;
tmpMeta35 = mmc_mk_cons(_path, _acc);
tmpMeta36 = mmc_mk_box2(0, tmpMeta35, _filter);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = tmpMeta36;
goto tmp3_done;
}
case 4: {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _itpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 5) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_otpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_otpl) { *out_otpl = _otpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_addDestructor2(threadData_t *threadData, modelica_metatype _path, modelica_string _pathstr, modelica_metatype _inHt)
{
modelica_metatype _ht = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ht = _inHt;
if((!omc_BaseHashTable_hasKey(threadData, _pathstr, _ht)))
{
tmpMeta1 = mmc_mk_box2(0, _pathstr, _path);
omc_BaseHashTable_add(threadData, tmpMeta1, _ht);
}
_return: OMC_LABEL_UNUSED
return _ht;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_addDestructor(threadData_t *threadData, modelica_metatype _func, modelica_metatype _inHt)
{
modelica_metatype _outHt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _func;
{
modelica_metatype _path = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,10) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,11,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,9,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,17,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_path = tmpMeta9;
_path = omc_AbsynUtil_joinPaths(threadData, _path, _OMC_LIT53);
tmpMeta1 = omc_SimCodeFunctionUtil_addDestructor2(threadData, _path, omc_AbsynUtil_pathStringNoQual(threadData, _path, _OMC_LIT54, 0, 0), _inHt);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inHt;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outHt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outHt;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_getCalledFunctionsInFunction2(threadData_t *threadData, modelica_metatype _inPath, modelica_string _pathstr, modelica_metatype _inHt, modelica_metatype _funcs)
{
modelica_metatype _outHt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inPath;
tmp4_2 = _inHt;
{
modelica_string _str = NULL;
modelica_metatype _path = NULL;
modelica_metatype _funcelem = NULL;
modelica_metatype _calledfuncs = NULL;
modelica_metatype _varfuncs = NULL;
modelica_metatype _els = NULL;
modelica_metatype _ht = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_ht = tmp4_2;
if (!omc_BaseHashTable_hasKey(threadData, _pathstr, _ht)) goto tmp3_end;
tmpMeta1 = _ht;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
_path = tmp4_1;
_ht = tmp4_2;
_funcelem = omc_DAEUtil_getNamedFunction(threadData, _path, _funcs);
_els = omc_DAEUtil_getFunctionElements(threadData, _funcelem);
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
_varfuncs = omc_List_fold(threadData, _els, boxvar_DAEUtil_collectFunctionRefVarPaths, tmpMeta6);
tmpMeta9 = mmc_mk_box2(0, boxvar_DAEUtil_collectValueblockFunctionRefVars, _varfuncs);
omc_DAEUtil_traverseDAEElementList(threadData, _els, boxvar_Expression_traverseSubexpressionsHelper, tmpMeta9, &tmpMeta7);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
_varfuncs = tmpMeta8;
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta14 = mmc_mk_box2(0, tmpMeta13, _varfuncs);
tmpMeta15 = mmc_mk_box2(0, boxvar_SimCodeFunctionUtil_matchNonBuiltinCallsAndFnRefPaths, tmpMeta14);
omc_DAEUtil_traverseDAEElementList(threadData, _els, boxvar_Expression_traverseSubexpressionsHelper, tmpMeta15, &tmpMeta10);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
_calledfuncs = tmpMeta12;
tmpMeta16 = mmc_mk_box2(0, _pathstr, _path);
_ht = omc_BaseHashTable_add(threadData, tmpMeta16, _ht);
_ht = omc_SimCodeFunctionUtil_addDestructor(threadData, _funcelem, _ht);
tmpMeta1 = omc_SimCodeFunctionUtil_getCalledFunctionsInFunctions(threadData, _calledfuncs, _ht, _funcs);
goto tmp3_done;
}
case 2: {
modelica_boolean tmp17;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
_path = tmp4_1;
tmp17 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_DAEUtil_getNamedFunction(threadData, _path, _funcs);
tmp17 = 1;
goto goto_18;
goto_18:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp17) {goto goto_2;}
tmpMeta19 = stringAppend(_OMC_LIT55,_pathstr);
tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT56);
_str = tmpMeta20;
omc_Error_addInternalError(threadData, _str, _OMC_LIT57);
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:;
}
}
_outHt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outHt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getCalledFunctionsInFunctions(threadData_t *threadData, modelica_metatype _paths, modelica_metatype _inHt, modelica_metatype _funcs)
{
modelica_metatype _outHt = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _paths;
tmp4_2 = _inHt;
{
modelica_metatype _rest = NULL;
modelica_metatype _path = NULL;
modelica_metatype _ht = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_ht = tmp4_2;
tmpMeta1 = _ht;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_path = tmpMeta6;
_rest = tmpMeta7;
_ht = tmp4_2;
_ht = omc_SimCodeFunctionUtil_getCalledFunctionsInFunction2(threadData, _path, omc_AbsynUtil_pathStringNoQual(threadData, _path, _OMC_LIT54, 0, 0), _ht, _funcs);
_paths = _rest;
_inHt = _ht;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outHt = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outHt;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_getImplicitRecordConstructors(threadData_t *threadData, modelica_metatype _inExpLst)
{
modelica_metatype _outExpLst = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExpLst;
{
modelica_metatype _cref = NULL;
modelica_metatype _record_path = NULL;
modelica_metatype _rest_expr = NULL;
modelica_metatype _record_cref = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
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);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,9,3) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,3,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_cref = tmpMeta9;
_record_path = tmpMeta12;
_rest_expr = tmpMeta8;
tmpMeta13 = omc_ComponentReference_crefLastSubs(threadData, _cref);
if (!listEmpty(tmpMeta13)) goto goto_2;
_cref = omc_ComponentReference_pathToCref(threadData, _record_path);
_record_cref = omc_Expression_crefExp(threadData, _cref);
_rest_expr = omc_SimCodeFunctionUtil_getImplicitRecordConstructors(threadData, _rest_expr);
tmpMeta14 = mmc_mk_cons(_record_cref, _rest_expr);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_1);
tmpMeta16 = MMC_CDR(tmp4_1);
_rest_expr = tmpMeta16;
tmpMeta1 = omc_SimCodeFunctionUtil_getImplicitRecordConstructors(threadData, _rest_expr);
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:;
}
}
_outExpLst = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExpLst;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_generateExtFunctionDynamicLoad(threadData_t *threadData, modelica_metatype _inMod)
{
modelica_boolean _outDynamicLoad;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
tmpMeta6 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT58);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,5) == 0) goto goto_2;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
if (optionNone(tmpMeta7)) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,4,1) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmp10 = mmc_unbox_integer(tmpMeta9);
_b = tmp10;
tmp1 = _b;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outDynamicLoad = tmp1;
_return: OMC_LABEL_UNUSED
return _outDynamicLoad;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionDynamicLoad(threadData_t *threadData, modelica_metatype _inMod)
{
modelica_boolean _outDynamicLoad;
modelica_metatype out_outDynamicLoad;
_outDynamicLoad = omc_SimCodeFunctionUtil_generateExtFunctionDynamicLoad(threadData, _inMod);
out_outDynamicLoad = mmc_mk_icon(_outDynamicLoad);
return out_outDynamicLoad;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr(threadData_t *threadData, modelica_metatype _inMod)
{
modelica_metatype _includes = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _inc = NULL;
modelica_string _inc_1 = NULL;
modelica_integer _lineNumberStart;
modelica_string _str = NULL;
modelica_string _fileName = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_integer tmp13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_boolean tmp20;
modelica_metatype tmpMeta21;
tmpMeta6 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT59);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,5) == 0) goto goto_2;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
if (optionNone(tmpMeta7)) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,1) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 6));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 4));
tmp13 = mmc_unbox_integer(tmpMeta12);
_inc = tmpMeta9;
_fileName = tmpMeta11;
_lineNumberStart = tmp13;
tmpMeta14 = stringAppend(_OMC_LIT60,intString(_lineNumberStart));
tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT61);
tmpMeta16 = stringAppend(tmpMeta15,_fileName);
tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT16);
_str = tmpMeta17;
_inc_1 = omc_System_unescapedString(threadData, _inc);
tmp20 = (modelica_boolean)(omc_Config_acceptMetaModelicaGrammar(threadData) || omc_Flags_isSet(threadData, _OMC_LIT65));
if(tmp20)
{
tmpMeta18 = mmc_mk_cons(_str, mmc_mk_cons(_inc_1, MMC_REFSTRUCTLIT(mmc_nil)));
tmpMeta21 = tmpMeta18;
}
else
{
tmpMeta19 = mmc_mk_cons(_inc_1, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta21 = tmpMeta19;
}
tmpMeta1 = tmpMeta21;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta22;
tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_includes = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _includes;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr(threadData_t *threadData, modelica_string _target, modelica_metatype _inMod, modelica_metatype *out_names)
{
modelica_metatype _outStringLst = NULL;
modelica_metatype _names = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_string tmp4_1;
tmp4_1 = omc_SimCodeFunctionUtil_getGerneralTarget(threadData, _target);
{
modelica_metatype _arr = NULL;
modelica_metatype _libsList = NULL;
modelica_metatype _namesList = NULL;
modelica_metatype _exp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (4 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT67), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmpMeta6 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT66);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,5) == 0) goto goto_2;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
if (optionNone(tmpMeta7)) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,13,1) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_arr = tmpMeta9;
_libsList = omc_List_map__2(threadData, _arr, boxvar_SimCodeFunctionUtil_getLibraryStringInMSVCFormat ,&_namesList);
tmpMeta[0+0] = omc_List_flatten(threadData, _libsList);
tmpMeta[0+1] = omc_List_flatten(threadData, _namesList);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (4 != MMC_STRLEN(tmp4_1) || strcmp(MMC_STRINGDATA(_OMC_LIT67), MMC_STRINGDATA(tmp4_1)) != 0) goto tmp3_end;
tmpMeta10 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT66);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,0,5) == 0) goto goto_2;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 5));
if (optionNone(tmpMeta11)) goto goto_2;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
_exp = tmpMeta12;
tmpMeta[0+0] = omc_SimCodeFunctionUtil_getLibraryStringInMSVCFormat(threadData, _exp, &tmpMeta[0+1]);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
tmpMeta13 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT66);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,5) == 0) goto goto_2;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 5));
if (optionNone(tmpMeta14)) goto goto_2;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,13,1) == 0) goto goto_2;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
_arr = tmpMeta16;
_libsList = omc_List_map__2(threadData, _arr, boxvar_SimCodeFunctionUtil_getLibraryStringInGccFormat ,&_namesList);
tmpMeta[0+0] = omc_List_flatten(threadData, _libsList);
tmpMeta[0+1] = omc_List_flatten(threadData, _namesList);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
tmpMeta17 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT66);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,0,5) == 0) goto goto_2;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 5));
if (optionNone(tmpMeta18)) goto goto_2;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 1));
_exp = tmpMeta19;
tmpMeta[0+0] = omc_SimCodeFunctionUtil_getLibraryStringInGccFormat(threadData, _exp, &tmpMeta[0+1]);
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta20;
tmpMeta[0+1] = tmpMeta21;
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:;
}
}
_outStringLst = tmpMeta[0+0];
_names = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_names) { *out_names = _names; }
return _outStringLst;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getLibraryStringInGccFormat(threadData_t *threadData, modelica_metatype _exp, modelica_metatype *out_names)
{
modelica_metatype _strs = NULL;
modelica_metatype _names = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
modelica_string _str = NULL;
modelica_metatype _strs1 = NULL;
modelica_metatype _strs2 = NULL;
modelica_metatype _strs3 = NULL;
modelica_metatype _names1 = NULL;
modelica_metatype _names2 = NULL;
modelica_metatype _names3 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 13; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT87), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
tmp4 += 10;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta7;
tmpMeta[0+1] = tmpMeta8;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta9) || strcmp(MMC_STRINGDATA(_OMC_LIT88), MMC_STRINGDATA(tmpMeta9)) != 0) goto tmp3_end;
tmp4 += 9;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta10;
tmpMeta[0+1] = tmpMeta11;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (7 != MMC_STRLEN(tmpMeta12) || strcmp(MMC_STRINGDATA(_OMC_LIT89), MMC_STRINGDATA(tmpMeta12)) != 0) goto tmp3_end;
tmp4 += 8;
if (!0) goto tmp3_end;
omc_Error_addCompilerNotification(threadData, _OMC_LIT68);
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta13;
tmpMeta[0+1] = tmpMeta14;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (2 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT90), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp3_end;
tmp4 += 7;
if (!0) goto tmp3_end;
omc_Error_addCompilerNotification(threadData, _OMC_LIT69);
tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta16;
tmpMeta[0+1] = tmpMeta17;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta18) || strcmp(MMC_STRINGDATA(_OMC_LIT91), MMC_STRINGDATA(tmpMeta18)) != 0) goto tmp3_end;
tmp4 += 6;
if (!0) goto tmp3_end;
omc_Error_addCompilerNotification(threadData, _OMC_LIT70);
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta19;
tmpMeta[0+1] = tmpMeta20;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta21) || strcmp(MMC_STRINGDATA(_OMC_LIT92), MMC_STRINGDATA(tmpMeta21)) != 0) goto tmp3_end;
tmp4 += 5;
if (!0) goto tmp3_end;
omc_Error_addCompilerNotification(threadData, _OMC_LIT71);
tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta22;
tmpMeta[0+1] = tmpMeta23;
goto tmp3_done;
}
case 6: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (5 != MMC_STRLEN(tmpMeta24) || strcmp(MMC_STRINGDATA(_OMC_LIT93), MMC_STRINGDATA(tmpMeta24)) != 0) goto tmp3_end;
_str = tmpMeta24;
tmp4 += 4;
if (!0) goto tmp3_end;
tmpMeta25 = stringAppend(_OMC_LIT72,_str);
_str = tmpMeta25;
omc_Error_addCompilerNotification(threadData, _OMC_LIT73);
tmpMeta26 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta26;
tmpMeta[0+1] = tmpMeta27;
goto tmp3_done;
}
case 7: {
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (3 != MMC_STRLEN(tmpMeta28) || strcmp(MMC_STRINGDATA(_OMC_LIT94), MMC_STRINGDATA(tmpMeta28)) != 0) goto tmp3_end;
tmp4 += 3;
if (!0) goto tmp3_end;
omc_Error_addCompilerNotification(threadData, _OMC_LIT74);
tmpMeta29 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta30 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta29;
tmpMeta[0+1] = tmpMeta30;
goto tmp3_done;
}
case 8: {
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (10 != MMC_STRLEN(tmpMeta31) || strcmp(MMC_STRINGDATA(_OMC_LIT95), MMC_STRINGDATA(tmpMeta31)) != 0) goto tmp3_end;
tmp4 += 2;
tmpMeta32 = MMC_REFSTRUCTLIT(mmc_nil);
_strs = tmpMeta32;
tmpMeta33 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _strs;
tmpMeta[0+1] = tmpMeta33;
goto tmp3_done;
}
case 9: {
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (17 != MMC_STRLEN(tmpMeta34) || strcmp(MMC_STRINGDATA(_OMC_LIT96), MMC_STRINGDATA(tmpMeta34)) != 0) goto tmp3_end;
tmp4 += 1;
_str = _OMC_LIT15;
tmpMeta35 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta36 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta35;
tmpMeta[0+1] = tmpMeta36;
goto tmp3_done;
}
case 10: {
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta37) || strcmp(MMC_STRINGDATA(_OMC_LIT97), MMC_STRINGDATA(tmpMeta37)) != 0) goto tmp3_end;
tmpMeta38 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _OMC_LIT76;
tmpMeta[0+1] = tmpMeta38;
goto tmp3_done;
}
case 11: {
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_str = tmpMeta39;
if((stringEqual(_str, _OMC_LIT83)))
{
_strs1 = omc_SimCodeFunctionUtil_getLibraryStringInGccFormat(threadData, _OMC_LIT78 ,&_names1);
_strs2 = omc_SimCodeFunctionUtil_getLibraryStringInGccFormat(threadData, _OMC_LIT80 ,&_names2);
_strs3 = omc_SimCodeFunctionUtil_getLibraryStringInGccFormat(threadData, _OMC_LIT82 ,&_names3);
_strs = listAppend(_strs1, listAppend(_strs2, _strs3));
_names = listAppend(_names1, listAppend(_names2, _names3));
}
else
{
tmpMeta40 = MMC_REFSTRUCTLIT(mmc_nil);
_strs = tmpMeta40;
tmpMeta41 = MMC_REFSTRUCTLIT(mmc_nil);
_names = tmpMeta41;
}
if((omc_System_regularFileExists(threadData, _str) || (stringEqual(_OMC_LIT84, stringGetStringChar(_str, ((modelica_integer) 1))))))
{
tmpMeta42 = mmc_mk_cons(_str, _strs);
_strs = tmpMeta42;
}
else
{
tmpMeta44 = stringAppend(_OMC_LIT72,_str);
tmpMeta43 = mmc_mk_cons(tmpMeta44, _strs);
_strs = tmpMeta43;
tmpMeta45 = mmc_mk_cons(_str, _names);
_names = tmpMeta45;
}
tmpMeta[0+0] = _strs;
tmpMeta[0+1] = _names;
goto tmp3_done;
}
case 12: {
omc_Error_addInternalError(threadData, _OMC_LIT85, _OMC_LIT86);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 13) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_strs = tmpMeta[0+0];
_names = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_names) { *out_names = _names; }
return _strs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getLibraryStringInMSVCFormat(threadData_t *threadData, modelica_metatype _exp, modelica_metatype *out_names)
{
modelica_metatype _strs = NULL;
modelica_metatype _names = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _exp;
{
modelica_string _str = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 7; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_str = tmpMeta6;
if (!((stringEqual(_str, _OMC_LIT88)) || (stringEqual(_str, _OMC_LIT87)))) goto tmp3_end;
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _OMC_LIT101;
tmpMeta[0+1] = tmpMeta7;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (10 != MMC_STRLEN(tmpMeta8) || strcmp(MMC_STRINGDATA(_OMC_LIT95), MMC_STRINGDATA(tmpMeta8)) != 0) goto tmp3_end;
tmp4 += 2;
tmp9 = 0;
if (1 != tmp9) goto goto_2;
_strs = _OMC_LIT127;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _strs;
tmpMeta[0+1] = tmpMeta10;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (17 != MMC_STRLEN(tmpMeta11) || strcmp(MMC_STRINGDATA(_OMC_LIT96), MMC_STRINGDATA(tmpMeta11)) != 0) goto tmp3_end;
tmp4 += 1;
_str = _OMC_LIT15;
tmpMeta12 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta12;
tmpMeta[0+1] = tmpMeta13;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (6 != MMC_STRLEN(tmpMeta14) || strcmp(MMC_STRINGDATA(_OMC_LIT97), MMC_STRINGDATA(tmpMeta14)) != 0) goto tmp3_end;
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _OMC_LIT131;
tmpMeta[0+1] = tmpMeta15;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta16;
modelica_boolean tmp17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_str = tmpMeta16;
tmp17 = (stringEqual(_OMC_LIT84, stringGetStringChar(_str, ((modelica_integer) 1))));
if (1 != tmp17) goto goto_2;
tmpMeta18 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta18;
tmpMeta[0+1] = tmpMeta19;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_str = tmpMeta20;
tmpMeta21 = stringAppend(_str,_OMC_LIT132);
_str = tmpMeta21;
tmpMeta22 = mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta23 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta22;
tmpMeta[0+1] = tmpMeta23;
goto tmp3_done;
}
case 6: {
omc_Error_addInternalError(threadData, _OMC_LIT85, _OMC_LIT133);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 7) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_strs = tmpMeta[0+0];
_names = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_names) { *out_names = _names; }
return _strs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData_t *threadData, modelica_boolean _add, modelica_string _dir, modelica_boolean _isLinux, modelica_metatype _inLibs)
{
modelica_metatype _libs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_boolean tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _add;
tmp4_2 = _inLibs;
{
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (1 != tmp4_1) goto tmp3_end;
_libs = tmp4_2;
_b = omc_System_directoryExists(threadData, _dir);
tmpMeta1 = omc_List_consOnTrue(threadData, _b, _dir, _libs);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inLibs;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_libs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _libs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData_t *threadData, modelica_metatype _add, modelica_metatype _dir, modelica_metatype _isLinux, modelica_metatype _inLibs)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_metatype _libs = NULL;
tmp1 = mmc_unbox_integer(_add);
tmp2 = mmc_unbox_integer(_isLinux);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, tmp1, _dir, tmp2, _inLibs);
return _libs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inMod)
{
modelica_metatype _outLibs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _str = NULL;
modelica_string _platform1 = NULL;
modelica_string _platform2 = NULL;
modelica_metatype _libs = NULL;
modelica_boolean _isLinux;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
tmpMeta6 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT134);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,5) == 0) goto goto_2;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 5));
if (optionNone(tmpMeta7)) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,1) == 0) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
_str = tmpMeta9;
_str = omc_CevalScript_getFullPathFromUri(threadData, _program, _str, 0);
_platform1 = omc_System_openModelicaPlatform(threadData);
_platform2 = omc_System_modelicaPlatform(threadData);
_isLinux = 0;
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, 1, _str, _isLinux, tmpMeta10);
tmpMeta11 = stringAppend(_str,_OMC_LIT27);
tmpMeta12 = stringAppend(tmpMeta11,_platform2);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, (!(stringEqual(_platform2, _OMC_LIT15))), tmpMeta12, _isLinux, _libs);
tmpMeta13 = stringAppend(_str,_OMC_LIT27);
tmpMeta14 = stringAppend(tmpMeta13,_platform1);
tmpMeta1 = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, (!(stringEqual(_platform1, _OMC_LIT15))), tmpMeta14, _isLinux, _libs);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
tmpMeta15 = stringAppend(_OMC_LIT135,omc_AbsynUtil_pathFirstIdent(threadData, _path));
tmpMeta16 = stringAppend(tmpMeta15,_OMC_LIT136);
_str = tmpMeta16;
_str = omc_CevalScript_getFullPathFromUri(threadData, _program, _str, 0);
_platform1 = omc_System_openModelicaPlatform(threadData);
_platform2 = omc_System_modelicaPlatform(threadData);
_isLinux = 0;
tmpMeta17 = MMC_REFSTRUCTLIT(mmc_nil);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, 1, _str, _isLinux, tmpMeta17);
tmpMeta18 = stringAppend(_str,_OMC_LIT27);
tmpMeta19 = stringAppend(tmpMeta18,_platform2);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, (!(stringEqual(_platform2, _OMC_LIT15))), tmpMeta19, _isLinux, _libs);
tmpMeta20 = stringAppend(_str,_OMC_LIT27);
tmpMeta21 = stringAppend(tmpMeta20,_platform1);
tmpMeta1 = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths2(threadData, (!(stringEqual(_platform1, _OMC_LIT15))), tmpMeta21, _isLinux, _libs);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta22;
tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta22;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outLibs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outLibs;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_userCompiledBinariesDirectory(threadData_t *threadData, modelica_metatype _path)
{
modelica_string _str = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = stringAppend(omc_Settings_getHomeDir(threadData, 0),_OMC_LIT137);
tmpMeta2 = stringAppend(tmpMeta1,omc_AbsynUtil_pathFirstIdent(threadData, _path));
_str = tmpMeta2;
_return: OMC_LABEL_UNUSED
return _str;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_getGerneralTarget(threadData_t *threadData, modelica_string _target)
{
modelica_string _generalTarget = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_generalTarget = ((omc_System_stringFind(threadData, _target, _OMC_LIT67) == ((modelica_integer) 0))?_OMC_LIT67:_target);
_return: OMC_LABEL_UNUSED
return _generalTarget;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2(threadData_t *threadData, modelica_string _dir, modelica_boolean _isLinux, modelica_string _target, modelica_metatype _inLibs)
{
modelica_metatype _libs = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_boolean tmp4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_boolean tmp11;
modelica_string tmp12;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmp4 = (modelica_boolean)_isLinux;
if(tmp4)
{
tmpMeta2 = stringAppend(_OMC_LIT138,_dir);
tmpMeta3 = stringAppend(tmpMeta2,_OMC_LIT16);
tmpMeta1 = mmc_mk_cons(tmpMeta3, _inLibs);
tmpMeta5 = tmpMeta1;
}
else
{
tmpMeta5 = _inLibs;
}
_libs = tmpMeta5;
tmp11 = (modelica_boolean)(stringEqual(omc_SimCodeFunctionUtil_getGerneralTarget(threadData, _target), _OMC_LIT67));
if(tmp11)
{
tmpMeta7 = stringAppend(_OMC_LIT139,_dir);
tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT16);
tmp12 = tmpMeta8;
}
else
{
tmpMeta9 = stringAppend(_OMC_LIT140,_dir);
tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT16);
tmp12 = tmpMeta10;
}
tmpMeta6 = mmc_mk_cons(tmp12, _libs);
_libs = tmpMeta6;
_return: OMC_LABEL_UNUSED
return _libs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2(threadData_t *threadData, modelica_metatype _dir, modelica_metatype _isLinux, modelica_metatype _target, modelica_metatype _inLibs)
{
modelica_integer tmp1;
modelica_metatype _libs = NULL;
tmp1 = mmc_unbox_integer(_isLinux);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2(threadData, _dir, tmp1, _target, _inLibs);
return _libs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inMod, modelica_metatype _inLibs, modelica_metatype *out_installDirs, modelica_metatype *out_resources)
{
modelica_metatype _outLibs = NULL;
modelica_metatype _installDirs = NULL;
modelica_metatype _resources = NULL;
modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inLibs;
{
modelica_string _str = NULL;
modelica_string _target = NULL;
modelica_string _resourcesStr = NULL;
modelica_metatype _libs = NULL;
modelica_metatype _libs2 = NULL;
modelica_boolean _isLinux;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta6;
tmpMeta[0+1] = tmpMeta7;
tmpMeta[0+2] = mmc_mk_none();
goto tmp3_done;
}
case 1: {
modelica_string tmp8 = 0;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
_libs = tmp4_1;
{
{
volatile mmc_switch_type tmp11;
int tmp12;
tmp11 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp10_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp11 < 2; tmp11++) {
switch (MMC_SWITCH_CAST(tmp11)) {
case 0: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
tmpMeta13 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT134);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,5) == 0) goto goto_9;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 5));
if (optionNone(tmpMeta14)) goto goto_9;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,3,1) == 0) goto goto_9;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
_str = tmpMeta16;
tmp8 = _str;
goto tmp10_done;
}
case 1: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
tmpMeta17 = stringAppend(_OMC_LIT135,omc_AbsynUtil_pathFirstIdent(threadData, _path));
tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT136);
tmp8 = tmpMeta18;
goto tmp10_done;
}
}
goto tmp10_end;
tmp10_end: ;
}
goto goto_9;
tmp10_done:
(void)tmp11;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp10_done2;
goto_9:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp11 < 2) {
goto tmp10_top;
}
goto goto_2;
tmp10_done2:;
}
}
_str = tmp8;
_str = omc_CevalScript_getFullPathFromUri(threadData, _program, _str, 0);
tmpMeta19 = stringAppend(_OMC_LIT135,omc_AbsynUtil_pathFirstIdent(threadData, _path));
tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT141);
_resourcesStr = omc_CevalScript_getFullPathFromUri(threadData, _program, tmpMeta20, 0);
_isLinux = 0;
_target = omc_Flags_getConfigString(threadData, _OMC_LIT165);
_libs2 = omc_SimCodeFunctionUtil_getLinkerLibraryPaths(threadData, _str, _path, _inLibs);
_libs = omc_List_fold2(threadData, _libs2, boxvar_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags2, mmc_mk_boolean(_isLinux), _target, _libs);
tmpMeta[0+0] = _libs;
tmpMeta[0+1] = listReverse(_libs2);
tmpMeta[0+2] = mmc_mk_some(_resourcesStr);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta21;
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = _inLibs;
tmpMeta[0+1] = tmpMeta21;
tmpMeta[0+2] = mmc_mk_none();
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outLibs = tmpMeta[0+0];
_installDirs = tmpMeta[0+1];
_resources = tmpMeta[0+2];
_return: OMC_LABEL_UNUSED
if (out_installDirs) { *out_installDirs = _installDirs; }
if (out_resources) { *out_resources = _resources; }
return _outLibs;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getLinkerLibraryPaths(threadData_t *threadData, modelica_string _uri, modelica_metatype _path, modelica_metatype _inLibs)
{
modelica_metatype _libPaths = NULL;
modelica_string _installationDir = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_installationDir = omc_Settings_getInstallationDirectoryPath(threadData);
{
volatile modelica_metatype tmp3_1;
tmp3_1 = _inLibs;
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 2; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp3_1)) goto tmp2_end;
tmpMeta5 = MMC_CAR(tmp3_1);
tmpMeta6 = MMC_CDR(tmp3_1);
if (7 != MMC_STRLEN(tmpMeta5) || strcmp(MMC_STRINGDATA(_OMC_LIT168), MMC_STRINGDATA(tmpMeta5)) != 0) goto tmp2_end;
if (!listEmpty(tmpMeta6)) goto tmp2_end;
if (!0) goto tmp2_end;
tmpMeta8 = stringAppend(_installationDir,_OMC_LIT166);
tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT15);
tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT167);
tmpMeta7 = mmc_mk_cons(tmpMeta10, MMC_REFSTRUCTLIT(mmc_nil));
_libPaths = tmpMeta7;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
tmpMeta12 = stringAppend(_uri,_OMC_LIT27);
tmpMeta13 = stringAppend(tmpMeta12,omc_System_modelicaPlatform(threadData));
tmpMeta14 = stringAppend(_uri,_OMC_LIT27);
tmpMeta15 = stringAppend(tmpMeta14,omc_System_openModelicaPlatform(threadData));
tmpMeta16 = stringAppend(omc_Settings_getHomeDir(threadData, 0),_OMC_LIT137);
tmpMeta17 = stringAppend(tmpMeta16,omc_AbsynUtil_pathFirstIdent(threadData, _path));
tmpMeta18 = stringAppend(_installationDir,_OMC_LIT166);
tmpMeta19 = stringAppend(_installationDir,_OMC_LIT166);
tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT15);
tmpMeta21 = stringAppend(tmpMeta20,_OMC_LIT167);
tmpMeta11 = mmc_mk_cons(_uri, mmc_mk_cons(tmpMeta13, mmc_mk_cons(tmpMeta15, mmc_mk_cons(tmpMeta17, mmc_mk_cons(tmpMeta18, mmc_mk_cons(tmpMeta21, MMC_REFSTRUCTLIT(mmc_nil)))))));
_libPaths = tmpMeta11;
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 _libPaths;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inMod, modelica_metatype _includes)
{
modelica_metatype _outDirs = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _includes;
{
modelica_string _str = NULL;
modelica_string _istr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta6;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_boolean tmp15;
modelica_metatype tmpMeta16;
tmpMeta7 = omc_Mod_getUnelabedSubMod(threadData, _inMod, _OMC_LIT169);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,5) == 0) goto goto_2;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 5));
if (optionNone(tmpMeta8)) goto goto_2;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,1) == 0) goto goto_2;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_str = tmpMeta10;
_str = omc_CevalScript_getFullPathFromUri(threadData, _program, _str, 0);
tmpMeta11 = stringAppend(_OMC_LIT170,_str);
tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT16);
_istr = tmpMeta12;
tmp15 = (modelica_boolean)omc_System_directoryExists(threadData, _str);
if(tmp15)
{
tmpMeta13 = mmc_mk_cons(_istr, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta16 = tmpMeta13;
}
else
{
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = tmpMeta14;
}
tmpMeta1 = tmpMeta16;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
tmpMeta17 = stringAppend(_OMC_LIT135,omc_AbsynUtil_pathFirstIdent(threadData, _path));
tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT171);
_str = tmpMeta18;
_str = omc_CevalScript_getFullPathFromUri(threadData, _program, _str, 0);
tmpMeta19 = stringAppend(_OMC_LIT170,_str);
tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT16);
_istr = tmpMeta20;
tmp23 = (modelica_boolean)omc_System_directoryExists(threadData, _str);
if(tmp23)
{
tmpMeta21 = mmc_mk_cons(_istr, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta24 = tmpMeta21;
}
else
{
tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta24 = tmpMeta22;
}
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta25;
tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta25;
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:;
}
}
_outDirs = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outDirs;
}
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_lookForExtFunctionLibrary(threadData_t *threadData, modelica_metatype _names, modelica_metatype _dirs, modelica_string _name, modelica_metatype _resources, modelica_metatype _path, modelica_metatype _info)
{
modelica_metatype _dirs2 = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
modelica_boolean tmp87;
modelica_metatype tmpMeta93;
modelica_string tmp94;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta2 = stringAppend(omc_Settings_getInstallationDirectoryPath(threadData),_OMC_LIT166);
tmpMeta3 = stringAppend(tmpMeta2,_OMC_LIT15);
tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT167);
tmpMeta8 = mmc_mk_cons(_OMC_LIT166, _dirs);
tmpMeta7 = mmc_mk_cons(_OMC_LIT172, tmpMeta8);
tmpMeta6 = mmc_mk_cons(_OMC_LIT166, tmpMeta7);
tmpMeta5 = mmc_mk_cons(_OMC_LIT172, tmpMeta6);
tmpMeta1 = mmc_mk_cons(tmpMeta4, tmpMeta5);
_dirs2 = tmpMeta1;
{
modelica_boolean __omcQ_24tmpVar1;
modelica_boolean tmp10;
modelica_boolean __omcQ_24tmpVar0;
modelica_integer tmp14;
modelica_metatype _n_loopVar = 0;
modelica_metatype _n;
_n_loopVar = _names;
__omcQ_24tmpVar1 = 0;
while(1) {
tmp14 = 1;
if (!listEmpty(_n_loopVar)) {
_n = MMC_CAR(_n_loopVar);
_n_loopVar = MMC_CDR(_n_loopVar);
tmp14--;
}
if (tmp14 == 0) {
{
modelica_boolean __omcQ_24tmpVar3;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean __omcQ_24tmpVar2;
modelica_integer tmp13;
modelica_metatype _d_loopVar = 0;
modelica_metatype _d;
_d_loopVar = _dirs2;
__omcQ_24tmpVar3 = 0;
while(1) {
tmp13 = 1;
if (!listEmpty(_d_loopVar)) {
_d = MMC_CAR(_d_loopVar);
_d_loopVar = MMC_CDR(_d_loopVar);
tmp13--;
}
if (tmp13 == 0) {
tmpMeta11 = stringAppend(_d,_OMC_LIT27);
tmpMeta12 = stringAppend(tmpMeta11,_n);
__omcQ_24tmpVar2 = omc_System_regularFileExists(threadData, tmpMeta12);
__omcQ_24tmpVar3 = (__omcQ_24tmpVar2 || __omcQ_24tmpVar3);
} else if (tmp13 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
tmp10 = __omcQ_24tmpVar3;
}
__omcQ_24tmpVar0 = tmp10;
__omcQ_24tmpVar1 = (__omcQ_24tmpVar0 || __omcQ_24tmpVar1);
} else if (tmp14 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
tmp9 = __omcQ_24tmpVar1;
}
if((!tmp9))
{
{
modelica_metatype tmp17_1;
tmp17_1 = _resources;
{
modelica_string _resourcesStr = NULL;
modelica_string _tmpdir = NULL;
modelica_string _cmd = NULL;
modelica_string _pwd = NULL;
modelica_string _contents = NULL;
modelica_string _found = NULL;
modelica_integer _status;
modelica_boolean _didFind;
volatile mmc_switch_type tmp17;
int tmp18;
tmp17 = 0;
for (; tmp17 < 2; tmp17++) {
switch (MMC_SWITCH_CAST(tmp17)) {
case 0: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta38;
modelica_metatype tmpMeta39;
modelica_metatype tmpMeta40;
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_metatype tmpMeta50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_metatype tmpMeta74;
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
if (optionNone(tmp17_1)) goto tmp16_end;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp17_1), 1));
_resourcesStr = tmpMeta19;
if(omc_System_directoryExists(threadData, _resourcesStr))
{
_didFind = 0;
{
modelica_metatype __omcQ_24tmpVar5;
modelica_metatype* tmp80;
modelica_metatype tmpMeta81;
modelica_string __omcQ_24tmpVar4;
modelica_integer tmp82;
modelica_metatype _dir_loopVar = 0;
modelica_metatype tmpMeta83;
modelica_metatype tmpMeta84;
modelica_metatype tmpMeta85;
modelica_metatype tmpMeta86;
modelica_metatype _dir;
tmpMeta83 = stringAppend(_resourcesStr,_OMC_LIT199);
_dir_loopVar = omc_System_subDirectories(threadData, tmpMeta83);
tmpMeta81 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar5 = tmpMeta81;
tmp80 = &__omcQ_24tmpVar5;
while(1) {
tmp82 = 1;
while (!listEmpty(_dir_loopVar)) {
_dir = MMC_CAR(_dir_loopVar);
_dir_loopVar = MMC_CDR(_dir_loopVar);
tmpMeta84 = stringAppend(_resourcesStr,_OMC_LIT185);
tmpMeta85 = stringAppend(tmpMeta84,_dir);
tmpMeta86 = stringAppend(tmpMeta85,_OMC_LIT200);
if (omc_System_regularFileExists(threadData, tmpMeta86)) {
tmp82--;
break;
}
}
if (tmp82 == 0) {
__omcQ_24tmpVar4 = _dir;
*tmp80 = mmc_mk_cons(__omcQ_24tmpVar4,0);
tmp80 = &MMC_CDR(*tmp80);
} else if (tmp82 == 1) {
break;
} else {
goto goto_15;
}
}
*tmp80 = mmc_mk_nil();
tmpMeta79 = __omcQ_24tmpVar5;
}
{
modelica_metatype _dir;
for (tmpMeta20 = tmpMeta79; !listEmpty(tmpMeta20); tmpMeta20=MMC_CDR(tmpMeta20))
{
_dir = MMC_CAR(tmpMeta20);
tmpMeta21 = stringAppend(omc_Settings_getTempDirectoryPath(threadData),_OMC_LIT173);
tmpMeta22 = stringAppend(tmpMeta21,_name);
tmpMeta23 = stringAppend(tmpMeta22,_OMC_LIT29);
_tmpdir = omc_System_createTemporaryDirectory(threadData, tmpMeta23);
tmpMeta25 = stringAppend(_OMC_LIT179,_tmpdir);
tmpMeta24 = mmc_mk_cons(tmpMeta25, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT178, tmpMeta24, _info);
tmpMeta26 = stringAppend(_OMC_LIT180,_resourcesStr);
tmpMeta27 = stringAppend(tmpMeta26,_OMC_LIT181);
tmpMeta28 = stringAppend(tmpMeta27,_tmpdir);
tmpMeta29 = stringAppend(tmpMeta28,_OMC_LIT16);
_cmd = tmpMeta29;
tmpMeta30 = mmc_mk_cons(_cmd, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT178, tmpMeta30, _info);
omc_System_systemCall(threadData, _cmd, _OMC_LIT15);
_pwd = omc_System_pwd(threadData);
tmpMeta31 = stringAppend(_tmpdir,_OMC_LIT185);
tmpMeta32 = stringAppend(tmpMeta31,_dir);
if((((modelica_integer) 0) == omc_System_cd(threadData, tmpMeta32)))
{
tmpMeta34 = stringAppend(_OMC_LIT186,omc_System_pwd(threadData));
tmpMeta33 = mmc_mk_cons(tmpMeta34, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT178, tmpMeta33, _info);
tmpMeta35 = stringAppend(_OMC_LIT187,omc_SimCodeFunctionUtil_userCompiledBinariesDirectory(threadData, _path));
tmpMeta36 = stringAppend(tmpMeta35,_OMC_LIT188);
_cmd = tmpMeta36;
_status = omc_System_systemCall(threadData, _cmd, _OMC_LIT189);
_contents = omc_System_readFile(threadData, _OMC_LIT189);
if((_status != ((modelica_integer) 0)))
{
tmpMeta38 = stringAppend(_OMC_LIT196,_cmd);
tmpMeta39 = stringAppend(tmpMeta38,_OMC_LIT197);
tmpMeta40 = stringAppend(tmpMeta39,_contents);
tmpMeta37 = mmc_mk_cons(tmpMeta40, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT183, tmpMeta37, _info);
}
else
{
tmpMeta42 = stringAppend(_OMC_LIT190,_cmd);
tmpMeta43 = stringAppend(tmpMeta42,_OMC_LIT30);
tmpMeta44 = stringAppend(tmpMeta43,_contents);
tmpMeta41 = mmc_mk_cons(tmpMeta44, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT178, tmpMeta41, _info);
_didFind = 1;
{
modelica_metatype _d;
for (tmpMeta45 = _dirs2; !listEmpty(tmpMeta45); tmpMeta45=MMC_CDR(tmpMeta45))
{
_d = MMC_CAR(tmpMeta45);
{
modelica_metatype _n;
for (tmpMeta46 = _names; !listEmpty(tmpMeta46); tmpMeta46=MMC_CDR(tmpMeta46))
{
_n = MMC_CAR(tmpMeta46);
tmpMeta47 = stringAppend(_d,_OMC_LIT27);
tmpMeta48 = stringAppend(tmpMeta47,_n);
if((!omc_System_regularFileExists(threadData, tmpMeta48)))
{
tmpMeta49 = mmc_mk_cons(_n, mmc_mk_cons(_cmd, mmc_mk_cons(omc_System_pwd(threadData), MMC_REFSTRUCTLIT(mmc_nil))));
omc_Error_addSourceMessage(threadData, _OMC_LIT193, tmpMeta49, _info);
_didFind = 0;
}
}
}
}
}
if(_didFind)
{
{
modelica_metatype __omcQ_24tmpVar11;
modelica_metatype* tmp53;
modelica_metatype tmpMeta54;
modelica_string __omcQ_24tmpVar10;
modelica_integer tmp55;
modelica_metatype _x_loopVar = 0;
modelica_metatype tmpMeta56;
modelica_metatype _x;
{
modelica_metatype __omcQ_24tmpVar7;
modelica_metatype* tmp57;
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype __omcQ_24tmpVar6;
modelica_integer tmp65;
modelica_metatype _n_loopVar = 0;
modelica_metatype _n;
_n_loopVar = _names;
tmpMeta58 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar7 = tmpMeta58;
tmp57 = &__omcQ_24tmpVar7;
while(1) {
tmp65 = 1;
if (!listEmpty(_n_loopVar)) {
_n = MMC_CAR(_n_loopVar);
_n_loopVar = MMC_CDR(_n_loopVar);
tmp65--;
}
if (tmp65 == 0) {
{
modelica_metatype __omcQ_24tmpVar9;
modelica_metatype* tmp60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_string __omcQ_24tmpVar8;
modelica_integer tmp64;
modelica_metatype _d_loopVar = 0;
modelica_metatype _d;
_d_loopVar = _dirs2;
tmpMeta61 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar9 = tmpMeta61;
tmp60 = &__omcQ_24tmpVar9;
while(1) {
tmp64 = 1;
if (!listEmpty(_d_loopVar)) {
_d = MMC_CAR(_d_loopVar);
_d_loopVar = MMC_CDR(_d_loopVar);
tmp64--;
}
if (tmp64 == 0) {
tmpMeta62 = stringAppend(_d,_OMC_LIT27);
tmpMeta63 = stringAppend(tmpMeta62,_n);
__omcQ_24tmpVar8 = tmpMeta63;
*tmp60 = mmc_mk_cons(__omcQ_24tmpVar8,0);
tmp60 = &MMC_CDR(*tmp60);
} else if (tmp64 == 1) {
break;
} else {
goto goto_15;
}
}
*tmp60 = mmc_mk_nil();
tmpMeta59 = __omcQ_24tmpVar9;
}
__omcQ_24tmpVar6 = tmpMeta59;
*tmp57 = mmc_mk_cons(__omcQ_24tmpVar6,0);
tmp57 = &MMC_CDR(*tmp57);
} else if (tmp65 == 1) {
break;
} else {
goto goto_15;
}
}
*tmp57 = mmc_mk_nil();
tmpMeta56 = __omcQ_24tmpVar7;
}
_x_loopVar = omc_List_flatten(threadData, tmpMeta56);
tmpMeta54 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar11 = tmpMeta54;
tmp53 = &__omcQ_24tmpVar11;
while(1) {
tmp55 = 1;
while (!listEmpty(_x_loopVar)) {
_x = MMC_CAR(_x_loopVar);
_x_loopVar = MMC_CDR(_x_loopVar);
if (omc_System_regularFileExists(threadData, _x)) {
tmp55--;
break;
}
}
if (tmp55 == 0) {
__omcQ_24tmpVar10 = _x;
*tmp53 = mmc_mk_cons(__omcQ_24tmpVar10,0);
tmp53 = &MMC_CDR(*tmp53);
} else if (tmp55 == 1) {
break;
} else {
goto goto_15;
}
}
*tmp53 = mmc_mk_nil();
tmpMeta52 = __omcQ_24tmpVar11;
}
_found = listHead(tmpMeta52);
tmpMeta67 = stringAppend(_OMC_LIT194,_found);
tmpMeta68 = stringAppend(tmpMeta67,_OMC_LIT195);
tmpMeta69 = stringAppend(tmpMeta68,_resourcesStr);
tmpMeta70 = stringAppend(tmpMeta69,_OMC_LIT185);
tmpMeta71 = stringAppend(tmpMeta70,_dir);
tmpMeta66 = mmc_mk_cons(tmpMeta71, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT178, tmpMeta66, _info);
}
}
}
else
{
tmpMeta73 = stringAppend(_OMC_LIT184,_tmpdir);
tmpMeta74 = stringAppend(tmpMeta73,_OMC_LIT185);
tmpMeta75 = stringAppend(tmpMeta74,_dir);
tmpMeta72 = mmc_mk_cons(tmpMeta75, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT183, tmpMeta72, _info);
}
omc_System_cd(threadData, _pwd);
omc_System_removeDirectory(threadData, _tmpdir);
tmpMeta77 = stringAppend(_OMC_LIT198,_tmpdir);
tmpMeta76 = mmc_mk_cons(tmpMeta77, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addSourceMessage(threadData, _OMC_LIT178, tmpMeta76, _info);
if(_didFind)
{
break;
}
}
}
}
goto tmp16_done;
}
case 1: {
goto tmp16_done;
}
}
goto tmp16_end;
tmp16_end: ;
}
goto goto_15;
goto_15:;
MMC_THROW_INTERNAL();
goto tmp16_done;
tmp16_done:;
}
}
;
{
modelica_boolean __omcQ_24tmpVar13;
modelica_boolean tmp88;
modelica_boolean __omcQ_24tmpVar12;
modelica_integer tmp92;
modelica_metatype _n_loopVar = 0;
modelica_metatype _n;
_n_loopVar = _names;
__omcQ_24tmpVar13 = 0;
while(1) {
tmp92 = 1;
if (!listEmpty(_n_loopVar)) {
_n = MMC_CAR(_n_loopVar);
_n_loopVar = MMC_CDR(_n_loopVar);
tmp92--;
}
if (tmp92 == 0) {
{
modelica_boolean __omcQ_24tmpVar15;
modelica_metatype tmpMeta89;
modelica_metatype tmpMeta90;
modelica_boolean __omcQ_24tmpVar14;
modelica_integer tmp91;
modelica_metatype _d_loopVar = 0;
modelica_metatype _d;
_d_loopVar = _dirs2;
__omcQ_24tmpVar15 = 0;
while(1) {
tmp91 = 1;
if (!listEmpty(_d_loopVar)) {
_d = MMC_CAR(_d_loopVar);
_d_loopVar = MMC_CDR(_d_loopVar);
tmp91--;
}
if (tmp91 == 0) {
tmpMeta89 = stringAppend(_d,_OMC_LIT27);
tmpMeta90 = stringAppend(tmpMeta89,_n);
__omcQ_24tmpVar14 = omc_System_regularFileExists(threadData, tmpMeta90);
__omcQ_24tmpVar15 = (__omcQ_24tmpVar14 || __omcQ_24tmpVar15);
} else if (tmp91 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
tmp88 = __omcQ_24tmpVar15;
}
__omcQ_24tmpVar12 = tmp88;
__omcQ_24tmpVar13 = (__omcQ_24tmpVar12 || __omcQ_24tmpVar13);
} else if (tmp92 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
tmp87 = __omcQ_24tmpVar13;
}
if((!tmp87))
{
if((!omc_Testsuite_isRunning(threadData)))
{
{
modelica_string __omcQ_24tmpVar19;
modelica_string tmp95;
modelica_string __omcQ_24tmpVar18;
modelica_metatype tmpMeta101;
modelica_integer tmp102;
modelica_metatype _n_loopVar = 0;
modelica_metatype _n;
_n_loopVar = _names;
__omcQ_24tmpVar19 = (modelica_string) mmc_emptystring;
while(1) {
tmp102 = 1;
if (!listEmpty(_n_loopVar)) {
_n = MMC_CAR(_n_loopVar);
_n_loopVar = MMC_CDR(_n_loopVar);
tmp102--;
}
if (tmp102 == 0) {
{
modelica_string __omcQ_24tmpVar21;
modelica_metatype tmpMeta96;
modelica_metatype tmpMeta97;
modelica_metatype tmpMeta98;
modelica_string __omcQ_24tmpVar20;
modelica_metatype tmpMeta99;
modelica_integer tmp100;
modelica_metatype _d_loopVar = 0;
modelica_metatype _d;
_d_loopVar = _dirs2;
__omcQ_24tmpVar21 = (modelica_string) mmc_emptystring;
while(1) {
tmp100 = 1;
if (!listEmpty(_d_loopVar)) {
_d = MMC_CAR(_d_loopVar);
_d_loopVar = MMC_CDR(_d_loopVar);
tmp100--;
}
if (tmp100 == 0) {
tmpMeta96 = stringAppend(_OMC_LIT204,_d);
tmpMeta97 = stringAppend(tmpMeta96,_OMC_LIT27);
tmpMeta98 = stringAppend(tmpMeta97,_n);
__omcQ_24tmpVar20 = tmpMeta98;
tmpMeta99 = stringAppend(__omcQ_24tmpVar21,__omcQ_24tmpVar20);
__omcQ_24tmpVar21 = tmpMeta99;
} else if (tmp100 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
tmp95 = __omcQ_24tmpVar21;
}
__omcQ_24tmpVar18 = tmp95;
tmpMeta101 = stringAppend(__omcQ_24tmpVar19,__omcQ_24tmpVar18);
__omcQ_24tmpVar19 = tmpMeta101;
} else if (tmp102 == 1) {
break;
} else {
MMC_THROW_INTERNAL();
}
}
tmp94 = __omcQ_24tmpVar19;
}
tmpMeta93 = mmc_mk_cons(_name, mmc_mk_cons(tmp94, MMC_REFSTRUCTLIT(mmc_nil)));
omc_Error_addSourceMessage(threadData, _OMC_LIT203, tmpMeta93, _info);
}
}
}
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_generateExtFunctionIncludes(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inAbsynAnnotationOption, modelica_metatype _info, modelica_metatype *out_includeDirs, modelica_metatype *out_libs, modelica_metatype *out_paths, modelica_boolean *out_dynamcLoad)
{
modelica_metatype _includes = NULL;
modelica_metatype _includeDirs = NULL;
modelica_metatype _libs = NULL;
modelica_metatype _paths = NULL;
modelica_boolean _dynamcLoad;
modelica_boolean tmp1_c4 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[5] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inAbsynAnnotationOption;
{
modelica_metatype _mod = NULL;
modelica_boolean _b;
modelica_string _target = NULL;
modelica_metatype _resources = NULL;
modelica_metatype _libNames = NULL;
modelica_metatype _fullLibNames = NULL;
modelica_metatype _dirs = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_boolean tmp22;
modelica_metatype tmpMeta23;
if (optionNone(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_mod = tmpMeta7;
_b = omc_SimCodeFunctionUtil_generateExtFunctionDynamicLoad(threadData, _mod);
_target = omc_Flags_getConfigString(threadData, _OMC_LIT165);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionIncludesLibstr(threadData, _target, _mod ,&_libNames);
_includes = omc_SimCodeFunctionUtil_generateExtFunctionIncludesIncludestr(threadData, _mod);
_libs = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryFlags(threadData, _program, _path, _mod, _libs ,&_dirs ,&_resources);
tmp22 = (modelica_boolean)omc_Flags_isSet(threadData, _OMC_LIT210);
if(tmp22)
{
tmpMeta23 = _libNames;
}
else
{
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta23 = tmpMeta21;
}
{
modelica_metatype _name;
for (tmpMeta8 = tmpMeta23; !listEmpty(tmpMeta8); tmpMeta8=MMC_CDR(tmpMeta8))
{
_name = MMC_CAR(tmpMeta8);
if((stringEqual(omc_SimCodeFunctionUtil_getGerneralTarget(threadData, _target), _OMC_LIT67)))
{
tmpMeta10 = stringAppend(_name,_OMC_LIT15);
tmpMeta11 = stringAppend(_OMC_LIT205,_name);
tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT206);
tmpMeta13 = stringAppend(_OMC_LIT205,_name);
tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT132);
tmpMeta9 = mmc_mk_cons(tmpMeta10, mmc_mk_cons(tmpMeta12, mmc_mk_cons(tmpMeta14, MMC_REFSTRUCTLIT(mmc_nil))));
_fullLibNames = tmpMeta9;
}
else
{
tmpMeta16 = stringAppend(_OMC_LIT205,_name);
tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT206);
tmpMeta18 = stringAppend(_OMC_LIT205,_name);
tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT15);
tmpMeta15 = mmc_mk_cons(tmpMeta17, mmc_mk_cons(tmpMeta19, MMC_REFSTRUCTLIT(mmc_nil)));
_fullLibNames = tmpMeta15;
}
omc_SimCodeFunctionUtil_lookForExtFunctionLibrary(threadData, _fullLibNames, _dirs, _name, _resources, _path, _info);
}
}
_paths = omc_SimCodeFunctionUtil_generateExtFunctionLibraryDirectoryPaths(threadData, _program, _path, _mod);
_includeDirs = omc_SimCodeFunctionUtil_generateExtFunctionIncludeDirectoryFlags(threadData, _program, _path, _mod, _includes);
tmpMeta[0+0] = _includes;
tmpMeta[0+1] = _includeDirs;
tmpMeta[0+2] = _libs;
tmpMeta[0+3] = _paths;
tmp1_c4 = _b;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
if (!optionNone(tmp4_1)) goto tmp3_end;
tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta27 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta[0+0] = tmpMeta24;
tmpMeta[0+1] = tmpMeta25;
tmpMeta[0+2] = tmpMeta26;
tmpMeta[0+3] = tmpMeta27;
tmp1_c4 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_includes = tmpMeta[0+0];
_includeDirs = tmpMeta[0+1];
_libs = tmpMeta[0+2];
_paths = tmpMeta[0+3];
_dynamcLoad = tmp1_c4;
_return: OMC_LABEL_UNUSED
if (out_includeDirs) { *out_includeDirs = _includeDirs; }
if (out_libs) { *out_libs = _libs; }
if (out_paths) { *out_paths = _paths; }
if (out_dynamcLoad) { *out_dynamcLoad = _dynamcLoad; }
return _includes;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_generateExtFunctionIncludes(threadData_t *threadData, modelica_metatype _program, modelica_metatype _path, modelica_metatype _inAbsynAnnotationOption, modelica_metatype _info, modelica_metatype *out_includeDirs, modelica_metatype *out_libs, modelica_metatype *out_paths, modelica_metatype *out_dynamcLoad)
{
modelica_boolean _dynamcLoad;
modelica_metatype _includes = NULL;
_includes = omc_SimCodeFunctionUtil_generateExtFunctionIncludes(threadData, _program, _path, _inAbsynAnnotationOption, _info, out_includeDirs, out_libs, out_paths, &_dynamcLoad);
if (out_dynamcLoad) { *out_dynamcLoad = mmc_mk_icon(_dynamcLoad); }
return _includes;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords(threadData_t *threadData, modelica_metatype _inExpl, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes)
{
modelica_metatype _outRecordDecls = NULL;
modelica_metatype _outReturnTypes = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inExpl;
tmp4_2 = _inAccRecordDecls;
tmp4_3 = _inReturnTypes;
{
modelica_metatype _rt = NULL;
modelica_metatype _rt_1 = NULL;
modelica_metatype _fieldNames = NULL;
modelica_metatype _rest = NULL;
modelica_string _name = NULL;
modelica_metatype _path = NULL;
modelica_metatype _accRecDecls = NULL;
modelica_boolean _b;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,32,5) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
_path = tmpMeta8;
_fieldNames = tmpMeta9;
_rest = tmpMeta7;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
_name = omc_AbsynUtil_pathStringUnquoteReplaceDot(threadData, _path, _OMC_LIT29);
_b = listMember(_name, _rt);
tmpMeta10 = mmc_mk_box3(5, &SimCodeFunction_RecordDeclaration_RECORD__DECL__DEF__desc, _path, _fieldNames);
_accRecDecls = omc_List_consOnTrue(threadData, (!_b), tmpMeta10, _accRecDecls);
_rt_1 = omc_List_consOnTrue(threadData, (!_b), _name, _rt);
_inExpl = _rest;
_inAccRecordDecls = _accRecDecls;
_inReturnTypes = _rt_1;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
_rest = tmpMeta12;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
_inExpl = _rest;
_inAccRecordDecls = _accRecDecls;
_inReturnTypes = _rt;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outRecordDecls = tmpMeta[0+0];
_outReturnTypes = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outReturnTypes) { *out_outReturnTypes = _outReturnTypes; }
return _outRecordDecls;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateNestedRecordDeclarations(threadData_t *threadData, modelica_metatype _inRecordTypes, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes)
{
modelica_metatype _outRecordDecls = NULL;
modelica_metatype _outReturnTypes = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
tmp4_1 = _inRecordTypes;
tmp4_2 = _inAccRecordDecls;
tmp4_3 = _inReturnTypes;
{
modelica_metatype _ty = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _rt = NULL;
modelica_metatype _rt_1 = NULL;
modelica_metatype _accRecDecls = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmp4 += 2;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,9,3) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,3,1) == 0) goto tmp3_end;
_ty = tmpMeta8;
_rest = tmpMeta7;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
_accRecDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord(threadData, _ty, _accRecDecls, _rt ,&_rt_1);
tmpMeta[0+0] = omc_SimCodeFunctionUtil_elaborateNestedRecordDeclarations(threadData, _rest, _accRecDecls, _rt_1, &tmpMeta[0+1]);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
_rest = tmpMeta11;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmpMeta[0+0] = omc_SimCodeFunctionUtil_elaborateNestedRecordDeclarations(threadData, _rest, _accRecDecls, _rt, &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:;
}
}
_outRecordDecls = tmpMeta[0+0];
_outReturnTypes = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outReturnTypes) { *out_outReturnTypes = _outReturnTypes; }
return _outRecordDecls;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_generateVarName(threadData_t *threadData, modelica_metatype _inVar)
{
modelica_string _outName = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVar;
{
modelica_string _name = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_name = tmpMeta6;
tmp1 = _name;
goto tmp3_done;
}
case 1: {
tmp1 = _OMC_LIT211;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outName = tmp1;
_return: OMC_LABEL_UNUSED
return _outName;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_compareVariable(threadData_t *threadData, modelica_metatype _v1, modelica_metatype _v2)
{
modelica_boolean _b;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_b = (stringCompare(omc_SimCodeFunctionUtil_variableName(threadData, _v1), omc_SimCodeFunctionUtil_variableName(threadData, _v2)) > ((modelica_integer) 0));
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_compareVariable(threadData_t *threadData, modelica_metatype _v1, modelica_metatype _v2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_compareVariable(threadData, _v1, _v2);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_variableName(threadData_t *threadData, modelica_metatype _v)
{
modelica_string _s = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _v;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,7) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_s = tmpMeta7;
tmp1 = _s;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_s = tmpMeta8;
tmp1 = _s;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_s = tmp1;
_return: OMC_LABEL_UNUSED
return _s;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_scodeParallelismToDAEParallelism(threadData_t *threadData, modelica_metatype _inParallelism)
{
modelica_metatype _outParallelism = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inParallelism;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmpMeta1 = _OMC_LIT212;
goto tmp3_done;
}
case 4: {
tmpMeta1 = _OMC_LIT213;
goto tmp3_done;
}
case 5: {
tmpMeta1 = _OMC_LIT214;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outParallelism = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outParallelism;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_checkSourceAndGetBindingExp(threadData_t *threadData, modelica_metatype _inBinding)
{
modelica_metatype _bindExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inBinding;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,0) == 0) goto tmp3_end;
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta1 = mmc_mk_some((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inBinding), 2))));
goto tmp3_done;
}
case 2: {
tmpMeta1 = mmc_mk_none();
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_bindExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _bindExp;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration(threadData_t *threadData, modelica_metatype _bind)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _bind;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration(threadData_t *threadData, modelica_metatype _bind)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration(threadData, _bind);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_string omc_SimCodeFunctionUtil_checkBindingsandGetConstructorName(threadData_t *threadData, modelica_string _rec_name, modelica_metatype _vars, modelica_boolean *out_is_default)
{
modelica_string _ctor_name = NULL;
modelica_boolean _is_default;
modelica_integer _varnum;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_is_default = 1;
_ctor_name = _rec_name;
_varnum = ((modelica_integer) 1);
{
modelica_metatype _var;
for (tmpMeta1 = _vars; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
{
_var = MMC_CAR(tmpMeta1);
if((mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_var), 6)))) && (!omc_SimCodeFunctionUtil_isBindingFromDerivedRecordDeclaration(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_var), 5)))))))
{
_is_default = 0;
tmpMeta2 = stringAppend(_ctor_name,_OMC_LIT29);
tmpMeta3 = stringAppend(tmpMeta2,intString(_varnum));
_ctor_name = tmpMeta3;
}
_varnum = ((modelica_integer) 1) + _varnum;
}
}
_return: OMC_LABEL_UNUSED
if (out_is_default) { *out_is_default = _is_default; }
return _ctor_name;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_checkBindingsandGetConstructorName(threadData_t *threadData, modelica_metatype _rec_name, modelica_metatype _vars, modelica_metatype *out_is_default)
{
modelica_boolean _is_default;
modelica_string _ctor_name = NULL;
_ctor_name = omc_SimCodeFunctionUtil_checkBindingsandGetConstructorName(threadData, _rec_name, _vars, &_is_default);
if (out_is_default) { *out_is_default = mmc_mk_icon(_is_default); }
return _ctor_name;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_typesVar(threadData_t *threadData, modelica_metatype _inTypesVar)
{
modelica_metatype _outVar = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTypesVar;
{
modelica_string _name = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cref_ = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _scPrl = NULL;
modelica_metatype _prl = NULL;
modelica_metatype _bindExp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
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));
_name = tmpMeta6;
_attr = tmpMeta7;
_ty = tmpMeta8;
_ty = omc_Types_simplifyType(threadData, _ty);
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_cref_ = omc_ComponentReference_makeCrefIdent(threadData, _name, _ty, tmpMeta9);
tmpMeta10 = _attr;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
_scPrl = tmpMeta11;
_prl = omc_SimCodeFunctionUtil_scodeParallelismToDAEParallelism(threadData, _scPrl);
_bindExp = omc_SimCodeFunctionUtil_checkSourceAndGetBindingExp(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inTypesVar), 5))));
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta13 = mmc_mk_box8(3, &SimCodeFunction_Variable_VARIABLE__desc, _cref_, _ty, _bindExp, tmpMeta12, _prl, _OMC_LIT215, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inTypesVar), 6))));
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVar = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVar;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_typesVarNoBinding(threadData_t *threadData, modelica_metatype _inTypesVar)
{
modelica_metatype _outVar = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inTypesVar;
{
modelica_string _name = NULL;
modelica_metatype _ty = NULL;
modelica_metatype _cref_ = NULL;
modelica_metatype _attr = NULL;
modelica_metatype _scPrl = NULL;
modelica_metatype _prl = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
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));
_name = tmpMeta6;
_attr = tmpMeta7;
_ty = tmpMeta8;
_ty = omc_Types_simplifyType(threadData, _ty);
tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
_cref_ = omc_ComponentReference_makeCrefIdent(threadData, _name, _ty, tmpMeta9);
tmpMeta10 = _attr;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
_scPrl = tmpMeta11;
_prl = omc_SimCodeFunctionUtil_scodeParallelismToDAEParallelism(threadData, _scPrl);
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta13 = mmc_mk_box8(3, &SimCodeFunction_Variable_VARIABLE__desc, _cref_, _ty, mmc_mk_none(), tmpMeta12, _prl, _OMC_LIT215, mmc_mk_boolean(0));
tmpMeta1 = tmpMeta13;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outVar = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVar;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord(threadData_t *threadData, modelica_metatype _inRecordType, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes)
{
modelica_metatype _outRecordDecls = NULL;
modelica_metatype _outReturnTypes = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
tmp4_1 = _inRecordType;
tmp4_2 = _inAccRecordDecls;
tmp4_3 = _inReturnTypes;
{
modelica_metatype _path = NULL;
modelica_metatype _varlst = NULL;
modelica_string _name = NULL;
modelica_string _sname = NULL;
modelica_metatype _rt = NULL;
modelica_metatype _rt_1 = NULL;
modelica_metatype _fieldNames = NULL;
modelica_metatype _accRecDecls = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _recDecl = NULL;
modelica_boolean _is_default;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 5; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,3,1) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_path = tmpMeta7;
_varlst = tmpMeta8;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
_name = omc_AbsynUtil_pathStringUnquoteReplaceDot(threadData, _path, _OMC_LIT29);
_rt_1 = _rt;
_sname = omc_SimCodeFunctionUtil_checkBindingsandGetConstructorName(threadData, _name, _varlst ,&_is_default);
if((!listMember(_sname, _rt_1)))
{
tmpMeta9 = mmc_mk_cons(_sname, _rt_1);
_rt_1 = tmpMeta9;
if(_is_default)
{
_accRecDecls = omc_SimCodeFunctionUtil_elaborateNestedRecordDeclarations(threadData, _varlst, _accRecDecls, _rt_1 ,&_rt_1);
_vars = omc_List_map(threadData, _varlst, boxvar_SimCodeFunctionUtil_typesVar);
tmpMeta10 = mmc_mk_box5(3, &SimCodeFunction_RecordDeclaration_RECORD__DECL__FULL__desc, _sname, mmc_mk_none(), _path, _vars);
_recDecl = tmpMeta10;
}
else
{
_vars = omc_List_map(threadData, _varlst, boxvar_SimCodeFunctionUtil_typesVar);
tmpMeta11 = mmc_mk_box4(4, &SimCodeFunction_RecordDeclaration_RECORD__DECL__ADD__CONSTRCTOR__desc, _sname, _name, _vars);
_recDecl = tmpMeta11;
}
_accRecDecls = omc_List_appendElt(threadData, _recDecl, _accRecDecls);
}
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt_1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,3,1) == 0) goto tmp3_end;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,6) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,0,2) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
if (10 != MMC_STRLEN(tmpMeta14) || strcmp(MMC_STRINGDATA(_OMC_LIT216), MMC_STRINGDATA(tmpMeta14)) != 0) goto tmp3_end;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,21,6) == 0) goto tmp3_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_path = tmpMeta15;
_varlst = tmpMeta16;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
_sname = omc_AbsynUtil_pathStringUnquoteReplaceDot(threadData, _path, _OMC_LIT29);
if((!listMember(_sname, _rt)))
{
_fieldNames = omc_List_map(threadData, _varlst, boxvar_SimCodeFunctionUtil_generateVarName);
tmpMeta18 = mmc_mk_box3(5, &SimCodeFunction_RecordDeclaration_RECORD__DECL__DEF__desc, _path, _fieldNames);
tmpMeta17 = mmc_mk_cons(tmpMeta18, _accRecDecls);
_accRecDecls = tmpMeta17;
tmpMeta19 = mmc_mk_cons(_sname, _rt);
_rt_1 = tmpMeta19;
_accRecDecls = omc_SimCodeFunctionUtil_elaborateNestedRecordDeclarations(threadData, _varlst, _accRecDecls, _rt_1 ,&_rt_1);
}
else
{
_rt_1 = _rt;
}
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt_1;
goto tmp3_done;
}
case 4: {
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outRecordDecls = tmpMeta[0+0];
_outReturnTypes = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outReturnTypes) { *out_outReturnTypes = _outReturnTypes; }
return _outRecordDecls;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getCrefFromExp(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _c = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _crefe = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_crefe = tmpMeta6;
tmpMeta1 = omc_ComponentReference_unelabCref(threadData, _crefe);
goto tmp3_done;
}
case 1: {
omc_Error_addInternalError(threadData, _OMC_LIT217, _OMC_LIT218);
goto goto_2;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_c = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _c;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_useZerocrossing(threadData_t *threadData)
{
modelica_boolean _res;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_res = omc_Flags_isSet(threadData, _OMC_LIT222);
_return: OMC_LABEL_UNUSED
return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_useZerocrossing(threadData_t *threadData)
{
modelica_boolean _res;
modelica_metatype out_res;
_res = omc_SimCodeFunctionUtil_useZerocrossing(threadData);
out_res = mmc_mk_icon(_res);
return out_res;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_SimCodeFunctionUtil_filterNg(threadData_t *threadData, modelica_integer _ng)
{
modelica_integer _outInteger;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outInteger = (omc_SimCodeFunctionUtil_useZerocrossing(threadData)?_ng:((modelica_integer) 0));
_return: OMC_LABEL_UNUSED
return _outInteger;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_filterNg(threadData_t *threadData, modelica_metatype _ng)
{
modelica_integer tmp1;
modelica_integer _outInteger;
modelica_metatype out_outInteger;
tmp1 = mmc_unbox_integer(_ng);
_outInteger = omc_SimCodeFunctionUtil_filterNg(threadData, tmp1);
out_outInteger = mmc_mk_icon(_outInteger);
return out_outInteger;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isDirectionNotInputNotOutput(threadData_t *threadData, modelica_metatype _inVarDirection)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVarDirection;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isDirectionNotInputNotOutput(threadData_t *threadData, modelica_metatype _inVarDirection)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_SimCodeFunctionUtil_isDirectionNotInputNotOutput(threadData, _inVarDirection);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isDirectionNotInput(threadData_t *threadData, modelica_metatype _inVarDirection)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVarDirection;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 4: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isDirectionNotInput(threadData_t *threadData, modelica_metatype _inVarDirection)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_SimCodeFunctionUtil_isDirectionNotInput(threadData, _inVarDirection);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData_t *threadData, modelica_metatype _inVarKind)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inVarKind;
{
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
tmp1 = 1;
goto tmp3_done;
}
case 5: {
tmp1 = 1;
goto tmp3_done;
}
case 6: {
tmp1 = 1;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData_t *threadData, modelica_metatype _inVarKind)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData, _inVarKind);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isVarNotInputNotOutput(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_metatype _vk = NULL;
modelica_metatype _vd = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_vk = tmpMeta6;
_vd = tmpMeta7;
if (!(omc_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData, _vk) && omc_SimCodeFunctionUtil_isDirectionNotInputNotOutput(threadData, _vd))) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isVarNotInputNotOutput(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_SimCodeFunctionUtil_isVarNotInputNotOutput(threadData, _inElement);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isVarQ(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _outB;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_metatype _vk = NULL;
modelica_metatype _vd = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_vk = tmpMeta6;
_vd = tmpMeta7;
if (!(omc_SimCodeFunctionUtil_isVarKindVarOrParameter(threadData, _vk) && omc_SimCodeFunctionUtil_isDirectionNotInput(threadData, _vd))) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outB = tmp1;
_return: OMC_LABEL_UNUSED
return _outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isVarQ(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_boolean _outB;
modelica_metatype out_outB;
_outB = omc_SimCodeFunctionUtil_isVarQ(threadData, _inElement);
out_outB = mmc_mk_icon(_outB);
return out_outB;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_matchMetarecordCalls(threadData_t *threadData, modelica_metatype _e, modelica_metatype _acc, modelica_metatype *out_outExps)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outExps = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_integer _index;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_integer tmp7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,32,5) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp7 = mmc_unbox_integer(tmpMeta6);
_index = tmp7;
_outExps = omc_List_consOnTrue(threadData, (((modelica_integer) -1) != _index), _e, _acc);
tmpMeta[0+0] = _e;
tmpMeta[0+1] = _outExps;
goto tmp3_done;
}
case 1: {
tmpMeta[0+0] = _e;
tmpMeta[0+1] = _acc;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outExps = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outExps) { *out_outExps = _outExps; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData_t *threadData, modelica_metatype _inVars, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes)
{
modelica_metatype _outRecordDecls = NULL;
modelica_metatype _outReturnTypes = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;
tmp4_1 = _inVars;
tmp4_2 = _inAccRecordDecls;
tmp4_3 = _inReturnTypes;
{
modelica_metatype _rest = NULL;
modelica_metatype _ft = NULL;
modelica_metatype _rt = NULL;
modelica_metatype _rt_1 = NULL;
modelica_metatype _rt_2 = NULL;
modelica_metatype _accRecDecls = NULL;
modelica_metatype _algorithm_ = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _binding = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmp4 += 3;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _rt;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,13) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 7));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 8));
_ft = tmpMeta8;
_binding = tmpMeta9;
_rest = tmpMeta7;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmp4 += 1;
_accRecDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord(threadData, _ft, _accRecDecls, _rt ,&_rt_1);
if((isSome(_binding) && omc_Config_acceptMetaModelicaGrammar(threadData)))
{
tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
omc_Expression_traverseExpBottomUp(threadData, omc_Util_getOption(threadData, _binding), boxvar_SimCodeFunctionUtil_matchMetarecordCalls, tmpMeta10 ,&_expl);
_accRecDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords(threadData, _expl, _accRecDecls, _rt_1 ,&_rt_1);
}
tmpMeta[0+0] = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _rest, _accRecDecls, _rt_1, &tmpMeta[0+1]);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_boolean tmp14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,16,2) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
_algorithm_ = tmpMeta13;
_rest = tmpMeta12;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmp14 = omc_Config_acceptMetaModelicaGrammar(threadData);
if (1 != tmp14) goto goto_2;
tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta16 = mmc_mk_box2(0, boxvar_SimCodeFunctionUtil_matchMetarecordCalls, tmpMeta15);
tmpMeta17 = omc_DAEUtil_traverseAlgorithmExps(threadData, _algorithm_, boxvar_Expression_traverseSubexpressionsHelper, tmpMeta16);
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
_expl = tmpMeta18;
_accRecDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords(threadData, _expl, _accRecDecls, _rt ,&_rt_2);
tmpMeta[0+0] = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _rest, _accRecDecls, _rt_2, &tmpMeta[0+1]);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmp4_1);
tmpMeta20 = MMC_CDR(tmp4_1);
_rest = tmpMeta20;
_accRecDecls = tmp4_2;
_rt = tmp4_3;
tmpMeta[0+0] = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _rest, _accRecDecls, _rt, &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:;
}
}
_outRecordDecls = tmpMeta[0+0];
_outReturnTypes = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outReturnTypes) { *out_outReturnTypes = _outReturnTypes; }
return _outRecordDecls;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes(threadData_t *threadData, modelica_metatype _inTypes, modelica_metatype _inAccRecordDecls, modelica_metatype _inReturnTypes, modelica_metatype *out_outReturnTypes)
{
modelica_metatype _outRecordDecls = NULL;
modelica_metatype _outReturnTypes = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inTypes;
tmp4_2 = _inAccRecordDecls;
{
modelica_metatype _accRecDecls = NULL;
modelica_metatype _firstType = NULL;
modelica_metatype _restTypes = NULL;
modelica_metatype _returnTypes = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_accRecDecls = tmp4_2;
tmpMeta[0+0] = _accRecDecls;
tmpMeta[0+1] = _inReturnTypes;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_firstType = tmpMeta6;
_restTypes = tmpMeta7;
_accRecDecls = tmp4_2;
_accRecDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord(threadData, _firstType, _accRecDecls, _inReturnTypes ,&_returnTypes);
_inTypes = _restTypes;
_inAccRecordDecls = _accRecDecls;
_inReturnTypes = _returnTypes;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outRecordDecls = tmpMeta[0+0];
_outReturnTypes = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outReturnTypes) { *out_outReturnTypes = _outReturnTypes; }
return _outRecordDecls;
}
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isLiteralExp(threadData_t *threadData, modelica_metatype _iexp)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _iexp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _expl = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 14; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,2) == 0) goto tmp2_end;
goto tmp2_done;
}
case 5: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,31,1) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (!optionNone(tmpMeta5)) goto tmp2_end;
goto tmp2_done;
}
case 6: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,31,1) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (optionNone(tmpMeta6)) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_exp = tmpMeta7;
_iexp = _exp;
goto _tailrecursive;
;
goto tmp2_done;
}
case 7: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,34,1) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_exp = tmpMeta8;
_iexp = _exp;
goto _tailrecursive;
;
goto tmp2_done;
}
case 8: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,29,2) == 0) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
_e1 = tmpMeta9;
_e2 = tmpMeta10;
omc_SimCodeFunctionUtil_isLiteralExp(threadData, _e1);
_iexp = _e2;
goto _tailrecursive;
;
goto tmp2_done;
}
case 9: {
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,28,1) == 0) goto tmp2_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_expl = tmpMeta11;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralExp);
goto tmp2_done;
}
case 10: {
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,30,1) == 0) goto tmp2_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_expl = tmpMeta12;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralExp);
goto tmp2_done;
}
case 11: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,32,5) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
_expl = tmpMeta13;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralExp);
goto tmp2_done;
}
case 12: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,36,2) == 0) goto tmp2_end;
goto tmp2_done;
}
case 13: {
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,13,3) == 0) goto tmp2_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,1,1) == 0) goto tmp2_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (16 != MMC_STRLEN(tmpMeta15) || strcmp(MMC_STRINGDATA(_OMC_LIT223), MMC_STRINGDATA(tmpMeta15)) != 0) goto tmp2_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
_expl = tmpMeta16;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralExp);
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_SimCodeFunctionUtil_isLiteralArrayExp(threadData_t *threadData, modelica_metatype _iexp)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _iexp;
{
modelica_metatype _e1 = NULL;
modelica_metatype _e2 = NULL;
modelica_metatype _exp = NULL;
modelica_metatype _expl = NULL;
modelica_metatype _expll = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 15; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,2,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 4: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,16,3) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 4));
_expl = tmpMeta5;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralArrayExp);
goto tmp2_done;
}
case 5: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,17,3) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 4));
_expll = tmpMeta6;
omc_List_map__0(threadData, omc_List_flatten(threadData, _expll), boxvar_SimCodeFunctionUtil_isLiteralArrayExp);
goto tmp2_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,2) == 0) goto tmp2_end;
goto tmp2_done;
}
case 7: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,31,1) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (!optionNone(tmpMeta7)) goto tmp2_end;
goto tmp2_done;
}
case 8: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,31,1) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (optionNone(tmpMeta8)) goto tmp2_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
_exp = tmpMeta9;
_iexp = _exp;
goto _tailrecursive;
;
goto tmp2_done;
}
case 9: {
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,34,1) == 0) goto tmp2_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_exp = tmpMeta10;
_iexp = _exp;
goto _tailrecursive;
;
goto tmp2_done;
}
case 10: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,29,2) == 0) goto tmp2_end;
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
_e1 = tmpMeta11;
_e2 = tmpMeta12;
omc_SimCodeFunctionUtil_isLiteralArrayExp(threadData, _e1);
_iexp = _e2;
goto _tailrecursive;
;
goto tmp2_done;
}
case 11: {
modelica_metatype tmpMeta13;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,28,1) == 0) goto tmp2_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_expl = tmpMeta13;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralArrayExp);
goto tmp2_done;
}
case 12: {
modelica_metatype tmpMeta14;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,30,1) == 0) goto tmp2_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
_expl = tmpMeta14;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralArrayExp);
goto tmp2_done;
}
case 13: {
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,32,5) == 0) goto tmp2_end;
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
_expl = tmpMeta15;
omc_List_map__0(threadData, _expl, boxvar_SimCodeFunctionUtil_isLiteralArrayExp);
goto tmp2_done;
}
case 14: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,36,2) == 0) goto tmp2_end;
goto tmp2_done;
}
}
goto tmp2_end;
tmp2_end: ;
}
goto goto_1;
goto_1:;
MMC_THROW_INTERNAL();
goto tmp2_done;
tmp2_done:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isTrivialLiteralExp(threadData_t *threadData, modelica_metatype _exp)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _exp;
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 10; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,34,1) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,2,1) == 0) goto tmp2_end;
goto goto_1;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,34,1) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp2_end;
goto goto_1;
goto tmp2_done;
}
case 2: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,34,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 4: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 5: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 6: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,5,2) == 0) goto tmp2_end;
goto tmp2_done;
}
case 7: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,28,1) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (!listEmpty(tmpMeta7)) goto tmp2_end;
goto tmp2_done;
}
case 8: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,31,1) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 2));
if (!optionNone(tmpMeta8)) goto tmp2_end;
goto tmp2_done;
}
case 9: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,36,2) == 0) goto tmp2_end;
goto tmp2_done;
}
}
goto tmp2_end;
tmp2_end: ;
}
goto goto_1;
goto_1:;
MMC_THROW_INTERNAL();
goto tmp2_done;
tmp2_done:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_listToCons2(threadData_t *threadData, modelica_metatype _ies)
{
modelica_metatype _o = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _ies;
{
modelica_metatype _car = NULL;
modelica_metatype _cdr = NULL;
modelica_metatype _es = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta1 = _OMC_LIT224;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
_car = tmpMeta6;
_es = tmpMeta7;
_cdr = omc_SimCodeFunctionUtil_listToCons2(threadData, _es);
tmpMeta8 = mmc_mk_box3(32, &DAE_Exp_CONS__desc, _car, _cdr);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_o = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _o;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_listToCons(threadData_t *threadData, modelica_metatype _e)
{
modelica_metatype _o = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _e;
{
modelica_metatype _es = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (listEmpty(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_CAR(tmpMeta6);
tmpMeta8 = MMC_CDR(tmpMeta6);
_es = tmpMeta6;
tmpMeta1 = omc_SimCodeFunctionUtil_listToCons2(threadData, _es);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_o = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _o;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_replaceLiteralExp2(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTpl = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_metatype _exp = NULL;
modelica_metatype _nexp = NULL;
modelica_integer _i;
modelica_integer _ix;
modelica_metatype _l = NULL;
modelica_metatype _ht = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_exp = tmp4_1;
_ht = tmpMeta6;
_ix = mmc_unbox_integer(omc_BaseHashTable_get(threadData, _exp, _ht));
tmpMeta7 = mmc_mk_box3(39, &DAE_Exp_SHARED__LITERAL__desc, mmc_mk_integer(_ix), _exp);
_nexp = tmpMeta7;
tmpMeta[0+0] = _nexp;
tmpMeta[0+1] = _inTpl;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_integer tmp9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
tmp9 = mmc_unbox_integer(tmpMeta8);
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
_exp = tmp4_1;
_i = tmp9;
_ht = tmpMeta10;
_l = tmpMeta11;
tmpMeta12 = mmc_mk_box2(0, _exp, mmc_mk_integer(_i));
_ht = omc_BaseHashTable_add(threadData, tmpMeta12, _ht);
tmpMeta13 = mmc_mk_box3(39, &DAE_Exp_SHARED__LITERAL__desc, mmc_mk_integer(_i), _exp);
_nexp = tmpMeta13;
tmpMeta14 = mmc_mk_cons(_exp, _l);
tmpMeta15 = mmc_mk_box3(0, mmc_mk_integer(((modelica_integer) 1) + _i), _ht, tmpMeta14);
tmpMeta[0+0] = _nexp;
tmpMeta[0+1] = 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:;
}
}
_outExp = tmpMeta[0+0];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_replaceLiteralExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_metatype _outTpl = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_metatype _exp = NULL;
modelica_string _msg = NULL;
modelica_metatype _t = NULL;
modelica_metatype _es = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_boolean tmp6;
_exp = tmp4_1;
_t = tmp4_2;
tmp6 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_SimCodeFunctionUtil_isLiteralExp(threadData, _exp);
tmp6 = 1;
goto goto_7;
goto_7:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp6) {goto goto_2;}
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _t;
goto tmp3_done;
}
case 1: {
_exp = tmp4_1;
_t = tmp4_2;
omc_SimCodeFunctionUtil_isTrivialLiteralExp(threadData, _exp);
tmpMeta[0+0] = _exp;
tmpMeta[0+1] = _t;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,28,1) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_es = tmpMeta8;
_t = tmp4_2;
tmp9 = (listLength(_es) > ((modelica_integer) 25));
if (1 != tmp9) goto goto_2;
tmpMeta[0+0] = omc_SimCodeFunctionUtil_replaceLiteralExp2(threadData, _inExp, _t, &tmpMeta[0+1]);
goto tmp3_done;
}
case 3: {
_exp = tmp4_1;
_t = tmp4_2;
_exp = omc_SimCodeFunctionUtil_listToCons(threadData, _exp);
tmpMeta[0+0] = omc_Expression_traverseExpBottomUp(threadData, _exp, boxvar_SimCodeFunctionUtil_replaceLiteralExp, _t, &tmpMeta[0+1]);
goto tmp3_done;
}
case 4: {
modelica_boolean tmp10;
_exp = tmp4_1;
tmp10 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_SimCodeFunctionUtil_listToCons(threadData, _exp);
tmp10 = 1;
goto goto_11;
goto_11:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp10) {goto goto_2;}
tmpMeta[0+0] = omc_SimCodeFunctionUtil_replaceLiteralExp2(threadData, _exp, _inTpl, &tmpMeta[0+1]);
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
_exp = tmp4_1;
tmpMeta12 = stringAppend(_OMC_LIT225,omc_ExpressionDump_printExpStr(threadData, _exp));
tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT54);
_msg = tmpMeta13;
omc_Error_addInternalError(threadData, _msg, _OMC_LIT226);
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 6) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta[0+0];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_replaceLiteralArrayExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_boolean *out_cont, modelica_metatype *out_outTpl)
{
modelica_metatype _outExp = NULL;
modelica_boolean _cont;
modelica_metatype _outTpl = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_cont = 1;
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inExp;
tmp4_2 = _inTpl;
{
modelica_metatype _exp2 = NULL;
modelica_metatype _tpl = NULL;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 19: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,3) == 0) goto tmp3_end;
_tpl = tmp4_2;
{
{
volatile mmc_switch_type tmp7;
int tmp8;
tmp7 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp6_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp7 < 2; tmp7++) {
switch (MMC_SWITCH_CAST(tmp7)) {
case 0: {
omc_SimCodeFunctionUtil_isLiteralArrayExp(threadData, _inExp);
_exp2 = omc_SimCodeFunctionUtil_replaceLiteralExp2(threadData, _inExp, _tpl ,&_tpl);
_cont = 0;
goto tmp6_done;
}
case 1: {
_exp2 = _inExp;
goto tmp6_done;
}
}
goto tmp6_end;
tmp6_end: ;
}
goto goto_5;
tmp6_done:
(void)tmp7;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp6_done2;
goto_5:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp7 < 2) {
goto tmp6_top;
}
goto goto_2;
tmp6_done2:;
}
}
;
tmpMeta[0+0] = _exp2;
tmpMeta[0+1] = _tpl;
goto tmp3_done;
}
case 20: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
_tpl = tmp4_2;
{
{
volatile mmc_switch_type tmp11;
int tmp12;
tmp11 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp10_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp11 < 2; tmp11++) {
switch (MMC_SWITCH_CAST(tmp11)) {
case 0: {
omc_SimCodeFunctionUtil_isLiteralArrayExp(threadData, _inExp);
_exp2 = omc_SimCodeFunctionUtil_replaceLiteralExp2(threadData, _inExp, _tpl ,&_tpl);
_cont = 0;
goto tmp10_done;
}
case 1: {
_exp2 = _inExp;
goto tmp10_done;
}
}
goto tmp10_end;
tmp10_end: ;
}
goto goto_9;
tmp10_done:
(void)tmp11;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp10_done2;
goto_9:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp11 < 2) {
goto tmp10_top;
}
goto goto_2;
tmp10_done2:;
}
}
;
tmpMeta[0+0] = _exp2;
tmpMeta[0+1] = _tpl;
goto tmp3_done;
}
default:
tmp3_default: OMC_LABEL_UNUSED; {
tmpMeta[0+0] = _inExp;
tmpMeta[0+1] = _inTpl;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta[0+0];
_outTpl = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_cont) { *out_cont = _cont; }
if (out_outTpl) { *out_outTpl = _outTpl; }
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_replaceLiteralArrayExp(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_cont, modelica_metatype *out_outTpl)
{
modelica_boolean _cont;
modelica_metatype _outExp = NULL;
_outExp = omc_SimCodeFunctionUtil_replaceLiteralArrayExp(threadData, _inExp, _inTpl, &_cont, out_outTpl);
if (out_cont) { *out_cont = mmc_mk_icon(_cont); }
return _outExp;
}
static modelica_metatype closure0_Patternm_traverseConstantPatternsHelper(threadData_t *thData, modelica_metatype closure, modelica_metatype inExp, modelica_metatype inT, modelica_metatype tmp1)
{
modelica_fnptr func = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
return boxptr_Patternm_traverseConstantPatternsHelper(thData, inExp, inT, func, tmp1);
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_findLiteralsHelper(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inTpl, modelica_metatype *out_tpl)
{
modelica_metatype _exp = NULL;
modelica_metatype _tpl = NULL;
modelica_metatype tmpMeta2;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_exp = _inExp;
_tpl = _inTpl;
tmpMeta2 = mmc_mk_box1(0, boxvar_SimCodeFunctionUtil_replaceLiteralExp);
_exp = omc_Expression_traverseExpBottomUp(threadData, _exp, (modelica_fnptr) mmc_mk_box2(0,closure0_Patternm_traverseConstantPatternsHelper,tmpMeta2), _tpl ,&_tpl);
_exp = omc_Expression_traverseExpTopDown(threadData, _exp, boxvar_SimCodeFunctionUtil_replaceLiteralArrayExp, _tpl ,&_tpl);
_return: OMC_LABEL_UNUSED
if (out_tpl) { *out_tpl = _tpl; }
return _exp;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_findLiterals(threadData_t *threadData, modelica_metatype _fns, modelica_metatype *out_literals)
{
modelica_metatype _ofns = NULL;
modelica_metatype _literals = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta4 = mmc_mk_box3(0, mmc_mk_integer(((modelica_integer) 0)), omc_HashTableExpToIndex_emptyHashTableSized(threadData, ((modelica_integer) 4013)), tmpMeta3);
tmpMeta5 = omc_DAEUtil_traverseDAEFunctions(threadData, _fns, boxvar_SimCodeFunctionUtil_findLiteralsHelper, tmpMeta4, &tmpMeta1);
_ofns = tmpMeta5;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
_literals = tmpMeta2;
_literals = listReverse(_literals);
_return: OMC_LABEL_UNUSED
if (out_literals) { *out_literals = _literals; }
return _ofns;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isParallelArrayVar(threadData_t *threadData, modelica_metatype _var)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _var;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,7) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,7) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,6,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,1,0) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isParallelArrayVar(threadData_t *threadData, modelica_metatype _var)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_isParallelArrayVar(threadData, _var);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_funcHasParallelInOutArrays(threadData_t *threadData, modelica_metatype _fn)
{
modelica_boolean _b;
modelica_metatype _inVars = NULL;
modelica_metatype _outVars = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
modelica_metatype tmpMeta4;
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _fn;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,0,7) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
_outVars = tmpMeta2;
_inVars = tmpMeta3;
{
modelica_metatype _e;
for (tmpMeta4 = _inVars; !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
{
_e = MMC_CAR(tmpMeta4);
if(omc_SimCodeFunctionUtil_isParallelArrayVar(threadData, _e))
{
_b = 1;
goto _return;
}
}
}
{
modelica_metatype _e;
for (tmpMeta6 = _outVars; !listEmpty(tmpMeta6); tmpMeta6=MMC_CDR(tmpMeta6))
{
_e = MMC_CAR(tmpMeta6);
if(omc_SimCodeFunctionUtil_isParallelArrayVar(threadData, _e))
{
_b = 1;
goto _return;
}
}
}
_b = 0;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_SimCodeFunctionUtil_funcHasParallelInOutArrays(threadData_t *threadData, modelica_metatype _fn)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_funcHasParallelInOutArrays(threadData, _fn);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC void omc_SimCodeFunctionUtil_isBoxedArg(threadData_t *threadData, modelica_metatype _var)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp3_1;
tmp3_1 = _var;
{
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
for (; tmp3 < 4; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,1,4) == 0) goto tmp2_end;
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta5;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,7) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta5,23,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,7) == 0) goto tmp2_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,25,1) == 0) goto tmp2_end;
goto tmp2_done;
}
case 3: {
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,7) == 0) goto tmp2_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,2,1) == 0) goto tmp2_end;
goto tmp2_done;
}
}
goto tmp2_end;
tmp2_end: ;
}
goto goto_1;
goto_1:;
MMC_THROW_INTERNAL();
goto tmp2_done;
tmp2_done:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isFunctionPtr(threadData_t *threadData, modelica_metatype _var)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _var;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isFunctionPtr(threadData_t *threadData, modelica_metatype _var)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_isFunctionPtr(threadData, _var);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_isBoxedFunction(threadData_t *threadData, modelica_metatype _fn)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _fn;
{
modelica_metatype _inVars = NULL;
modelica_metatype _outVars = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,7) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_outVars = tmpMeta6;
_inVars = tmpMeta7;
tmp4 += 1;
omc_List_map__0(threadData, _inVars, boxvar_SimCodeFunctionUtil_isBoxedArg);
omc_List_map__0(threadData, _outVars, boxvar_SimCodeFunctionUtil_isBoxedArg);
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,14) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
_inVars = tmpMeta8;
_outVars = tmpMeta9;
omc_List_map__0(threadData, _inVars, boxvar_SimCodeFunctionUtil_isBoxedArg);
omc_List_map__0(threadData, _outVars, boxvar_SimCodeFunctionUtil_isBoxedArg);
tmp1 = 1;
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
modelica_metatype boxptr_SimCodeFunctionUtil_isBoxedFunction(threadData_t *threadData, modelica_metatype _fn)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_isBoxedFunction(threadData, _fn);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
void omc_SimCodeFunctionUtil_checkValidMainFunction(threadData_t *threadData, modelica_string _name, modelica_metatype _fn)
{
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp3_1;
tmp3_1 = _fn;
{
modelica_metatype _inVars = NULL;
volatile mmc_switch_type tmp3;
int tmp4;
tmp3 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp2_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp3 < 3; tmp3++) {
switch (MMC_SWITCH_CAST(tmp3)) {
case 0: {
modelica_metatype tmpMeta5;
modelica_boolean tmp6;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,7) == 0) goto tmp2_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 4));
_inVars = tmpMeta5;
tmp3 += 1;
tmp6 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_List_find(threadData, _inVars, boxvar_SimCodeFunctionUtil_isFunctionPtr);
tmp6 = 1;
goto goto_7;
goto_7:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp6) {goto goto_1;}
goto tmp2_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_boolean tmp9;
if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,3,14) == 0) goto tmp2_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 7));
_inVars = tmpMeta8;
tmp9 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
omc_List_find(threadData, _inVars, boxvar_SimCodeFunctionUtil_isFunctionPtr);
tmp9 = 1;
goto goto_10;
goto_10:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp9) {goto goto_1;}
goto tmp2_done;
}
case 2: {
modelica_metatype tmpMeta11;
tmpMeta11 = mmc_mk_cons(_name, MMC_REFSTRUCTLIT(mmc_nil));
omc_Error_addMessage(threadData, _OMC_LIT231, tmpMeta11);
goto goto_1;
goto tmp2_done;
}
}
goto tmp2_end;
tmp2_end: ;
}
goto goto_1;
tmp2_done:
(void)tmp3;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp2_done2;
goto_1:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp3 < 3) {
goto tmp2_top;
}
MMC_THROW_INTERNAL();
tmp2_done2:;
}
}
;
_return: OMC_LABEL_UNUSED
return;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateStatement(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_metatype _stmts = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _inElement;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,16,2) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
_stmts = tmpMeta3;
_return: OMC_LABEL_UNUSED
return _stmts;
}
PROTECTED_FUNCTION_STATIC modelica_integer omc_SimCodeFunctionUtil_findIndexInList(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _outVars, modelica_integer _inCurrentIndex, modelica_boolean *out_hasBinding)
{
modelica_integer _crefIndexInOutVars;
modelica_boolean _hasBinding;
modelica_integer tmp1_c0 __attribute__((unused)) = 0;
modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_integer tmp4_2;
tmp4_1 = _outVars;
tmp4_2 = _inCurrentIndex;
{
modelica_metatype _name = NULL;
modelica_metatype _restOutVars = NULL;
modelica_metatype _v = NULL;
modelica_integer _currentIndex;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmp1_c0 = ((modelica_integer) -1);
tmp1_c1 = 0;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_boolean tmp10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,7) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
_name = tmpMeta8;
_v = tmpMeta9;
_currentIndex = tmp4_2;
tmp10 = omc_ComponentReference_crefEqualNoStringCompare(threadData, _cref, _name);
if (1 != tmp10) goto goto_2;
tmp1_c0 = _currentIndex;
tmp1_c1 = isSome(_v);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
_restOutVars = tmpMeta12;
_currentIndex = tmp4_2;
_currentIndex = ((modelica_integer) 1) + _currentIndex;
tmp1_c0 = omc_SimCodeFunctionUtil_findIndexInList(threadData, _cref, _restOutVars, _currentIndex, &tmp1_c1);
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:;
}
}
_crefIndexInOutVars = tmp1_c0;
_hasBinding = tmp1_c1;
_return: OMC_LABEL_UNUSED
if (out_hasBinding) { *out_hasBinding = _hasBinding; }
return _crefIndexInOutVars;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_findIndexInList(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _outVars, modelica_metatype _inCurrentIndex, modelica_metatype *out_hasBinding)
{
modelica_integer tmp1;
modelica_boolean _hasBinding;
modelica_integer _crefIndexInOutVars;
modelica_metatype out_crefIndexInOutVars;
tmp1 = mmc_unbox_integer(_inCurrentIndex);
_crefIndexInOutVars = omc_SimCodeFunctionUtil_findIndexInList(threadData, _cref, _outVars, tmp1, &_hasBinding);
out_crefIndexInOutVars = mmc_mk_icon(_crefIndexInOutVars);
if (out_hasBinding) { *out_hasBinding = mmc_mk_icon(_hasBinding); }
return out_crefIndexInOutVars;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_assignOutputIndex(threadData_t *threadData, modelica_metatype _simExtArgIn, modelica_metatype _outVars)
{
modelica_metatype _simExtArgOut = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _simExtArgIn;
{
modelica_metatype _cref = NULL;
modelica_metatype _fcref = NULL;
modelica_boolean _isInput;
modelica_integer _outputIndex;
modelica_boolean _isArray;
modelica_boolean _hasBinding;
modelica_metatype _type_ = NULL;
modelica_metatype _exp = NULL;
modelica_integer _newOutputIndex;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_integer tmp10;
modelica_metatype tmpMeta11;
modelica_integer tmp12;
modelica_metatype tmpMeta13;
modelica_boolean tmp14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,6) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp8 = mmc_unbox_integer(tmpMeta7);
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp10 = mmc_unbox_integer(tmpMeta9);
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmp12 = mmc_unbox_integer(tmpMeta11);
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
_cref = tmpMeta6;
_isInput = tmp8;
_outputIndex = tmp10;
_isArray = tmp12;
_type_ = tmpMeta13;
tmp4 += 1;
tmp14 = (_outputIndex == ((modelica_integer) -1));
if (1 != tmp14) goto goto_2;
_fcref = omc_ComponentReference_crefFirstCref(threadData, _cref);
_newOutputIndex = omc_SimCodeFunctionUtil_findIndexInList(threadData, _fcref, _outVars, ((modelica_integer) 1) ,&_hasBinding);
tmpMeta15 = mmc_mk_box7(3, &SimCodeFunction_SimExtArg_SIMEXTARG__desc, _cref, mmc_mk_boolean(_isInput), mmc_mk_integer(_newOutputIndex), mmc_mk_boolean(_isArray), mmc_mk_boolean(_hasBinding), _type_);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
modelica_metatype tmpMeta19;
modelica_integer tmp20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_boolean tmp23;
modelica_metatype tmpMeta24;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,5) == 0) goto tmp3_end;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmp18 = mmc_unbox_integer(tmpMeta17);
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmp20 = mmc_unbox_integer(tmpMeta19);
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
_cref = tmpMeta16;
_isInput = tmp18;
_outputIndex = tmp20;
_type_ = tmpMeta21;
_exp = tmpMeta22;
tmp23 = (_outputIndex == ((modelica_integer) -1));
if (1 != tmp23) goto goto_2;
_newOutputIndex = omc_SimCodeFunctionUtil_findIndexInList(threadData, _cref, _outVars, ((modelica_integer) 1), NULL);
tmpMeta24 = mmc_mk_box6(5, &SimCodeFunction_SimExtArg_SIMEXTARGSIZE__desc, _cref, mmc_mk_boolean(_isInput), mmc_mk_integer(_newOutputIndex), _type_, _exp);
tmpMeta1 = tmpMeta24;
goto tmp3_done;
}
case 2: {
tmpMeta1 = _simExtArgIn;
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:;
}
}
_simExtArgOut = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _simExtArgOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_fixOutputIndex(threadData_t *threadData, modelica_metatype _outVars, modelica_metatype _simExtArgsIn, modelica_metatype _extReturnIn, modelica_metatype *out_extReturnOut)
{
modelica_metatype _simExtArgsOut = NULL;
modelica_metatype _extReturnOut = NULL;
modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_simExtArgsOut = omc_List_map1(threadData, _simExtArgsIn, boxvar_SimCodeFunctionUtil_assignOutputIndex, _outVars);
_extReturnOut = omc_SimCodeFunctionUtil_assignOutputIndex(threadData, _extReturnIn, _outVars);
tmpMeta[0+0] = _simExtArgsOut;
tmpMeta[0+1] = _extReturnOut;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_simExtArgsOut = tmpMeta[0+0];
_extReturnOut = tmpMeta[0+1];
_return: OMC_LABEL_UNUSED
if (out_extReturnOut) { *out_extReturnOut = _extReturnOut; }
return _simExtArgsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_extArgsToSimExtArgs(threadData_t *threadData, modelica_metatype _extArg)
{
modelica_metatype _simExtArg = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _extArg;
{
modelica_metatype _componentRef = NULL;
modelica_metatype _dir = NULL;
modelica_metatype _type_ = NULL;
modelica_boolean _isInput;
modelica_boolean _isOutput;
modelica_boolean _isArray;
modelica_metatype _exp_ = NULL;
modelica_integer _outputIndex;
int tmp4;
{
switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
case 3: {
modelica_metatype tmpMeta5;
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,3) == 0) goto tmp3_end;
tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_componentRef = tmpMeta5;
_dir = tmpMeta6;
_type_ = tmpMeta7;
_isInput = omc_AbsynUtil_isInput(threadData, _dir);
_isOutput = omc_AbsynUtil_isOutput(threadData, _dir);
_outputIndex = (_isOutput?((modelica_integer) -1):((modelica_integer) 0));
_isArray = omc_Types_isArray(threadData, _type_);
_type_ = omc_Types_simplifyType(threadData, _type_);
tmpMeta8 = mmc_mk_box7(3, &SimCodeFunction_SimExtArg_SIMEXTARG__desc, _componentRef, mmc_mk_boolean(_isInput), mmc_mk_integer(_outputIndex), mmc_mk_boolean(_isArray), mmc_mk_boolean(0), _type_);
tmpMeta1 = tmpMeta8;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_exp_ = tmpMeta9;
_type_ = tmpMeta10;
_type_ = omc_Types_simplifyType(threadData, _type_);
tmpMeta11 = mmc_mk_box3(4, &SimCodeFunction_SimExtArg_SIMEXTARGEXP__desc, _exp_, _type_);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_componentRef = tmpMeta12;
_type_ = tmpMeta13;
_exp_ = tmpMeta14;
_type_ = omc_Types_simplifyType(threadData, _type_);
tmpMeta15 = mmc_mk_box6(5, &SimCodeFunction_SimExtArg_SIMEXTARGSIZE__desc, _componentRef, mmc_mk_boolean(1), mmc_mk_integer(((modelica_integer) 0)), _type_, _exp_);
tmpMeta1 = tmpMeta15;
goto tmp3_done;
}
case 6: {
tmpMeta1 = _OMC_LIT232;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_simExtArg = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _simExtArg;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_daeInOutSimVar(threadData_t *threadData, modelica_metatype _inElement)
{
modelica_metatype _outVar = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inElement;
{
modelica_string _name = NULL;
modelica_metatype _daeType = NULL;
modelica_metatype _id = NULL;
modelica_metatype _kind = NULL;
modelica_metatype _prl = NULL;
modelica_metatype _inst_dims = NULL;
modelica_metatype _binding = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,3) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,11,4) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
_name = tmpMeta7;
_prl = tmpMeta8;
_daeType = tmpMeta9;
_binding = tmpMeta10;
tmpMeta11 = mmc_mk_box6(3, &DAE_FuncArg_FUNCARG__desc, _name, _daeType, _OMC_LIT233, _prl, mmc_mk_none());
tmpMeta1 = omc_SimCodeFunctionUtil_typesSimFunctionArg(threadData, tmpMeta11, _binding);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,13) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
_id = tmpMeta12;
_kind = tmpMeta13;
_prl = tmpMeta14;
_daeType = tmpMeta15;
_binding = tmpMeta16;
_inst_dims = tmpMeta17;
_daeType = omc_Types_simplifyType(threadData, _daeType);
tmpMeta18 = mmc_mk_box8(3, &SimCodeFunction_Variable_VARIABLE__desc, _id, _daeType, _binding, _inst_dims, _prl, _kind, mmc_mk_boolean(0));
tmpMeta1 = tmpMeta18;
goto tmp3_done;
}
case 2: {
omc_Error_addInternalError(threadData, _OMC_LIT234, _OMC_LIT235);
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:;
}
}
_outVar = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVar;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_typesSimFunctionArg(threadData_t *threadData, modelica_metatype _inFuncArg, modelica_metatype _binding)
{
modelica_metatype _outVar = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inFuncArg;
{
modelica_metatype _tty = NULL;
modelica_string _name = NULL;
modelica_metatype _cref_ = NULL;
modelica_metatype _const = NULL;
modelica_metatype _args = NULL;
modelica_metatype _res_ty = NULL;
modelica_metatype _var_args = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _kind = NULL;
modelica_metatype _prl = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,11,4) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,14,2) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
_name = tmpMeta6;
_args = tmpMeta8;
_tys = tmpMeta10;
tmp4 += 1;
_var_args = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
_tys = omc_List_map(threadData, _tys, boxvar_Types_simplifyType);
tmpMeta11 = mmc_mk_box5(4, &SimCodeFunction_Variable_FUNCTION__PTR__desc, _name, _tys, _var_args, _binding);
tmpMeta1 = tmpMeta11;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,11,4) == 0) goto tmp3_end;
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,7,0) == 0) goto tmp3_end;
_name = tmpMeta12;
_args = tmpMeta14;
_var_args = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
tmpMeta16 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta17 = mmc_mk_box5(4, &SimCodeFunction_Variable_FUNCTION__PTR__desc, _name, tmpMeta16, _var_args, _binding);
tmpMeta1 = tmpMeta17;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,11,4) == 0) goto tmp3_end;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
_name = tmpMeta18;
_args = tmpMeta20;
_res_ty = tmpMeta21;
_res_ty = omc_Types_simplifyType(threadData, _res_ty);
_var_args = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
tmpMeta22 = mmc_mk_cons(_res_ty, MMC_REFSTRUCTLIT(mmc_nil));
tmpMeta23 = mmc_mk_box5(4, &SimCodeFunction_Variable_FUNCTION__PTR__desc, _name, tmpMeta22, _var_args, _binding);
tmpMeta1 = tmpMeta23;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_name = tmpMeta24;
_tty = tmpMeta25;
_const = tmpMeta26;
_prl = tmpMeta27;
_tty = omc_Types_simplifyType(threadData, _tty);
tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
_cref_ = omc_ComponentReference_makeCrefIdent(threadData, _name, _tty, tmpMeta28);
_kind = omc_DAEUtil_const2VarKind(threadData, _const);
tmpMeta29 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta30 = mmc_mk_box8(3, &SimCodeFunction_Variable_VARIABLE__desc, _cref_, _tty, _binding, tmpMeta29, _prl, _kind, mmc_mk_boolean(0));
tmpMeta1 = tmpMeta30;
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:;
}
}
_outVar = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outVar;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateFunction(threadData_t *threadData, modelica_metatype _program, modelica_metatype _inElement, modelica_metatype _inRecordTypes, modelica_metatype _inRecordDecls, modelica_metatype _inIncludes, modelica_metatype _inIncludeDirs, modelica_metatype _inLibs, modelica_metatype _inLibPaths, modelica_metatype *out_outRecordTypes, modelica_metatype *out_outRecordDecls, modelica_metatype *out_outIncludes, modelica_metatype *out_outIncludeDirs, modelica_metatype *out_outLibs, modelica_metatype *out_outLibPaths)
{
modelica_metatype _outFunction = NULL;
modelica_metatype _outRecordTypes = NULL;
modelica_metatype _outRecordDecls = NULL;
modelica_metatype _outIncludes = NULL;
modelica_metatype _outIncludeDirs = NULL;
modelica_metatype _outLibs = NULL;
modelica_metatype _outLibPaths = NULL;
modelica_metatype tmpMeta[7] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;volatile modelica_metatype tmp4_3;volatile modelica_metatype tmp4_4;volatile modelica_metatype tmp4_5;volatile modelica_metatype tmp4_6;volatile modelica_metatype tmp4_7;
tmp4_1 = _inElement;
tmp4_2 = _inRecordTypes;
tmp4_3 = _inRecordDecls;
tmp4_4 = _inIncludes;
tmp4_5 = _inIncludeDirs;
tmp4_6 = _inLibs;
tmp4_7 = _inLibPaths;
{
modelica_metatype _fn = NULL;
modelica_string _extfnname = NULL;
modelica_string _lang = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _includes = NULL;
modelica_metatype _libs = NULL;
modelica_metatype _libPaths = NULL;
modelica_metatype _fn_libs = NULL;
modelica_metatype _fn_paths = NULL;
modelica_metatype _fn_includes = NULL;
modelica_metatype _fn_includeDirs = NULL;
modelica_metatype _rt = NULL;
modelica_metatype _rt_1 = NULL;
modelica_metatype _fpath = NULL;
modelica_metatype _args = NULL;
modelica_metatype _restype = NULL;
modelica_metatype _extargs = NULL;
modelica_metatype _simextargs = NULL;
modelica_metatype _extReturn = NULL;
modelica_metatype _extretarg = NULL;
modelica_metatype _ann = NULL;
modelica_metatype _extdecl = NULL;
modelica_metatype _outVars = NULL;
modelica_metatype _inVars = NULL;
modelica_metatype _biVars = NULL;
modelica_metatype _funArgs = NULL;
modelica_metatype _varDecls = NULL;
modelica_metatype _recordDecls = NULL;
modelica_metatype _bodyStmts = NULL;
modelica_metatype _daeElts = NULL;
modelica_metatype _name = NULL;
modelica_metatype _source = NULL;
modelica_metatype _info = NULL;
modelica_boolean _dynamicLoad;
modelica_metatype _includeDirs = NULL;
modelica_metatype _funAttrs = NULL;
modelica_metatype _varlst = NULL;
modelica_metatype _visibility = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_integer tmp16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta23;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,10) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,1) == 0) goto tmp3_end;
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,11,4) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 4));
tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmp16 = mmc_unbox_integer(tmpMeta15);
if (0 != tmp16) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
_fpath = tmpMeta6;
_daeElts = tmpMeta10;
_args = tmpMeta12;
_funAttrs = tmpMeta13;
_visibility = tmpMeta14;
_source = tmpMeta17;
_rt = tmp4_2;
_recordDecls = tmp4_3;
_includes = tmp4_4;
_includeDirs = tmp4_5;
_libs = tmp4_6;
_libPaths = tmp4_7;
tmpMeta18 = _funAttrs;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,0) == 0) goto goto_2;
_outVars = omc_List_map(threadData, omc_DAEUtil_getOutputElements(threadData, _daeElts), boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_funArgs = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
_recordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _daeElts, _recordDecls, _rt ,&_rt_1);
_vars = omc_List_filterOnTrue(threadData, _daeElts, boxvar_SimCodeFunctionUtil_isVarQ);
_varDecls = omc_List_map(threadData, _vars, boxvar_SimCodeFunctionUtil_daeInOutSimVar);
{
modelica_metatype __omcQ_24tmpVar23;
modelica_metatype tmpMeta21;
modelica_metatype __omcQ_24tmpVar22;
modelica_integer tmp22;
modelica_metatype _e_loopVar = 0;
modelica_metatype _e;
_e_loopVar = _daeElts;
tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar23 = tmpMeta21;
while(1) {
tmp22 = 1;
while (!listEmpty(_e_loopVar)) {
_e = MMC_CAR(_e_loopVar);
_e_loopVar = MMC_CDR(_e_loopVar);
if (omc_DAEUtil_isAlgorithm(threadData, _e)) {
tmp22--;
break;
}
}
if (tmp22 == 0) {
__omcQ_24tmpVar22 = omc_SimCodeFunctionUtil_elaborateStatement(threadData, _e);
__omcQ_24tmpVar23 = listAppend(__omcQ_24tmpVar22, __omcQ_24tmpVar23);
} else if (tmp22 == 1) {
break;
} else {
goto goto_2;
}
}
tmpMeta20 = __omcQ_24tmpVar23;
}
_bodyStmts = tmpMeta20;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta23 = mmc_mk_box8(3, &SimCodeFunction_Function_FUNCTION__desc, _fpath, _outVars, _funArgs, _varDecls, _bodyStmts, _visibility, _info);
tmpMeta[0+0] = tmpMeta23;
tmpMeta[0+1] = _rt_1;
tmpMeta[0+2] = _recordDecls;
tmpMeta[0+3] = _includes;
tmpMeta[0+4] = _includeDirs;
tmpMeta[0+5] = _libs;
tmpMeta[0+6] = _libPaths;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
modelica_integer tmp33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
modelica_metatype tmpMeta36;
modelica_metatype tmpMeta37;
modelica_metatype tmpMeta40;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,10) == 0) goto tmp3_end;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta25)) goto tmp3_end;
tmpMeta26 = MMC_CAR(tmpMeta25);
tmpMeta27 = MMC_CDR(tmpMeta25);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,0,1) == 0) goto tmp3_end;
tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta29,11,4) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 2));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 4));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmp33 = mmc_unbox_integer(tmpMeta32);
if (0 != tmp33) goto tmp3_end;
tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
_fpath = tmpMeta24;
_daeElts = tmpMeta28;
_args = tmpMeta30;
_funAttrs = tmpMeta31;
_source = tmpMeta34;
_rt = tmp4_2;
_recordDecls = tmp4_3;
_includes = tmp4_4;
_includeDirs = tmp4_5;
_libs = tmp4_6;
_libPaths = tmp4_7;
tmpMeta35 = _funAttrs;
tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta35), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta36,2,0) == 0) goto goto_2;
_outVars = omc_List_map(threadData, omc_DAEUtil_getOutputElements(threadData, _daeElts), boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_funArgs = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
_recordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _daeElts, _recordDecls, _rt ,&_rt_1);
_vars = omc_List_filterOnTrue(threadData, _daeElts, boxvar_SimCodeFunctionUtil_isVarNotInputNotOutput);
_varDecls = omc_List_map(threadData, _vars, boxvar_SimCodeFunctionUtil_daeInOutSimVar);
{
modelica_metatype __omcQ_24tmpVar25;
modelica_metatype tmpMeta38;
modelica_metatype __omcQ_24tmpVar24;
modelica_integer tmp39;
modelica_metatype _e_loopVar = 0;
modelica_metatype _e;
_e_loopVar = _daeElts;
tmpMeta38 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar25 = tmpMeta38;
while(1) {
tmp39 = 1;
while (!listEmpty(_e_loopVar)) {
_e = MMC_CAR(_e_loopVar);
_e_loopVar = MMC_CDR(_e_loopVar);
if (omc_DAEUtil_isAlgorithm(threadData, _e)) {
tmp39--;
break;
}
}
if (tmp39 == 0) {
__omcQ_24tmpVar24 = omc_SimCodeFunctionUtil_elaborateStatement(threadData, _e);
__omcQ_24tmpVar25 = listAppend(__omcQ_24tmpVar24, __omcQ_24tmpVar25);
} else if (tmp39 == 1) {
break;
} else {
goto goto_2;
}
}
tmpMeta37 = __omcQ_24tmpVar25;
}
_bodyStmts = tmpMeta37;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta40 = mmc_mk_box7(5, &SimCodeFunction_Function_KERNEL__FUNCTION__desc, _fpath, _outVars, _funArgs, _varDecls, _bodyStmts, _info);
tmpMeta[0+0] = tmpMeta40;
tmpMeta[0+1] = _rt_1;
tmpMeta[0+2] = _recordDecls;
tmpMeta[0+3] = _includes;
tmpMeta[0+4] = _includeDirs;
tmpMeta[0+5] = _libs;
tmpMeta[0+6] = _libPaths;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta41;
modelica_metatype tmpMeta42;
modelica_metatype tmpMeta43;
modelica_metatype tmpMeta44;
modelica_metatype tmpMeta45;
modelica_metatype tmpMeta46;
modelica_metatype tmpMeta47;
modelica_metatype tmpMeta48;
modelica_metatype tmpMeta49;
modelica_integer tmp50;
modelica_metatype tmpMeta51;
modelica_metatype tmpMeta52;
modelica_metatype tmpMeta53;
modelica_metatype tmpMeta54;
modelica_metatype tmpMeta57;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,10) == 0) goto tmp3_end;
tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta42)) goto tmp3_end;
tmpMeta43 = MMC_CAR(tmpMeta42);
tmpMeta44 = MMC_CDR(tmpMeta42);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,0,1) == 0) goto tmp3_end;
tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 2));
tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,11,4) == 0) goto tmp3_end;
tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 4));
tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
tmp50 = mmc_unbox_integer(tmpMeta49);
if (0 != tmp50) goto tmp3_end;
tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
_fpath = tmpMeta41;
_daeElts = tmpMeta45;
_args = tmpMeta47;
_funAttrs = tmpMeta48;
_source = tmpMeta51;
_rt = tmp4_2;
_recordDecls = tmp4_3;
_includes = tmp4_4;
_includeDirs = tmp4_5;
_libs = tmp4_6;
_libPaths = tmp4_7;
tmp4 += 2;
tmpMeta52 = _funAttrs;
tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 7));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta53,1,0) == 0) goto goto_2;
_outVars = omc_List_map(threadData, omc_DAEUtil_getOutputElements(threadData, _daeElts), boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_funArgs = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
_recordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _daeElts, _recordDecls, _rt ,&_rt_1);
_vars = omc_List_filterOnTrue(threadData, _daeElts, boxvar_SimCodeFunctionUtil_isVarQ);
_varDecls = omc_List_map(threadData, _vars, boxvar_SimCodeFunctionUtil_daeInOutSimVar);
{
modelica_metatype __omcQ_24tmpVar27;
modelica_metatype tmpMeta55;
modelica_metatype __omcQ_24tmpVar26;
modelica_integer tmp56;
modelica_metatype _e_loopVar = 0;
modelica_metatype _e;
_e_loopVar = _daeElts;
tmpMeta55 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar27 = tmpMeta55;
while(1) {
tmp56 = 1;
while (!listEmpty(_e_loopVar)) {
_e = MMC_CAR(_e_loopVar);
_e_loopVar = MMC_CDR(_e_loopVar);
if (omc_DAEUtil_isAlgorithm(threadData, _e)) {
tmp56--;
break;
}
}
if (tmp56 == 0) {
__omcQ_24tmpVar26 = omc_SimCodeFunctionUtil_elaborateStatement(threadData, _e);
__omcQ_24tmpVar27 = listAppend(__omcQ_24tmpVar26, __omcQ_24tmpVar27);
} else if (tmp56 == 1) {
break;
} else {
goto goto_2;
}
}
tmpMeta54 = __omcQ_24tmpVar27;
}
_bodyStmts = tmpMeta54;
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta57 = mmc_mk_box7(4, &SimCodeFunction_Function_PARALLEL__FUNCTION__desc, _fpath, _outVars, _funArgs, _varDecls, _bodyStmts, _info);
tmpMeta[0+0] = tmpMeta57;
tmpMeta[0+1] = _rt_1;
tmpMeta[0+2] = _recordDecls;
tmpMeta[0+3] = _includes;
tmpMeta[0+4] = _includeDirs;
tmpMeta[0+5] = _libs;
tmpMeta[0+6] = _libPaths;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta58;
modelica_metatype tmpMeta59;
modelica_metatype tmpMeta60;
modelica_metatype tmpMeta61;
modelica_metatype tmpMeta62;
modelica_metatype tmpMeta63;
modelica_metatype tmpMeta64;
modelica_metatype tmpMeta65;
modelica_metatype tmpMeta66;
modelica_metatype tmpMeta67;
modelica_metatype tmpMeta68;
modelica_metatype tmpMeta69;
modelica_metatype tmpMeta70;
modelica_metatype tmpMeta71;
modelica_metatype tmpMeta72;
modelica_metatype tmpMeta73;
modelica_metatype tmpMeta74;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,10) == 0) goto tmp3_end;
tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (listEmpty(tmpMeta59)) goto tmp3_end;
tmpMeta60 = MMC_CAR(tmpMeta59);
tmpMeta61 = MMC_CDR(tmpMeta59);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta60,1,2) == 0) goto tmp3_end;
tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 2));
tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta60), 3));
tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta64,11,4) == 0) goto tmp3_end;
tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta64), 2));
tmpMeta66 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
_fpath = tmpMeta58;
_daeElts = tmpMeta62;
_extdecl = tmpMeta63;
_args = tmpMeta65;
_visibility = tmpMeta66;
_source = tmpMeta67;
_rt = tmp4_2;
_recordDecls = tmp4_3;
_includes = tmp4_4;
_includeDirs = tmp4_5;
_libs = tmp4_6;
_libPaths = tmp4_7;
tmp4 += 1;
tmpMeta68 = _extdecl;
tmpMeta69 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta68), 2));
tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta68), 3));
tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta68), 4));
tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta68), 5));
tmpMeta73 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta68), 6));
_extfnname = tmpMeta69;
_extargs = tmpMeta70;
_extretarg = tmpMeta71;
_lang = tmpMeta72;
_ann = tmpMeta73;
_funArgs = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
_outVars = omc_List_map(threadData, omc_DAEUtil_getOutputElements(threadData, _daeElts), boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_inVars = omc_List_map(threadData, omc_DAEUtil_getInputVars(threadData, _daeElts), boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_biVars = omc_List_map(threadData, omc_DAEUtil_getBidirElements(threadData, _daeElts), boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_recordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarations(threadData, _daeElts, _recordDecls, _rt ,&_rt_1);
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
_fn_includes = omc_SimCodeFunctionUtil_generateExtFunctionIncludes(threadData, _program, _fpath, _ann, _info ,&_fn_includeDirs ,&_fn_libs ,&_fn_paths ,&_dynamicLoad);
_includes = omc_List_union(threadData, _fn_includes, _includes);
_includeDirs = omc_List_union(threadData, _fn_includeDirs, _includeDirs);
_libs = omc_List_union(threadData, _fn_libs, _libs);
_libPaths = omc_List_union(threadData, _fn_paths, _libPaths);
_simextargs = omc_List_map(threadData, _extargs, boxvar_SimCodeFunctionUtil_extArgsToSimExtArgs);
_extReturn = omc_SimCodeFunctionUtil_extArgsToSimExtArgs(threadData, _extretarg);
_simextargs = omc_SimCodeFunctionUtil_fixOutputIndex(threadData, _outVars, _simextargs, _extReturn ,&_extReturn);
_lang = omc_System_toupper(threadData, _lang);
tmpMeta74 = mmc_mk_box15(6, &SimCodeFunction_Function_EXTERNAL__FUNCTION__desc, _fpath, _extfnname, _funArgs, _simextargs, _extReturn, _inVars, _outVars, _biVars, _fn_includes, _fn_libs, _lang, _visibility, _info, mmc_mk_boolean(_dynamicLoad));
tmpMeta[0+0] = tmpMeta74;
tmpMeta[0+1] = _rt_1;
tmpMeta[0+2] = _recordDecls;
tmpMeta[0+3] = _includes;
tmpMeta[0+4] = _includeDirs;
tmpMeta[0+5] = _libs;
tmpMeta[0+6] = _libPaths;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta75;
modelica_metatype tmpMeta76;
modelica_metatype tmpMeta77;
modelica_metatype tmpMeta78;
modelica_metatype tmpMeta79;
modelica_metatype tmpMeta80;
modelica_metatype tmpMeta81;
modelica_metatype tmpMeta82;
modelica_metatype tmpMeta83;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta75,11,4) == 0) goto tmp3_end;
tmpMeta76 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta75), 2));
tmpMeta77 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta75), 3));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta77,9,3) == 0) goto tmp3_end;
tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta77), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta78,3,1) == 0) goto tmp3_end;
tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta78), 2));
tmpMeta80 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
_args = tmpMeta76;
_restype = tmpMeta77;
_name = tmpMeta79;
_source = tmpMeta80;
_rt = tmp4_2;
_recordDecls = tmp4_3;
_includes = tmp4_4;
_includeDirs = tmp4_5;
_libs = tmp4_6;
_libPaths = tmp4_7;
_funArgs = omc_List_map1(threadData, _args, boxvar_SimCodeFunctionUtil_typesSimFunctionArg, mmc_mk_none());
_recordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForRecord(threadData, _restype, _recordDecls, _rt ,&_rt_1);
tmpMeta81 = _restype;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta81,9,3) == 0) goto goto_2;
tmpMeta82 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta81), 3));
_varlst = tmpMeta82;
_varlst = omc_List_filterOnFalse(threadData, _varlst, boxvar_Types_isModifiableTypesVar);
_varDecls = omc_List_map(threadData, _varlst, boxvar_SimCodeFunctionUtil_typesVar);
_info = omc_ElementSource_getElementSourceFileInfo(threadData, _source);
tmpMeta83 = mmc_mk_box6(7, &SimCodeFunction_Function_RECORD__CONSTRUCTOR__desc, _name, _funArgs, _varDecls, _OMC_LIT236, _info);
tmpMeta[0+0] = tmpMeta83;
tmpMeta[0+1] = _rt_1;
tmpMeta[0+2] = _recordDecls;
tmpMeta[0+3] = _includes;
tmpMeta[0+4] = _includeDirs;
tmpMeta[0+5] = _libs;
tmpMeta[0+6] = _libPaths;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta84;
_fn = tmp4_1;
tmpMeta84 = stringAppend(_OMC_LIT237,omc_DAEDump_dumpFunctionStr(threadData, _fn));
omc_Error_addInternalError(threadData, tmpMeta84, _OMC_LIT238);
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 < 6) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outFunction = tmpMeta[0+0];
_outRecordTypes = tmpMeta[0+1];
_outRecordDecls = tmpMeta[0+2];
_outIncludes = tmpMeta[0+3];
_outIncludeDirs = tmpMeta[0+4];
_outLibs = tmpMeta[0+5];
_outLibPaths = tmpMeta[0+6];
_return: OMC_LABEL_UNUSED
if (out_outRecordTypes) { *out_outRecordTypes = _outRecordTypes; }
if (out_outRecordDecls) { *out_outRecordDecls = _outRecordDecls; }
if (out_outIncludes) { *out_outIncludes = _outIncludes; }
if (out_outIncludeDirs) { *out_outIncludeDirs = _outIncludeDirs; }
if (out_outLibs) { *out_outLibs = _outLibs; }
if (out_outLibPaths) { *out_outLibPaths = _outLibPaths; }
return _outFunction;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_elaborateFunctions2(threadData_t *threadData, modelica_metatype _program, modelica_metatype _daeElements, modelica_metatype _inFunctions, modelica_metatype _inRecordTypes, modelica_metatype _inDecls, modelica_metatype _inIncludes, modelica_metatype _inIncludeDirs, modelica_metatype _inLibs, modelica_metatype _inPaths, modelica_metatype *out_outRecordTypes, modelica_metatype *out_outDecls, modelica_metatype *out_outIncludes, modelica_metatype *out_outIncludeDirs, modelica_metatype *out_outLibs, modelica_metatype *out_outLibsPaths)
{
modelica_metatype _outFunctions = NULL;
modelica_metatype _outRecordTypes = NULL;
modelica_metatype _outDecls = NULL;
modelica_metatype _outIncludes = NULL;
modelica_metatype _outIncludeDirs = NULL;
modelica_metatype _outLibs = NULL;
modelica_metatype _outLibsPaths = NULL;
modelica_metatype tmpMeta[7] __attribute__((unused)) = {0};
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_metatype tmp4_6;modelica_metatype tmp4_7;modelica_metatype tmp4_8;
tmp4_1 = _daeElements;
tmp4_2 = _inFunctions;
tmp4_3 = _inRecordTypes;
tmp4_4 = _inDecls;
tmp4_5 = _inIncludes;
tmp4_6 = _inIncludeDirs;
tmp4_7 = _inLibs;
tmp4_8 = _inPaths;
{
modelica_boolean _b;
modelica_metatype _accfns = NULL;
modelica_metatype _fn = NULL;
modelica_metatype _rt = NULL;
modelica_metatype _rt_1 = NULL;
modelica_metatype _includes = NULL;
modelica_metatype _libs = NULL;
modelica_metatype _libPaths = NULL;
modelica_metatype _fel = NULL;
modelica_metatype _rest = NULL;
modelica_metatype _decls = NULL;
modelica_string _name = NULL;
modelica_string _fname = NULL;
modelica_metatype _includeDirs = NULL;
modelica_metatype _path = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 6; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
_accfns = tmp4_2;
_rt = tmp4_3;
_decls = tmp4_4;
_includes = tmp4_5;
_includeDirs = tmp4_6;
_libs = tmp4_7;
_libPaths = tmp4_8;
tmpMeta[0+0] = listReverse(_accfns);
tmpMeta[0+1] = _rt;
tmpMeta[0+2] = _decls;
tmpMeta[0+3] = _includes;
tmpMeta[0+4] = _includeDirs;
tmpMeta[0+5] = _libs;
tmpMeta[0+6] = _libPaths;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,0,10) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,11,4) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 6));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,0) == 0) goto tmp3_end;
_rest = tmpMeta7;
_accfns = tmp4_2;
_rt = tmp4_3;
_decls = tmp4_4;
_includes = tmp4_5;
_includeDirs = tmp4_6;
_libs = tmp4_7;
_libPaths = tmp4_8;
_daeElements = _rest;
_inFunctions = _accfns;
_inRecordTypes = _rt;
_inDecls = _decls;
_inIncludes = _includes;
_inIncludeDirs = _includeDirs;
_inLibs = _libs;
_inPaths = _libPaths;
goto _tailrecursive;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta11 = MMC_CAR(tmp4_1);
tmpMeta12 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta11,0,10) == 0) goto tmp3_end;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 6));
tmp14 = mmc_unbox_integer(tmpMeta13);
if (1 != tmp14) goto tmp3_end;
_rest = tmpMeta12;
_accfns = tmp4_2;
_rt = tmp4_3;
_decls = tmp4_4;
_includes = tmp4_5;
_includeDirs = tmp4_6;
_libs = tmp4_7;
_libPaths = tmp4_8;
_daeElements = _rest;
_inFunctions = _accfns;
_inRecordTypes = _rt;
_inDecls = _decls;
_inIncludes = _includes;
_inIncludeDirs = _includeDirs;
_inLibs = _libs;
_inPaths = _libPaths;
goto _tailrecursive;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta15 = MMC_CAR(tmp4_1);
tmpMeta16 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,0,10) == 0) goto tmp3_end;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
if (listEmpty(tmpMeta18)) goto tmp3_end;
tmpMeta19 = MMC_CAR(tmpMeta18);
tmpMeta20 = MMC_CDR(tmpMeta18);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,1,2) == 0) goto tmp3_end;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 3));
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 5));
if (7 != MMC_STRLEN(tmpMeta23) || strcmp(MMC_STRINGDATA(_OMC_LIT266), MMC_STRINGDATA(tmpMeta23)) != 0) goto tmp3_end;
_fel = tmpMeta15;
_path = tmpMeta17;
_name = tmpMeta22;
_rest = tmpMeta16;
_accfns = tmp4_2;
_rt = tmp4_3;
_decls = tmp4_4;
_includes = tmp4_5;
_includeDirs = tmp4_6;
_libs = tmp4_7;
_libPaths = tmp4_8;
_fname = omc_AbsynUtil_pathString(threadData, omc_AbsynUtil_makeNotFullyQualified(threadData, _path), _OMC_LIT54, 1, 0);
_b = (stringEqual(_fname, _name));
if((!_b))
{
_fn = omc_SimCodeFunctionUtil_elaborateFunction(threadData, _program, _fel, _rt, _decls, _includes, _includeDirs, _libs, _libPaths ,NULL ,&_decls ,&_includes ,&_includeDirs ,&_libs ,&_libPaths);
}
_daeElements = _rest;
_inFunctions = omc_List_consOnTrue(threadData, (!_b), _fn, _accfns);
_inRecordTypes = _rt;
_inDecls = _decls;
_inIncludes = _includes;
_inIncludeDirs = _includeDirs;
_inLibs = _libs;
_inPaths = _libPaths;
goto _tailrecursive;
goto tmp3_done;
}
case 4: {
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_metatype tmpMeta26;
modelica_metatype tmpMeta27;
modelica_metatype tmpMeta28;
modelica_metatype tmpMeta29;
modelica_metatype tmpMeta30;
modelica_metatype tmpMeta31;
modelica_metatype tmpMeta32;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta24 = MMC_CAR(tmp4_1);
tmpMeta25 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,0,10) == 0) goto tmp3_end;
tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 3));
if (listEmpty(tmpMeta27)) goto tmp3_end;
tmpMeta28 = MMC_CAR(tmpMeta27);
tmpMeta29 = MMC_CDR(tmpMeta27);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta28,1,2) == 0) goto tmp3_end;
tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta28), 3));
tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 5));
if (1 != MMC_STRLEN(tmpMeta32) || strcmp(MMC_STRINGDATA(_OMC_LIT267), MMC_STRINGDATA(tmpMeta32)) != 0) goto tmp3_end;
_fel = tmpMeta24;
_path = tmpMeta26;
_name = tmpMeta31;
_rest = tmpMeta25;
_accfns = tmp4_2;
_rt = tmp4_3;
_decls = tmp4_4;
_includes = tmp4_5;
_includeDirs = tmp4_6;
_libs = tmp4_7;
_libPaths = tmp4_8;
_fname = omc_AbsynUtil_pathString(threadData, omc_AbsynUtil_makeNotFullyQualified(threadData, _path), _OMC_LIT54, 1, 0);
_b = (listMember(_name, _OMC_LIT265) && (stringEqual(_fname, _name)));
if((!_b))
{
_fn = omc_SimCodeFunctionUtil_elaborateFunction(threadData, _program, _fel, _rt, _decls, _includes, _includeDirs, _libs, _libPaths ,NULL ,&_decls ,&_includes ,&_includeDirs ,&_libs ,&_libPaths);
}
_daeElements = _rest;
_inFunctions = omc_List_consOnTrue(threadData, (!_b), _fn, _accfns);
_inRecordTypes = _rt;
_inDecls = _decls;
_inIncludes = _includes;
_inIncludeDirs = _includeDirs;
_inLibs = _libs;
_inPaths = _libPaths;
goto _tailrecursive;
goto tmp3_done;
}
case 5: {
modelica_metatype tmpMeta33;
modelica_metatype tmpMeta34;
modelica_metatype tmpMeta35;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta33 = MMC_CAR(tmp4_1);
tmpMeta34 = MMC_CDR(tmp4_1);
_fel = tmpMeta33;
_rest = tmpMeta34;
_accfns = tmp4_2;
_rt = tmp4_3;
_decls = tmp4_4;
_includes = tmp4_5;
_includeDirs = tmp4_6;
_libs = tmp4_7;
_libPaths = tmp4_8;
_fn = omc_SimCodeFunctionUtil_elaborateFunction(threadData, _program, _fel, _rt, _decls, _includes, _includeDirs, _libs, _libPaths ,&_rt_1 ,&_decls ,&_includes ,&_includeDirs ,&_libs ,&_libPaths);
tmpMeta35 = mmc_mk_cons(_fn, _accfns);
_daeElements = _rest;
_inFunctions = tmpMeta35;
_inRecordTypes = _rt_1;
_inDecls = _decls;
_inIncludes = _includes;
_inIncludeDirs = _includeDirs;
_inLibs = _libs;
_inPaths = _libPaths;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outFunctions = tmpMeta[0+0];
_outRecordTypes = tmpMeta[0+1];
_outDecls = tmpMeta[0+2];
_outIncludes = tmpMeta[0+3];
_outIncludeDirs = tmpMeta[0+4];
_outLibs = tmpMeta[0+5];
_outLibsPaths = tmpMeta[0+6];
_return: OMC_LABEL_UNUSED
if (out_outRecordTypes) { *out_outRecordTypes = _outRecordTypes; }
if (out_outDecls) { *out_outDecls = _outDecls; }
if (out_outIncludes) { *out_outIncludes = _outIncludes; }
if (out_outIncludeDirs) { *out_outIncludeDirs = _outIncludeDirs; }
if (out_outLibs) { *out_outLibs = _outLibs; }
if (out_outLibsPaths) { *out_outLibsPaths = _outLibsPaths; }
return _outFunctions;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isRecordDeclEqual(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _decl1;
tmp4_2 = _decl2;
{
modelica_string _name1 = NULL;
modelica_string _name2 = NULL;
modelica_metatype _path1 = NULL;
modelica_metatype _path2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,4) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_name1 = tmpMeta6;
_name2 = tmpMeta7;
tmp1 = (stringEqual(_name1, _name2));
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,2) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_path1 = tmpMeta8;
_path2 = tmpMeta9;
tmp1 = omc_AbsynUtil_pathEqual(threadData, _path1, _path2);
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isRecordDeclEqual(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_isRecordDeclEqual(threadData, _decl1, _decl2);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isRecordDecl(threadData_t *threadData, modelica_metatype _decl, modelica_string _name)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _decl;
{
modelica_string _name1 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
_name1 = tmpMeta6;
tmp1 = (stringEqual(_name, _name1));
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isRecordDecl(threadData_t *threadData, modelica_metatype _decl, modelica_metatype _name)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_isRecordDecl(threadData, _decl, _name);
out_b = mmc_mk_icon(_b);
return out_b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getRecordDependenciesFromType(threadData_t *threadData, modelica_metatype _ty, modelica_metatype _allDecls)
{
modelica_metatype _decl = NULL;
modelica_metatype _path = NULL;
modelica_string _name = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _ty;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta1,9,3) == 0) MMC_THROW_INTERNAL();
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta2,3,1) == 0) MMC_THROW_INTERNAL();
tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
_path = tmpMeta3;
_name = omc_AbsynUtil_pathStringUnquoteReplaceDot(threadData, _path, _OMC_LIT29);
_decl = omc_List_find1(threadData, _allDecls, boxvar_SimCodeFunctionUtil_isRecordDecl, _name);
_return: OMC_LABEL_UNUSED
return _decl;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getVarType(threadData_t *threadData, modelica_metatype _var)
{
modelica_metatype _ty = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _var;
{
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,7) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_ty = tmpMeta6;
tmpMeta1 = _ty;
goto tmp3_done;
}
case 1: {
tmpMeta1 = _OMC_LIT268;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_ty = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _ty;
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_SimCodeFunctionUtil_getRecordDependencies(threadData_t *threadData, modelica_metatype _decl, modelica_metatype _allDecls)
{
modelica_metatype _dependencies = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _decl;
{
modelica_string _name = NULL;
modelica_metatype _vars = NULL;
modelica_metatype _tys = NULL;
modelica_metatype _tyss = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
if (optionNone(tmpMeta6)) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
_name = tmpMeta7;
tmpMeta1 = omc_List_select1(threadData, _allDecls, boxvar_SimCodeFunctionUtil_isRecordDecl, _name);
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta8;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,3) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_name = tmpMeta8;
tmpMeta1 = omc_List_select1(threadData, _allDecls, boxvar_SimCodeFunctionUtil_isRecordDecl, _name);
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,4) == 0) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
_vars = tmpMeta9;
{
modelica_metatype __omcQ_24tmpVar29;
modelica_metatype* tmp11;
modelica_metatype tmpMeta12;
modelica_metatype __omcQ_24tmpVar28;
modelica_integer tmp13;
modelica_metatype _v_loopVar = 0;
modelica_metatype _v;
_v_loopVar = _vars;
tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
__omcQ_24tmpVar29 = tmpMeta12;
tmp11 = &__omcQ_24tmpVar29;
while(1) {
tmp13 = 1;
if (!listEmpty(_v_loopVar)) {
_v = MMC_CAR(_v_loopVar);
_v_loopVar = MMC_CDR(_v_loopVar);
tmp13--;
}
if (tmp13 == 0) {
__omcQ_24tmpVar28 = omc_SimCodeFunctionUtil_getVarType(threadData, _v);
*tmp11 = mmc_mk_cons(__omcQ_24tmpVar28,0);
tmp11 = &MMC_CDR(*tmp11);
} else if (tmp13 == 1) {
break;
} else {
goto goto_2;
}
}
*tmp11 = mmc_mk_nil();
tmpMeta10 = __omcQ_24tmpVar29;
}
_tys = tmpMeta10;
_tyss = omc_List_map1(threadData, _tys, boxvar_Types_getAllInnerTypesOfType, boxvar_Util_anyReturnTrue);
_tys = omc_List_flatten(threadData, _tyss);
_dependencies = omc_List_filterMap1(threadData, _tys, boxvar_SimCodeFunctionUtil_getRecordDependenciesFromType, _allDecls);
tmpMeta1 = omc_List_unique(threadData, _dependencies);
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta14;
tmpMeta14 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta1 = tmpMeta14;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_dependencies = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _dependencies;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_elaborateFunctions(threadData_t *threadData, modelica_metatype _program, modelica_metatype _daeElements, modelica_metatype _metarecordTypes, modelica_metatype _literals, modelica_metatype _includes, modelica_metatype *out_extraRecordDecls, modelica_metatype *out_outIncludes, modelica_metatype *out_includeDirs, modelica_metatype *out_libs, modelica_metatype *out_libpaths)
{
modelica_metatype _functions = NULL;
modelica_metatype _extraRecordDecls = NULL;
modelica_metatype _outIncludes = NULL;
modelica_metatype _includeDirs = NULL;
modelica_metatype _libs = NULL;
modelica_metatype _libpaths = NULL;
modelica_metatype _fns = NULL;
modelica_metatype _outRecordTypes = NULL;
modelica_metatype _ht = NULL;
modelica_metatype _g = 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;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
_extraRecordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsForMetarecords(threadData, _literals, tmpMeta1, tmpMeta2 ,&_outRecordTypes);
tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
_functions = omc_SimCodeFunctionUtil_elaborateFunctions2(threadData, _program, _daeElements, tmpMeta3, _outRecordTypes, _extraRecordDecls, _includes, tmpMeta4, tmpMeta5, tmpMeta6 ,&_outRecordTypes ,&_extraRecordDecls ,&_outIncludes ,&_includeDirs ,&_libs ,&_libpaths);
_extraRecordDecls = omc_List_unique(threadData, _extraRecordDecls);
_extraRecordDecls = omc_SimCodeFunctionUtil_elaborateRecordDeclarationsFromTypes(threadData, _metarecordTypes, _extraRecordDecls, _outRecordTypes, NULL);
_extraRecordDecls = omc_List_sort(threadData, _extraRecordDecls, boxvar_SimCodeFunctionUtil_orderRecordDecls);
_ht = omc_HashTableStringToPath_emptyHashTableSized(threadData, ((modelica_integer) 257));
_extraRecordDecls = omc_List_mapFold(threadData, _extraRecordDecls, boxvar_SimCodeFunctionUtil_aliasRecordDeclarations, _ht, NULL);
_g = omc_Graph_buildGraph(threadData, _extraRecordDecls, boxvar_SimCodeFunctionUtil_getRecordDependencies, _extraRecordDecls);
tmpMeta8 = omc_Graph_topologicalSort(threadData, _g, boxvar_SimCodeFunctionUtil_isRecordDeclEqual, &tmpMeta7);
_extraRecordDecls = tmpMeta8;
if (!listEmpty(tmpMeta7)) MMC_THROW_INTERNAL();
_return: OMC_LABEL_UNUSED
if (out_extraRecordDecls) { *out_extraRecordDecls = _extraRecordDecls; }
if (out_outIncludes) { *out_outIncludes = _outIncludes; }
if (out_includeDirs) { *out_includeDirs = _includeDirs; }
if (out_libs) { *out_libs = _libs; }
if (out_libpaths) { *out_libpaths = _libpaths; }
return _functions;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_orderRecordDecls(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2)
{
modelica_boolean _b;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _decl1;
tmp4_2 = _decl2;
{
modelica_metatype _path1 = NULL;
modelica_metatype _path2 = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,2) == 0) goto tmp3_end;
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
_path1 = tmpMeta6;
_path2 = tmpMeta7;
tmp1 = omc_AbsynUtil_pathGe(threadData, _path1, _path2);
goto tmp3_done;
}
case 1: {
tmp1 = 1;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_b = tmp1;
_return: OMC_LABEL_UNUSED
return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_orderRecordDecls(threadData_t *threadData, modelica_metatype _decl1, modelica_metatype _decl2)
{
modelica_boolean _b;
modelica_metatype out_b;
_b = omc_SimCodeFunctionUtil_orderRecordDecls(threadData, _decl1, _decl2);
out_b = mmc_mk_icon(_b);
return out_b;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_createDAEString(threadData_t *threadData, modelica_string _inString)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box2(5, &DAE_Exp_SCONST__desc, _inString);
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_createAssertforSqrt(threadData_t *threadData, modelica_metatype _inExp)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = mmc_mk_box6(14, &DAE_Exp_RELATION__desc, _inExp, _OMC_LIT270, _OMC_LIT272, mmc_mk_integer(((modelica_integer) -1)), mmc_mk_none());
_outExp = omc_ExpressionSimplify_simplify(threadData, tmpMeta1, NULL);
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_string omc_SimCodeFunctionUtil_hackGetFirstExternalFunctionLib(threadData_t *threadData, modelica_metatype _libs)
{
modelica_string _outFirstLib = NULL;
modelica_string tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
{
modelica_string _lib = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
_lib = omc_List_last(threadData, _libs);
tmp1 = omc_System_stringReplace(threadData, _lib, _OMC_LIT72, _OMC_LIT15);
goto tmp3_done;
}
case 1: {
tmp1 = _OMC_LIT273;
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:;
}
}
_outFirstLib = tmp1;
_return: OMC_LABEL_UNUSED
return _outFirstLib;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isMatrixExpansion(threadData_t *threadData, modelica_metatype _rows, modelica_metatype _inCref, modelica_integer _rowIndex, modelica_integer _colIndex)
{
modelica_boolean _isExpanded;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _rows;
{
modelica_metatype _restRows = NULL;
modelica_metatype _restElems = NULL;
modelica_integer _r;
modelica_integer _c;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 2;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (!listEmpty(tmpMeta6)) goto tmp3_end;
_restRows = tmpMeta7;
tmp4 += 1;
tmp1 = omc_SimCodeFunctionUtil_isMatrixExpansion(threadData, _restRows, _inCref, ((modelica_integer) 1) + _rowIndex, ((modelica_integer) 1));
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_metatype tmpMeta14;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_integer tmp18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_metatype tmpMeta21;
modelica_metatype tmpMeta22;
modelica_integer tmp23;
modelica_boolean tmp24;
modelica_boolean tmp25;
modelica_metatype tmpMeta26;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta8);
tmpMeta11 = MMC_CDR(tmpMeta8);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_cr = tmpMeta12;
_restElems = tmpMeta11;
_restRows = tmpMeta9;
tmpMeta13 = omc_ComponentReference_crefLastSubs(threadData, _cr);
if (listEmpty(tmpMeta13)) goto goto_2;
tmpMeta14 = MMC_CAR(tmpMeta13);
tmpMeta15 = MMC_CDR(tmpMeta13);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta14,2,1) == 0) goto goto_2;
tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,0,1) == 0) goto goto_2;
tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
tmp18 = mmc_unbox_integer(tmpMeta17);
if (listEmpty(tmpMeta15)) goto goto_2;
tmpMeta19 = MMC_CAR(tmpMeta15);
tmpMeta20 = MMC_CDR(tmpMeta15);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,2,1) == 0) goto goto_2;
tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta21,0,1) == 0) goto goto_2;
tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta21), 2));
tmp23 = mmc_unbox_integer(tmpMeta22);
if (!listEmpty(tmpMeta20)) goto goto_2;
_r = tmp18;
_c = tmp23;
tmp24 = ((_r == _rowIndex) && (_c == _colIndex));
if (1 != tmp24) goto goto_2;
_cr = omc_ComponentReference_crefStripLastSubs(threadData, _cr);
tmp25 = omc_ComponentReference_crefEqualNoStringCompare(threadData, _inCref, _cr);
if (1 != tmp25) goto goto_2;
tmpMeta26 = mmc_mk_cons(_restElems, _restRows);
tmp1 = omc_SimCodeFunctionUtil_isMatrixExpansion(threadData, tmpMeta26, _inCref, _rowIndex, ((modelica_integer) 1) + _colIndex);
goto tmp3_done;
}
case 3: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 4) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_isExpanded = tmp1;
_return: OMC_LABEL_UNUSED
return _isExpanded;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isMatrixExpansion(threadData_t *threadData, modelica_metatype _rows, modelica_metatype _inCref, modelica_metatype _rowIndex, modelica_metatype _colIndex)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_boolean _isExpanded;
modelica_metatype out_isExpanded;
tmp1 = mmc_unbox_integer(_rowIndex);
tmp2 = mmc_unbox_integer(_colIndex);
_isExpanded = omc_SimCodeFunctionUtil_isMatrixExpansion(threadData, _rows, _inCref, tmp1, tmp2);
out_isExpanded = mmc_mk_icon(_isExpanded);
return out_isExpanded;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_hackMatrixReverseToCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _context)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _cr = NULL;
modelica_metatype _aty = NULL;
modelica_metatype _rows = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
modelica_metatype tmpMeta22;
modelica_metatype tmpMeta23;
modelica_metatype tmpMeta24;
modelica_metatype tmpMeta25;
modelica_integer tmp26;
modelica_boolean tmp27;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,17,3) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta7)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmpMeta7);
tmpMeta9 = MMC_CDR(tmpMeta7);
if (listEmpty(tmpMeta8)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta8);
tmpMeta11 = MMC_CDR(tmpMeta8);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_aty = tmpMeta6;
_rows = tmpMeta7;
_cr = tmpMeta12;
tmp13 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmpMeta15 = _context;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,2) == 0) goto goto_14;
tmp13 = 1;
goto goto_14;
goto_14:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp13) {goto goto_2;}
tmpMeta16 = omc_ComponentReference_crefLastSubs(threadData, _cr);
if (listEmpty(tmpMeta16)) goto goto_2;
tmpMeta17 = MMC_CAR(tmpMeta16);
tmpMeta18 = MMC_CDR(tmpMeta16);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,2,1) == 0) goto goto_2;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,1) == 0) goto goto_2;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp21 = mmc_unbox_integer(tmpMeta20);
if (1 != tmp21) goto goto_2;
if (listEmpty(tmpMeta18)) goto goto_2;
tmpMeta22 = MMC_CAR(tmpMeta18);
tmpMeta23 = MMC_CDR(tmpMeta18);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,2,1) == 0) goto goto_2;
tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,0,1) == 0) goto goto_2;
tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
tmp26 = mmc_unbox_integer(tmpMeta25);
if (1 != tmp26) goto goto_2;
if (!listEmpty(tmpMeta23)) goto goto_2;
_cr = omc_ComponentReference_crefStripLastSubs(threadData, _cr);
tmp27 = omc_SimCodeFunctionUtil_isMatrixExpansion(threadData, _rows, _cr, ((modelica_integer) 1), ((modelica_integer) 1));
if (1 != tmp27) goto goto_2;
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr, _aty);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isArrayExpansion(threadData_t *threadData, modelica_metatype _inArrayElems, modelica_metatype _inCref, modelica_integer _index)
{
modelica_boolean _isExpanded;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inArrayElems;
{
modelica_metatype _aRest = NULL;
modelica_integer _i;
modelica_metatype _cr = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 3; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp4 += 1;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_metatype tmpMeta13;
modelica_integer tmp14;
modelica_boolean tmp15;
modelica_boolean tmp16;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,6,2) == 0) goto tmp3_end;
tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
_cr = tmpMeta8;
_aRest = tmpMeta7;
tmpMeta9 = omc_ComponentReference_crefLastSubs(threadData, _cr);
if (listEmpty(tmpMeta9)) goto goto_2;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,1) == 0) goto goto_2;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,0,1) == 0) goto goto_2;
tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
tmp14 = mmc_unbox_integer(tmpMeta13);
if (!listEmpty(tmpMeta11)) goto goto_2;
_i = tmp14;
tmp15 = (_i == _index);
if (1 != tmp15) goto goto_2;
_cr = omc_ComponentReference_crefStripLastSubs(threadData, _cr);
tmp16 = omc_ComponentReference_crefEqualNoStringCompare(threadData, _inCref, _cr);
if (1 != tmp16) goto goto_2;
tmp1 = omc_SimCodeFunctionUtil_isArrayExpansion(threadData, _aRest, _inCref, ((modelica_integer) 1) + _index);
goto tmp3_done;
}
case 2: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 3) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_isExpanded = tmp1;
_return: OMC_LABEL_UNUSED
return _isExpanded;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isArrayExpansion(threadData_t *threadData, modelica_metatype _inArrayElems, modelica_metatype _inCref, modelica_metatype _index)
{
modelica_integer tmp1;
modelica_boolean _isExpanded;
modelica_metatype out_isExpanded;
tmp1 = mmc_unbox_integer(_index);
_isExpanded = omc_SimCodeFunctionUtil_isArrayExpansion(threadData, _inArrayElems, _inCref, tmp1);
out_isExpanded = mmc_mk_icon(_isExpanded);
return out_isExpanded;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_hackArrayReverseToCref(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _context)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;
tmp4_1 = _inExp;
{
modelica_metatype _aRest = NULL;
modelica_metatype _cr = NULL;
modelica_metatype _aty = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_integer tmp8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
modelica_boolean tmp13;
modelica_metatype tmpMeta15;
modelica_metatype tmpMeta16;
modelica_metatype tmpMeta17;
modelica_metatype tmpMeta18;
modelica_metatype tmpMeta19;
modelica_metatype tmpMeta20;
modelica_integer tmp21;
modelica_boolean tmp22;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,16,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));
tmp8 = mmc_unbox_integer(tmpMeta7);
if (1 != tmp8) goto tmp3_end;
tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
if (listEmpty(tmpMeta9)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmpMeta9);
tmpMeta11 = MMC_CDR(tmpMeta9);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,6,2) == 0) goto tmp3_end;
tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
_aty = tmpMeta6;
_cr = tmpMeta12;
_aRest = tmpMeta11;
tmp13 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmpMeta15 = _context;
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,1,2) == 0) goto goto_14;
tmp13 = 1;
goto goto_14;
goto_14:;
MMC_CATCH_INTERNAL(mmc_jumper)
if (tmp13) {goto goto_2;}
tmpMeta16 = omc_ComponentReference_crefLastSubs(threadData, _cr);
if (listEmpty(tmpMeta16)) goto goto_2;
tmpMeta17 = MMC_CAR(tmpMeta16);
tmpMeta18 = MMC_CDR(tmpMeta16);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta17,2,1) == 0) goto goto_2;
tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta19,0,1) == 0) goto goto_2;
tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
tmp21 = mmc_unbox_integer(tmpMeta20);
if (1 != tmp21) goto goto_2;
if (!listEmpty(tmpMeta18)) goto goto_2;
_cr = omc_ComponentReference_crefStripLastSubs(threadData, _cr);
tmp22 = omc_SimCodeFunctionUtil_isArrayExpansion(threadData, _aRest, _cr, ((modelica_integer) 2));
if (1 != tmp22) goto goto_2;
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr, _aty);
goto tmp3_done;
}
case 1: {
tmpMeta1 = _inExp;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_derComponentRef(threadData_t *threadData, modelica_metatype _inCref)
{
modelica_metatype _derCref = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_derCref = omc_ComponentReference_crefPrefixDer(threadData, _inCref);
_return: OMC_LABEL_UNUSED
return _derCref;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_splitRecordAssignmentToMemberAssignments(threadData_t *threadData, modelica_metatype _lhs_cref, modelica_metatype _lhs_type, modelica_string _rhs_cref_str)
{
modelica_metatype _outAssigns = NULL;
modelica_metatype _rhs_cref = NULL;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_metatype tmpMeta3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
_outAssigns = tmpMeta1;
tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
tmpMeta3 = mmc_mk_box4(4, &DAE_ComponentRef_CREF__IDENT__desc, _rhs_cref_str, _lhs_type, tmpMeta2);
_rhs_cref = tmpMeta3;
{
modelica_metatype tmp6_1;
tmp6_1 = _lhs_type;
{
modelica_metatype _l_v_exp = NULL;
modelica_metatype _r_v_exp = NULL;
modelica_metatype _stmt = NULL;
volatile mmc_switch_type tmp6;
int tmp7;
tmp6 = 0;
for (; tmp6 < 1; tmp6++) {
switch (MMC_SWITCH_CAST(tmp6)) {
case 0: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
modelica_metatype tmpMeta12;
if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,9,3) == 0) goto tmp5_end;
{
modelica_metatype _v;
for (tmpMeta8 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_lhs_type), 3))); !listEmpty(tmpMeta8); tmpMeta8=MMC_CDR(tmpMeta8))
{
_v = MMC_CAR(tmpMeta8);
_l_v_exp = omc_SimCodeFunctionUtil_makeCrefRecordExp(threadData, _lhs_cref, _v);
_r_v_exp = omc_SimCodeFunctionUtil_makeCrefRecordExp(threadData, _rhs_cref, _v);
if(omc_Types_isArray(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 4)))))
{
tmpMeta9 = mmc_mk_box5(5, &DAE_Statement_STMT__ASSIGN__ARR__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 4))), _l_v_exp, _r_v_exp, _OMC_LIT276);
_stmt = tmpMeta9;
}
else
{
tmpMeta10 = mmc_mk_box5(3, &DAE_Statement_STMT__ASSIGN__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_v), 4))), _l_v_exp, _r_v_exp, _OMC_LIT276);
_stmt = tmpMeta10;
}
tmpMeta11 = mmc_mk_cons(_stmt, _outAssigns);
_outAssigns = tmpMeta11;
}
}
_outAssigns = listReverse(_outAssigns);
goto tmp5_done;
}
}
goto tmp5_end;
tmp5_end: ;
}
goto goto_4;
goto_4:;
MMC_THROW_INTERNAL();
goto tmp5_done;
tmp5_done:;
}
}
;
_return: OMC_LABEL_UNUSED
return _outAssigns;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_makeCrefRecordExp(threadData_t *threadData, modelica_metatype _inCRefRecord, modelica_metatype _inVar)
{
modelica_metatype _outExp = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;modelica_metatype tmp4_2;
tmp4_1 = _inCRefRecord;
tmp4_2 = _inVar;
{
modelica_metatype _cr = NULL;
modelica_metatype _cr1 = NULL;
modelica_string _name = NULL;
modelica_metatype _tp = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 1; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
modelica_metatype tmpMeta8;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
_cr = tmp4_1;
_name = tmpMeta6;
_tp = tmpMeta7;
tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
_cr1 = omc_ComponentReference_crefPrependIdent(threadData, _cr, _name, tmpMeta8, _tp);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _cr1, _tp);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outExp = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _outExp;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_isNotProtected(threadData_t *threadData, modelica_metatype _simVar)
{
modelica_boolean _isProtected;
modelica_metatype tmpMeta1;
modelica_metatype tmpMeta2;
modelica_integer tmp3;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
tmpMeta1 = _simVar;
tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 23));
tmp3 = mmc_unbox_integer(tmpMeta2);
_isProtected = tmp3;
_isProtected = (!_isProtected);
_return: OMC_LABEL_UNUSED
return _isProtected;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_isNotProtected(threadData_t *threadData, modelica_metatype _simVar)
{
modelica_boolean _isProtected;
modelica_metatype out_isProtected;
_isProtected = omc_SimCodeFunctionUtil_isNotProtected(threadData, _simVar);
out_isProtected = mmc_mk_icon(_isProtected);
return out_isProtected;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_protectedVars(threadData_t *threadData, modelica_metatype _InSimVars)
{
modelica_metatype _OutSimVars = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_OutSimVars = omc_List_filterOnTrue(threadData, _InSimVars, boxvar_SimCodeFunctionUtil_isNotProtected);
_return: OMC_LABEL_UNUSED
return _OutSimVars;
}
DLLExport
modelica_integer omc_SimCodeFunctionUtil_decrementInt(threadData_t *threadData, modelica_integer _inInt, modelica_integer _decrement)
{
modelica_integer _outInt;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outInt = _inInt - _decrement;
_return: OMC_LABEL_UNUSED
return _outInt;
}
modelica_metatype boxptr_SimCodeFunctionUtil_decrementInt(threadData_t *threadData, modelica_metatype _inInt, modelica_metatype _decrement)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer _outInt;
modelica_metatype out_outInt;
tmp1 = mmc_unbox_integer(_inInt);
tmp2 = mmc_unbox_integer(_decrement);
_outInt = omc_SimCodeFunctionUtil_decrementInt(threadData, tmp1, tmp2);
out_outInt = mmc_mk_icon(_outInt);
return out_outInt;
}
DLLExport
modelica_integer omc_SimCodeFunctionUtil_incrementInt(threadData_t *threadData, modelica_integer _inInt, modelica_integer _increment)
{
modelica_integer _outInt;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_outInt = _inInt + _increment;
_return: OMC_LABEL_UNUSED
return _outInt;
}
modelica_metatype boxptr_SimCodeFunctionUtil_incrementInt(threadData_t *threadData, modelica_metatype _inInt, modelica_metatype _increment)
{
modelica_integer tmp1;
modelica_integer tmp2;
modelica_integer _outInt;
modelica_metatype out_outInt;
tmp1 = mmc_unbox_integer(_inInt);
tmp2 = mmc_unbox_integer(_increment);
_outInt = omc_SimCodeFunctionUtil_incrementInt(threadData, tmp1, tmp2);
out_outInt = mmc_mk_icon(_outInt);
return out_outInt;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_buildCrefExpFromAsub(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _subs)
{
modelica_metatype _cRefOut = NULL;
modelica_metatype tmpMeta1;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
tmp4_1 = _cref;
tmp4_2 = _subs;
{
modelica_metatype _ty = NULL;
modelica_metatype _crNew = NULL;
modelica_metatype _indexes = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
MMC_TRY_INTERNAL(mmc_jumper)
tmp3_top:
threadData->mmc_jumper = &new_mmc_jumper;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_2)) goto tmp3_end;
tmpMeta1 = _cref;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
_crNew = tmpMeta6;
_ty = tmpMeta7;
_indexes = omc_List_map(threadData, _subs, boxvar_Expression_makeIndexSubscript);
_crNew = omc_ComponentReference_subscriptCref(threadData, _crNew, _indexes);
tmpMeta1 = omc_Expression_makeCrefExp(threadData, _crNew, _ty);
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
tmp3_done:
(void)tmp4;
MMC_RESTORE_INTERNAL(mmc_jumper);
goto tmp3_done2;
goto_2:;
MMC_CATCH_INTERNAL(mmc_jumper);
if (++tmp4 < 2) {
goto tmp3_top;
}
MMC_THROW_INTERNAL();
tmp3_done2:;
}
}
_cRefOut = tmpMeta1;
_return: OMC_LABEL_UNUSED
return _cRefOut;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_crefIsScalar(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _context)
{
modelica_boolean _isScalar;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
if(omc_SimCodeFunctionUtil_inFunctionContext(threadData, _context))
{
_isScalar = listEmpty(omc_ComponentReference_crefLastSubs(threadData, _cref));
}
else
{
if(omc_Flags_isSet(threadData, _OMC_LIT280))
{
_isScalar = omc_ComponentReference_crefHasScalarSubscripts(threadData, _cref);
}
else
{
_isScalar = (!omc_ComponentReference_crefHaveSubs(threadData, _cref));
}
}
_return: OMC_LABEL_UNUSED
return _isScalar;
}
modelica_metatype boxptr_SimCodeFunctionUtil_crefIsScalar(threadData_t *threadData, modelica_metatype _cref, modelica_metatype _context)
{
modelica_boolean _isScalar;
modelica_metatype out_isScalar;
_isScalar = omc_SimCodeFunctionUtil_crefIsScalar(threadData, _cref, _context);
out_isScalar = mmc_mk_icon(_isScalar);
return out_isScalar;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_inFunctionContext(threadData_t *threadData, modelica_metatype _inContext)
{
modelica_boolean _outInFunction;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inContext;
{
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 2; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,2) == 0) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
tmp1 = 0;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outInFunction = tmp1;
_return: OMC_LABEL_UNUSED
return _outInFunction;
}
modelica_metatype boxptr_SimCodeFunctionUtil_inFunctionContext(threadData_t *threadData, modelica_metatype _inContext)
{
modelica_boolean _outInFunction;
modelica_metatype out_outInFunction;
_outInFunction = omc_SimCodeFunctionUtil_inFunctionContext(threadData, _inContext);
out_outInFunction = mmc_mk_icon(_outInFunction);
return out_outInFunction;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_crefNoSub(threadData_t *threadData, modelica_metatype _cref)
{
modelica_boolean _noSub;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_noSub = (!omc_ComponentReference_crefHaveSubs(threadData, _cref));
_return: OMC_LABEL_UNUSED
return _noSub;
}
modelica_metatype boxptr_SimCodeFunctionUtil_crefNoSub(threadData_t *threadData, modelica_metatype _cref)
{
modelica_boolean _noSub;
modelica_metatype out_noSub;
_noSub = omc_SimCodeFunctionUtil_crefNoSub(threadData, _cref);
out_noSub = mmc_mk_icon(_noSub);
return out_noSub;
}
PROTECTED_FUNCTION_STATIC modelica_boolean omc_SimCodeFunctionUtil_subsToScalar(threadData_t *threadData, modelica_metatype _inExpSubscriptLst)
{
modelica_boolean _outBoolean;
modelica_boolean tmp1 = 0;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
{
modelica_metatype tmp4_1;
tmp4_1 = _inExpSubscriptLst;
{
modelica_metatype _r = NULL;
volatile mmc_switch_type tmp4;
int tmp5;
tmp4 = 0;
for (; tmp4 < 4; tmp4++) {
switch (MMC_SWITCH_CAST(tmp4)) {
case 0: {
if (!listEmpty(tmp4_1)) goto tmp3_end;
tmp1 = 1;
goto tmp3_done;
}
case 1: {
modelica_metatype tmpMeta6;
modelica_metatype tmpMeta7;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta6 = MMC_CAR(tmp4_1);
tmpMeta7 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 2: {
modelica_metatype tmpMeta8;
modelica_metatype tmpMeta9;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta8 = MMC_CAR(tmp4_1);
tmpMeta9 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,0,0) == 0) goto tmp3_end;
tmp1 = 0;
goto tmp3_done;
}
case 3: {
modelica_metatype tmpMeta10;
modelica_metatype tmpMeta11;
if (listEmpty(tmp4_1)) goto tmp3_end;
tmpMeta10 = MMC_CAR(tmp4_1);
tmpMeta11 = MMC_CDR(tmp4_1);
if (mmc__uniontype__metarecord__typedef__equal(tmpMeta10,2,1) == 0) goto tmp3_end;
_r = tmpMeta11;
_inExpSubscriptLst = _r;
goto _tailrecursive;
goto tmp3_done;
}
}
goto tmp3_end;
tmp3_end: ;
}
goto goto_2;
goto_2:;
MMC_THROW_INTERNAL();
goto tmp3_done;
tmp3_done:;
}
}
_outBoolean = tmp1;
_return: OMC_LABEL_UNUSED
return _outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_SimCodeFunctionUtil_subsToScalar(threadData_t *threadData, modelica_metatype _inExpSubscriptLst)
{
modelica_boolean _outBoolean;
modelica_metatype out_outBoolean;
_outBoolean = omc_SimCodeFunctionUtil_subsToScalar(threadData, _inExpSubscriptLst);
out_outBoolean = mmc_mk_icon(_outBoolean);
return out_outBoolean;
}
DLLExport
modelica_boolean omc_SimCodeFunctionUtil_crefSubIsScalar(threadData_t *threadData, modelica_metatype _cref)
{
modelica_boolean _isScalar;
modelica_metatype _subs = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_subs = omc_ComponentReference_crefSubs(threadData, _cref);
_isScalar = omc_SimCodeFunctionUtil_subsToScalar(threadData, _subs);
_return: OMC_LABEL_UNUSED
return _isScalar;
}
modelica_metatype boxptr_SimCodeFunctionUtil_crefSubIsScalar(threadData_t *threadData, modelica_metatype _cref)
{
modelica_boolean _isScalar;
modelica_metatype out_isScalar;
_isScalar = omc_SimCodeFunctionUtil_crefSubIsScalar(threadData, _cref);
out_isScalar = mmc_mk_icon(_isScalar);
return out_isScalar;
}
DLLExport
modelica_metatype omc_SimCodeFunctionUtil_elementVars(threadData_t *threadData, modelica_metatype _ild)
{
modelica_metatype _vars = NULL;
modelica_metatype _ld = NULL;
MMC_SO();
_tailrecursive: OMC_LABEL_UNUSED
_ld = omc_List_filterOnTrue(threadData, _ild, boxvar_SimCodeFunctionUtil_isVarQ);
_vars = omc_List_map(threadData, _ld, boxvar_SimCodeFunctionUtil_daeInOutSimVar);
_return: OMC_LABEL_UNUSED
return _vars;
}
